6220-addressFilter #1886
|
@ -129,25 +129,43 @@ module.exports = Self => {
|
||||||
const stmts = [];
|
const stmts = [];
|
||||||
const stmt = new ParameterizedSQL(
|
const stmt = new ParameterizedSQL(
|
||||||
`SELECT
|
`SELECT
|
||||||
DISTINCT c.id,
|
DISTINCT c.id,
|
||||||
c.name,
|
c.name,
|
||||||
c.fi,
|
c.fi,
|
||||||
c.socialName,
|
c.socialName,
|
||||||
c.phone,
|
c.phone,
|
||||||
c.mobile,
|
c.mobile,
|
||||||
c.city,
|
c.city,
|
||||||
c.postcode,
|
c.postcode,
|
||||||
c.email,
|
c.email,
|
||||||
c.isActive,
|
c.isActive,
|
||||||
c.isFreezed,
|
c.isFreezed,
|
||||||
p.id AS provinceFk,
|
p.id AS provinceFk,
|
||||||
p.name AS province,
|
p.name AS province,
|
||||||
u.id AS salesPersonFk,
|
u.id AS salesPersonFk,
|
||||||
u.name AS salesPerson
|
u.name AS salesPerson,
|
||||||
FROM client c
|
a.street,
|
||||||
LEFT JOIN account.user u ON u.id = c.salesPersonFk
|
a.city AS addressCity,
|
||||||
LEFT JOIN province p ON p.id = c.provinceFk
|
a.provinceFk AS addressProvinceFk,
|
||||||
JOIN vn.address a ON a.clientFk = c.id
|
a.postalCode AS addressPostalCode,
|
||||||
|
a.phone AS addressPhone,
|
||||||
|
a.mobile AS addressMobile,
|
||||||
|
a.nickname,
|
||||||
|
a.isDefaultAddress,
|
||||||
|
a.agencyModeFk AS addressAgencyModeFk,
|
||||||
|
a.isActive AS addressIsActive,
|
||||||
|
|||||||
|
a.longitude AS addressLongitude,
|
||||||
jgallego
commented
provinceAddressFk provinceAddressFk
|
|||||||
|
a.latitude AS addressLatitude,
|
||||||
|
a.isEqualizated,
|
||||||
|
a.customsAgentFk AS addressCustomsAgentFk,
|
||||||
|
a.incotermsFk AS addressIncotermsFk,
|
||||||
|
a.isLogifloraAllowed,
|
||||||
|
a.editorFk AS addressEditorFk
|
||||||
|
FROM client c
|
||||||
|
LEFT JOIN account.user u ON u.id = c.salesPersonFk
|
||||||
|
LEFT JOIN province p ON p.id = c.provinceFk
|
||||||
|
JOIN vn.address a ON a.clientFk = c.id;
|
||||||
|
|
||||||
`
|
`
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
provinceClientFk