feat: sincro client supplier sage refs #7595
gitea/salix/pipeline/pr-master This commit looks good
Details
gitea/salix/pipeline/pr-master This commit looks good
Details
This commit is contained in:
parent
11675c2e35
commit
68f48de6f0
|
@ -410,15 +410,26 @@ BEGIN
|
|||
FROM sage.movConta mc
|
||||
JOIN vn.supplier s ON s.account = mc.CodigoCuenta
|
||||
WHERE NOT enlazadoSage
|
||||
)SELECT idClientSupplier, `type`
|
||||
),clientSupplierSync AS(
|
||||
SELECT idClientSupplier, `type`
|
||||
FROM sage.clientSupplier cs
|
||||
WHERE isSync
|
||||
)
|
||||
SELECT idClientSupplier, `type`
|
||||
FROM sage.clientSupplier cs
|
||||
WHERE NOT isSync
|
||||
UNION
|
||||
SELECT id, 'C'
|
||||
FROM client
|
||||
FROM client c
|
||||
LEFT JOIN clientSupplierSync cs ON cs.idClientSupplier = c.id
|
||||
AND cs.Type ='C'
|
||||
WHERE cs.idClientSupplier IS NULL
|
||||
UNION
|
||||
SELECT id, 'P'
|
||||
FROM supplier;
|
||||
FROM supplier s
|
||||
LEFT JOIN clientSupplierSync cs ON cs.idClientSupplier = s.id
|
||||
AND cs.Type ='P'
|
||||
WHERE cs.idClientSupplier IS NULL;
|
||||
|
||||
CALL clientSupplier_add(vCompanyFk);
|
||||
|
||||
|
|
Loading…
Reference in New Issue