3852-client.search-panel2 #1111
|
@ -114,53 +114,24 @@ module.exports = Self => {
|
|||
const stmts = [];
|
||||
const stmt = new ParameterizedSQL(
|
||||
`SELECT
|
||||
c.id,
|
||||
DISTINCT c.id,
|
||||
c.name,
|
||||
c.socialName,
|
||||
c.fi,
|
||||
c.credit,
|
||||
c.creditInsurance,
|
||||
c.socialName,
|
||||
c.phone,
|
||||
c.mobile,
|
||||
c.street,
|
||||
c.city,
|
||||
c.postcode,
|
||||
c.email,
|
||||
c.created,
|
||||
c.isActive,
|
||||
c.isVies,
|
||||
c.isTaxDataChecked,
|
||||
c.isEqualizated,
|
||||
c.isFreezed,
|
||||
c.hasToInvoice,
|
||||
c.hasToInvoiceByAddress,
|
||||
c.isToBeMailed,
|
||||
c.hasSepaVnl,
|
||||
c.hasLcr,
|
||||
c.hasCoreVnl,
|
||||
ct.id AS countryFk,
|
||||
ct.country,
|
||||
p.id AS provinceFk,
|
||||
p.name AS province,
|
||||
u.id AS salesPersonFk,
|
||||
u.name AS salesPerson,
|
||||
bt.code AS businessTypeFk,
|
||||
bt.description AS businessType,
|
||||
pm.id AS payMethodFk,
|
||||
pm.name AS payMethod,
|
||||
sti.CodigoIva AS sageTaxTypeFk,
|
||||
sti.Iva AS sageTaxType,
|
||||
stt.CodigoTransaccion AS sageTransactionTypeFk,
|
||||
stt.Transaccion AS sageTransactionType
|
||||
u.name AS salesPerson
|
||||
FROM client c
|
||||
LEFT JOIN account.user u ON u.id = c.salesPersonFk
|
||||
LEFT JOIN country ct ON ct.id = c.countryFk
|
||||
LEFT JOIN province p ON p.id = c.provinceFk
|
||||
LEFT JOIN businessType bt ON bt.code = c.businessTypeFk
|
||||
LEFT JOIN payMethod pm ON pm.id = c.payMethodFk
|
||||
LEFT JOIN sage.TiposIva sti ON sti.CodigoIva = c.taxTypeSageFk
|
||||
LEFT JOIN sage.TiposTransacciones stt ON stt.CodigoTransaccion = c.transactionTypeSageFk
|
||||
LEFT JOIN vn.address a ON a.id = c.defaultAddressFk
|
||||
JOIN vn.address a ON a.clientFk = c.id
|
||||
`
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue