refs #5347
This commit is contained in:
parent
be1c145d9a
commit
9fe7024d17
|
@ -76,12 +76,14 @@ BEGIN
|
|||
hasCoreVnl = vHasCoreVnl,
|
||||
isActive = TRUE;
|
||||
|
||||
IF (SELECT COUNT(*)
|
||||
FROM mandate
|
||||
WHERE clientFk = vUserFk
|
||||
AND companyFk = vCompanyFk
|
||||
AND mandateTypeFk = vMandateTypeFk) = 0 THEN
|
||||
INSERT INTO mandate (clientFk, companyFk, mandateTypeFk)
|
||||
VALUES (vUserFk, vCompanyFk, vMandateTypeFk);
|
||||
INSERT INTO mandate (clientFk, companyFk, mandateTypeFk)
|
||||
SELECT vUserFk, vCompanyFk, vMandateTypeFk
|
||||
WHERE NOT EXISTS (
|
||||
SELECT id
|
||||
FROM mandate
|
||||
WHERE clientFk = vUserFk
|
||||
AND companyFk = vCompanyFk
|
||||
AND mandateTypeFk = vMandateTypeFk
|
||||
);
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -1,5 +1,3 @@
|
|||
DROP PROCEDURE IF EXISTS vn.clientCreate;
|
||||
|
||||
ALTER TABLE vn.clientConfig ADD defaultPayMethodFk tinyint(3) unsigned NULL;
|
||||
ALTER TABLE vn.clientConfig ADD defaultDueDay int unsigned NULL;
|
||||
ALTER TABLE vn.clientConfig ADD defaultCredit decimal(10, 2) NULL;
|
||||
|
@ -9,10 +7,11 @@ ALTER TABLE vn.clientConfig ADD defaultMandateTypeFk smallint(5) NULL;
|
|||
ALTER TABLE vn.clientConfig ADD CONSTRAINT clientNewConfigPayMethod_FK FOREIGN KEY (dafaultPayMethodFk) REFERENCES vn.payMethod(id);
|
||||
ALTER TABLE vn.clientConfig ADD CONSTRAINT clientNewConfigMandateType_FK FOREIGN KEY (defaultMandateTypeFk) REFERENCES vn.mandateType(id);
|
||||
|
||||
UPDATE vn.clientConfig
|
||||
INSERT IGNORE INTO vn.clientConfig
|
||||
SET defaultPayMethodFk = 4,
|
||||
defaultDueDay = 5,
|
||||
defaultCredit = 300.0,
|
||||
defaultIsTaxDataChecked = 1,
|
||||
defaultHasCoreVnl = 1,
|
||||
defaultMandateTypeFk = 2;
|
||||
defaultMandateTypeFk = 2
|
||||
WHERE id = 1;
|
Loading…
Reference in New Issue