Quantity
Worker
- Shelving
- Parking
+ Shelving
+ Parking
Created
- {{::itemShelvingSale.quantity}}
+
+ {{itemShelvingSale.quantity}}
+
+
+
+
+
- {{::itemShelvingSale.shelvingFk}}
- {{::itemShelvingSale.code}}
+
+
+
+
+
+
+
+
{{::itemShelvingSale.created | date: 'dd/MM/yyyy HH:mm'}}
diff --git a/modules/ticket/front/sale-tracking/index.js b/modules/ticket/front/sale-tracking/index.js
index 60b422cc0..6c0e7232e 100644
--- a/modules/ticket/front/sale-tracking/index.js
+++ b/modules/ticket/front/sale-tracking/index.js
@@ -3,62 +3,6 @@ import Section from 'salix/components/section';
import './style.scss';
class Controller extends Section {
- constructor($element, $) {
- super($element, $);
- this.filter = {
- include: [
- {
- relation: 'item'
- },
- {
- relation: 'saleTracking',
- scope: {
- fields: ['isChecked']
- }
- },
- {
- relation: 'saleGroupDetail',
- scope: {
- fields: ['saleGroupFk'],
- include: {
- relation: 'saleGroup',
- scope: {
- fields: ['parkingFk'],
- include: {
- relation: 'parking',
- scope: {
- fields: ['code']
- }
- }
- }
- }
- }
- }
- ]
- };
- }
-
- get sales() {
- return this._sales;
- }
-
- set sales(value) {
- this._sales = value;
- if (value) {
- const query = `Sales/${this.$params.id}/salePreparingList`;
- this.$http.get(query)
- .then(res => {
- this.salePreparingList = res.data;
- for (const salePreparing of this.salePreparingList) {
- for (const sale of this.sales) {
- if (salePreparing.saleFk == sale.id)
- sale.preparingList = salePreparing;
- }
- }
- });
- }
- }
-
showItemDescriptor(event, sale) {
this.quicklinks = {
btnThree: {
@@ -75,20 +19,145 @@ class Controller extends Section {
}
showSaleTracking(sale) {
- this.saleId = sale.id;
+ this.saleId = sale.saleFk;
this.$.saleTracking.show();
}
showItemShelvingSale(sale) {
- this.saleId = sale.id;
+ this.saleId = sale.saleFk;
this.$.itemShelvingSale.show();
}
+
+ clickSaleGroupDetail(index) {
+ const sale = this.sales[index];
+ if (!sale.saleGroupDetailFk) return;
+
+ return this.$http.delete(`SaleGroupDetails/${sale.saleGroupDetailFk}`)
+ .then(() => {
+ sale.hasSaleGroupDetail = false;
+ this.vnApp.showSuccess(this.$t('Data saved!'));
+ });
+ }
+
+ clickPreviousSelected(index) {
+ const sale = this.sales[index];
+ if (!sale.isPreviousSelected) {
+ this.saleTrackingNew(sale, 'PREVIOUS_PREPARATION', false);
+ sale.isPreviousSelected = true;
+ } else {
+ this.saleTrackingDel(sale, 'PREVIOUS_PREPARATION');
+ sale.isPreviousSelected = false;
+ sale.isPrevious = false;
+ }
+ }
+
+ clickPrevious(index) {
+ const sale = this.sales[index];
+ if (!sale.isPrevious) {
+ this.saleTrackingNew(sale, 'PREVIOUS_PREPARATION', true);
+ sale.isPrevious = true;
+ sale.isPreviousSelected = true;
+ } else {
+ this.saleTrackingNew(sale, 'PREVIOUS_PREPARATION', false);
+ sale.isPrevious = false;
+ }
+ }
+
+ clickPrepared(index) {
+ const sale = this.sales[index];
+ if (!sale.isPrepared) {
+ this.saleTrackingNew(sale, 'PREPARED', true);
+ sale.isPrepared = true;
+ } else {
+ this.saleTrackingDel(sale, 'PREPARED');
+ sale.isPrepared = false;
+ }
+ }
+
+ clickControled(index) {
+ const sale = this.sales[index];
+ if (!sale.isControled) {
+ this.saleTrackingNew(sale, 'CHECKED', true);
+ sale.isControled = true;
+ } else {
+ this.saleTrackingDel(sale, 'CHECKED');
+ sale.isControled = false;
+ }
+ }
+
+ saleTrackingNew(sale, stateCode, isChecked) {
+ const params = {
+ saleFk: sale.saleFk,
+ isChecked: isChecked,
+ quantity: sale.quantity,
+ stateCode: stateCode
+ };
+ this.$http.post(`SaleTrackings/new`, params).then(() => {
+ this.vnApp.showSuccess(this.$t('Data saved!'));
+ });
+ }
+
+ saleTrackingDel(sale, stateCode) {
+ const params = {
+ saleFk: sale.saleFk,
+ stateCode: stateCode
+ };
+ this.$http.post(`SaleTrackings/delete`, params).then(() => {
+ this.vnApp.showSuccess(this.$t('Data saved!'));
+ });
+ }
+
+ updateQuantity(itemShelvingSale) {
+ const params = {
+ quantity: itemShelvingSale.quantity
+ };
+ this.$http.patch(`ItemShelvingSales/${itemShelvingSale.id}`, params)
+ .then(() => {
+ this.vnApp.showSuccess(this.$t('Data saved!'));
+ });
+ }
+
+ async updateShelving(itemShelvingSale) {
+ const params = {
+ shelvingFk: itemShelvingSale.shelvingFk
+ };
+ const res = await this.$http.patch(`ItemShelvings/${itemShelvingSale.itemShelvingFk}`, params);
+
+ const filter = {
+ fields: ['parkingFk'],
+ where: {
+ code: res.data.shelvingFk
+ }
+ };
+ this.$http.get(`Shelvings/findOne`, {filter})
+ .then(res => {
+ itemShelvingSale.parkingFk = res.data.parkingFk;
+ this.vnApp.showSuccess(this.$t('Data saved!'));
+ });
+ }
+
+ async updateParking(itemShelvingSale) {
+ const filter = {
+ fields: ['id'],
+ where: {
+ code: itemShelvingSale.shelvingFk
+ }
+ };
+ const res = await this.$http.get(`Shelvings/findOne`, {filter});
+
+ const params = {
+ parkingFk: itemShelvingSale.parkingFk
+ };
+ this.$http.patch(`Shelvings/${res.data.id}`, params)
+ .then(() => this.vnApp.showSuccess(this.$t('Data saved!')));
+ }
}
ngModule.vnComponent('vnTicketSaleTracking', {
template: require('./index.html'),
controller: Controller,
bindings: {
- ticket: '<'
+ ticket: '<',
+ model: ''
}
});
diff --git a/modules/ticket/front/sale-tracking/locale/es.yml b/modules/ticket/front/sale-tracking/locale/es.yml
index eabc0a04d..559321dd6 100644
--- a/modules/ticket/front/sale-tracking/locale/es.yml
+++ b/modules/ticket/front/sale-tracking/locale/es.yml
@@ -1,6 +1,7 @@
-ItemShelvings sale: Carros línea
-has saleGroupDetail: tiene detalle grupo lineas
-is previousSelected: es previa seleccionada
-is previous: es previa
-is prepared: esta preparado
-is controled: esta controlado
+Shelvings sale: Carros línea
+Log states: Historial estados
+sale group detail: detalle grupo lineas
+previous selected: previa seleccionado
+previous: previa
+prepared: preparado
+checked: revisado
diff --git a/modules/ticket/front/sale-tracking/style.scss b/modules/ticket/front/sale-tracking/style.scss
index 78a0bda1d..f0807d75d 100644
--- a/modules/ticket/front/sale-tracking/style.scss
+++ b/modules/ticket/front/sale-tracking/style.scss
@@ -1,14 +1,5 @@
@import "variables";
-vn-sale-tracking {
- .chip {
- display: inline-block;
- min-width: 15px;
- min-height: 25px;
- }
-
-}
-
.circleState {
display: inline-block;
justify-content: center;
diff --git a/modules/worker/front/pbx/index.js b/modules/worker/front/pbx/index.js
index d37f6f7d8..3b6443d3c 100644
--- a/modules/worker/front/pbx/index.js
+++ b/modules/worker/front/pbx/index.js
@@ -5,7 +5,7 @@ class Controller extends Section {
onSubmit() {
const sip = this.worker.sip;
const params = {
- userFk: this.worker.userFk,
+ userFk: this.worker.id,
extension: sip.extension
};
this.$.watcher.check();
diff --git a/print/templates/reports/entry-order/sql/supplier.sql b/print/templates/reports/entry-order/sql/supplier.sql
index 11a2bc602..81ed7e883 100644
--- a/print/templates/reports/entry-order/sql/supplier.sql
+++ b/print/templates/reports/entry-order/sql/supplier.sql
@@ -8,4 +8,4 @@ SELECT
FROM supplier s
JOIN entry e ON e.supplierFk = s.id
LEFT JOIN province p ON p.id = s.provinceFk
-WHERE e.id = ?
\ No newline at end of file
+WHERE e.id = ?
diff --git a/print/templates/reports/invoiceIn/invoiceIn.html b/print/templates/reports/invoiceIn/invoiceIn.html
index 8f072947f..a86fd42b0 100644
--- a/print/templates/reports/invoiceIn/invoiceIn.html
+++ b/print/templates/reports/invoiceIn/invoiceIn.html
@@ -32,6 +32,7 @@
{{invoice.name}}
{{invoice.postalAddress}}
{{invoice.postcodeCity}}
+ {{invoice.postCode}}, {{invoice.city}}, ({{invoice.province}})
{{$t('fiscalId')}}: {{invoice.nif}}
{{$t('phone')}}: {{invoice.phone}}
diff --git a/print/templates/reports/invoiceIn/sql/invoice.sql b/print/templates/reports/invoiceIn/sql/invoice.sql
index dae979011..82eeebce0 100644
--- a/print/templates/reports/invoiceIn/sql/invoice.sql
+++ b/print/templates/reports/invoiceIn/sql/invoice.sql
@@ -4,6 +4,9 @@ SELECT
i.issued,
s.name,
s.street AS postalAddress,
+ s.city,
+ s.postCode,
+ pr.name province,
s.nif,
s.phone,
p.name payMethod
@@ -11,4 +14,5 @@ SELECT
JOIN supplier s ON s.id = i.supplierFk
JOIN company c ON c.id = i.companyFk
JOIN payMethod p ON p.id = s.payMethodFk
+ LEFT JOIN province pr ON pr.id = s.provinceFk
WHERE i.id = ?