refactor: borrado codigo sql innecesario

This commit is contained in:
Vicent Llopis 2022-10-26 14:25:17 +02:00
parent fa89d1f944
commit c0b95564c3
1 changed files with 4 additions and 33 deletions

View File

@ -114,53 +114,24 @@ module.exports = Self => {
const stmts = []; const stmts = [];
const stmt = new ParameterizedSQL( const stmt = new ParameterizedSQL(
`SELECT `SELECT
c.id, DISTINCT c.id,
c.name, c.name,
c.socialName,
c.fi, c.fi,
c.credit, c.socialName,
c.creditInsurance,
c.phone, c.phone,
c.mobile,
c.street,
c.city, c.city,
c.postcode, c.postcode,
c.email, c.email,
c.created,
c.isActive, c.isActive,
c.isVies,
c.isTaxDataChecked,
c.isEqualizated,
c.isFreezed, 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.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
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
FROM client c FROM client c
LEFT JOIN account.user u ON u.id = c.salesPersonFk 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 province p ON p.id = c.provinceFk
LEFT JOIN businessType bt ON bt.code = c.businessTypeFk JOIN vn.address a ON a.clientFk = c.id
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
` `
); );