Merge branch '6346-FixWagonModule' of https://gitea.verdnatura.es/verdnatura/salix into 6346-FixWagonModule
This commit is contained in:
commit
ec4b8b9e4f
|
@ -37,7 +37,6 @@ module.exports = Self => {
|
|||
});
|
||||
|
||||
const xmlString = response.data;
|
||||
console.log('xmlString: ', xmlString);
|
||||
const parser = new DOMParser();
|
||||
const xmlDoc = parser.parseFromString(xmlString, 'text/xml');
|
||||
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 vBookEntry INT;
|
||||
DECLARE vFiscalYear INT;
|
||||
DECLARE vIncorrectInvoiceInDueDay INT;
|
||||
|
||||
DECLARE vInvoicesIn CURSOR FOR
|
||||
SELECT DISTINCT e.invoiceInFk
|
||||
|
@ -24,6 +25,19 @@ BEGIN
|
|||
|
||||
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
|
||||
JOIN entry e ON e.invoiceInFk = ii.id
|
||||
JOIN duaEntry de ON de.entryFk = e.id
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
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
|
||||
/**
|
||||
* Calcula los vctos. de una factura recibida
|
||||
|
@ -56,12 +58,13 @@ BEGIN
|
|||
COUNT(DISTINCT(pdd.detail)) cont,
|
||||
s.payDay,
|
||||
ii.issued,
|
||||
DATE(ii.created) + INTERVAL 2 DAY created
|
||||
DATE(ii.created) + INTERVAL iic.dueDateMarginDays DAY created
|
||||
FROM invoiceIn ii
|
||||
JOIN invoiceInTax iit ON iit.invoiceInFk = ii.id
|
||||
LEFT JOIN sage.TiposIva ti ON ti.CodigoIva= iit.taxTypeSageFk
|
||||
JOIN supplier s ON s.id = ii.supplierFk
|
||||
JOIN payDemDetail pdd ON pdd.id = s.payDemFk
|
||||
JOIN invoiceInConfig iic
|
||||
WHERE ii.id = vInvoiceInFk
|
||||
GROUP BY ii.id
|
||||
)sub
|
||||
|
|
|
@ -75,13 +75,6 @@ proc: BEGIN
|
|||
) sub
|
||||
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
|
||||
CALL cache.visible_refresh(vCalcFk, FALSE, vWarehouseFk);
|
||||
|
||||
|
@ -93,8 +86,12 @@ proc: BEGIN
|
|||
WHERE calc_id = vCalcFk;
|
||||
|
||||
UPDATE tmp.itemInventory it
|
||||
JOIN tItemInventoryCalc iic ON iic.itemFk = 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
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.itemCalc
|
||||
|
@ -142,8 +139,9 @@ proc: BEGIN
|
|||
CALL item_getAtp(vDate);
|
||||
CALL travel_upcomingArrivals(vWarehouseFk, vDate);
|
||||
|
||||
UPDATE tmp.itemInventory ai
|
||||
JOIN (
|
||||
CREATE OR REPLACE TEMPORARY TABLE tItemAvailableCalc
|
||||
(PRIMARY KEY (itemFk))
|
||||
ENGINE = MEMORY
|
||||
SELECT it.itemFk,
|
||||
SUM(it.quantity) quantity,
|
||||
im.quantity minQuantity
|
||||
|
@ -155,18 +153,21 @@ proc: BEGIN
|
|||
WHERE it.dated < IF(vMaxDays < 0 AND t.landing IS NOT NULL,
|
||||
t.landing,
|
||||
vDateToTomorrow)
|
||||
GROUP BY it.itemFk
|
||||
) sub ON sub.itemFk = ai.id
|
||||
SET ai.avalaible = IF(sub.minQuantity > 0,
|
||||
ai.avalaible,
|
||||
ai.avalaible + sub.minQuantity),
|
||||
ai.sd = ai.inventory + sub.quantity;
|
||||
GROUP BY it.itemFk;
|
||||
|
||||
UPDATE tmp.itemInventory it
|
||||
JOIN tItemAvailableCalc iac ON iac.itemFk = it.id
|
||||
SET it.avalaible = IF(iac.minQuantity > 0,
|
||||
it.avalaible,
|
||||
it.avalaible + iac.minQuantity),
|
||||
it.sd = it.inventory + iac.quantity;
|
||||
|
||||
DROP TEMPORARY TABLE
|
||||
tmp.itemTravel,
|
||||
tmp.itemCalc,
|
||||
tmp.itemAtp,
|
||||
tItemInventoryCalc,
|
||||
tItemVisibleCalc;
|
||||
tItemVisibleCalc,
|
||||
tItemAvailableCalc;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -174,8 +174,9 @@ proc: BEGIN
|
|||
WHERE NOT `lines`;
|
||||
|
||||
-- Lineas por linea de encajado
|
||||
UPDATE tmp.productionBuffer pb
|
||||
JOIN (
|
||||
CREATE OR REPLACE TEMPORARY TABLE tItemPackingType
|
||||
(PRIMARY KEY(ticketFk))
|
||||
ENGINE = MEMORY
|
||||
SELECT ticketFk,
|
||||
SUM(sub.H) H,
|
||||
SUM(sub.V) V,
|
||||
|
@ -190,11 +191,13 @@ proc: BEGIN
|
|||
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;
|
||||
GROUP BY ticketFk;
|
||||
|
||||
UPDATE tmp.productionBuffer pb
|
||||
JOIN tItemPackingType ti ON ti.ticketFk = pb.ticketFk
|
||||
SET pb.H = ti.H,
|
||||
pb.V = ti.V,
|
||||
pb.N = ti.N;
|
||||
|
||||
-- Colecciones segun tipo de encajado
|
||||
UPDATE tmp.productionBuffer pb
|
||||
|
@ -273,6 +276,7 @@ proc: BEGIN
|
|||
tmp.risk,
|
||||
tmp.ticket_problems,
|
||||
tmp.ticketWithPrevia,
|
||||
tItemShelvingStock;
|
||||
tItemShelvingStock,
|
||||
tItemPackingType;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_splitItemPackingType`(
|
||||
vSelf INT,
|
||||
vItemPackingTypeFk VARCHAR(1)
|
||||
vOriginalItemPackingTypeFk VARCHAR(1)
|
||||
)
|
||||
BEGIN
|
||||
/**
|
||||
|
@ -9,7 +9,7 @@ BEGIN
|
|||
* Respeta el id inicial para el tipo propuesto.
|
||||
*
|
||||
* @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)
|
||||
*/
|
||||
DECLARE vItemPackingTypeFk VARCHAR(1) DEFAULT 'H';
|
||||
|
@ -23,7 +23,7 @@ BEGIN
|
|||
SELECT itemPackingTypeFk
|
||||
FROM tSaleGroup
|
||||
WHERE itemPackingTypeFk IS NOT NULL
|
||||
ORDER BY (itemPackingTypeFk = vItemPackingTypeFk) DESC;
|
||||
ORDER BY (itemPackingTypeFk = vOriginalItemPackingTypeFk) DESC;
|
||||
|
||||
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'];
|
||||
function config($stateProvider, $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
|
||||
.state('layout', {
|
||||
|
|
Loading…
Reference in New Issue