feat: refs #7247 clientSupplier_add #2346
|
@ -53,7 +53,7 @@ BEGIN
|
||||||
IFNULL(c.street, ''),
|
IFNULL(c.street, ''),
|
||||||
c.accountingAccount,
|
c.accountingAccount,
|
||||||
@fi := IF(cu.code = LEFT(TRIM(c.fi), 2) AND c.isVies, MID(TRIM(c.fi), 3, LENGTH(TRIM(c.fi))-1), TRIM(c.fi)),
|
@fi := IF(cu.code = LEFT(TRIM(c.fi), 2) AND c.isVies, MID(TRIM(c.fi), 3, LENGTH(TRIM(c.fi))-1), TRIM(c.fi)),
|
||||||
IF(c.isVies, CONCAT(cu.code, @fi ), TRIM(c.fi)),
|
IF(c.isVies, CONCAT(IFNULL(cu.viesCode,cu.code), @fi ), TRIM(c.fi)),
|
||||||
IFNULL(c.postcode, ''),
|
IFNULL(c.postcode, ''),
|
||||||
IFNULL(c.city, ''),
|
IFNULL(c.city, ''),
|
||||||
IFNULL(pr.CodigoProvincia, ''),
|
IFNULL(pr.CodigoProvincia, ''),
|
||||||
|
@ -91,7 +91,7 @@ BEGIN
|
||||||
IFNULL(s.street, ''),
|
IFNULL(s.street, ''),
|
||||||
s.account,
|
s.account,
|
||||||
@nif := IF(co.code = LEFT(TRIM(s.nif), 2), MID(TRIM(s.nif), 3, LENGTH(TRIM(s.nif))-1), TRIM(s.nif)),
|
@nif := IF(co.code = LEFT(TRIM(s.nif), 2), MID(TRIM(s.nif), 3, LENGTH(TRIM(s.nif))-1), TRIM(s.nif)),
|
||||||
IF(s.isVies, CONCAT(co.code, @nif), TRIM(s.nif)),
|
IF(s.isVies, CONCAT(IFNULL(co.viesCode,co.code), @nif), TRIM(s.nif)),
|
||||||
IFNULL(s.postCode,''),
|
IFNULL(s.postCode,''),
|
||||||
IFNULL(s.city, ''),
|
IFNULL(s.city, ''),
|
||||||
IFNULL(pr.CodigoProvincia, ''),
|
IFNULL(pr.CodigoProvincia, ''),
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
ALTER TABLE vn.country
|
||||||
|
ADD IF NOT EXISTS viesCode varchar(2) DEFAULT NULL NULL AFTER code;
|
||||||
|
|
||||||
|
UPDATE IGNORE vn.country
|
||||||
|
SET viesCode = 'FR'
|
||||||
|
WHERE code = 'MC'; -- Mónaco
|
Loading…
Reference in New Issue