Merge branch 'dev' into 5036-regularizar-historicos
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
commit
3b0e8c2412
28
CHANGELOG.md
28
CHANGELOG.md
|
@ -5,10 +5,10 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [2304.01] - 2023-02-09
|
||||
## [2306.01] - 2023-02-23
|
||||
|
||||
### Added
|
||||
- (Trabajadores -> Nuevo trabajador) Nueva sección
|
||||
-
|
||||
|
||||
### Changed
|
||||
-
|
||||
|
@ -16,6 +16,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
### Fixed
|
||||
-
|
||||
|
||||
## [2304.01] - 2023-02-09
|
||||
|
||||
### Added
|
||||
- (Rutas) Al descargar varias facturas se comprime en un zip
|
||||
- (Trabajadores -> Nuevo trabajador) Nueva sección
|
||||
- (Tickets -> Adelantar tickets) Añadidos campos "líneas" y "litros" al ticket origen
|
||||
- (Tickets -> Adelantar tickets) Nuevo icono muestra cuando las agencias de los tickets origen/destino son distintas
|
||||
|
||||
### Changed
|
||||
- (Entradas -> Compras) Cambiados los campos "Precio Grouping/Packing" por "PVP" y "Precio" por "Coste"
|
||||
- (Artículos -> Últimas entradas) Cambiados los campos "P.P.U." y "P.P.P." por "PVP"
|
||||
- (Rutas -> Sumario/Tickets) Actualizados campos de los tickets
|
||||
- (Proveedores -> Crear/Editar) Permite añadir Proveedores con la misma razón social pero con países distintos
|
||||
- (Tickets -> Adelantar tickets) Cambiados selectores de estado por checks "Pendiente origen/destino"
|
||||
- (Tickets -> Adelantar tickets) Cambiado stock de destino a origen.
|
||||
|
||||
### Fixed
|
||||
- (Artículos -> Etiquetas) Permite intercambiar la relevancia entre dos etiquetas.
|
||||
- (Cliente -> Datos Fiscales) No se permite seleccionar 'Notificar vía e-mail' a los clientes sin e-mail
|
||||
- (Tickets -> Datos básicos) Permite guardar la hora de envío
|
||||
- (Tickets -> Añadir pago) Eliminado "null" en las referencias
|
||||
- (Tickets -> Adelantar tickets) Permite ordenar por importe
|
||||
- (Tickets -> Adelantar tickets) El filtrado por encajado muestra también los tickets sin tipo de encajado
|
||||
|
||||
## [2302.01] - 2023-01-26
|
||||
|
||||
### Added
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE `vn`.`supplier` ADD UNIQUE (name, countryFk);
|
|
@ -0,0 +1,3 @@
|
|||
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
|
||||
VALUES
|
||||
('Tag', 'onSubmit', 'WRITE', 'ALLOW', 'ROLE', 'employee');
|
|
@ -0,0 +1,110 @@
|
|||
DROP PROCEDURE IF EXISTS vn.ticket_canAdvance;
|
||||
|
||||
DELIMITER $$
|
||||
$$
|
||||
CREATE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_canAdvance`(vDateFuture DATE, vDateToAdvance DATE, vWarehouseFk INT)
|
||||
BEGIN
|
||||
/**
|
||||
* Devuelve los tickets y la cantidad de lineas de venta que se pueden adelantar.
|
||||
*
|
||||
* @param vDateFuture Fecha de los tickets que se quieren adelantar.
|
||||
* @param vDateToAdvance Fecha a cuando se quiere adelantar.
|
||||
* @param vWarehouseFk Almacén
|
||||
*/
|
||||
|
||||
DECLARE vDateInventory DATE;
|
||||
|
||||
SELECT inventoried INTO vDateInventory FROM vn.config;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.stock;
|
||||
CREATE TEMPORARY TABLE tmp.stock
|
||||
(itemFk INT PRIMARY KEY,
|
||||
amount INT)
|
||||
ENGINE = MEMORY;
|
||||
|
||||
INSERT INTO tmp.stock(itemFk, amount)
|
||||
SELECT itemFk, SUM(quantity) amount FROM
|
||||
(
|
||||
SELECT itemFk, quantity
|
||||
FROM vn.itemTicketOut
|
||||
WHERE shipped >= vDateInventory
|
||||
AND shipped < vDateFuture
|
||||
AND warehouseFk = vWarehouseFk
|
||||
UNION ALL
|
||||
SELECT itemFk, quantity
|
||||
FROM vn.itemEntryIn
|
||||
WHERE landed >= vDateInventory
|
||||
AND landed < vDateFuture
|
||||
AND isVirtualStock = FALSE
|
||||
AND warehouseInFk = vWarehouseFk
|
||||
UNION ALL
|
||||
SELECT itemFk, quantity
|
||||
FROM vn.itemEntryOut
|
||||
WHERE shipped >= vDateInventory
|
||||
AND shipped < vDateFuture
|
||||
AND warehouseOutFk = vWarehouseFk
|
||||
) t
|
||||
GROUP BY itemFk HAVING amount != 0;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.filter;
|
||||
CREATE TEMPORARY TABLE tmp.filter
|
||||
(INDEX (id))
|
||||
SELECT s.ticketFk futureId,
|
||||
t2.ticketFk id,
|
||||
count(DISTINCT s.id) saleCount,
|
||||
t2.state,
|
||||
t2.isNotValidated,
|
||||
st.name futureState,
|
||||
st.isNotValidated futureIsNotValidated,
|
||||
GROUP_CONCAT(DISTINCT ipt.code ORDER BY ipt.code) futureIpt,
|
||||
t2.ipt,
|
||||
t.workerFk,
|
||||
CAST(SUM(litros) AS DECIMAL(10,0)) futureLiters,
|
||||
CAST(COUNT(*) AS DECIMAL(10,0)) `futureLines`,
|
||||
t2.shipped,
|
||||
t.shipped futureShipped,
|
||||
t2.totalWithVat,
|
||||
t.totalWithVat futureTotalWithVat,
|
||||
t2.agency,
|
||||
am.name futureAgency,
|
||||
t2.lines,
|
||||
t2.liters,
|
||||
SUM((s.quantity <= IFNULL(st.amount,0))) hasStock
|
||||
FROM vn.ticket t
|
||||
JOIN vn.ticketState ts ON ts.ticketFk = t.id
|
||||
JOIN vn.state st ON st.id = ts.stateFk
|
||||
JOIN vn.saleVolume sv ON t.id = sv.ticketFk
|
||||
JOIN (SELECT
|
||||
t2.id ticketFk,
|
||||
t2.addressFk,
|
||||
st.isNotValidated,
|
||||
st.name state,
|
||||
GROUP_CONCAT(DISTINCT ipt.code ORDER BY ipt.code) ipt,
|
||||
t2.shipped,
|
||||
t2.totalWithVat,
|
||||
am.name agency,
|
||||
CAST(SUM(litros) AS DECIMAL(10,0)) liters,
|
||||
CAST(COUNT(*) AS DECIMAL(10,0)) `lines`
|
||||
FROM vn.ticket t2
|
||||
JOIN vn.saleVolume sv ON t2.id = sv.ticketFk
|
||||
JOIN vn.sale s ON s.ticketFk = t2.id
|
||||
JOIN vn.item i ON i.id = s.itemFk
|
||||
JOIN vn.ticketState ts ON ts.ticketFk = t2.id
|
||||
JOIN vn.state st ON st.id = ts.stateFk
|
||||
JOIN vn.agencyMode am ON t2.agencyModeFk = am.id
|
||||
LEFT JOIN vn.itemPackingType ipt ON ipt.code = i.itemPackingTypeFk
|
||||
WHERE t2.shipped BETWEEN vDateToAdvance AND util.dayend(vDateToAdvance)
|
||||
AND t2.warehouseFk = vWarehouseFk
|
||||
GROUP BY t2.id) t2 ON t2.addressFk = t.addressFk
|
||||
JOIN vn.sale s ON s.ticketFk = t.id
|
||||
JOIN vn.item i ON i.id = s.itemFk
|
||||
JOIN vn.agencyMode am ON t.agencyModeFk = am.id
|
||||
LEFT JOIN vn.itemPackingType ipt ON ipt.code = i.itemPackingTypeFk
|
||||
LEFT JOIN tmp.stock st ON st.itemFk = s.itemFk
|
||||
WHERE t.shipped BETWEEN vDateFuture AND util.dayend(vDateFuture)
|
||||
AND t.warehouseFk = vWarehouseFk
|
||||
GROUP BY t.id;
|
||||
|
||||
DROP TEMPORARY TABLE tmp.stock;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -0,0 +1,6 @@
|
|||
UPDATE `vn`.`client`
|
||||
SET isToBeMailed = FALSE
|
||||
WHERE
|
||||
mailAddress is NULL
|
||||
AND email is NULL
|
||||
AND isToBeMailed = TRUE;
|
|
@ -80203,4 +80203,3 @@ USE `vncontrol`;
|
|||
-- Dump completed on 2022-11-21 7:57:28
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -778,8 +778,8 @@ export default {
|
|||
ipt: 'vn-autocomplete[label="Destination IPT"]',
|
||||
tableIpt: 'vn-autocomplete[name="ipt"]',
|
||||
tableFutureIpt: 'vn-autocomplete[name="futureIpt"]',
|
||||
futureState: 'vn-autocomplete[label="Origin Grouped State"]',
|
||||
state: 'vn-autocomplete[label="Destination Grouped State"]',
|
||||
futureState: 'vn-check[label="Pending Origin"]',
|
||||
state: 'vn-check[label="Pending Destination"]',
|
||||
warehouseFk: 'vn-autocomplete[label="Warehouse"]',
|
||||
tableButtonSearch: 'vn-button[vn-tooltip="Search"]',
|
||||
moveButton: 'vn-button[vn-tooltip="Advance tickets"]',
|
||||
|
@ -944,9 +944,9 @@ export default {
|
|||
routeSummary: {
|
||||
header: 'vn-route-summary > vn-card > h5',
|
||||
cost: 'vn-route-summary vn-label-value[label="Cost"]',
|
||||
firstTicketID: 'vn-route-summary vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(2) > span',
|
||||
firstTicketID: 'vn-route-summary vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(10) > span',
|
||||
firstTicketDescriptor: '.vn-popover.shown vn-ticket-descriptor',
|
||||
firstAlias: 'vn-route-summary vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(3) > span',
|
||||
firstAlias: 'vn-route-summary vn-tbody > vn-tr:nth-child(1) > vn-td:nth-child(5) > span',
|
||||
firstClientDescriptor: '.vn-popover.shown vn-client-descriptor',
|
||||
goToRouteSummaryButton: 'vn-route-summary > vn-card > h5 > a',
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ describe('Worker time control path', () => {
|
|||
|
||||
it('should go to the next month, go to current month and go 1 month in the past', async() => {
|
||||
let date = new Date();
|
||||
date.setDate(1);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
let month = date.toLocaleString('default', {month: 'long'});
|
||||
|
||||
|
@ -32,6 +33,7 @@ describe('Worker time control path', () => {
|
|||
expect(result).toContain(month);
|
||||
|
||||
date = new Date();
|
||||
date.setDate(1);
|
||||
month = date.toLocaleString('default', {month: 'long'});
|
||||
|
||||
await page.click(selectors.workerTimeControl.previousMonthButton);
|
||||
|
@ -40,6 +42,7 @@ describe('Worker time control path', () => {
|
|||
expect(result).toContain(month);
|
||||
|
||||
date = new Date();
|
||||
date.setDate(1);
|
||||
date.setMonth(date.getMonth() - 1);
|
||||
const timestamp = Math.round(date.getTime() / 1000);
|
||||
month = date.toLocaleString('default', {month: 'long'});
|
||||
|
|
|
@ -50,7 +50,7 @@ describe('Ticket Advance path', () => {
|
|||
await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
|
||||
await page.autocompleteSearch(selectors.ticketAdvance.ipt, 'Horizontal');
|
||||
await page.waitToClick(selectors.ticketAdvance.submit);
|
||||
await page.waitForNumberOfElements(selectors.ticketAdvance.table, 0);
|
||||
await page.waitForNumberOfElements(selectors.ticketAdvance.table, 1);
|
||||
|
||||
await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
|
||||
await page.clearInput(selectors.ticketAdvance.ipt);
|
||||
|
@ -62,7 +62,7 @@ describe('Ticket Advance path', () => {
|
|||
await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
|
||||
await page.autocompleteSearch(selectors.ticketAdvance.futureIpt, 'Horizontal');
|
||||
await page.waitToClick(selectors.ticketAdvance.submit);
|
||||
await page.waitForNumberOfElements(selectors.ticketAdvance.table, 0);
|
||||
await page.waitForNumberOfElements(selectors.ticketAdvance.table, 1);
|
||||
|
||||
await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
|
||||
await page.clearInput(selectors.ticketAdvance.futureIpt);
|
||||
|
@ -70,26 +70,36 @@ describe('Ticket Advance path', () => {
|
|||
await page.waitForNumberOfElements(selectors.ticketAdvance.table, 1);
|
||||
});
|
||||
|
||||
it('should search with the origin grouped state', async() => {
|
||||
it('should search with the origin pending state', async() => {
|
||||
await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
|
||||
await page.autocompleteSearch(selectors.ticketAdvance.futureState, 'Free');
|
||||
await page.waitToClick(selectors.ticketAdvance.futureState);
|
||||
await page.waitToClick(selectors.ticketAdvance.submit);
|
||||
await page.waitForNumberOfElements(selectors.ticketAdvance.table, 1);
|
||||
|
||||
await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
|
||||
await page.clearInput(selectors.ticketAdvance.futureState);
|
||||
await page.waitToClick(selectors.ticketAdvance.futureState);
|
||||
await page.waitToClick(selectors.ticketAdvance.submit);
|
||||
await page.waitForNumberOfElements(selectors.ticketAdvance.table, 0);
|
||||
|
||||
await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
|
||||
await page.waitToClick(selectors.ticketAdvance.futureState);
|
||||
await page.waitToClick(selectors.ticketAdvance.submit);
|
||||
await page.waitForNumberOfElements(selectors.ticketAdvance.table, 1);
|
||||
});
|
||||
|
||||
it('should search with the destination grouped state', async() => {
|
||||
await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
|
||||
await page.autocompleteSearch(selectors.ticketAdvance.state, 'Free');
|
||||
await page.waitToClick(selectors.ticketAdvance.state);
|
||||
await page.waitToClick(selectors.ticketAdvance.submit);
|
||||
await page.waitForNumberOfElements(selectors.ticketAdvance.table, 0);
|
||||
|
||||
await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
|
||||
await page.clearInput(selectors.ticketAdvance.state);
|
||||
await page.waitToClick(selectors.ticketAdvance.state);
|
||||
await page.waitToClick(selectors.ticketAdvance.submit);
|
||||
await page.waitForNumberOfElements(selectors.ticketAdvance.table, 1);
|
||||
|
||||
await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
|
||||
await page.waitToClick(selectors.ticketAdvance.state);
|
||||
await page.waitToClick(selectors.ticketAdvance.submit);
|
||||
await page.waitForNumberOfElements(selectors.ticketAdvance.table, 1);
|
||||
});
|
||||
|
@ -116,42 +126,7 @@ describe('Ticket Advance path', () => {
|
|||
await page.waitForNumberOfElements(selectors.ticketAdvance.table, 1);
|
||||
});
|
||||
|
||||
it('should search in smart-table with stock', async() => {
|
||||
await page.waitToClick(selectors.ticketAdvance.tableButtonSearch);
|
||||
await page.write(selectors.ticketAdvance.tableStock, '5');
|
||||
await page.waitForNumberOfElements(selectors.ticketAdvance.table, 2);
|
||||
|
||||
await page.waitToClick(selectors.ticketAdvance.tableButtonSearch);
|
||||
await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
|
||||
await page.waitToClick(selectors.ticketAdvance.submit);
|
||||
await page.waitForNumberOfElements(selectors.ticketAdvance.table, 1);
|
||||
});
|
||||
|
||||
it('should search in smart-table with especified Lines', async() => {
|
||||
await page.waitToClick(selectors.ticketAdvance.tableButtonSearch);
|
||||
await page.write(selectors.ticketAdvance.tableLines, '0');
|
||||
await page.keyboard.press('Enter');
|
||||
await page.waitForNumberOfElements(selectors.ticketAdvance.table, 1);
|
||||
|
||||
await page.waitToClick(selectors.ticketAdvance.tableButtonSearch);
|
||||
await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
|
||||
await page.waitToClick(selectors.ticketAdvance.submit);
|
||||
await page.waitForNumberOfElements(selectors.ticketAdvance.table, 1);
|
||||
});
|
||||
|
||||
it('should search in smart-table with especified Liters', async() => {
|
||||
await page.waitToClick(selectors.ticketAdvance.tableButtonSearch);
|
||||
await page.write(selectors.ticketAdvance.tableLiters, '0');
|
||||
await page.keyboard.press('Enter');
|
||||
await page.waitForNumberOfElements(selectors.ticketAdvance.table, 1);
|
||||
|
||||
await page.waitToClick(selectors.ticketAdvance.tableButtonSearch);
|
||||
await page.waitToClick(selectors.ticketAdvance.openAdvancedSearchButton);
|
||||
await page.waitToClick(selectors.ticketAdvance.submit);
|
||||
await page.waitForNumberOfElements(selectors.ticketAdvance.table, 1);
|
||||
});
|
||||
|
||||
it('should check the three last tickets and move to the future', async() => {
|
||||
it('should check the one ticket and move to the present', async() => {
|
||||
await page.waitToClick(selectors.ticketAdvance.multiCheck);
|
||||
await page.waitToClick(selectors.ticketAdvance.moveButton);
|
||||
await page.waitToClick(selectors.ticketAdvance.acceptButton);
|
||||
|
|
|
@ -87,6 +87,7 @@ ngModule.vnComponent('vnButtonMenu', {
|
|||
selectFields: '<?',
|
||||
initialData: '<?',
|
||||
showFilter: '<?',
|
||||
fields: '<?',
|
||||
field: '=?',
|
||||
url: '@?',
|
||||
data: '<?',
|
||||
|
|
|
@ -147,28 +147,17 @@ export default class CrudModel extends ModelProxy {
|
|||
this.moreRows = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves current changes on the server.
|
||||
*
|
||||
* @return {Promise} The save request promise
|
||||
*/
|
||||
save() {
|
||||
if (!this.isChanged)
|
||||
return this.$q.resolve();
|
||||
getChanges() {
|
||||
if (!this.isChanged) return null;
|
||||
|
||||
let deletes = [];
|
||||
let updates = [];
|
||||
let creates = [];
|
||||
let orgDeletes = [];
|
||||
let orgUpdates = [];
|
||||
let orgCreates = [];
|
||||
const deletes = [];
|
||||
const updates = [];
|
||||
const creates = [];
|
||||
|
||||
let pk = this.primaryKey;
|
||||
const pk = this.primaryKey;
|
||||
|
||||
for (let row of this.removed) {
|
||||
for (let row of this.removed)
|
||||
deletes.push(row.$orgRow[pk]);
|
||||
orgDeletes.push(row);
|
||||
}
|
||||
|
||||
for (let row of this.data) {
|
||||
if (row.$isNew) {
|
||||
|
@ -178,7 +167,6 @@ export default class CrudModel extends ModelProxy {
|
|||
data[prop] = row[prop];
|
||||
}
|
||||
creates.push(row);
|
||||
orgCreates.push(row);
|
||||
} else if (row.$oldData) {
|
||||
let data = {};
|
||||
for (let prop in row.$oldData)
|
||||
|
@ -187,28 +175,38 @@ export default class CrudModel extends ModelProxy {
|
|||
data,
|
||||
where: {[pk]: row.$orgRow[pk]}
|
||||
});
|
||||
orgUpdates.push(row);
|
||||
}
|
||||
}
|
||||
|
||||
let changes = {deletes, updates, creates};
|
||||
const changes = {deletes, updates, creates};
|
||||
|
||||
for (let prop in changes) {
|
||||
if (changes[prop].length === 0)
|
||||
changes[prop] = undefined;
|
||||
}
|
||||
|
||||
if (!changes)
|
||||
return this.$q.resolve();
|
||||
return changes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves current changes on the server.
|
||||
*
|
||||
* @return {Promise} The save request promise
|
||||
*/
|
||||
save() {
|
||||
const pk = this.primaryKey;
|
||||
const changes = this.getChanges();
|
||||
if (!changes) return this.$q.resolve();
|
||||
|
||||
const creates = changes.creates || [];
|
||||
let url = this.saveUrl ? this.saveUrl : `${this._url}/crud`;
|
||||
return this.$http.post(url, changes)
|
||||
.then(res => {
|
||||
const created = res.data;
|
||||
|
||||
// Apply new data to created instances
|
||||
for (let i = 0; i < orgCreates.length; i++) {
|
||||
const row = orgCreates[i];
|
||||
for (let i = 0; i < creates.length; i++) {
|
||||
const row = creates[i];
|
||||
row[pk] = created[i][pk];
|
||||
|
||||
for (let prop in row) {
|
||||
|
|
|
@ -42,6 +42,7 @@ vn-log {
|
|||
& > td.after,
|
||||
& > th.after {
|
||||
width: 40%;
|
||||
white-space: pre-line;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
"Changed client paymethod": "I have changed the pay method for client [{{clientName}} ({{clientId}})]({{{url}}})",
|
||||
"Sent units from ticket": "I sent *{{quantity}}* units of [{{concept}} ({{itemId}})]({{{itemUrl}}}) to *\"{{nickname}}\"* coming from ticket id [{{ticketId}}]({{{ticketUrl}}})",
|
||||
"Change quantity": "{{concept}} change of {{oldQuantity}} to {{newQuantity}}",
|
||||
"Claim will be picked": "The product from the claim [({{claimId}})]({{{claimUrl}}}) from the client *{{clientName}}* will be picked",
|
||||
"Claim will be picked": "The product from the claim [({{claimId}})]({{{claimUrl}}}) from the client *{{clientName}}* will be picked",
|
||||
"Claim state has changed to incomplete": "The state of the claim [({{claimId}})]({{{claimUrl}}}) from client *{{clientName}}* has changed to *incomplete*",
|
||||
"Claim state has changed to canceled": "The state of the claim [({{claimId}})]({{{claimUrl}}}) from client *{{clientName}}* has changed to *canceled*",
|
||||
"Customs agent is required for a non UEE member": "Customs agent is required for a non UEE member",
|
||||
|
@ -137,15 +137,18 @@
|
|||
"Password does not meet requirements": "Password does not meet requirements",
|
||||
"You don't have privileges to change the zone": "You don't have privileges to change the zone or for these parameters there are more than one shipping options, talk to agencies",
|
||||
"Not enough privileges to edit a client": "Not enough privileges to edit a client",
|
||||
"Claim pickup order sent": "Claim pickup order sent [{{claimId}}]({{{claimUrl}}}) to client *{{clientName}}*",
|
||||
"Claim pickup order sent": "Claim pickup order sent [{{claimId}}]({{{claimUrl}}}) to client *{{clientName}}*",
|
||||
"You don't have grant privilege": "You don't have grant privilege",
|
||||
"You don't own the role and you can't assign it to another user": "You don't own the role and you can't assign it to another user",
|
||||
"Email verify": "Email verify",
|
||||
"Email verify": "Email verify",
|
||||
"Ticket merged": "Ticket [{{originId}}]({{{originFullPath}}}) ({{{originDated}}}) merged with [{{destinationId}}]({{{destinationFullPath}}}) ({{{destinationDated}}})",
|
||||
"Sale(s) blocked, please contact production": "Sale(s) blocked, please contact production",
|
||||
"App locked": "App locked by user {{userId}}",
|
||||
"The sales of the receiver ticket can't be modified": "The sales of the receiver ticket can't be modified",
|
||||
"Receipt's bank was not found": "Receipt's bank was not found",
|
||||
"This receipt was not compensated": "This receipt was not compensated",
|
||||
"Client's email was not found": "Client's email was not found"
|
||||
"The sales of the receiver ticket can't be modified": "The sales of the receiver ticket can't be modified",
|
||||
"Receipt's bank was not found": "Receipt's bank was not found",
|
||||
"This receipt was not compensated": "This receipt was not compensated",
|
||||
"Client's email was not found": "Client's email was not found",
|
||||
"It is not possible to modify tracked sales": "It is not possible to modify tracked sales",
|
||||
"It is not possible to modify sales that their articles are from Floramondo": "It is not possible to modify sales that their articles are from Floramondo",
|
||||
"It is not possible to modify cloned sales": "It is not possible to modify cloned sales",
|
||||
"Valid priorities: 1,2,3": "Valid priorities: 1,2,3"
|
||||
}
|
||||
|
|
|
@ -84,7 +84,6 @@
|
|||
"The current ticket can't be modified": "El ticket actual no puede ser modificado",
|
||||
"The current claim can't be modified": "La reclamación actual no puede ser modificada",
|
||||
"The sales of this ticket can't be modified": "Las lineas de este ticket no pueden ser modificadas",
|
||||
"Sale(s) blocked, contact production": "Linea(s) bloqueada(s), contacte con produccion",
|
||||
"Please select at least one sale": "Por favor selecciona al menos una linea",
|
||||
"All sales must belong to the same ticket": "Todas las lineas deben pertenecer al mismo ticket",
|
||||
"NO_ZONE_FOR_THIS_PARAMETERS": "Para este día no hay ninguna zona configurada",
|
||||
|
@ -259,5 +258,11 @@
|
|||
"Try again": "Vuelve a intentarlo",
|
||||
"Aplicación bloqueada por el usuario 9": "Aplicación bloqueada por el usuario 9",
|
||||
"Failed to upload file": "Error al subir archivo",
|
||||
"The DOCUWARE PDF document does not exists": "The DOCUWARE PDF document does not exists"
|
||||
"The DOCUWARE PDF document does not exists": "El documento PDF Docuware no existe",
|
||||
"It is not possible to modify tracked sales": "No es posible modificar líneas de pedido que se hayan empezado a preparar",
|
||||
"It is not possible to modify sales that their articles are from Floramondo": "No es posible modificar líneas de pedido cuyos artículos sean de Floramondo",
|
||||
"It is not possible to modify cloned sales": "No es posible modificar líneas de pedido clonadas",
|
||||
"A supplier with the same name already exists. Change the country.": "Un proveedor con el mismo nombre ya existe. Cambie el país.",
|
||||
"There is no assigned email for this client": "No hay correo asignado para este cliente"
|
||||
}
|
||||
|
||||
|
|
|
@ -19,10 +19,26 @@ class Controller extends ModuleCard {
|
|||
}, {
|
||||
relation: 'ticket',
|
||||
scope: {
|
||||
fields: ['zoneFk'],
|
||||
include: {
|
||||
relation: 'zone'
|
||||
}
|
||||
fields: ['zoneFk', 'addressFk'],
|
||||
include: [
|
||||
{
|
||||
relation: 'zone',
|
||||
scope: {
|
||||
fields: ['name']
|
||||
}
|
||||
},
|
||||
{
|
||||
relation: 'address',
|
||||
scope: {
|
||||
fields: ['provinceFk'],
|
||||
include: {
|
||||
relation: 'province',
|
||||
scope: {
|
||||
fields: ['name']
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
||||
}, {
|
||||
relation: 'claimState',
|
||||
|
|
|
@ -55,9 +55,13 @@
|
|||
<span
|
||||
ng-click="zoneDescriptor.show($event, $ctrl.claim.ticket.zoneFk)"
|
||||
class="link">
|
||||
{{$ctrl.claim.ticket.zoneFk}}
|
||||
{{$ctrl.claim.ticket.zone.name}}
|
||||
</span>
|
||||
</vn-label-value>
|
||||
<vn-label-value
|
||||
label="Province"
|
||||
value="{{$ctrl.claim.ticket.address.province.name}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value
|
||||
label="Ticket">
|
||||
<span
|
||||
|
|
|
@ -141,6 +141,16 @@ module.exports = Self => {
|
|||
done();
|
||||
}
|
||||
|
||||
Self.validateAsync('isToBeMailed', isToBeMailed, {
|
||||
message: 'There is no assigned email for this client'
|
||||
});
|
||||
|
||||
function isToBeMailed(err, done) {
|
||||
if (this.isToBeMailed == true && !this.email)
|
||||
err();
|
||||
done();
|
||||
}
|
||||
|
||||
Self.validateAsync('defaultAddressFk', isActive,
|
||||
{message: 'Unable to default a disabled consignee'}
|
||||
);
|
||||
|
|
|
@ -59,13 +59,11 @@ class Controller extends Dialog {
|
|||
|
||||
if (value) {
|
||||
const accountingType = value.accountingType;
|
||||
if (this.originalDescription) {
|
||||
this.receipt.description =
|
||||
`${accountingType && accountingType.receiptDescription}, ${this.originalDescription}`;
|
||||
} else {
|
||||
this.receipt.description =
|
||||
`${accountingType && accountingType.receiptDescription}`;
|
||||
}
|
||||
if (accountingType.receiptDescription != null) {
|
||||
this.receipt.description = accountingType.receiptDescription;
|
||||
if (this.originalDescription) this.receipt.description += `, ${this.originalDescription}`;
|
||||
} else if (this.originalDescription)
|
||||
this.receipt.description = this.originalDescription;
|
||||
this.maxAmount = accountingType && accountingType.maxAmount;
|
||||
|
||||
this.receipt.payed = new Date();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Edit buy(s): Editar compra(s)
|
||||
Buying value: Precio
|
||||
Buying value: Coste
|
||||
Freight value: Porte
|
||||
Commission value: Comisión
|
||||
Package value: Embalaje
|
||||
|
@ -16,4 +16,4 @@ Field to edit: Campo a editar
|
|||
PackageName: Cubo
|
||||
Edit: Editar
|
||||
buy(s): compra(s)
|
||||
Package out: Embalaje envíos
|
||||
Package out: Embalaje envíos
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
</vn-one>
|
||||
<vn-one>
|
||||
<vn-label-value label="Reference">
|
||||
<span
|
||||
<span
|
||||
ng-click="travelDescriptor.show($event, $ctrl.entryData.travel.id)"
|
||||
class="link">
|
||||
{{$ctrl.entryData.travel.ref}}
|
||||
|
@ -114,8 +114,7 @@
|
|||
<th translate center field="grouping">Grouping</th>
|
||||
<th translate center field="buyingValue">Buying value</th>
|
||||
<th translate center field="price3">Import</th>
|
||||
<th translate center expand field="price2">Grouping price</th>
|
||||
<th translate center expand field="price3">Packing price</th>
|
||||
<th translate center expand field="price">PVP</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody ng-repeat="line in buys">
|
||||
|
@ -125,19 +124,18 @@
|
|||
<td center title="{{::line.packageFk | dashIfEmpty}}">{{::line.packageFk | dashIfEmpty}}</td>
|
||||
<td center title="{{::line.weight}}">{{::line.weight}}</td>
|
||||
<td center>
|
||||
<vn-chip class="transparent" translate-attr="line.groupingMode == 2 ? {title: 'Minimun amount'} : {title: 'Packing'}" ng-class="{'message': line.groupingMode == 2}">
|
||||
<vn-chip class="transparent" translate-attr="line.groupingMode == 2 ? {title: 'Minimun amount'} : {title: 'Packing'}" ng-class="{'message': line.groupingMode == 2}">
|
||||
<span>{{::line.packing | dashIfEmpty}}</span>
|
||||
</vn-chip>
|
||||
</td>
|
||||
<td center>
|
||||
<vn-chip class="transparent" translate-attr="line.groupingMode == 1 ? {title: 'Minimun amount'} : {title: 'Grouping'}" ng-class="{'message': line.groupingMode == 1}">
|
||||
<vn-chip class="transparent" translate-attr="line.groupingMode == 1 ? {title: 'Minimun amount'} : {title: 'Grouping'}" ng-class="{'message': line.groupingMode == 1}">
|
||||
<span>{{::line.grouping | dashIfEmpty}}</span>
|
||||
</vn-chip>
|
||||
</vn-td>
|
||||
<td center title="{{::line.buyingValue | currency: 'EUR':2}}">{{::line.buyingValue | currency: 'EUR':2}}</td>
|
||||
<td center title="{{::line.quantity * line.buyingValue | currency: 'EUR':2}}">{{::line.quantity * line.buyingValue | currency: 'EUR':2}}</td>
|
||||
<td center title="{{::line.price2 | currency: 'EUR':2}}">{{::line.price2 | currency: 'EUR':2}}</td>
|
||||
<td center title="{{::line.price3 | currency: 'EUR':2}}">{{::line.price3 | currency: 'EUR':2}}</td>
|
||||
<td center title="Grouping / Packing">{{::line.price2 | currency: 'EUR':2 | dashIfEmpty}} / {{::line.price3 | currency: 'EUR':2 | dashIfEmpty}}</td>
|
||||
</tr>
|
||||
<tr class="dark-row">
|
||||
<td shrink>
|
||||
|
@ -195,7 +193,7 @@
|
|||
vn-id="item-descriptor"
|
||||
warehouse-fk="$ctrl.vnConfig.warehouseFk">
|
||||
</vn-item-descriptor-popover>
|
||||
<vn-travel-descriptor-popover
|
||||
<vn-travel-descriptor-popover
|
||||
vn-id="travelDescriptor">
|
||||
</vn-travel-descriptor-popover>
|
||||
|
||||
|
|
|
@ -0,0 +1,81 @@
|
|||
|
||||
module.exports = function(Self) {
|
||||
Self.remoteMethodCtx('onSubmit', {
|
||||
description: 'Save model changes',
|
||||
accessType: 'WRITE',
|
||||
accepts: [
|
||||
{
|
||||
arg: 'creates',
|
||||
type: ['object'],
|
||||
description: 'The itemTags records to create'
|
||||
}, {
|
||||
arg: 'deletes',
|
||||
type: ['number'],
|
||||
description: 'The itemTags ids to delete'
|
||||
}, {
|
||||
arg: 'updates',
|
||||
type: ['object'],
|
||||
description: 'The itemTags records to update'
|
||||
}, {
|
||||
arg: 'maxPriority',
|
||||
type: 'number',
|
||||
description: 'The maxPriority value'
|
||||
}
|
||||
],
|
||||
returns: {
|
||||
root: true,
|
||||
type: 'object'
|
||||
},
|
||||
http: {
|
||||
verb: 'PATCH',
|
||||
path: '/onSubmit'
|
||||
}
|
||||
});
|
||||
|
||||
Self.onSubmit = async(ctx, options) => {
|
||||
const models = Self.app.models;
|
||||
const args = ctx.args;
|
||||
let tx;
|
||||
const myOptions = {};
|
||||
|
||||
if (typeof options == 'object')
|
||||
Object.assign(myOptions, options);
|
||||
|
||||
if (!myOptions.transaction) {
|
||||
tx = await Self.beginTransaction({});
|
||||
myOptions.transaction = tx;
|
||||
}
|
||||
|
||||
try {
|
||||
if (args.deletes) {
|
||||
for (const itemTagId of args.deletes)
|
||||
await models.ItemTag.destroyById(itemTagId, myOptions);
|
||||
}
|
||||
|
||||
if (args.updates) {
|
||||
for (const row of args.updates) {
|
||||
if (row.data.priority) {
|
||||
const itemTag = await models.ItemTag.findById(row.where.id, null, myOptions);
|
||||
await itemTag.updateAttributes({
|
||||
priority: row.data.priority + args.maxPriority
|
||||
}, myOptions);
|
||||
}
|
||||
}
|
||||
for (const row of args.updates) {
|
||||
const itemTag = await models.ItemTag.findById(row.where.id, null, myOptions);
|
||||
await itemTag.updateAttributes(row.data, myOptions);
|
||||
}
|
||||
}
|
||||
|
||||
if (args.creates) {
|
||||
for (const itemTag of args.creates)
|
||||
await models.ItemTag.create(itemTag, myOptions);
|
||||
}
|
||||
|
||||
if (tx) await tx.commit();
|
||||
} catch (e) {
|
||||
if (tx) await tx.rollback();
|
||||
throw e;
|
||||
}
|
||||
};
|
||||
};
|
|
@ -0,0 +1,96 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
describe('tag onSubmit()', () => {
|
||||
it('should delete a tag', async() => {
|
||||
const tx = await models.Item.beginTransaction({});
|
||||
const options = {transaction: tx};
|
||||
|
||||
try {
|
||||
const deletes = [40];
|
||||
const ctx = {
|
||||
args: {
|
||||
deletes: deletes
|
||||
}
|
||||
};
|
||||
await models.Tag.onSubmit(ctx, options);
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
throw e;
|
||||
}
|
||||
});
|
||||
|
||||
it('should update a tag', async() => {
|
||||
const tx = await models.Item.beginTransaction({});
|
||||
const options = {transaction: tx};
|
||||
|
||||
try {
|
||||
const updates = [{data: {value: 'Container Test'}, where: {id: 36}}];
|
||||
const ctx = {
|
||||
args: {
|
||||
updates: updates
|
||||
}
|
||||
};
|
||||
await models.Tag.onSubmit(ctx, options);
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
throw e;
|
||||
}
|
||||
});
|
||||
|
||||
it('should create a tag', async() => {
|
||||
const tx = await models.Item.beginTransaction({});
|
||||
const options = {transaction: tx};
|
||||
|
||||
try {
|
||||
const creates = [{
|
||||
'itemFk': '6',
|
||||
'priority': 8,
|
||||
'$orgIndex': null,
|
||||
'$oldData': null,
|
||||
'$isNew': true,
|
||||
'tagFk': 3,
|
||||
'value': 'madera'
|
||||
}];
|
||||
const ctx = {
|
||||
args: {
|
||||
creates: creates
|
||||
}
|
||||
};
|
||||
await models.Tag.onSubmit(ctx, options);
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
throw e;
|
||||
}
|
||||
});
|
||||
|
||||
it('should swap priority for two tags', async() => {
|
||||
const tx = await models.Item.beginTransaction({});
|
||||
const options = {transaction: tx};
|
||||
|
||||
try {
|
||||
const updates = [
|
||||
{data: {priority: 2}, where: {id: 36}},
|
||||
{data: {priority: 1}, where: {id: 37}}
|
||||
];
|
||||
const ctx = {
|
||||
args: {
|
||||
updates: updates,
|
||||
maxPriority: 7,
|
||||
|
||||
}
|
||||
};
|
||||
await models.Tag.onSubmit(ctx, options);
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
throw e;
|
||||
}
|
||||
});
|
||||
});
|
|
@ -1,3 +1,4 @@
|
|||
module.exports = Self => {
|
||||
require('../methods/tag/filterValue')(Self);
|
||||
require('../methods/tag/onSubmit')(Self);
|
||||
};
|
||||
|
|
|
@ -9,15 +9,15 @@
|
|||
</vn-crud-model>
|
||||
|
||||
<vn-card class="vn-w-md vn-pa-md">
|
||||
<vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-date-picker class="vn-pa-xs"
|
||||
vn-one
|
||||
label="Since"
|
||||
vn-one
|
||||
label="Since"
|
||||
ng-model="$ctrl.dateFrom">
|
||||
</vn-date-picker>
|
||||
<vn-date-picker class="vn-pa-xs"
|
||||
vn-one
|
||||
label="To"
|
||||
vn-one
|
||||
label="To"
|
||||
ng-model="$ctrl.dateTo">
|
||||
</vn-date-picker>
|
||||
</vn-horizontal>
|
||||
|
@ -35,8 +35,7 @@
|
|||
<vn-th field="warehouseFk">Warehouse</vn-th>
|
||||
<vn-th field="landed">Landed</vn-th>
|
||||
<vn-th number>Entry</vn-th>
|
||||
<vn-th number vn-tooltip="Price Per Unit">P.P.U</vn-th>
|
||||
<vn-th number vn-tooltip="Price Per Package">P.P.P</vn-th>
|
||||
<vn-th vn-tooltip="Grouping / Packing">PVP</vn-th>
|
||||
<vn-th number class="expendable">Label</vn-th>
|
||||
<vn-th number>Packing</vn-th>
|
||||
<vn-th number>Grouping</vn-th>
|
||||
|
@ -51,7 +50,7 @@
|
|||
<vn-tbody>
|
||||
<vn-tr ng-repeat="entry in entries">
|
||||
<vn-td center>
|
||||
<vn-check
|
||||
<vn-check
|
||||
ng-model="entry.isIgnored"
|
||||
disabled="true">
|
||||
</vn-check>
|
||||
|
@ -65,30 +64,31 @@
|
|||
{{::entry.entryFk | dashIfEmpty}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td number>{{::entry.price2 | dashIfEmpty}}</vn-td>
|
||||
<vn-td number>{{::entry.price3 | dashIfEmpty}}</vn-td>
|
||||
<vn-td title="{{::entry.price2 | currency: 'EUR':2 | dashIfEmpty}} / {{::entry.price3 | currency: 'EUR':2 | dashIfEmpty}}">
|
||||
{{::entry.price2 | currency: 'EUR':2 | dashIfEmpty}} / {{::entry.price3 | currency: 'EUR':2 | dashIfEmpty}}
|
||||
</vn-td>
|
||||
<vn-td number class="expendable">{{entry.stickers | dashIfEmpty}}</vn-td>
|
||||
<vn-td number>
|
||||
<vn-chip translate-attr="{title: 'Packing'}" ng-class="{'message': entry.groupingMode == 2}">
|
||||
<vn-chip translate-attr="{title: 'Packing'}" ng-class="{'message': entry.groupingMode == 2}">
|
||||
<span>{{::entry.packing | dashIfEmpty}}</span>
|
||||
</vn-chip>
|
||||
</vn-td>
|
||||
<vn-td number>
|
||||
<vn-chip translate-attr="{title: 'Grouping'}" ng-class="{'message': entry.groupingMode == 1}">
|
||||
<vn-chip translate-attr="{title: 'Grouping'}" ng-class="{'message': entry.groupingMode == 1}">
|
||||
<span>{{::entry.grouping | dashIfEmpty}}</span>
|
||||
</vn-chip>
|
||||
</vn-td>
|
||||
<vn-td number class="expendable">{{::entry.stems | dashIfEmpty}}</vn-td>
|
||||
<vn-td number>{{::entry.quantity}}</vn-td>
|
||||
<vn-td number
|
||||
<vn-td number
|
||||
class="expendable">
|
||||
<span
|
||||
vn-tooltip="
|
||||
{{::$ctrl.$t('Cost')}}: {{::entry.buyingValue| dashIfEmpty}}<br>
|
||||
{{::$ctrl.$t('Package')}}: {{::entry.packageValue| dashIfEmpty}}<br>
|
||||
{{::$ctrl.$t('Freight')}}: {{::entry.freightValue| dashIfEmpty}}<br>
|
||||
{{::$ctrl.$t('Comission')}}: {{::entry.comissionValue| dashIfEmpty}}">
|
||||
{{::entry.cost | dashIfEmpty}}
|
||||
{{::$ctrl.$t('Cost')}}: {{::entry.buyingValue | currency: 'EUR':2 | dashIfEmpty}}<br>
|
||||
{{::$ctrl.$t('Package')}}: {{::entry.packageValue | currency: 'EUR':2 | dashIfEmpty}}<br>
|
||||
{{::$ctrl.$t('Freight')}}: {{::entry.freightValue | currency: 'EUR':2 | dashIfEmpty}}<br>
|
||||
{{::$ctrl.$t('Comission')}}: {{::entry.comissionValue | currency: 'EUR':2 | dashIfEmpty}}">
|
||||
{{::entry.cost | currency: 'EUR':2 | dashIfEmpty}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td number>{{::entry.weight | dashIfEmpty}}</vn-td>
|
||||
|
@ -113,24 +113,24 @@
|
|||
ng-click="contextmenu.filterBySelection()">
|
||||
Filter by selection
|
||||
</vn-item>
|
||||
<vn-item translate
|
||||
ng-if="contextmenu.isFilterAllowed()"
|
||||
<vn-item translate
|
||||
ng-if="contextmenu.isFilterAllowed()"
|
||||
ng-click="contextmenu.excludeSelection()">
|
||||
Exclude selection
|
||||
</vn-item>
|
||||
<vn-item translate
|
||||
ng-if="contextmenu.isFilterAllowed()"
|
||||
<vn-item translate
|
||||
ng-if="contextmenu.isFilterAllowed()"
|
||||
ng-click="contextmenu.removeFilter()">
|
||||
Remove filter
|
||||
</vn-item>
|
||||
<vn-item translate
|
||||
<vn-item translate
|
||||
ng-click="contextmenu.removeAllFilters()">
|
||||
Remove all filters
|
||||
</vn-item>
|
||||
<vn-item translate
|
||||
ng-if="contextmenu.isActionAllowed()"
|
||||
<vn-item translate
|
||||
ng-if="contextmenu.isActionAllowed()"
|
||||
ng-click="contextmenu.copyValue()">
|
||||
Copy value
|
||||
</vn-item>
|
||||
</slot-menu>
|
||||
</vn-contextmenu>
|
||||
</vn-contextmenu>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
data="tags"
|
||||
auto-load="true">
|
||||
</vn-crud-model>
|
||||
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
|
||||
<form name="form" class="vn-w-md">
|
||||
<vn-card class="vn-pa-lg">
|
||||
<vn-horizontal ng-repeat="itemTag in $ctrl.itemTags">
|
||||
<vn-autocomplete vn-two vn-id="tag" vn-focus
|
||||
|
@ -74,8 +74,9 @@
|
|||
</vn-card>
|
||||
<vn-button-bar>
|
||||
<vn-submit
|
||||
ng-click="$ctrl.onSubmit()"
|
||||
disabled="!watcher.dataChanged()"
|
||||
label="Save">
|
||||
</vn-submit>
|
||||
</vn-button-bar>
|
||||
</form>
|
||||
</form>
|
||||
|
|
|
@ -29,11 +29,17 @@ class Controller extends Section {
|
|||
}
|
||||
|
||||
onSubmit() {
|
||||
this.$.watcher.check();
|
||||
this.$.model.save().then(() => {
|
||||
const changes = this.$.model.getChanges();
|
||||
const data = {
|
||||
creates: changes.creates,
|
||||
deletes: changes.deletes,
|
||||
updates: changes.updates,
|
||||
maxPriority: this.getHighestPriority()
|
||||
};
|
||||
this.$http.patch(`Tags/onSubmit`, data).then(() => {
|
||||
this.$.model.refresh();
|
||||
this.$.watcher.notifySaved();
|
||||
this.$.watcher.updateOriginalData();
|
||||
this.card.reload();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
const JSZip = require('jszip');
|
||||
|
||||
module.exports = Self => {
|
||||
Self.remoteMethodCtx('downloadZip', {
|
||||
description: 'Download a zip file with multiple routes pdfs',
|
||||
accessType: 'READ',
|
||||
accepts: [
|
||||
{
|
||||
arg: 'id',
|
||||
type: 'string',
|
||||
description: 'The routes ids',
|
||||
}
|
||||
],
|
||||
returns: [
|
||||
{
|
||||
arg: 'body',
|
||||
type: 'file',
|
||||
root: true
|
||||
}, {
|
||||
arg: 'Content-Type',
|
||||
type: 'string',
|
||||
http: {target: 'header'}
|
||||
}, {
|
||||
arg: 'Content-Disposition',
|
||||
type: 'string',
|
||||
http: {target: 'header'}
|
||||
}
|
||||
],
|
||||
http: {
|
||||
path: '/downloadZip',
|
||||
verb: 'GET'
|
||||
}
|
||||
});
|
||||
|
||||
Self.downloadZip = async function(ctx, id, options) {
|
||||
const models = Self.app.models;
|
||||
const myOptions = {};
|
||||
const zip = new JSZip();
|
||||
|
||||
if (typeof options == 'object')
|
||||
Object.assign(myOptions, options);
|
||||
|
||||
const ids = id.split(',');
|
||||
for (let id of ids) {
|
||||
ctx.args.id = id;
|
||||
const routePdf = await models.Route.driverRoutePdf(ctx, id);
|
||||
const fileName = extractFileName(routePdf[2]);
|
||||
const body = routePdf[0];
|
||||
|
||||
zip.file(fileName, body);
|
||||
}
|
||||
|
||||
const stream = zip.generateNodeStream({streamFiles: true});
|
||||
|
||||
return [stream, 'application/zip', `filename="download.zip"`];
|
||||
};
|
||||
|
||||
function extractFileName(str) {
|
||||
const matches = str.match(/"(.*?)"/);
|
||||
return matches ? matches[1] : str;
|
||||
}
|
||||
};
|
|
@ -50,14 +50,17 @@ module.exports = Self => {
|
|||
am.name AS agencyModeName,
|
||||
u.nickname AS userNickname,
|
||||
vn.ticketTotalVolume(t.id) AS volume,
|
||||
tob.description
|
||||
tob.description,
|
||||
GROUP_CONCAT(DISTINCT i.itemPackingTypeFk ORDER BY i.itemPackingTypeFk) ipt
|
||||
FROM vn.route r
|
||||
JOIN ticket t ON t.routeFk = r.id
|
||||
JOIN vn.sale s ON s.ticketFk = t.id
|
||||
JOIN vn.item i ON i.id = s.itemFk
|
||||
LEFT JOIN ticketState ts ON ts.ticketFk = t.id
|
||||
LEFT JOIN state st ON st.id = ts.stateFk
|
||||
LEFT JOIN warehouse wh ON wh.id = t.warehouseFk
|
||||
LEFT JOIN observationType ot ON ot.code = 'delivery'
|
||||
LEFT JOIN ticketObservation tob ON tob.ticketFk = t.id
|
||||
LEFT JOIN ticketObservation tob ON tob.ticketFk = t.id
|
||||
AND tob.observationTypeFk = ot.id
|
||||
LEFT JOIN address a ON a.id = t.addressFk
|
||||
LEFT JOIN agencyMode am ON am.id = t.agencyModeFk
|
||||
|
@ -70,7 +73,9 @@ module.exports = Self => {
|
|||
const where = filter.where;
|
||||
where['r.id'] = filter.id;
|
||||
|
||||
stmt.merge(conn.makeSuffix(filter));
|
||||
stmt.merge(conn.makeWhere(filter.where));
|
||||
stmt.merge(conn.makeGroupBy('t.id'));
|
||||
stmt.merge(conn.makeOrderBy(filter.order));
|
||||
|
||||
const tickets = await conn.executeStmt(stmt, myOptions);
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ module.exports = Self => {
|
|||
require('../methods/route/driverRoutePdf')(Self);
|
||||
require('../methods/route/driverRouteEmail')(Self);
|
||||
require('../methods/route/sendSms')(Self);
|
||||
require('../methods/route/downloadZip')(Self);
|
||||
|
||||
Self.validate('kmStart', validateDistance, {
|
||||
message: 'Distance must be lesser than 1000'
|
||||
|
|
|
@ -34,12 +34,22 @@ export default class Controller extends Section {
|
|||
}
|
||||
|
||||
showRouteReport() {
|
||||
const routes = [];
|
||||
const routesIds = [];
|
||||
for (let route of this.checked)
|
||||
routes.push(route.id);
|
||||
const routesId = routes.join(',');
|
||||
routesIds.push(route.id);
|
||||
const stringRoutesIds = routesIds.join(',');
|
||||
|
||||
this.vnReport.show(`Routes/${routesId}/driver-route-pdf`);
|
||||
if (this.checked.length <= 1) {
|
||||
const url = `api/Routes/${stringRoutesIds}/driver-route-pdf?access_token=${this.vnToken.token}`;
|
||||
window.open(url, '_blank');
|
||||
} else {
|
||||
const serializedParams = this.$httpParamSerializer({
|
||||
access_token: this.vnToken.token,
|
||||
id: stringRoutesIds
|
||||
});
|
||||
const url = `api/Routes/downloadZip?${serializedParams}`;
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
}
|
||||
|
||||
openClonationDialog() {
|
||||
|
|
|
@ -44,17 +44,15 @@ describe('Component vnRouteIndex', () => {
|
|||
|
||||
describe('showRouteReport()', () => {
|
||||
it('should call to the vnReport show method', () => {
|
||||
controller.vnReport.show = jest.fn();
|
||||
jest.spyOn(window, 'open').mockReturnThis();
|
||||
|
||||
const data = controller.$.model.data;
|
||||
data[0].checked = true;
|
||||
data[2].checked = true;
|
||||
|
||||
const routeIds = '1,3';
|
||||
|
||||
controller.showRouteReport();
|
||||
|
||||
expect(controller.vnReport.show).toHaveBeenCalledWith(`Routes/${routeIds}/driver-route-pdf`);
|
||||
expect(window.open).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -10,26 +10,26 @@
|
|||
</h5>
|
||||
<vn-horizontal>
|
||||
<vn-one>
|
||||
<vn-label-value label="Id"
|
||||
<vn-label-value label="Id"
|
||||
value="{{$ctrl.summary.route.id}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Date"
|
||||
<vn-label-value label="Date"
|
||||
value="{{$ctrl.summary.route.created | date: 'dd/MM/yyyy'}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Agency"
|
||||
<vn-label-value label="Agency"
|
||||
value="{{$ctrl.summary.route.agencyMode.name}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Vehicle"
|
||||
<vn-label-value label="Vehicle"
|
||||
value="{{$ctrl.summary.route.vehicle.numberPlate}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Driver">
|
||||
<span
|
||||
<span
|
||||
ng-click="workerDescriptor.show($event, $ctrl.summary.route.workerFk)"
|
||||
class="link">
|
||||
{{$ctrl.summary.route.worker.user.name}}
|
||||
</span>
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Cost"
|
||||
<vn-label-value label="Cost"
|
||||
value="{{$ctrl.summary.route.cost | currency: 'EUR':2}}">
|
||||
</vn-label-value>
|
||||
</vn-one>
|
||||
|
@ -40,35 +40,35 @@
|
|||
<vn-label-value label="Finishing time"
|
||||
value="{{$ctrl.summary.route.finished | date: 'HH:MM'}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Km Start"
|
||||
<vn-label-value label="Km Start"
|
||||
value="{{$ctrl.summary.route.kmStart}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Km End"
|
||||
<vn-label-value label="Km End"
|
||||
value="{{$ctrl.summary.route.kmEnd}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Volume"
|
||||
<vn-label-value label="Volume"
|
||||
value="{{$ctrl.summary.route.m3 | dashIfEmpty}} / {{$ctrl.summary.route.vehicle.m3 | dashIfEmpty}} m³">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Packages"
|
||||
<vn-label-value label="Packages"
|
||||
value="{{$ctrl.packagesTotal}}">
|
||||
</vn-label-value>
|
||||
</vn-one>
|
||||
<vn-one>
|
||||
<vn-textarea
|
||||
disabled="true"
|
||||
label="Description"
|
||||
label="Description"
|
||||
ng-model="$ctrl.summary.route.description">
|
||||
</vn-textarea>
|
||||
</vn-one>
|
||||
<vn-auto>
|
||||
<h4 ng-show="$ctrl.isDelivery">
|
||||
<a
|
||||
<a
|
||||
ui-sref="route.card.tickets({id:$ctrl.route.id})"
|
||||
target="_self">
|
||||
<span translate vn-tooltip="Go to">Ticket</span>
|
||||
</a>
|
||||
</h4>
|
||||
<h4
|
||||
<h4
|
||||
translate
|
||||
ng-show="!$ctrl.isDelivery">
|
||||
Ticket
|
||||
|
@ -77,45 +77,49 @@
|
|||
<vn-thead>
|
||||
<vn-tr>
|
||||
<vn-th shrink>Order</vn-th>
|
||||
<vn-th number>Ticket id</vn-th>
|
||||
<vn-th>Alias</vn-th>
|
||||
<vn-th>Street</vn-th>
|
||||
<vn-th>City</vn-th>
|
||||
<vn-th shrink>PC</vn-th>
|
||||
<vn-th>Client</vn-th>
|
||||
<vn-th>Warehouse</vn-th>
|
||||
<vn-th number shrink>Packages</vn-th>
|
||||
<vn-th shrink>m³</vn-th>
|
||||
<vn-th>Warehouse</vn-th>
|
||||
<vn-th shrink>PC</vn-th>
|
||||
<vn-th>Street</vn-th>
|
||||
<vn-th shrink>Packaging</vn-th>
|
||||
<vn-th number>Ticket</vn-th>
|
||||
<vn-th shrink></vn-th>
|
||||
</vn-tr>
|
||||
</vn-thead>
|
||||
<vn-tbody>
|
||||
<vn-tr ng-repeat="ticket in $ctrl.summary.tickets">
|
||||
<vn-td shrink>{{ticket.priority | dashIfEmpty}}</vn-td>
|
||||
<vn-td expand title="{{ticket.address.street}}">{{ticket.street}}</vn-td>
|
||||
<vn-td expand>{{ticket.city}}</vn-td>
|
||||
<vn-td shrink>{{ticket.postalCode}}</vn-td>
|
||||
<vn-td>
|
||||
<span
|
||||
ng-click="clientDescriptor.show($event, ticket.clientFk)"
|
||||
class="link">
|
||||
{{ticket.nickname}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td>{{ticket.warehouseName}}</vn-td>
|
||||
<vn-td number shrink>{{ticket.packages}}</vn-td>
|
||||
<vn-td shrink>{{ticket.volume}}</vn-td>
|
||||
<vn-td shrink>{{ticket.ipt}}</vn-td>
|
||||
<vn-td number>
|
||||
<span
|
||||
<span
|
||||
ng-click="ticketDescriptor.show($event, ticket.id)"
|
||||
class="link">
|
||||
{{ticket.id}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td>
|
||||
<span
|
||||
ng-click="clientDescriptor.show($event, ticket.clientFk)"
|
||||
class="link">
|
||||
{{ticket.nickname}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td number shrink>{{ticket.packages}}</vn-td>
|
||||
<vn-td shrink>{{ticket.volume}}</vn-td>
|
||||
<vn-td>{{ticket.warehouseName}}</vn-td>
|
||||
<vn-td shrink>{{ticket.postalCode}}</vn-td>
|
||||
<vn-td expand title="{{ticket.address.street}}">{{ticket.street}}</vn-td>
|
||||
<vn-td shrink>
|
||||
<vn-icon
|
||||
ng-if="ticket.notes.length"
|
||||
vn-tooltip="{{ticket.notes[0].description}}"
|
||||
icon="insert_drive_file"
|
||||
class="bright">
|
||||
</vn-icon>
|
||||
<vn-icon-button
|
||||
ng-if="::ticket.description"
|
||||
vn-tooltip="{{::ticket.description}}"
|
||||
icon="icon-notes"
|
||||
tabindex="-1">
|
||||
</vn-icon-button>
|
||||
</vn-td>
|
||||
</vn-tr>
|
||||
</vn-tbody>
|
||||
|
@ -123,12 +127,12 @@
|
|||
</vn-auto>
|
||||
</vn-horizontal>
|
||||
</vn-card>
|
||||
<vn-ticket-descriptor-popover
|
||||
<vn-ticket-descriptor-popover
|
||||
vn-id="ticketDescriptor">
|
||||
</vn-ticket-descriptor-popover>
|
||||
<vn-client-descriptor-popover
|
||||
vn-id="clientDescriptor">
|
||||
</vn-client-descriptor-popover>
|
||||
<vn-worker-descriptor-popover
|
||||
<vn-worker-descriptor-popover
|
||||
vn-id="workerDescriptor">
|
||||
</vn-worker-descriptor-popover>
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
data="$ctrl.tickets"
|
||||
auto-load="true">
|
||||
</vn-crud-model>
|
||||
<vn-data-viewer
|
||||
<vn-data-viewer
|
||||
model="model">
|
||||
<form
|
||||
<form
|
||||
class="vn-w-xl"
|
||||
name="form">
|
||||
<vn-card>
|
||||
|
@ -25,18 +25,18 @@
|
|||
vn-tooltip="Open buscaman"
|
||||
icon="icon-buscaman">
|
||||
</vn-button>
|
||||
<vn-button
|
||||
<vn-button
|
||||
disabled="!$ctrl.isChecked"
|
||||
ng-click="$ctrl.deletePriority()"
|
||||
vn-tooltip="Delete priority"
|
||||
icon="filter_alt">
|
||||
</vn-button>
|
||||
<vn-button
|
||||
<vn-button
|
||||
ng-click="$ctrl.setOrderedPriority($ctrl.tickets)"
|
||||
vn-tooltip="Renumber all tickets in the order you see on the screen"
|
||||
icon="format_list_numbered">
|
||||
</vn-button>
|
||||
<vn-button
|
||||
<vn-button
|
||||
vn-acl="deliveryBoss"
|
||||
vn-acl-action="remove"
|
||||
disabled="!$ctrl.isChecked"
|
||||
|
@ -59,8 +59,10 @@
|
|||
<vn-th field="city">City</vn-th>
|
||||
<vn-th field="postalCode" translate-attr="{title: 'Postcode'}" shrink>PC</vn-th>
|
||||
<vn-th field="clientFk" expand>Client</vn-th>
|
||||
<vn-th field="warehouse" expand>Warehouse</vn-th>
|
||||
<vn-th field="packages" shrink>Packages</vn-th>
|
||||
<vn-th field="volume" shrink>m³</vn-th>
|
||||
<vn-th field="packaging" shrink>Packaging</vn-th>
|
||||
<vn-th field="id" number>Ticket</vn-th>
|
||||
<vn-th shrink></vn-th>
|
||||
<vn-th shrink></vn-th>
|
||||
|
@ -100,8 +102,10 @@
|
|||
{{::ticket.nickname}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td>{{ticket.warehouseName}}</vn-td>
|
||||
<vn-td shrink>{{::ticket.packages}}</vn-td>
|
||||
<vn-td shrink>{{::ticket.volume | number:2}}</vn-td>
|
||||
<vn-td shrink>{{::ticket.ipt}}</vn-td>
|
||||
<vn-td number>
|
||||
<span
|
||||
ng-click="ticketDescriptor.show($event, ticket.id)"
|
||||
|
@ -140,13 +144,13 @@
|
|||
</vn-card>
|
||||
</form>
|
||||
</vn-data-viewer>
|
||||
<vn-ticket-descriptor-popover
|
||||
<vn-ticket-descriptor-popover
|
||||
vn-id="ticketDescriptor">
|
||||
</vn-ticket-descriptor-popover>
|
||||
<vn-client-descriptor-popover
|
||||
vn-id="clientDescriptor">
|
||||
</vn-client-descriptor-popover>
|
||||
<vn-confirm
|
||||
<vn-confirm
|
||||
vn-id="confirm"
|
||||
question="Delete ticket from route?"
|
||||
on-accept="$ctrl.removeTicketFromRoute($index)">
|
||||
|
@ -160,7 +164,7 @@
|
|||
<div fixed-bottom-right>
|
||||
<vn-vertical style="align-items: center;">
|
||||
<a vn-bind="+">
|
||||
<vn-button
|
||||
<vn-button
|
||||
class="round md vn-mb-sm"
|
||||
ng-click="$ctrl.$.ticketPopup.show()"
|
||||
icon="add"
|
||||
|
@ -172,14 +176,14 @@
|
|||
</a>
|
||||
</vn-vertical>
|
||||
</div>
|
||||
<vn-ticket-descriptor-popover
|
||||
<vn-ticket-descriptor-popover
|
||||
vn-id="ticket-descriptor">
|
||||
</vn-ticket-descriptor-popover>
|
||||
<vn-client-descriptor-popover
|
||||
<vn-client-descriptor-popover
|
||||
vn-id="client-descriptor">
|
||||
</vn-client-descriptor-popover>
|
||||
<!-- SMS Dialog -->
|
||||
<vn-route-sms
|
||||
vn-id="sms"
|
||||
sms="$ctrl.newSMS">
|
||||
</vn-route-sms>
|
||||
</vn-route-sms>
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"module": "shelving",
|
||||
"name": "Shelvings",
|
||||
"icon" : "contact_support",
|
||||
"icon" : "icon-inventory",
|
||||
"dependencies": ["worker"],
|
||||
"validations" : true,
|
||||
"menus": {
|
||||
"main": [
|
||||
{"state": "shelving.index", "icon": "contact_support"}
|
||||
{"state": "shelving.index", "icon": "icon-inventory"}
|
||||
],
|
||||
"card": [
|
||||
{"state": "shelving.card.basicData", "icon": "settings"},
|
||||
|
@ -20,7 +20,7 @@
|
|||
"abstract": true,
|
||||
"component": "vn-shelving",
|
||||
"description": "Shelvings"
|
||||
},
|
||||
},
|
||||
{
|
||||
"url": "/index?q",
|
||||
"state": "shelving.index",
|
||||
|
@ -32,13 +32,13 @@
|
|||
"state": "shelving.create",
|
||||
"component": "vn-shelving-create",
|
||||
"description": "New shelving"
|
||||
},
|
||||
},
|
||||
{
|
||||
"url": "/:id",
|
||||
"state": "shelving.card",
|
||||
"abstract": true,
|
||||
"component": "vn-shelving-card"
|
||||
},
|
||||
},
|
||||
{
|
||||
"url": "/summary",
|
||||
"state": "shelving.card.summary",
|
||||
|
@ -47,7 +47,7 @@
|
|||
"params": {
|
||||
"shelving": "$ctrl.shelving"
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
"url": "/basic-data",
|
||||
"state": "shelving.card.basicData",
|
||||
|
@ -56,7 +56,7 @@
|
|||
"params": {
|
||||
"shelving": "$ctrl.shelving"
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
"url" : "/log",
|
||||
"state": "shelving.card.log",
|
||||
|
@ -64,4 +64,4 @@
|
|||
"description": "Log"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,10 +16,6 @@ module.exports = Self => {
|
|||
message: 'The social name cannot be empty'
|
||||
});
|
||||
|
||||
Self.validatesUniquenessOf('name', {
|
||||
message: 'The supplier name must be unique'
|
||||
});
|
||||
|
||||
if (this.city) {
|
||||
Self.validatesPresenceOf('city', {
|
||||
message: 'City cannot be empty'
|
||||
|
@ -117,6 +113,27 @@ module.exports = Self => {
|
|||
throw new UserError('You can not modify is pay method checked');
|
||||
});
|
||||
|
||||
Self.validateAsync('name', 'countryFk', hasSupplierSameName, {
|
||||
message: 'A supplier with the same name already exists. Change the country.'
|
||||
});
|
||||
|
||||
async function hasSupplierSameName(err, done) {
|
||||
if (!this.name || !this.countryFk) done();
|
||||
const supplier = await Self.app.models.Supplier.findOne(
|
||||
{
|
||||
where: {
|
||||
name: this.name,
|
||||
countryFk: this.countryFk
|
||||
},
|
||||
fields: ['id']
|
||||
});
|
||||
|
||||
if (supplier && supplier.id != this.id)
|
||||
err();
|
||||
|
||||
done();
|
||||
}
|
||||
|
||||
Self.observe('before save', async function(ctx) {
|
||||
const changes = ctx.data || ctx.instance;
|
||||
const orgData = ctx.currentInstance;
|
||||
|
|
|
@ -24,36 +24,42 @@
|
|||
</vn-textfield>
|
||||
<vn-input-number
|
||||
type="number"
|
||||
step="0.01"
|
||||
label="Minimum M3"
|
||||
ng-model="supplierAgencyTerm.minimumM3"
|
||||
rule>
|
||||
</vn-input-number>
|
||||
<vn-input-number
|
||||
type="number"
|
||||
step="0.01"
|
||||
label="Package Price"
|
||||
ng-model="supplierAgencyTerm.packagePrice"
|
||||
rule>
|
||||
</vn-input-number>
|
||||
<vn-input-number
|
||||
type="number"
|
||||
step="0.01"
|
||||
label="Km Price"
|
||||
ng-model="supplierAgencyTerm.kmPrice"
|
||||
rule>
|
||||
</vn-input-number>
|
||||
<vn-input-number
|
||||
type="number"
|
||||
step="0.01"
|
||||
label="M3 Price"
|
||||
ng-model="supplierAgencyTerm.m3Price"
|
||||
rule>
|
||||
</vn-input-number>
|
||||
<vn-input-number
|
||||
type="number"
|
||||
step="0.01"
|
||||
label="Route Price"
|
||||
ng-model="supplierAgencyTerm.routePrice"
|
||||
rule>
|
||||
</vn-input-number>
|
||||
<vn-input-number
|
||||
type="number"
|
||||
step="0.01"
|
||||
label="Minimum Km"
|
||||
ng-model="supplierAgencyTerm.minimumKm"
|
||||
rule>
|
||||
|
|
|
@ -56,6 +56,13 @@ module.exports = Self => {
|
|||
const shouldEditCloned = canEditCloned || !hasSaleCloned;
|
||||
const shouldEditFloramondo = canEditFloramondo || !hasSaleFloramondo;
|
||||
|
||||
return shouldEditTracked && shouldEditCloned && shouldEditFloramondo;
|
||||
if (!shouldEditTracked)
|
||||
throw new UserError('It is not possible to modify tracked sales');
|
||||
if (!shouldEditCloned)
|
||||
throw new UserError('It is not possible to modify cloned sales');
|
||||
if (!shouldEditFloramondo)
|
||||
throw new UserError('It is not possible to modify sales that their articles are from Floramondo');
|
||||
|
||||
return true;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -43,9 +43,7 @@ module.exports = Self => {
|
|||
try {
|
||||
const saleIds = sales.map(sale => sale.id);
|
||||
|
||||
const canEditSales = await models.Sale.canEdit(ctx, saleIds, myOptions);
|
||||
if (!canEditSales)
|
||||
throw new UserError(`Sale(s) blocked, please contact production`);
|
||||
await models.Sale.canEdit(ctx, saleIds, myOptions);
|
||||
|
||||
const ticket = await models.Ticket.findById(ticketId, {
|
||||
include: {
|
||||
|
|
|
@ -37,9 +37,7 @@ module.exports = Self => {
|
|||
try {
|
||||
const salesIds = sales.map(sale => sale.id);
|
||||
|
||||
const canEditSale = await models.Sale.canEdit(ctx, salesIds, myOptions);
|
||||
if (!canEditSale)
|
||||
throw new UserError(`Sale(s) blocked, please contact production`);
|
||||
await models.Sale.canEdit(ctx, salesIds, myOptions);
|
||||
|
||||
const query = `
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.recalculateSales;
|
||||
|
|
|
@ -51,9 +51,7 @@ module.exports = Self => {
|
|||
try {
|
||||
const salesIds = sales.map(sale => sale.id);
|
||||
|
||||
const canEditSale = await models.Sale.canEdit(ctx, salesIds, myOptions);
|
||||
if (!canEditSale)
|
||||
throw new UserError(`Sale(s) blocked, please contact production`);
|
||||
await models.Sale.canEdit(ctx, salesIds, myOptions);
|
||||
|
||||
let changesMade = '';
|
||||
const promises = [];
|
||||
|
|
|
@ -50,7 +50,7 @@ describe('sale canEdit()', () => {
|
|||
|
||||
it('should return false if any of the sales has a saleTracking record', async() => {
|
||||
const tx = await models.Sale.beginTransaction({});
|
||||
|
||||
let error;
|
||||
try {
|
||||
const options = {transaction: tx};
|
||||
|
||||
|
@ -59,15 +59,15 @@ describe('sale canEdit()', () => {
|
|||
|
||||
const sales = [31];
|
||||
|
||||
const result = await models.Sale.canEdit(ctx, sales, options);
|
||||
|
||||
expect(result).toEqual(false);
|
||||
|
||||
await models.Sale.canEdit(ctx, sales, options);
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
throw e;
|
||||
error = e;
|
||||
}
|
||||
|
||||
expect(error).toEqual(
|
||||
new Error('It is not possible to modify tracked sales'));
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -75,22 +75,22 @@ describe('sale canEdit()', () => {
|
|||
const saleCloned = [29];
|
||||
it('should return false if any of the sales is cloned', async() => {
|
||||
const tx = await models.Sale.beginTransaction({});
|
||||
|
||||
let error;
|
||||
try {
|
||||
const options = {transaction: tx};
|
||||
|
||||
const buyerId = 35;
|
||||
const ctx = {req: {accessToken: {userId: buyerId}}};
|
||||
|
||||
const result = await models.Sale.canEdit(ctx, saleCloned, options);
|
||||
|
||||
expect(result).toEqual(false);
|
||||
|
||||
await models.Sale.canEdit(ctx, saleCloned, options);
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
throw e;
|
||||
error = e;
|
||||
}
|
||||
|
||||
expect(error).toEqual(
|
||||
new Error('It is not possible to modify cloned sales'));
|
||||
});
|
||||
|
||||
it('should return true if any of the sales is cloned and has the correct role', async() => {
|
||||
|
@ -130,7 +130,7 @@ describe('sale canEdit()', () => {
|
|||
it('should return false if any of the sales isFloramondo', async() => {
|
||||
const tx = await models.Sale.beginTransaction({});
|
||||
const sales = [26];
|
||||
|
||||
let error;
|
||||
try {
|
||||
const options = {transaction: tx};
|
||||
|
||||
|
@ -140,15 +140,15 @@ describe('sale canEdit()', () => {
|
|||
const saleToEdit = await models.Sale.findById(sales[0], null, options);
|
||||
await saleToEdit.updateAttribute('itemFk', 9, options);
|
||||
|
||||
const result = await models.Sale.canEdit(ctx, sales, options);
|
||||
|
||||
expect(result).toEqual(false);
|
||||
|
||||
await models.Sale.canEdit(ctx, sales, options);
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
throw e;
|
||||
error = e;
|
||||
}
|
||||
|
||||
expect(error).toEqual(
|
||||
new Error('It is not possible to modify sales that their articles are from Floramondo'));
|
||||
});
|
||||
|
||||
it('should return true if any of the sales is of isFloramondo and has the correct role', async() => {
|
||||
|
|
|
@ -40,10 +40,7 @@ module.exports = Self => {
|
|||
try {
|
||||
const currentLine = await models.Sale.findById(id, null, myOptions);
|
||||
|
||||
const canEditSale = await models.Sale.canEdit(ctx, [id], myOptions);
|
||||
|
||||
if (!canEditSale)
|
||||
throw new UserError(`Sale(s) blocked, please contact production`);
|
||||
await models.Sale.canEdit(ctx, [id], myOptions);
|
||||
|
||||
const line = await currentLine.updateAttributes({concept: newConcept}, myOptions);
|
||||
|
||||
|
|
|
@ -66,9 +66,7 @@ module.exports = Self => {
|
|||
|
||||
const sale = await models.Sale.findById(id, filter, myOptions);
|
||||
|
||||
const canEditSale = await models.Sale.canEdit(ctx, [id], myOptions);
|
||||
if (!canEditSale)
|
||||
throw new UserError(`Sale(s) blocked, please contact production`);
|
||||
await models.Sale.canEdit(ctx, [id], myOptions);
|
||||
|
||||
const oldPrice = sale.price;
|
||||
const userId = ctx.req.accessToken.userId;
|
||||
|
|
|
@ -41,9 +41,7 @@ module.exports = Self => {
|
|||
}
|
||||
|
||||
try {
|
||||
const canEditSale = await models.Sale.canEdit(ctx, [id], myOptions);
|
||||
if (!canEditSale)
|
||||
throw new UserError(`Sale(s) blocked, please contact production`);
|
||||
await models.Sale.canEdit(ctx, [id], myOptions);
|
||||
|
||||
const filter = {
|
||||
include: {
|
||||
|
|
|
@ -24,7 +24,7 @@ module.exports = Self => {
|
|||
if (typeof options == 'object')
|
||||
Object.assign(myOptions, options);
|
||||
|
||||
let statesList = await models.State.find({where: filter.where}, myOptions);
|
||||
let statesList = await models.State.find(filter, myOptions);
|
||||
const isProduction = await models.Account.hasRole(userId, 'production', myOptions);
|
||||
const isSalesPerson = await models.Account.hasRole(userId, 'salesPerson', myOptions);
|
||||
const isAdministrative = await models.Account.hasRole(userId, 'administrative', myOptions);
|
||||
|
|
|
@ -50,14 +50,14 @@ module.exports = Self => {
|
|||
required: false
|
||||
},
|
||||
{
|
||||
arg: 'state',
|
||||
type: 'string',
|
||||
arg: 'isNotValidated',
|
||||
type: 'boolean',
|
||||
description: 'Origin state',
|
||||
required: false
|
||||
},
|
||||
{
|
||||
arg: 'futureState',
|
||||
type: 'string',
|
||||
arg: 'futureIsNotValidated',
|
||||
type: 'boolean',
|
||||
description: 'Destination state',
|
||||
required: false
|
||||
},
|
||||
|
@ -92,13 +92,23 @@ module.exports = Self => {
|
|||
case 'futureId':
|
||||
return {'f.futureId': value};
|
||||
case 'ipt':
|
||||
return {'f.ipt': value};
|
||||
return {or:
|
||||
[
|
||||
{'f.ipt': {like: `%${value}%`}},
|
||||
{'f.ipt': null}
|
||||
]
|
||||
};
|
||||
case 'futureIpt':
|
||||
return {'f.futureIpt': value};
|
||||
case 'state':
|
||||
return {'f.stateCode': {like: `%${value}%`}};
|
||||
case 'futureState':
|
||||
return {'f.futureStateCode': {like: `%${value}%`}};
|
||||
return {or:
|
||||
[
|
||||
{'f.futureIpt': {like: `%${value}%`}},
|
||||
{'f.futureIpt': null}
|
||||
]
|
||||
};
|
||||
case 'isNotValidated':
|
||||
return {'f.isNotValidated': value};
|
||||
case 'futureIsNotValidated':
|
||||
return {'f.futureIsNotValidated': value};
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ describe('TicketFuture getTicketsAdvance()', () => {
|
|||
}
|
||||
});
|
||||
|
||||
it('should return the tickets matching the origin grouped state', async() => {
|
||||
it('should return the tickets matching the origin pending state', async() => {
|
||||
const tx = await models.Ticket.beginTransaction({});
|
||||
|
||||
try {
|
||||
|
@ -39,7 +39,7 @@ describe('TicketFuture getTicketsAdvance()', () => {
|
|||
dateFuture: tomorrow,
|
||||
dateToAdvance: today,
|
||||
warehouseFk: 1,
|
||||
state: 'OK'
|
||||
futureIsNotValidated: true
|
||||
};
|
||||
|
||||
const ctx = {req: {accessToken: {userId: 9}}, args};
|
||||
|
@ -54,7 +54,7 @@ describe('TicketFuture getTicketsAdvance()', () => {
|
|||
}
|
||||
});
|
||||
|
||||
it('should return the tickets matching the destination grouped state', async() => {
|
||||
it('should return the tickets matching the destination pending state', async() => {
|
||||
const tx = await models.Ticket.beginTransaction({});
|
||||
|
||||
try {
|
||||
|
@ -64,13 +64,13 @@ describe('TicketFuture getTicketsAdvance()', () => {
|
|||
dateFuture: tomorrow,
|
||||
dateToAdvance: today,
|
||||
warehouseFk: 1,
|
||||
futureState: 'FREE'
|
||||
isNotValidated: true
|
||||
};
|
||||
|
||||
const ctx = {req: {accessToken: {userId: 9}}, args};
|
||||
const result = await models.Ticket.getTicketsAdvance(ctx, options);
|
||||
|
||||
expect(result.length).toBeGreaterThan(0);
|
||||
expect(result.length).toEqual(0);
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
|
@ -89,7 +89,7 @@ describe('TicketFuture getTicketsAdvance()', () => {
|
|||
dateFuture: tomorrow,
|
||||
dateToAdvance: today,
|
||||
warehouseFk: 1,
|
||||
ipt: 'Vertical'
|
||||
ipt: 'V'
|
||||
};
|
||||
|
||||
const ctx = {req: {accessToken: {userId: 9}}, args};
|
||||
|
@ -114,7 +114,7 @@ describe('TicketFuture getTicketsAdvance()', () => {
|
|||
dateFuture: tomorrow,
|
||||
dateToAdvance: today,
|
||||
warehouseFk: 1,
|
||||
tfIpt: 'Vertical'
|
||||
tfIpt: 'V'
|
||||
};
|
||||
|
||||
const ctx = {req: {accessToken: {userId: 9}}, args};
|
||||
|
|
|
@ -39,26 +39,18 @@
|
|||
</vn-autocomplete>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal class="vn-px-lg">
|
||||
<vn-autocomplete vn-one
|
||||
data="$ctrl.groupedStates"
|
||||
label="Origin Grouped State"
|
||||
value-field="code"
|
||||
show-field="name"
|
||||
ng-model="filter.futureState">
|
||||
<tpl-item>
|
||||
{{name}}
|
||||
</tpl-item>
|
||||
</vn-autocomplete>
|
||||
<vn-autocomplete vn-one
|
||||
data="$ctrl.groupedStates"
|
||||
label="Destination Grouped State"
|
||||
value-field="code"
|
||||
show-field="name"
|
||||
ng-model="filter.state">
|
||||
<tpl-item>
|
||||
{{name}}
|
||||
</tpl-item>
|
||||
</vn-autocomplete>
|
||||
<vn-check
|
||||
vn-one
|
||||
label="Pending Origin"
|
||||
ng-model="filter.futureIsNotValidated"
|
||||
triple-state="true">
|
||||
</vn-check>
|
||||
<vn-check
|
||||
vn-one
|
||||
label="Pending Destination"
|
||||
ng-model="filter.isNotValidated"
|
||||
triple-state="true">
|
||||
</vn-check>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal class="vn-px-lg">
|
||||
<vn-autocomplete
|
||||
|
|
|
@ -5,24 +5,9 @@ class Controller extends SearchPanel {
|
|||
constructor($, $element) {
|
||||
super($, $element);
|
||||
this.filter = this.$.filter;
|
||||
this.getGroupedStates();
|
||||
this.getItemPackingTypes();
|
||||
}
|
||||
|
||||
getGroupedStates() {
|
||||
let groupedStates = [];
|
||||
this.$http.get('AlertLevels').then(res => {
|
||||
for (let state of res.data) {
|
||||
groupedStates.push({
|
||||
id: state.id,
|
||||
code: state.code,
|
||||
name: this.$t(state.code)
|
||||
});
|
||||
}
|
||||
this.groupedStates = groupedStates;
|
||||
});
|
||||
}
|
||||
|
||||
getItemPackingTypes() {
|
||||
let itemPackingTypes = [];
|
||||
const filter = {
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
Advance tickets: Adelantar tickets
|
||||
Pending Origin: Pendiente origen
|
||||
Pending Destination: Pendiente destino
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
<thead>
|
||||
<tr second-header>
|
||||
<td></td>
|
||||
<th colspan="5" translate>Origin</th>
|
||||
<th colspan="8" translate>Destination</th>
|
||||
<th colspan="9" translate>Origin</th>
|
||||
<th colspan="7" translate>Destination</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th shrink>
|
||||
|
@ -43,19 +43,30 @@
|
|||
check-field="checked">
|
||||
</vn-multi-check>
|
||||
</th>
|
||||
<th shrink>
|
||||
</th>
|
||||
<th field="futureId">
|
||||
<span translate>ID</span>
|
||||
</th>
|
||||
<th field="futureShipped">
|
||||
<span translate>Date</span>
|
||||
</th>
|
||||
<th field="futureIpt" title="Item Packing Type">
|
||||
<th field="futureIpt" title="{{'Item Packing Type' | translate}}">
|
||||
<span>IPT</span>
|
||||
</th>
|
||||
<th field="futureState">
|
||||
<span translate>State</span>
|
||||
</th>
|
||||
<th field="totalWithVat">
|
||||
<th field="futureLiters">
|
||||
<span translate>Liters</span>
|
||||
</th>
|
||||
<th field="hasStock">
|
||||
<span>Stock</span>
|
||||
</th>
|
||||
<th field="futureLines">
|
||||
<span translate>Lines</span>
|
||||
</th>
|
||||
<th field="futureTotalWithVat">
|
||||
<span translate>Import</span>
|
||||
</th>
|
||||
<th separator field="id">
|
||||
|
@ -64,7 +75,7 @@
|
|||
<th field="shipped">
|
||||
<span translate>Date</span>
|
||||
</th>
|
||||
<th field="ipt" title="Item Packing Type">
|
||||
<th field="ipt" title="{{'Item Packing Type' | translate}}">
|
||||
<span>IPT</span>
|
||||
</th>
|
||||
<th field="state">
|
||||
|
@ -73,13 +84,10 @@
|
|||
<th field="liters">
|
||||
<span translate>Liters</span>
|
||||
</th>
|
||||
<th field="hasStock">
|
||||
<span>Stock</span>
|
||||
</th>
|
||||
<th field="lines">
|
||||
<span translate>Lines</span>
|
||||
</th>
|
||||
<th field="futureTotalWithVat">
|
||||
<th field="totalWithVat">
|
||||
<span translate>Import</span>
|
||||
</th>
|
||||
</tr>
|
||||
|
@ -92,6 +100,13 @@
|
|||
vn-click-stop>
|
||||
</vn-check>
|
||||
</td>
|
||||
<td>
|
||||
<vn-icon
|
||||
ng-show="ticket.futureAgency !== ticket.agency"
|
||||
icon="icon-agency-term"
|
||||
vn-tooltip="{{$ctrl.agencies(ticket.futureAgency, ticket.agency)}}">
|
||||
</vn-icon>
|
||||
</td>
|
||||
<td>
|
||||
<span
|
||||
ng-click="ticketDescriptor.show($event, ticket.futureId)"
|
||||
|
@ -111,6 +126,9 @@
|
|||
{{::ticket.futureState | dashIfEmpty}}
|
||||
</span>
|
||||
</td>
|
||||
<td>{{::ticket.futureLiters | dashIfEmpty}}</td>
|
||||
<td>{{::ticket.hasStock | dashIfEmpty}}</td>
|
||||
<td>{{::ticket.futureLines | dashIfEmpty}}</td>
|
||||
<td>
|
||||
<span class="chip {{$ctrl.totalPriceColor(ticket.futureTotalWithVat)}}">
|
||||
{{::(ticket.futureTotalWithVat ? ticket.futureTotalWithVat : 0) | currency: 'EUR': 2}}
|
||||
|
@ -136,7 +154,6 @@
|
|||
</span>
|
||||
</td>
|
||||
<td>{{::ticket.liters | dashIfEmpty}}</td>
|
||||
<td>{{::ticket.hasStock | dashIfEmpty}}</td>
|
||||
<td>{{::ticket.lines | dashIfEmpty}}</td>
|
||||
<td>
|
||||
<span class="chip {{$ctrl.totalPriceColor(ticket.totalWithVat)}}">
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import ngModule from '../module';
|
||||
import Section from 'salix/components/section';
|
||||
import './style.scss';
|
||||
|
||||
export default class Controller extends Section {
|
||||
constructor($element, $) {
|
||||
|
@ -128,6 +129,11 @@ export default class Controller extends Section {
|
|||
});
|
||||
}
|
||||
|
||||
agencies(futureAgency, agency) {
|
||||
return this.$t(`Origin agency`, {agency: futureAgency}) +
|
||||
'<br/>' + this.$t(`Destination agency`, {agency: agency});
|
||||
}
|
||||
|
||||
moveTicketsAdvance() {
|
||||
let ticketsToMove = [];
|
||||
this.checked.forEach(ticket => {
|
||||
|
@ -157,6 +163,10 @@ export default class Controller extends Section {
|
|||
return {'liters': value};
|
||||
case 'lines':
|
||||
return {'lines': value};
|
||||
case 'futureLiters':
|
||||
return {'futureLiters': value};
|
||||
case 'futureLines':
|
||||
return {'futureLines': value};
|
||||
case 'ipt':
|
||||
return {'ipt': value};
|
||||
case 'futureIpt':
|
||||
|
|
|
@ -4,3 +4,6 @@ Advance confirmation: ¿Desea adelantar {{checked}} tickets?
|
|||
Success: Tickets movidos correctamente
|
||||
Lines: Líneas
|
||||
Liters: Litros
|
||||
Item Packing Type: Encajado
|
||||
Origin agency: "Agencia origen: {{agency}}"
|
||||
Destination agency: "Agencia destino: {{agency}}"
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
@import "variables";
|
||||
|
||||
vn-ticket-advance{
|
||||
vn-icon {
|
||||
color: #f7931e
|
||||
}
|
||||
}
|
|
@ -75,8 +75,10 @@ class Controller extends Component {
|
|||
}
|
||||
|
||||
set shipped(value) {
|
||||
if (new Date(this.ticket.shipped).toDateString() != value.toDateString())
|
||||
value.setHours(0, 0, 0, 0);
|
||||
|
||||
this.ticket.shipped = value;
|
||||
this.ticket.shipped.setHours(0, 0, 0, 0);
|
||||
this.getLanded({
|
||||
shipped: value,
|
||||
addressFk: this.ticket.addressFk,
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
disabled="!$ctrl.isEditable"
|
||||
label="State"
|
||||
value-field="code"
|
||||
fields="['id', 'name', 'alertLevel', 'code']"
|
||||
url="States/editableStates"
|
||||
on-change="$ctrl.changeState(value)">
|
||||
</vn-button-menu>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<vn-card class="summary">
|
||||
<h5>
|
||||
<a
|
||||
<a
|
||||
ng-if="::$ctrl.summary.id"
|
||||
vn-tooltip="Go to the ticket"
|
||||
ui-sref="ticket.card.summary({id: {{::$ctrl.summary.id}}})"
|
||||
|
@ -8,36 +8,37 @@
|
|||
<vn-icon-button icon="launch"></vn-icon-button>
|
||||
</a>
|
||||
<span>
|
||||
Ticket #{{$ctrl.summary.id}} - {{$ctrl.summary.client.name}}
|
||||
Ticket #{{$ctrl.summary.id}} - {{$ctrl.summary.client.name}}
|
||||
({{$ctrl.summary.client.id}}) - {{$ctrl.summary.nickname}}
|
||||
</span>
|
||||
<vn-button-menu
|
||||
<vn-button-menu
|
||||
disabled="!$ctrl.isEditable"
|
||||
class="message"
|
||||
label="Change state"
|
||||
value-field="code"
|
||||
fields="['id', 'name', 'alertLevel', 'code']"
|
||||
url="States/editableStates"
|
||||
on-change="$ctrl.changeState(value)">
|
||||
</vn-button-menu>
|
||||
<vn-ticket-descriptor-menu
|
||||
<vn-ticket-descriptor-menu
|
||||
ng-if="!$ctrl.isOnTicketCard"
|
||||
ticket-id="$ctrl.summary.id"
|
||||
ticket-id="$ctrl.summary.id"
|
||||
parent-reload="$ctrl.reload()"
|
||||
/>
|
||||
</h5>
|
||||
<vn-horizontal>
|
||||
<vn-one>
|
||||
<vn-label-value label="State"
|
||||
<vn-label-value label="State"
|
||||
value="{{$ctrl.summary.ticketState.state.name}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Salesperson">
|
||||
<span
|
||||
<span
|
||||
ng-click="workerDescriptor.show($event, $ctrl.summary.client.salesPersonFk)"
|
||||
class="link">
|
||||
{{$ctrl.summary.client.salesPersonUser.name}}
|
||||
</span>
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Agency"
|
||||
<vn-label-value label="Agency"
|
||||
value="{{$ctrl.summary.agencyMode.name}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Zone">
|
||||
|
@ -47,11 +48,11 @@
|
|||
{{$ctrl.summary.zone.name}}
|
||||
</span>
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Warehouse"
|
||||
<vn-label-value label="Warehouse"
|
||||
value="{{$ctrl.summary.warehouse.name}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Route">
|
||||
<span
|
||||
<span
|
||||
ng-click="routeDescriptor.show($event, $ctrl.summary.routeFk)"
|
||||
class="link">
|
||||
{{$ctrl.summary.routeFk}}
|
||||
|
@ -66,17 +67,17 @@
|
|||
</vn-label-value>
|
||||
</vn-one>
|
||||
<vn-two>
|
||||
<vn-label-value label="Shipped"
|
||||
<vn-label-value label="Shipped"
|
||||
value="{{$ctrl.summary.shipped | date: 'dd/MM/yyyy HH:mm'}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Landed"
|
||||
<vn-label-value label="Landed"
|
||||
value="{{$ctrl.summary.landed | date: 'dd/MM/yyyy'}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Package size"
|
||||
<vn-label-value label="Package size"
|
||||
value="{{$ctrl.summary.packages}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Address phone"
|
||||
ng-if="$ctrl.summary.address.phone != null"
|
||||
ng-if="$ctrl.summary.address.phone != null"
|
||||
value="{{$ctrl.summary.address.phone}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Address mobile"
|
||||
|
@ -109,7 +110,7 @@
|
|||
</vn-one>
|
||||
<vn-auto name="sales">
|
||||
<h4>
|
||||
<a
|
||||
<a
|
||||
ui-sref="ticket.card.sale({id:$ctrl.ticket.id})"
|
||||
target="_self">
|
||||
<span translate vn-tooltip="Go to">Sale</span>
|
||||
|
@ -146,13 +147,13 @@
|
|||
vn-tooltip="{{::$ctrl.$t('Claim')}}: {{::sale.claimBeginning.claimFk}}">
|
||||
</vn-icon>
|
||||
</a>
|
||||
<vn-icon
|
||||
ng-show="::(sale.visible < 0)"
|
||||
<vn-icon
|
||||
ng-show="::(sale.visible < 0)"
|
||||
color-main
|
||||
icon="warning"
|
||||
vn-tooltip="Visible: {{::sale.visible || 0}}">
|
||||
</vn-icon>
|
||||
<vn-icon ng-show="sale.reserved"
|
||||
<vn-icon ng-show="sale.reserved"
|
||||
icon="icon-reserve"
|
||||
translate-attr="{title: 'Reserved'}">
|
||||
</vn-icon>
|
||||
|
@ -170,22 +171,22 @@
|
|||
</vn-icon>
|
||||
</vn-td>
|
||||
<vn-td number shrink>
|
||||
<span
|
||||
<span
|
||||
ng-click="itemDescriptor.show($event, sale.itemFk, sale.id, $ctrl.ticket.shipped)"
|
||||
class="link">
|
||||
{{sale.itemFk | zeroFill:6}}
|
||||
</span>
|
||||
</vn-td>
|
||||
<vn-td number shrink>
|
||||
<vn-chip
|
||||
class="transparent"
|
||||
<vn-chip
|
||||
class="transparent"
|
||||
ng-class="{'alert': sale.visible < 0}">
|
||||
{{::sale.visible}}
|
||||
</vn-chip>
|
||||
</vn-td>
|
||||
<vn-td number shrink>
|
||||
<vn-chip
|
||||
class="transparent"
|
||||
<vn-chip
|
||||
class="transparent"
|
||||
ng-class="{'alert': sale.available < 0}">
|
||||
{{::sale.available}}
|
||||
</vn-chip>
|
||||
|
@ -216,7 +217,7 @@
|
|||
</vn-auto>
|
||||
<vn-one ng-if="$ctrl.summary.packagings.length != 0">
|
||||
<h4>
|
||||
<a
|
||||
<a
|
||||
ui-sref="ticket.card.package({id:$ctrl.ticket.id})"
|
||||
target="_self">
|
||||
<span translate vn-tooltip="Go to">Packages</span>
|
||||
|
@ -241,7 +242,7 @@
|
|||
</vn-one>
|
||||
<vn-one class="services" ng-if="$ctrl.summary.services.length != 0">
|
||||
<h4>
|
||||
<a
|
||||
<a
|
||||
ui-sref="ticket.card.service({id:$ctrl.ticket.id})"
|
||||
target="_self">
|
||||
<span translate vn-tooltip="Go to">Service</span>
|
||||
|
@ -276,7 +277,7 @@
|
|||
<vn-horizontal>
|
||||
<vn-auto ng-if="$ctrl.summary.requests.length != 0">
|
||||
<h4>
|
||||
<a
|
||||
<a
|
||||
ui-sref="ticket.card.request.index({id:$ctrl.ticket.id})"
|
||||
target="_self">
|
||||
<span translate vn-tooltip="Go to">Purchase request</span>
|
||||
|
@ -304,7 +305,7 @@
|
|||
<vn-td number>{{::request.quantity}}</vn-td>
|
||||
<vn-td number>{{::request.price}}</vn-td>
|
||||
<vn-td number>
|
||||
<span
|
||||
<span
|
||||
ng-show="::request.saleFk"
|
||||
ng-click="itemDescriptor.show($event, request.sale.itemFk, request.sale.id)"
|
||||
class="link">
|
||||
|
@ -336,9 +337,9 @@
|
|||
<vn-invoice-out-descriptor-popover
|
||||
vn-id="invoice-out-descriptor">
|
||||
</vn-invoice-out-descriptor-popover>
|
||||
<vn-worker-descriptor-popover
|
||||
<vn-worker-descriptor-popover
|
||||
vn-id="workerDescriptor">
|
||||
</vn-worker-descriptor-popover>
|
||||
<vn-zone-descriptor-popover
|
||||
<vn-zone-descriptor-popover
|
||||
vn-id="zoneDescriptor">
|
||||
</vn-zone-descriptor-popover>
|
||||
</vn-zone-descriptor-popover>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "salix-back",
|
||||
"version": "23.04.01",
|
||||
"version": "23.06.01",
|
||||
"author": "Verdnatura Levante SL",
|
||||
"description": "Salix backend",
|
||||
"license": "GPL-3.0",
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
<div class="content">
|
||||
<h1 class="title centered uppercase">{{$t('title')}}</h1>
|
||||
<p class="centered">
|
||||
Recibo de <strong class="uppercase">{{client.socialName}}</strong>, la cantidad de
|
||||
<strong>{{receipt.amountPaid}} €</strong> en concepto de 'entrega a cuenta', quedando pendiente en
|
||||
la cuenta del cliente un saldo de <strong>{{receipt.amountUnpaid}} €</strong>.
|
||||
Recibo #{{receipt.id}} de <strong class="uppercase">{{client.socialName}}</strong>,
|
||||
la cantidad de <strong>{{receipt.amountPaid}} €</strong>
|
||||
en concepto de 'entrega a cuenta'.
|
||||
</p>
|
||||
<div class="signature">
|
||||
<img v-bind:src="getReportSrc('signature.png')" />
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
SELECT
|
||||
r.id,
|
||||
r.amountPaid,
|
||||
cr.amount AS amountUnpaid,
|
||||
r.payed,
|
||||
SELECT
|
||||
r.id,
|
||||
r.amountPaid,
|
||||
r.payed,
|
||||
r.companyFk
|
||||
FROM receipt r
|
||||
JOIN client c ON c.id = r.clientFk
|
||||
JOIN vn.clientRisk cr ON cr.clientFk = c.id
|
||||
AND cr.companyFk = r.companyFk
|
||||
WHERE r.id = ?
|
||||
WHERE r.id = ?
|
||||
|
|
Loading…
Reference in New Issue