Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 5472-user_passExpired
This commit is contained in:
commit
a22a8a6bd8
|
@ -40,8 +40,7 @@ module.exports = Self => {
|
|||
try {
|
||||
const sale = await models.Sale.findById(saleId, null, myOptions);
|
||||
const saleUpdated = await sale.updateAttributes({
|
||||
originalQuantity: sale.quantity,
|
||||
quantity: quantity
|
||||
quantity
|
||||
}, myOptions);
|
||||
|
||||
if (tx) await tx.commit();
|
||||
|
|
|
@ -30,7 +30,7 @@ describe('setSaleQuantity()', () => {
|
|||
await models.Collection.setSaleQuantity(saleId, newQuantity, options);
|
||||
const updateSale = await models.Sale.findById(saleId, null, options);
|
||||
|
||||
expect(updateSale.originalQuantity).toEqual(originalSale.quantity);
|
||||
expect(updateSale.quantity).not.toEqual(originalSale.quantity);
|
||||
expect(updateSale.quantity).toEqual(newQuantity);
|
||||
|
||||
await tx.rollback();
|
||||
|
|
|
@ -8,7 +8,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `vn`.`invoiceOut_new`(
|
|||
BEGIN
|
||||
/**
|
||||
* Creación de facturas emitidas.
|
||||
* requiere previamente tabla ticketToInvoice(id).
|
||||
* requiere previamente tabla tmp.ticketToInvoice(id).
|
||||
*
|
||||
* @param vSerial serie a la cual se hace la factura
|
||||
* @param vInvoiceDate fecha de la factura
|
||||
|
@ -36,13 +36,13 @@ BEGIN
|
|||
|
||||
SELECT t.clientFk, t.companyFk
|
||||
INTO vClient, vCompany
|
||||
FROM ticketToInvoice tt
|
||||
FROM tmp.ticketToInvoice tt
|
||||
JOIN ticket t ON t.id = tt.id
|
||||
LIMIT 1;
|
||||
|
||||
-- Eliminem de ticketToInvoice els tickets que no han de ser facturats
|
||||
-- Eliminem de tmp.ticketToInvoice els tickets que no han de ser facturats
|
||||
DELETE ti.*
|
||||
FROM ticketToInvoice ti
|
||||
FROM tmp.ticketToInvoice ti
|
||||
JOIN ticket t ON t.id = ti.id
|
||||
JOIN sale s ON s.ticketFk = t.id
|
||||
JOIN item i ON i.id = s.itemFk
|
||||
|
@ -57,7 +57,7 @@ BEGIN
|
|||
|
||||
SELECT SUM(s.quantity * s.price * (100 - s.discount)/100), ts.id
|
||||
INTO vIsAnySaleToInvoice, vIsAnyServiceToInvoice
|
||||
FROM ticketToInvoice t
|
||||
FROM tmp.ticketToInvoice t
|
||||
LEFT JOIN sale s ON s.ticketFk = t.id
|
||||
LEFT JOIN ticketService ts ON ts.ticketFk = t.id;
|
||||
|
||||
|
@ -100,13 +100,13 @@ BEGIN
|
|||
WHERE id = vNewInvoiceId;
|
||||
|
||||
UPDATE ticket t
|
||||
JOIN ticketToInvoice ti ON ti.id = t.id
|
||||
JOIN tmp.ticketToInvoice ti ON ti.id = t.id
|
||||
SET t.refFk = vNewRef;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.updateInter;
|
||||
CREATE TEMPORARY TABLE tmp.updateInter ENGINE = MEMORY
|
||||
SELECT s.id,ti.id ticket_id,vWorker Id_Trabajador
|
||||
FROM ticketToInvoice ti
|
||||
FROM tmp.ticketToInvoice ti
|
||||
LEFT JOIN ticketState ts ON ti.id = ts.ticket
|
||||
JOIN state s
|
||||
WHERE IFNULL(ts.alertLevel,0) < 3 and s.`code` = getAlert3State(ti.id);
|
||||
|
@ -116,7 +116,7 @@ BEGIN
|
|||
|
||||
INSERT INTO ticketLog (action, userFk, originFk, description)
|
||||
SELECT 'UPDATE', account.myUser_getId(), ti.id, CONCAT('Crea factura ', vNewRef)
|
||||
FROM ticketToInvoice ti;
|
||||
FROM tmp.ticketToInvoice ti;
|
||||
|
||||
CALL invoiceExpenceMake(vNewInvoiceId);
|
||||
CALL invoiceTaxMake(vNewInvoiceId,vTaxArea);
|
||||
|
@ -159,7 +159,7 @@ BEGIN
|
|||
(KEY (ticketFk))
|
||||
ENGINE = MEMORY
|
||||
SELECT id ticketFk
|
||||
FROM ticketToInvoice;
|
||||
FROM tmp.ticketToInvoice;
|
||||
|
||||
CALL `ticket_getTax`('NATIONAL');
|
||||
|
||||
|
@ -220,6 +220,6 @@ BEGIN
|
|||
|
||||
END IF;
|
||||
|
||||
DROP TEMPORARY TABLE `ticketToInvoice`;
|
||||
DROP TEMPORARY TABLE `tmp`.`ticketToInvoice`;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -10,14 +10,14 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`invoiceOut_new`(
|
|||
BEGIN
|
||||
/**
|
||||
* Creación de facturas emitidas.
|
||||
* requiere previamente tabla ticketToInvoice(id).
|
||||
* requiere previamente tabla tmp.ticketToInvoice(id).
|
||||
*
|
||||
* @param vSerial serie a la cual se hace la factura
|
||||
* @param vInvoiceDate fecha de la factura
|
||||
* @param vTaxArea tipo de iva en relacion a la empresa y al cliente
|
||||
* @param vNewInvoiceId id de la factura que se acaba de generar
|
||||
* @return vNewInvoiceId
|
||||
*/
|
||||
*/
|
||||
DECLARE vIsAnySaleToInvoice BOOL;
|
||||
DECLARE vIsAnyServiceToInvoice BOOL;
|
||||
DECLARE vNewRef VARCHAR(255);
|
||||
|
@ -37,32 +37,32 @@ BEGIN
|
|||
DECLARE vMaxShipped DATE;
|
||||
|
||||
SET vInvoiceDate = IFNULL(vInvoiceDate, util.CURDATE());
|
||||
|
||||
SELECT t.clientFk,
|
||||
t.companyFk,
|
||||
|
||||
SELECT t.clientFk,
|
||||
t.companyFk,
|
||||
MAX(DATE(t.shipped)),
|
||||
DATE(vInvoiceDate) >= invoiceOut_getMaxIssued(
|
||||
vSerial,
|
||||
t.companyFk,
|
||||
vSerial,
|
||||
t.companyFk,
|
||||
YEAR(vInvoiceDate))
|
||||
INTO vClientFk,
|
||||
INTO vClientFk,
|
||||
vCompanyFk,
|
||||
vMaxShipped,
|
||||
vIsCorrectInvoiceDate
|
||||
FROM ticketToInvoice tt
|
||||
FROM tmp.ticketToInvoice tt
|
||||
JOIN ticket t ON t.id = tt.id;
|
||||
|
||||
IF(vMaxShipped > vInvoiceDate) THEN
|
||||
IF(vMaxShipped > vInvoiceDate) THEN
|
||||
CALL util.throw("Invoice date can't be less than max date");
|
||||
END IF;
|
||||
|
||||
|
||||
IF NOT vIsCorrectInvoiceDate THEN
|
||||
CALL util.throw('Exists an invoice with a previous date');
|
||||
END IF;
|
||||
|
||||
-- Eliminem de ticketToInvoice els tickets que no han de ser facturats
|
||||
|
||||
-- Eliminem de tmp.ticketToInvoice els tickets que no han de ser facturats
|
||||
DELETE ti.*
|
||||
FROM ticketToInvoice ti
|
||||
FROM tmp.ticketToInvoice ti
|
||||
JOIN ticket t ON t.id = ti.id
|
||||
JOIN sale s ON s.ticketFk = t.id
|
||||
JOIN item i ON i.id = s.itemFk
|
||||
|
@ -77,11 +77,11 @@ BEGIN
|
|||
|
||||
SELECT SUM(s.quantity * s.price * (100 - s.discount)/100) <> 0
|
||||
INTO vIsAnySaleToInvoice
|
||||
FROM ticketToInvoice t
|
||||
FROM tmp.ticketToInvoice t
|
||||
JOIN sale s ON s.ticketFk = t.id;
|
||||
|
||||
SELECT COUNT(*) > 0 INTO vIsAnyServiceToInvoice
|
||||
FROM ticketToInvoice t
|
||||
FROM tmp.ticketToInvoice t
|
||||
JOIN ticketService ts ON ts.ticketFk = t.id;
|
||||
|
||||
IF (vIsAnySaleToInvoice OR vIsAnyServiceToInvoice)
|
||||
|
@ -121,13 +121,13 @@ BEGIN
|
|||
WHERE id = vNewInvoiceId;
|
||||
|
||||
UPDATE ticket t
|
||||
JOIN ticketToInvoice ti ON ti.id = t.id
|
||||
JOIN tmp.ticketToInvoice ti ON ti.id = t.id
|
||||
SET t.refFk = vNewRef;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.updateInter;
|
||||
CREATE TEMPORARY TABLE tmp.updateInter ENGINE = MEMORY
|
||||
SELECT s.id,ti.id ticket_id,vWorker Id_Trabajador
|
||||
FROM ticketToInvoice ti
|
||||
FROM tmp.ticketToInvoice ti
|
||||
LEFT JOIN ticketState ts ON ti.id = ts.ticket
|
||||
JOIN state s
|
||||
WHERE IFNULL(ts.alertLevel,0) < 3 and s.`code` = getAlert3State(ti.id);
|
||||
|
@ -137,7 +137,7 @@ BEGIN
|
|||
|
||||
INSERT INTO ticketLog (action, userFk, originFk, description)
|
||||
SELECT 'UPDATE', account.myUser_getId(), ti.id, CONCAT('Crea factura ', vNewRef)
|
||||
FROM ticketToInvoice ti;
|
||||
FROM tmp.ticketToInvoice ti;
|
||||
|
||||
CALL invoiceExpenceMake(vNewInvoiceId);
|
||||
CALL invoiceTaxMake(vNewInvoiceId,vTaxArea);
|
||||
|
@ -157,12 +157,12 @@ BEGIN
|
|||
WHERE io.id = vNewInvoiceId;
|
||||
|
||||
DROP TEMPORARY TABLE tmp.updateInter;
|
||||
|
||||
SELECT COUNT(*), id
|
||||
|
||||
SELECT COUNT(*), id
|
||||
INTO vIsInterCompany, vInterCompanyFk
|
||||
FROM company
|
||||
FROM company
|
||||
WHERE clientFk = vClientFk;
|
||||
|
||||
|
||||
IF (vIsInterCompany) THEN
|
||||
|
||||
INSERT INTO invoiceIn(supplierFk, supplierRef, issued, companyFk)
|
||||
|
@ -175,7 +175,7 @@ BEGIN
|
|||
(KEY (ticketFk))
|
||||
ENGINE = MEMORY
|
||||
SELECT id ticketFk
|
||||
FROM ticketToInvoice;
|
||||
FROM tmp.ticketToInvoice;
|
||||
|
||||
CALL `ticket_getTax`('NATIONAL');
|
||||
|
||||
|
@ -201,7 +201,7 @@ BEGIN
|
|||
) sub;
|
||||
|
||||
INSERT INTO invoiceInTax(invoiceInFk, taxableBase, expenceFk, taxTypeSageFk, transactionTypeSageFk)
|
||||
SELECT vNewInvoiceInFk,
|
||||
SELECT vNewInvoiceInFk,
|
||||
SUM(tt.taxableBase) - IF(tt.code = @vTaxCodeGeneral,
|
||||
@vTaxableBaseServices, 0) taxableBase,
|
||||
i.expenceFk,
|
||||
|
@ -215,13 +215,13 @@ BEGIN
|
|||
ORDER BY tt.priority;
|
||||
|
||||
CALL invoiceInDueDay_calculate(vNewInvoiceInFk);
|
||||
|
||||
SELECT COUNT(*) INTO vIsCEESerial
|
||||
|
||||
SELECT COUNT(*) INTO vIsCEESerial
|
||||
FROM invoiceOutSerial
|
||||
WHERE code = vSerial;
|
||||
|
||||
IF vIsCEESerial THEN
|
||||
|
||||
|
||||
INSERT INTO invoiceInIntrastat (
|
||||
invoiceInFk,
|
||||
intrastatFk,
|
||||
|
@ -253,6 +253,6 @@ BEGIN
|
|||
DROP TEMPORARY TABLE tmp.ticketServiceTax;
|
||||
END IF;
|
||||
END IF;
|
||||
DROP TEMPORARY TABLE `ticketToInvoice`;
|
||||
DROP TEMPORARY TABLE tmp.`ticketToInvoice`;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
DELIMITER ;
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
DROP PROCEDURE IF EXISTS `vn`.`sale_setQuantity`;
|
||||
DROP PROCEDURE IF EXISTS `vn`.`collection_updateSale`;
|
||||
DROP PROCEDURE IF EXISTS `vn`.`replaceMovimientosMark`;
|
||||
DROP PROCEDURE IF EXISTS `vn`.`saleTracking_Replace`;
|
||||
DROP PROCEDURE IF EXISTS `vn`.`sale_updateOriginalQuantity`;
|
|
@ -42776,7 +42776,7 @@ CREATE DEFINER=`root`@`localhost` FUNCTION `hasAnyNegativeBase`() RETURNS tinyin
|
|||
BEGIN
|
||||
|
||||
/* Calcula si existe alguna base imponible negativa
|
||||
* Requiere la tabla temporal vn.ticketToInvoice(id)
|
||||
* Requiere la tabla temporal tmp.ticketToInvoice(id)
|
||||
*
|
||||
* returns BOOLEAN
|
||||
*/
|
||||
|
@ -42787,7 +42787,7 @@ BEGIN
|
|||
(KEY (ticketFk))
|
||||
ENGINE = MEMORY
|
||||
SELECT id ticketFk
|
||||
FROM ticketToInvoice;
|
||||
FROM tmp.ticketToInvoice;
|
||||
|
||||
CALL ticket_getTax(NULL);
|
||||
|
||||
|
@ -55223,7 +55223,7 @@ DELIMITER ;;
|
|||
CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceExpenceMake`(IN vInvoice INT)
|
||||
BEGIN
|
||||
/* Inserta las partidas de gasto correspondientes a la factura
|
||||
* REQUIERE tabla ticketToInvoice
|
||||
* REQUIERE tabla tmp.ticketToInvoice
|
||||
* @param vInvoice Numero de factura
|
||||
*/
|
||||
DELETE FROM invoiceOutExpence
|
||||
|
@ -55233,7 +55233,7 @@ BEGIN
|
|||
SELECT vInvoice,
|
||||
expenceFk,
|
||||
SUM(ROUND(quantity * price * (100 - discount)/100,2)) amount
|
||||
FROM ticketToInvoice t
|
||||
FROM tmp.ticketToInvoice t
|
||||
JOIN sale s ON s.ticketFk = t.id
|
||||
JOIN item i ON i.id = s.itemFk
|
||||
GROUP BY i.expenceFk
|
||||
|
@ -55243,7 +55243,7 @@ BEGIN
|
|||
SELECT vInvoice,
|
||||
tst.expenceFk,
|
||||
SUM(ROUND(ts.quantity * ts.price ,2)) amount
|
||||
FROM ticketToInvoice t
|
||||
FROM tmp.ticketToInvoice t
|
||||
JOIN ticketService ts ON ts.ticketFk = t.id
|
||||
JOIN ticketServiceType tst ON tst.id = ts.ticketServiceTypeFk
|
||||
HAVING amount != 0;
|
||||
|
@ -55270,9 +55270,9 @@ BEGIN
|
|||
|
||||
SET vMaxTicketDate = vn2008.DAYEND(vMaxTicketDate);
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS `ticketToInvoice`;
|
||||
DROP TEMPORARY TABLE IF EXISTS `tmp`.`ticketToInvoice`;
|
||||
|
||||
CREATE TEMPORARY TABLE `ticketToInvoice`
|
||||
CREATE TEMPORARY TABLE `tmp`.`ticketToInvoice`
|
||||
(PRIMARY KEY (`id`))
|
||||
ENGINE = MEMORY
|
||||
SELECT Id_Ticket id FROM vn2008.Tickets WHERE (Fecha BETWEEN vMinDateTicket
|
||||
|
@ -55305,8 +55305,8 @@ BEGIN
|
|||
SET vMinTicketDate = util.firstDayOfYear(vMaxTicketDate - INTERVAL 1 YEAR);
|
||||
SET vMaxTicketDate = util.dayend(vMaxTicketDate);
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS `ticketToInvoice`;
|
||||
CREATE TEMPORARY TABLE `ticketToInvoice`
|
||||
DROP TEMPORARY TABLE IF EXISTS `tmp`.`ticketToInvoice`;
|
||||
CREATE TEMPORARY TABLE `tmp`.`ticketToInvoice`
|
||||
(PRIMARY KEY (`id`))
|
||||
ENGINE = MEMORY
|
||||
SELECT id FROM ticket t
|
||||
|
@ -55333,9 +55333,9 @@ DELIMITER ;;
|
|||
CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceFromTicket`(IN vTicket INT)
|
||||
BEGIN
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS `ticketToInvoice`;
|
||||
DROP TEMPORARY TABLE IF EXISTS `tmp`.`ticketToInvoice`;
|
||||
|
||||
CREATE TEMPORARY TABLE `ticketToInvoice`
|
||||
CREATE TEMPORARY TABLE `tmp`.`ticketToInvoice`
|
||||
(PRIMARY KEY (`id`))
|
||||
ENGINE = MEMORY
|
||||
SELECT id FROM vn.ticket
|
||||
|
@ -55931,9 +55931,9 @@ BEGIN
|
|||
JOIN invoiceOut io ON io.companyFk = s.id
|
||||
WHERE io.id = vInvoiceFk;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS ticketToInvoice;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.ticketToInvoice;
|
||||
|
||||
CREATE TEMPORARY TABLE ticketToInvoice
|
||||
CREATE TEMPORARY TABLE tmp.ticketToInvoice
|
||||
SELECT id
|
||||
FROM ticket
|
||||
WHERE refFk = vInvoiceRef;
|
||||
|
@ -56408,9 +56408,9 @@ BEGIN
|
|||
JOIN client c ON c.id = io.clientFk
|
||||
WHERE io.id = vInvoice;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS ticketToInvoice;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.ticketToInvoice;
|
||||
|
||||
CREATE TEMPORARY TABLE ticketToInvoice
|
||||
CREATE TEMPORARY TABLE tmp.ticketToInvoice
|
||||
SELECT id
|
||||
FROM ticket
|
||||
WHERE refFk = vInvoiceRef;
|
||||
|
@ -56456,7 +56456,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceOut_exportationFromClient`(
|
|||
vCompanyFk INT)
|
||||
BEGIN
|
||||
/**
|
||||
* Genera tabla temporal ticketToInvoice necesaría para el proceso de facturación
|
||||
* Genera tabla temporal tmp.ticketToInvoice necesaría para el proceso de facturación
|
||||
* Los abonos quedan excluidos en las exportaciones
|
||||
*
|
||||
* @param vMaxTicketDate Fecha hasta la cual cogerá tickets para facturar
|
||||
|
@ -56467,8 +56467,8 @@ BEGIN
|
|||
SET vMinTicketDate = util.firstDayOfYear(vMaxTicketDate - INTERVAL 1 YEAR);
|
||||
SET vMaxTicketDate = util.dayend(vMaxTicketDate);
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS `ticketToInvoice`;
|
||||
CREATE TEMPORARY TABLE `ticketToInvoice`
|
||||
DROP TEMPORARY TABLE IF EXISTS `tmp`.`ticketToInvoice`;
|
||||
CREATE TEMPORARY TABLE `tmp`.`ticketToInvoice`
|
||||
(PRIMARY KEY (`id`))
|
||||
ENGINE = MEMORY
|
||||
SELECT t.id
|
||||
|
@ -56503,7 +56503,7 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `invoiceOut_new`(
|
|||
BEGIN
|
||||
/**
|
||||
* Creación de facturas emitidas.
|
||||
* requiere previamente tabla ticketToInvoice(id).
|
||||
* requiere previamente tabla tmp.ticketToInvoice(id).
|
||||
*
|
||||
* @param vSerial serie a la cual se hace la factura
|
||||
* @param vInvoiceDate fecha de la factura
|
||||
|
@ -56531,13 +56531,13 @@ BEGIN
|
|||
|
||||
SELECT t.clientFk, t.companyFk
|
||||
INTO vClientFk, vCompanyFk
|
||||
FROM ticketToInvoice tt
|
||||
FROM tmp.ticketToInvoice tt
|
||||
JOIN ticket t ON t.id = tt.id
|
||||
LIMIT 1;
|
||||
|
||||
-- Eliminem de ticketToInvoice els tickets que no han de ser facturats
|
||||
-- Eliminem de tmp.ticketToInvoice els tickets que no han de ser facturats
|
||||
DELETE ti.*
|
||||
FROM ticketToInvoice ti
|
||||
FROM tmp.ticketToInvoice ti
|
||||
JOIN ticket t ON t.id = ti.id
|
||||
JOIN sale s ON s.ticketFk = t.id
|
||||
JOIN item i ON i.id = s.itemFk
|
||||
|
@ -56552,7 +56552,7 @@ BEGIN
|
|||
|
||||
SELECT SUM(s.quantity * s.price * (100 - s.discount)/100), ts.id
|
||||
INTO vIsAnySaleToInvoice, vIsAnyServiceToInvoice
|
||||
FROM ticketToInvoice t
|
||||
FROM tmp.ticketToInvoice t
|
||||
LEFT JOIN sale s ON s.ticketFk = t.id
|
||||
LEFT JOIN ticketService ts ON ts.ticketFk = t.id;
|
||||
|
||||
|
@ -56593,13 +56593,13 @@ BEGIN
|
|||
WHERE id = vNewInvoiceId;
|
||||
|
||||
UPDATE ticket t
|
||||
JOIN ticketToInvoice ti ON ti.id = t.id
|
||||
JOIN tmp.ticketToInvoice ti ON ti.id = t.id
|
||||
SET t.refFk = vNewRef;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.updateInter;
|
||||
CREATE TEMPORARY TABLE tmp.updateInter ENGINE = MEMORY
|
||||
SELECT s.id,ti.id ticket_id,vWorker Id_Trabajador
|
||||
FROM ticketToInvoice ti
|
||||
FROM tmp.ticketToInvoice ti
|
||||
LEFT JOIN ticketState ts ON ti.id = ts.ticket
|
||||
JOIN state s
|
||||
WHERE IFNULL(ts.alertLevel,0) < 3 and s.`code` = getAlert3State(ti.id);
|
||||
|
@ -56609,7 +56609,7 @@ BEGIN
|
|||
|
||||
INSERT INTO ticketLog (action, userFk, originFk, description)
|
||||
SELECT 'UPDATE', account.myUser_getId(), ti.id, CONCAT('Crea factura ', vNewRef)
|
||||
FROM ticketToInvoice ti;
|
||||
FROM tmp.ticketToInvoice ti;
|
||||
|
||||
CALL invoiceExpenceMake(vNewInvoiceId);
|
||||
CALL invoiceTaxMake(vNewInvoiceId,vTaxArea);
|
||||
|
@ -56647,7 +56647,7 @@ BEGIN
|
|||
(KEY (ticketFk))
|
||||
ENGINE = MEMORY
|
||||
SELECT id ticketFk
|
||||
FROM ticketToInvoice;
|
||||
FROM tmp.ticketToInvoice;
|
||||
|
||||
CALL `ticket_getTax`('NATIONAL');
|
||||
|
||||
|
@ -56725,7 +56725,7 @@ BEGIN
|
|||
DROP TEMPORARY TABLE tmp.ticketServiceTax;
|
||||
END IF;
|
||||
END IF;
|
||||
DROP TEMPORARY TABLE `ticketToInvoice`;
|
||||
DROP TEMPORARY TABLE `tmp`.`ticketToInvoice`;
|
||||
END ;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
|
@ -56876,7 +56876,7 @@ BEGIN
|
|||
(KEY (ticketFk))
|
||||
ENGINE = MEMORY
|
||||
SELECT id ticketFk
|
||||
FROM ticketToInvoice;
|
||||
FROM tmp.ticketToInvoice;
|
||||
|
||||
CALL ticket_getTax(vTaxArea);
|
||||
|
||||
|
@ -68689,7 +68689,7 @@ DELIMITER ;
|
|||
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
||||
/*!50003 SET character_set_results = @saved_cs_results */ ;
|
||||
/*!50003 SET collation_connection = @saved_col_connection */ ;
|
||||
/*!50003 DROP PROCEDURE IF EXISTS `ticketToInvoiceByAddress` */;
|
||||
/*!50003 DROP PROCEDURE IF EXISTS `tmp`.`ticketToInvoiceByAddress` */;
|
||||
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
||||
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
||||
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
|
||||
|
@ -68709,9 +68709,9 @@ BEGIN
|
|||
|
||||
SET vEnded = util.dayEnd(vEnded);
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS vn.ticketToInvoice;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.ticketToInvoice;
|
||||
|
||||
CREATE TEMPORARY TABLE vn.ticketToInvoice
|
||||
CREATE TEMPORARY TABLE tmp.ticketToInvoice
|
||||
SELECT id
|
||||
FROM vn.ticket
|
||||
WHERE addressFk = vAddress
|
||||
|
@ -68745,9 +68745,9 @@ BEGIN
|
|||
|
||||
SET vEnded = util.dayEnd(vEnded);
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS vn.ticketToInvoice;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.ticketToInvoice;
|
||||
|
||||
CREATE TEMPORARY TABLE vn.ticketToInvoice
|
||||
CREATE TEMPORARY TABLE tmp.ticketToInvoice
|
||||
SELECT id
|
||||
FROM vn.ticket
|
||||
WHERE clientFk = vClient
|
||||
|
@ -68808,9 +68808,9 @@ BEGIN
|
|||
JOIN vn.client c ON c.id = io.clientFk
|
||||
WHERE io.id = vInvoice;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS vn.ticketToInvoice;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.ticketToInvoice;
|
||||
|
||||
CREATE TEMPORARY TABLE vn.ticketToInvoice
|
||||
CREATE TEMPORARY TABLE tmp.ticketToInvoice
|
||||
SELECT id
|
||||
FROM vn.ticket
|
||||
WHERE refFk = vInvoiceRef;
|
||||
|
|
|
@ -174,7 +174,6 @@ export default class Autocomplete extends Field {
|
|||
|
||||
refreshDisplayed() {
|
||||
let display = '';
|
||||
let hasTemplate = this.$transclude && this.$transclude.isSlotFilled('tplItem');
|
||||
|
||||
if (this._selection && this.showField) {
|
||||
if (this.multiple && Array.isArray(this._selection)) {
|
||||
|
@ -182,19 +181,8 @@ export default class Autocomplete extends Field {
|
|||
if (display.length > 0) display += ', ';
|
||||
display += item[this.showField];
|
||||
}
|
||||
} else {
|
||||
} else
|
||||
display = this._selection[this.showField];
|
||||
if (hasTemplate) {
|
||||
let template = this.$transclude(() => {}, null, 'tplItem');
|
||||
const element = template[0];
|
||||
const description = element.querySelector('.text-secondary');
|
||||
if (description) description.remove();
|
||||
|
||||
const displayElement = angular.element(element);
|
||||
const displayText = displayElement.text();
|
||||
display = this.$interpolate(displayText)(this._selection);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.input.value = display;
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<div class="letter">
|
||||
{{::$ctrl.val && $ctrl.val.charAt(0).toUpperCase()}}
|
||||
</div>
|
||||
<div class="image" ng-transclude>
|
||||
</div>
|
|
@ -0,0 +1,63 @@
|
|||
import ngModule from '../../module';
|
||||
import Component from 'core/lib/component';
|
||||
import './style.scss';
|
||||
|
||||
/**
|
||||
* Displays colored avatar based on value.
|
||||
*
|
||||
* @property {*} val The value
|
||||
*/
|
||||
export default class Avatar extends Component {
|
||||
get val() {
|
||||
return this._val;
|
||||
}
|
||||
|
||||
set val(value) {
|
||||
this._val = value;
|
||||
|
||||
const val = value || '';
|
||||
let hash = 0;
|
||||
for (let i = 0; i < val.length; i++)
|
||||
hash += val.charCodeAt(i);
|
||||
const color = '#' + colors[hash % colors.length];
|
||||
|
||||
const el = this.element;
|
||||
el.style.backgroundColor = color;
|
||||
el.title = val;
|
||||
}
|
||||
}
|
||||
|
||||
ngModule.vnComponent('vnAvatar', {
|
||||
template: require('./index.html'),
|
||||
controller: Avatar,
|
||||
bindings: {
|
||||
val: '@?'
|
||||
},
|
||||
transclude: true
|
||||
});
|
||||
|
||||
const colors = [
|
||||
'e2553d', // Coral
|
||||
'FFA07A', // Salmon
|
||||
'FFDAB9', // Peach
|
||||
'a17077', // Pink
|
||||
'bf0e99', // Pink light
|
||||
'52a500', // Green chartreuse
|
||||
'00aeae', // Cian
|
||||
'b754cf', // Purple middle
|
||||
'8a69cd', // Blue lavender
|
||||
'1fa8a1', // Green ocean
|
||||
'DC143C', // Red crimson
|
||||
'5681cf', // Blue steel
|
||||
'FF1493', // Ping intense
|
||||
'02ba02', // Green lime
|
||||
'1E90FF', // Blue sky
|
||||
'8B008B', // Purple dark
|
||||
'cc7000', // Orange bright
|
||||
'00b5b8', // Turquoise
|
||||
'8B0000', // Red dark
|
||||
'008080', // Green bluish
|
||||
'2F4F4F', // Gray board
|
||||
'7e7e7e', // Gray
|
||||
'5d5d5d', // Gray dark
|
||||
];
|
|
@ -0,0 +1,32 @@
|
|||
@import "variables";
|
||||
|
||||
vn-avatar {
|
||||
display: block;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
height: 36px;
|
||||
width: 36px;
|
||||
font-size: 22px;
|
||||
background-color: $color-main;
|
||||
position: relative;
|
||||
|
||||
& > * {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
& > .letter {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
& > .image {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
||||
& > img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -17,6 +17,7 @@ import './pagination/pagination';
|
|||
import './searchbar/searchbar';
|
||||
import './scroll-up/scroll-up';
|
||||
import './autocomplete';
|
||||
import './avatar';
|
||||
import './button';
|
||||
import './button-menu';
|
||||
import './calendar';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import './index';
|
||||
|
||||
describe('Salix Component vnLog', () => {
|
||||
describe('Component vnJsonValue', () => {
|
||||
let controller;
|
||||
let $scope;
|
||||
let $element;
|
||||
|
@ -10,7 +10,7 @@ describe('Salix Component vnLog', () => {
|
|||
|
||||
beforeEach(inject(($componentController, $rootScope) => {
|
||||
$scope = $rootScope.$new();
|
||||
$element = angular.element('<json-value></json-value>');
|
||||
$element = angular.element('<vn-json-value></vn-json-value>');
|
||||
controller = $componentController('vnJsonValue', {$element, $scope});
|
||||
el = controller.element;
|
||||
}));
|
||||
|
|
|
@ -17,20 +17,15 @@
|
|||
<vn-data-viewer model="model" class="vn-w-md vn-px-sm">
|
||||
<div class="change vn-mb-sm" ng-repeat="log in $ctrl.logs">
|
||||
<div class="user-wrapper">
|
||||
<div
|
||||
class="user vn-mt-xs"
|
||||
<vn-avatar class="vn-mt-xs"
|
||||
ng-class="::{system: !log.user}"
|
||||
ng-style="::$ctrl.userBgColor(log.user)"
|
||||
title="{{::log.user.nickname || 'System'}}">
|
||||
<div class="user-letter">
|
||||
{{::log.user ? log.user.name.charAt(0).toUpperCase() : 'S'}}
|
||||
</div>
|
||||
val="{{::log.user ? log.user.nickname : 'System'}}"
|
||||
ng-click="$ctrl.showWorkerDescriptor($event, log)">
|
||||
<img
|
||||
ng-if="::log.user.image"
|
||||
ng-src="/api/Images/user/160x160/{{::log.userFk}}/download?access_token={{::$ctrl.vnToken.token}}"
|
||||
ng-click="$ctrl.showWorkerDescriptor($event, log)">
|
||||
ng-src="/api/Images/user/160x160/{{::log.userFk}}/download?access_token={{::$ctrl.vnToken.token}}">
|
||||
</img>
|
||||
</div>
|
||||
</vn-avatar>
|
||||
<div class="arrow bg-panel"></div>
|
||||
<div class="line"></div>
|
||||
</div>
|
||||
|
@ -41,7 +36,7 @@
|
|||
title="{{::log.creationDate | date:'dd/MM/yyyy HH:mm'}}">
|
||||
{{::$ctrl.relativeDate(log.creationDate)}}
|
||||
</div>
|
||||
<span class="chip {{::$ctrl.actionsClass[log.action]}}" translate>
|
||||
<span class="chip" ng-class="::$ctrl.actionsClass[log.action]" translate>
|
||||
{{::$ctrl.actionsText[log.action]}}
|
||||
</span>
|
||||
</div>
|
||||
|
@ -62,7 +57,9 @@
|
|||
{{::log.changedModelValue}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="changes {{::log.props.length ? 'props' : 'no-props'}}" vn-id="changes">
|
||||
<div class="changes"
|
||||
ng-class="::log.props.length ? 'props' : 'no-props'"
|
||||
vn-id="changes">
|
||||
<vn-icon icon="visibility"
|
||||
class="expand-button"
|
||||
ng-click="$ctrl.toggleAttributes(log, changes, true)">
|
||||
|
@ -141,13 +138,25 @@
|
|||
ng-model="filter.userFk"
|
||||
value-field="id"
|
||||
show-field="nickname"
|
||||
fields="['id', 'name', 'nickname']"
|
||||
fields="['id', 'name', 'nickname', 'image']"
|
||||
search-function="$ctrl.searchUser($search)"
|
||||
url="{{$ctrl.url}}/{{$ctrl.originId}}/editors"
|
||||
order="nickname">
|
||||
<tpl-item>
|
||||
<div>{{nickname}}</div>
|
||||
<div class="text-secondary text-caption">{{name}}</div>
|
||||
<div style="display: flex;">
|
||||
<vn-avatar
|
||||
class="vn-mr-sm"
|
||||
val="{{::nickname}}">
|
||||
<img
|
||||
ng-if="::image"
|
||||
ng-src="/api/Images/user/160x160/{{::id}}/download?access_token={{::$ctrl.vnToken.token}}">
|
||||
</img>
|
||||
</vn-avatar>
|
||||
<div>
|
||||
<div>{{::nickname}}</div>
|
||||
<div class="text-secondary text-caption">{{::name}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</tpl-item>
|
||||
</vn-autocomplete>
|
||||
<vn-autocomplete
|
||||
|
|
|
@ -186,17 +186,6 @@ export default class Controller extends Section {
|
|||
}
|
||||
}
|
||||
|
||||
userBgColor(user) {
|
||||
if (!user) return;
|
||||
const name = user.name || '';
|
||||
let hash = 0;
|
||||
for (let i = 0; i < name.length; i++)
|
||||
hash += name.charCodeAt(i);
|
||||
return {
|
||||
backgroundColor: '#'+ colors[hash % colors.length]
|
||||
};
|
||||
}
|
||||
|
||||
showWorkerDescriptor(event, log) {
|
||||
if (log.user?.worker)
|
||||
this.$.workerDescriptor.show(event.target, log.userFk);
|
||||
|
@ -214,29 +203,3 @@ ngModule.vnComponent('vnLog', {
|
|||
url: '@'
|
||||
}
|
||||
});
|
||||
|
||||
const colors = [
|
||||
'e2553d', // Coral
|
||||
'FFA07A', // Salmon
|
||||
'FFDAB9', // Peach
|
||||
'a17077', // Pink
|
||||
'bf0e99', // Pink light
|
||||
'52a500', // Green chartreuse
|
||||
'00aeae', // Cian
|
||||
'b754cf', // Purple middle
|
||||
'8a69cd', // Blue lavender
|
||||
'1fa8a1', // Green ocean
|
||||
'DC143C', // Red crimson
|
||||
'5681cf', // Blue steel
|
||||
'FF1493', // Ping intense
|
||||
'02ba02', // Green lime
|
||||
'1E90FF', // Blue sky
|
||||
'8B008B', // Purple dark
|
||||
'cc7000', // Orange bright
|
||||
'00b5b8', // Turquoise
|
||||
'8B0000', // Red dark
|
||||
'008080', // Green bluish
|
||||
'2F4F4F', // Gray board
|
||||
'7e7e7e', // Gray
|
||||
'5d5d5d', // Gray dark
|
||||
];
|
||||
|
|
|
@ -8,34 +8,11 @@ vn-log {
|
|||
position: relative;
|
||||
padding-right: 10px;
|
||||
|
||||
& > .user {
|
||||
position: relative;
|
||||
border-radius: 50%;
|
||||
height: 36px;
|
||||
width: 36px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
& > vn-avatar {
|
||||
cursor: pointer;
|
||||
|
||||
& > * {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
&.system {
|
||||
background-color: $color-main;
|
||||
}
|
||||
.user-letter {
|
||||
font-size: 22px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
img {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: $color-main !important;
|
||||
}
|
||||
}
|
||||
& > .arrow {
|
||||
|
|
|
@ -28,7 +28,7 @@ module.exports = Self => {
|
|||
const isAccount = await models.Account.findById(id);
|
||||
|
||||
if (isClient && !isAccount)
|
||||
await models.VnUser.setPassword(id, newPassword);
|
||||
await models.Account.setPassword(id, newPassword);
|
||||
else
|
||||
throw new UserError(`Modifiable password only via recovery or by an administrator`);
|
||||
};
|
||||
|
|
|
@ -75,8 +75,8 @@ module.exports = function(Self) {
|
|||
serial = result.serial;
|
||||
|
||||
await Self.rawSql(`
|
||||
DROP TEMPORARY TABLE IF EXISTS ticketToInvoice;
|
||||
CREATE TEMPORARY TABLE ticketToInvoice
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.ticketToInvoice;
|
||||
CREATE TEMPORARY TABLE tmp.ticketToInvoice
|
||||
(PRIMARY KEY (id))
|
||||
ENGINE = MEMORY
|
||||
SELECT id FROM vn.ticket
|
||||
|
|
|
@ -17,9 +17,10 @@ sections:
|
|||
title: Utilización de GoLabel
|
||||
description: Para utilizar el programa de impresión de cintas sigue estos pasos
|
||||
steps:
|
||||
- Adjunto a este correo tenemos el 'model.ezp' (la plantilla de cintas de corona estandar), descárgalo y seguramente lo tengas en la carpeta 'Descargas'
|
||||
- Abre el programa GoLabel
|
||||
- Haz clic en el icono de la barra superior con forma de carpeta con una hoja.
|
||||
- Selecciona el archivo llamado 'model.ezp'(que seguramente este en 'Descargas') adjunto en este correo, haz clic en abrir.
|
||||
- Selecciona el archivo llamado 'model.ezp'(que seguramente este en 'Descargas'), haz clic en abrir.
|
||||
- Una vez abierto el archivo, haz doble click sobre el texto, en el cuadro que nos sale pulse donde esta el texto de ejemplo (En este caso "TUS HERMANOS") y nos saldra en ese mismo recuadro a la parte izquierda para editarlo y escribir lo que quiera.
|
||||
- Cuando ya tenga el texto que desee pulse en el boton 'OK'.
|
||||
- Ve a 'Archivo' → 'Guardar Como' y guárdelo en el escritorio en el escritorio con otro nombre.
|
||||
|
|
Loading…
Reference in New Issue