8032-devToTest_2440 #3009
|
@ -17,14 +17,14 @@ BEGIN
|
||||||
* @param vOrderBy Order by criteria
|
* @param vOrderBy Order by criteria
|
||||||
* @param vIsConciliated Indicates whether it is reconciled or not
|
* @param vIsConciliated Indicates whether it is reconciled or not
|
||||||
* @param vHasEntries Indicates if future entries must be shown
|
* @param vHasEntries Indicates if future entries must be shown
|
||||||
* @return tmp.supplierStatement
|
* @return tmp.supplierStatement
|
||||||
*/
|
*/
|
||||||
DECLARE vBalanceStartingDate DATETIME;
|
DECLARE vBalanceStartingDate DATETIME;
|
||||||
|
|
||||||
SET @euroBalance:= 0;
|
SET @euroBalance:= 0;
|
||||||
SET @currencyBalance:= 0;
|
SET @currencyBalance:= 0;
|
||||||
|
|
||||||
SELECT balanceStartingDate
|
SELECT balanceStartingDate
|
||||||
INTO vBalanceStartingDate
|
INTO vBalanceStartingDate
|
||||||
FROM invoiceInConfig;
|
FROM invoiceInConfig;
|
||||||
|
|
||||||
|
@ -64,14 +64,14 @@ BEGIN
|
||||||
c.code,
|
c.code,
|
||||||
'invoiceIn' statementType
|
'invoiceIn' statementType
|
||||||
FROM invoiceIn ii
|
FROM invoiceIn ii
|
||||||
JOIN invoiceInDueDay iid ON iid.invoiceInFk = ii.id
|
LEFT JOIN invoiceInDueDay iid ON iid.invoiceInFk = ii.id
|
||||||
JOIN currency c ON c.id = ii.currencyFk
|
JOIN currency c ON c.id = ii.currencyFk
|
||||||
WHERE ii.issued >= vBalanceStartingDate
|
WHERE ii.issued >= vBalanceStartingDate
|
||||||
AND ii.supplierFk = vSupplierFk
|
AND ii.supplierFk = vSupplierFk
|
||||||
AND vCurrencyFk IN (ii.currencyFk, 0)
|
AND vCurrencyFk IN (ii.currencyFk, 0)
|
||||||
AND vCompanyFk IN (ii.companyFk, 0)
|
AND vCompanyFk IN (ii.companyFk, 0)
|
||||||
AND (vIsConciliated = ii.isBooked OR NOT vIsConciliated)
|
AND (vIsConciliated = ii.isBooked OR NOT vIsConciliated)
|
||||||
GROUP BY iid.id
|
GROUP BY iid.id, ii.id
|
||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT p.bankFk,
|
SELECT p.bankFk,
|
||||||
p.companyFk,
|
p.companyFk,
|
||||||
|
@ -107,7 +107,7 @@ BEGIN
|
||||||
AND vCurrencyFk IN (p.currencyFk, 0)
|
AND vCurrencyFk IN (p.currencyFk, 0)
|
||||||
AND vCompanyFk IN (p.companyFk, 0)
|
AND vCompanyFk IN (p.companyFk, 0)
|
||||||
AND (vIsConciliated = p.isConciliated OR NOT vIsConciliated)
|
AND (vIsConciliated = p.isConciliated OR NOT vIsConciliated)
|
||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT NULL,
|
SELECT NULL,
|
||||||
companyFk,
|
companyFk,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -134,7 +134,7 @@ BEGIN
|
||||||
AND vCurrencyFk IN (se.currencyFk,0)
|
AND vCurrencyFk IN (se.currencyFk,0)
|
||||||
AND vCompanyFk IN (se.companyFk,0)
|
AND vCompanyFk IN (se.companyFk,0)
|
||||||
AND (vIsConciliated = se.isConciliated OR NOT vIsConciliated)
|
AND (vIsConciliated = se.isConciliated OR NOT vIsConciliated)
|
||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT NULL bankFk,
|
SELECT NULL bankFk,
|
||||||
e.companyFk,
|
e.companyFk,
|
||||||
'E' serial,
|
'E' serial,
|
||||||
|
@ -150,7 +150,7 @@ BEGIN
|
||||||
FALSE isBooked,
|
FALSE isBooked,
|
||||||
c.code,
|
c.code,
|
||||||
'order'
|
'order'
|
||||||
FROM entry e
|
FROM entry e
|
||||||
JOIN travel tr ON tr.id = e.travelFk
|
JOIN travel tr ON tr.id = e.travelFk
|
||||||
JOIN currency c ON c.id = e.currencyFk
|
JOIN currency c ON c.id = e.currencyFk
|
||||||
WHERE e.supplierFk = vSupplierFk
|
WHERE e.supplierFk = vSupplierFk
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
ALTER TABLE `vn`.`payrollWorkCenter` DROP PRIMARY KEY;
|
||||||
|
ALTER TABLE `vn`.`payrollWorkCenter` DROP COLUMN `empresa_id__`;
|
||||||
|
ALTER TABLE `vn`.`payrollWorkCenter` DROP COLUMN `Centro__`;
|
||||||
|
ALTER TABLE `vn`.`payrollWorkCenter` DROP COLUMN `nss_cotizacion__`;
|
||||||
|
ALTER TABLE `vn`.`payrollWorkCenter` DROP COLUMN `domicilio__`;
|
||||||
|
ALTER TABLE `vn`.`payrollWorkCenter` DROP COLUMN `poblacion__`;
|
||||||
|
ALTER TABLE `vn`.`payrollWorkCenter` DROP COLUMN `cp__`;
|
||||||
|
ALTER TABLE `vn`.`payrollWorker` DROP COLUMN `nss__`;
|
||||||
|
ALTER TABLE `vn`.`payrollWorker` DROP COLUMN `codpuesto__`;
|
||||||
|
ALTER TABLE `vn`.`payrollWorker` DROP COLUMN `codcontrato__`;
|
||||||
|
ALTER TABLE `vn`.`payrollWorker` DROP COLUMN `FAntiguedad__`;
|
||||||
|
ALTER TABLE `vn`.`payrollWorker` DROP COLUMN `codcategoria__`;
|
||||||
|
ALTER TABLE `vn`.`payrollWorker` DROP COLUMN `ContratoTemporal__`;
|
Loading…
Reference in New Issue