#6346 new WagonType section #2778
|
@ -37,7 +37,6 @@ module.exports = Self => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const xmlString = response.data;
|
const xmlString = response.data;
|
||||||
console.log('xmlString: ', xmlString);
|
|
||||||
const parser = new DOMParser();
|
const parser = new DOMParser();
|
||||||
const xmlDoc = parser.parseFromString(xmlString, 'text/xml');
|
const xmlDoc = parser.parseFromString(xmlString, 'text/xml');
|
||||||
const result = xmlDoc.getElementsByTagName('Mensaje')[0].textContent;
|
const result = xmlDoc.getElementsByTagName('Mensaje')[0].textContent;
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
DELIMITER $$
|
||||||
|
CREATE OR REPLACE DEFINER=`root`@`localhost` EVENT `vn`.`travel_setDelivered`
|
||||||
|
ON SCHEDULE EVERY 1 DAY
|
||||||
|
STARTS '2024-07-12 00:10:00.000'
|
||||||
|
ON COMPLETION PRESERVE
|
||||||
|
ENABLE
|
||||||
|
DO BEGIN
|
||||||
|
UPDATE travel t
|
||||||
|
SET t.isDelivered = TRUE
|
||||||
|
WHERE t.shipped < util.VN_CURDATE();
|
||||||
|
END$$
|
||||||
|
DELIMITER ;
|
|
@ -12,6 +12,7 @@ BEGIN
|
||||||
DECLARE vInvoiceFk INT;
|
DECLARE vInvoiceFk INT;
|
||||||
DECLARE vBookEntry INT;
|
DECLARE vBookEntry INT;
|
||||||
DECLARE vFiscalYear INT;
|
DECLARE vFiscalYear INT;
|
||||||
|
DECLARE vIncorrectInvoiceInDueDay INT;
|
||||||
|
|
||||||
DECLARE vInvoicesIn CURSOR FOR
|
DECLARE vInvoicesIn CURSOR FOR
|
||||||
SELECT DISTINCT e.invoiceInFk
|
SELECT DISTINCT e.invoiceInFk
|
||||||
|
@ -24,6 +25,19 @@ BEGIN
|
||||||
|
|
||||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
||||||
|
|
||||||
|
SELECT GROUP_CONCAT(ii.id) INTO vIncorrectInvoiceInDueDay
|
||||||
|
FROM invoiceInDueDay iidd
|
||||||
|
JOIN invoiceIn ii ON iidd.invoiceInFk = ii.id
|
||||||
|
JOIN `entry` e ON e.invoiceInFk = ii.id
|
||||||
|
JOIN duaEntry de ON de.entryFk = e.id
|
||||||
|
JOIN invoiceInConfig iic
|
||||||
|
WHERE de.duaFk = vDuaFk
|
||||||
|
AND iidd.dueDated <= util.VN_CURDATE() + INTERVAL iic.dueDateMarginDays DAY;
|
||||||
|
|
||||||
|
IF vIncorrectInvoiceInDueDay THEN
|
||||||
|
CALL util.throw(CONCAT('Incorrect due date, invoice: ', vIncorrectInvoiceInDueDay));
|
||||||
|
END IF;
|
||||||
|
|
||||||
UPDATE invoiceIn ii
|
UPDATE invoiceIn ii
|
||||||
JOIN entry e ON e.invoiceInFk = ii.id
|
JOIN entry e ON e.invoiceInFk = ii.id
|
||||||
JOIN duaEntry de ON de.entryFk = e.id
|
JOIN duaEntry de ON de.entryFk = e.id
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`invoiceInDueDay_calculate`(vInvoiceInFk INT)
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`invoiceInDueDay_calculate`(
|
||||||
|
vInvoiceInFk INT
|
||||||
|
)
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
* Calcula los vctos. de una factura recibida
|
* Calcula los vctos. de una factura recibida
|
||||||
|
@ -56,12 +58,13 @@ BEGIN
|
||||||
COUNT(DISTINCT(pdd.detail)) cont,
|
COUNT(DISTINCT(pdd.detail)) cont,
|
||||||
s.payDay,
|
s.payDay,
|
||||||
ii.issued,
|
ii.issued,
|
||||||
DATE(ii.created) + INTERVAL 2 DAY created
|
DATE(ii.created) + INTERVAL iic.dueDateMarginDays DAY created
|
||||||
FROM invoiceIn ii
|
FROM invoiceIn ii
|
||||||
JOIN invoiceInTax iit ON iit.invoiceInFk = ii.id
|
JOIN invoiceInTax iit ON iit.invoiceInFk = ii.id
|
||||||
LEFT JOIN sage.TiposIva ti ON ti.CodigoIva= iit.taxTypeSageFk
|
LEFT JOIN sage.TiposIva ti ON ti.CodigoIva= iit.taxTypeSageFk
|
||||||
JOIN supplier s ON s.id = ii.supplierFk
|
JOIN supplier s ON s.id = ii.supplierFk
|
||||||
JOIN payDemDetail pdd ON pdd.id = s.payDemFk
|
JOIN payDemDetail pdd ON pdd.id = s.payDemFk
|
||||||
|
JOIN invoiceInConfig iic
|
||||||
WHERE ii.id = vInvoiceInFk
|
WHERE ii.id = vInvoiceInFk
|
||||||
GROUP BY ii.id
|
GROUP BY ii.id
|
||||||
)sub
|
)sub
|
||||||
|
|
|
@ -75,13 +75,6 @@ proc: BEGIN
|
||||||
) sub
|
) sub
|
||||||
GROUP BY itemFk;
|
GROUP BY itemFk;
|
||||||
|
|
||||||
UPDATE tmp.itemInventory ai
|
|
||||||
JOIN tItemInventoryCalc iic ON iic.itemFk = ai.id
|
|
||||||
SET ai.inventory = iic.quantity,
|
|
||||||
ai.visible = iic.quantity,
|
|
||||||
ai.avalaible = iic.quantity,
|
|
||||||
ai.sd = iic.quantity;
|
|
||||||
|
|
||||||
-- Cálculo del visible
|
-- Cálculo del visible
|
||||||
CALL cache.visible_refresh(vCalcFk, FALSE, vWarehouseFk);
|
CALL cache.visible_refresh(vCalcFk, FALSE, vWarehouseFk);
|
||||||
|
|
||||||
|
@ -93,8 +86,12 @@ proc: BEGIN
|
||||||
WHERE calc_id = vCalcFk;
|
WHERE calc_id = vCalcFk;
|
||||||
|
|
||||||
UPDATE tmp.itemInventory it
|
UPDATE tmp.itemInventory it
|
||||||
|
JOIN tItemInventoryCalc iic ON iic.itemFk = it.id
|
||||||
JOIN tItemVisibleCalc ivc ON ivc.item_id = it.id
|
JOIN tItemVisibleCalc ivc ON ivc.item_id = it.id
|
||||||
SET it.visible = it.visible + ivc.visible;
|
SET it.inventory = iic.quantity,
|
||||||
|
it.visible = ivc.visible,
|
||||||
|
it.avalaible = iic.quantity,
|
||||||
|
it.sd = iic.quantity;
|
||||||
|
|
||||||
-- Calculo del disponible
|
-- Calculo del disponible
|
||||||
CREATE OR REPLACE TEMPORARY TABLE tmp.itemCalc
|
CREATE OR REPLACE TEMPORARY TABLE tmp.itemCalc
|
||||||
|
@ -142,31 +139,35 @@ proc: BEGIN
|
||||||
CALL item_getAtp(vDate);
|
CALL item_getAtp(vDate);
|
||||||
CALL travel_upcomingArrivals(vWarehouseFk, vDate);
|
CALL travel_upcomingArrivals(vWarehouseFk, vDate);
|
||||||
|
|
||||||
UPDATE tmp.itemInventory ai
|
CREATE OR REPLACE TEMPORARY TABLE tItemAvailableCalc
|
||||||
JOIN (
|
(PRIMARY KEY (itemFk))
|
||||||
SELECT it.itemFk,
|
ENGINE = MEMORY
|
||||||
SUM(it.quantity) quantity,
|
SELECT it.itemFk,
|
||||||
im.quantity minQuantity
|
SUM(it.quantity) quantity,
|
||||||
FROM tmp.itemCalc it
|
im.quantity minQuantity
|
||||||
JOIN tmp.itemAtp im ON im.itemFk = it.itemFk
|
FROM tmp.itemCalc it
|
||||||
JOIN item i ON i.id = it.itemFk
|
JOIN tmp.itemAtp im ON im.itemFk = it.itemFk
|
||||||
LEFT JOIN origin o ON o.id = i.originFk
|
JOIN item i ON i.id = it.itemFk
|
||||||
LEFT JOIN tmp.itemTravel t ON t.wh = o.warehouseFk
|
LEFT JOIN origin o ON o.id = i.originFk
|
||||||
WHERE it.dated < IF(vMaxDays < 0 AND t.landing IS NOT NULL,
|
LEFT JOIN tmp.itemTravel t ON t.wh = o.warehouseFk
|
||||||
t.landing,
|
WHERE it.dated < IF(vMaxDays < 0 AND t.landing IS NOT NULL,
|
||||||
vDateToTomorrow)
|
t.landing,
|
||||||
GROUP BY it.itemFk
|
vDateToTomorrow)
|
||||||
) sub ON sub.itemFk = ai.id
|
GROUP BY it.itemFk;
|
||||||
SET ai.avalaible = IF(sub.minQuantity > 0,
|
|
||||||
ai.avalaible,
|
UPDATE tmp.itemInventory it
|
||||||
ai.avalaible + sub.minQuantity),
|
JOIN tItemAvailableCalc iac ON iac.itemFk = it.id
|
||||||
ai.sd = ai.inventory + sub.quantity;
|
SET it.avalaible = IF(iac.minQuantity > 0,
|
||||||
|
it.avalaible,
|
||||||
|
it.avalaible + iac.minQuantity),
|
||||||
|
it.sd = it.inventory + iac.quantity;
|
||||||
|
|
||||||
DROP TEMPORARY TABLE
|
DROP TEMPORARY TABLE
|
||||||
tmp.itemTravel,
|
tmp.itemTravel,
|
||||||
tmp.itemCalc,
|
tmp.itemCalc,
|
||||||
tmp.itemAtp,
|
tmp.itemAtp,
|
||||||
tItemInventoryCalc,
|
tItemInventoryCalc,
|
||||||
tItemVisibleCalc;
|
tItemVisibleCalc,
|
||||||
|
tItemAvailableCalc;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -174,27 +174,30 @@ proc: BEGIN
|
||||||
WHERE NOT `lines`;
|
WHERE NOT `lines`;
|
||||||
|
|
||||||
-- Lineas por linea de encajado
|
-- Lineas por linea de encajado
|
||||||
|
CREATE OR REPLACE TEMPORARY TABLE tItemPackingType
|
||||||
|
(PRIMARY KEY(ticketFk))
|
||||||
|
ENGINE = MEMORY
|
||||||
|
SELECT ticketFk,
|
||||||
|
SUM(sub.H) H,
|
||||||
|
SUM(sub.V) V,
|
||||||
|
SUM(sub.N) N
|
||||||
|
FROM (
|
||||||
|
SELECT t.ticketFk,
|
||||||
|
SUM(i.itemPackingTypeFk = 'H') H,
|
||||||
|
SUM(i.itemPackingTypeFk = 'V') V,
|
||||||
|
SUM(i.itemPackingTypeFk IS NULL) N
|
||||||
|
FROM tmp.productionTicket t
|
||||||
|
JOIN sale s ON s.ticketFk = t.ticketFk
|
||||||
|
JOIN item i ON i.id = s.itemFk
|
||||||
|
GROUP BY t.ticketFk, i.itemPackingTypeFk
|
||||||
|
) sub
|
||||||
|
GROUP BY ticketFk;
|
||||||
|
|
||||||
UPDATE tmp.productionBuffer pb
|
UPDATE tmp.productionBuffer pb
|
||||||
JOIN (
|
JOIN tItemPackingType ti ON ti.ticketFk = pb.ticketFk
|
||||||
SELECT ticketFk,
|
SET pb.H = ti.H,
|
||||||
SUM(sub.H) H,
|
pb.V = ti.V,
|
||||||
SUM(sub.V) V,
|
pb.N = ti.N;
|
||||||
SUM(sub.N) N
|
|
||||||
FROM (
|
|
||||||
SELECT t.ticketFk,
|
|
||||||
SUM(i.itemPackingTypeFk = 'H') H,
|
|
||||||
SUM(i.itemPackingTypeFk = 'V') V,
|
|
||||||
SUM(i.itemPackingTypeFk IS NULL) N
|
|
||||||
FROM tmp.productionTicket t
|
|
||||||
JOIN sale s ON s.ticketFk = t.ticketFk
|
|
||||||
JOIN item i ON i.id = s.itemFk
|
|
||||||
GROUP BY t.ticketFk, i.itemPackingTypeFk
|
|
||||||
) sub
|
|
||||||
GROUP BY ticketFk
|
|
||||||
) sub2 ON sub2.ticketFk = pb.ticketFk
|
|
||||||
SET pb.H = sub2.H,
|
|
||||||
pb.V = sub2.V,
|
|
||||||
pb.N = sub2.N;
|
|
||||||
|
|
||||||
-- Colecciones segun tipo de encajado
|
-- Colecciones segun tipo de encajado
|
||||||
UPDATE tmp.productionBuffer pb
|
UPDATE tmp.productionBuffer pb
|
||||||
|
@ -273,6 +276,7 @@ proc: BEGIN
|
||||||
tmp.risk,
|
tmp.risk,
|
||||||
tmp.ticket_problems,
|
tmp.ticket_problems,
|
||||||
tmp.ticketWithPrevia,
|
tmp.ticketWithPrevia,
|
||||||
tItemShelvingStock;
|
tItemShelvingStock,
|
||||||
|
tItemPackingType;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
DELIMITER $$
|
DELIMITER $$
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_splitItemPackingType`(
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_splitItemPackingType`(
|
||||||
vSelf INT,
|
vSelf INT,
|
||||||
vItemPackingTypeFk VARCHAR(1)
|
vOriginalItemPackingTypeFk VARCHAR(1)
|
||||||
)
|
)
|
||||||
BEGIN
|
BEGIN
|
||||||
/**
|
/**
|
||||||
|
@ -9,7 +9,7 @@ BEGIN
|
||||||
* Respeta el id inicial para el tipo propuesto.
|
* Respeta el id inicial para el tipo propuesto.
|
||||||
*
|
*
|
||||||
* @param vSelf Id ticket
|
* @param vSelf Id ticket
|
||||||
* @param vItemPackingTypeFk Tipo para el que se reserva el número de ticket original
|
* @param vOriginalItemPackingTypeFk Tipo para el que se reserva el número de ticket original
|
||||||
* @return table tmp.ticketIPT(ticketFk, itemPackingTypeFk)
|
* @return table tmp.ticketIPT(ticketFk, itemPackingTypeFk)
|
||||||
*/
|
*/
|
||||||
DECLARE vItemPackingTypeFk VARCHAR(1) DEFAULT 'H';
|
DECLARE vItemPackingTypeFk VARCHAR(1) DEFAULT 'H';
|
||||||
|
@ -23,7 +23,7 @@ BEGIN
|
||||||
SELECT itemPackingTypeFk
|
SELECT itemPackingTypeFk
|
||||||
FROM tSaleGroup
|
FROM tSaleGroup
|
||||||
WHERE itemPackingTypeFk IS NOT NULL
|
WHERE itemPackingTypeFk IS NOT NULL
|
||||||
ORDER BY (itemPackingTypeFk = vItemPackingTypeFk) DESC;
|
ORDER BY (itemPackingTypeFk = vOriginalItemPackingTypeFk) DESC;
|
||||||
|
|
||||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
ALTER TABLE vn.invoiceInConfig
|
||||||
|
ADD dueDateMarginDays INT UNSIGNED DEFAULT 2 NULL;
|
|
@ -4,7 +4,17 @@ import getMainRoute from 'core/lib/get-main-route';
|
||||||
config.$inject = ['$stateProvider', '$urlRouterProvider'];
|
config.$inject = ['$stateProvider', '$urlRouterProvider'];
|
||||||
function config($stateProvider, $urlRouterProvider) {
|
function config($stateProvider, $urlRouterProvider) {
|
||||||
$urlRouterProvider
|
$urlRouterProvider
|
||||||
.otherwise('/');
|
.otherwise(async($injector, {$location}) => {
|
||||||
|
const prefix = '#!';
|
||||||
|
if (!$location.$$path) return window.location.href = `/${prefix}/`;
|
||||||
|
|
||||||
|
const url = $location.$$absUrl
|
||||||
|
.replace('5000', '9000')
|
||||||
|
.replace('salix', 'lilium')
|
||||||
|
.replace(prefix, '#')
|
||||||
|
.replace('client', 'customer');
|
||||||
|
window.location.href = url;
|
||||||
|
});
|
||||||
|
|
||||||
$stateProvider
|
$stateProvider
|
||||||
.state('layout', {
|
.state('layout', {
|
||||||
|
|
Loading…
Reference in New Issue