From bbf68a88a792a3e531b1fd463ca6771cbd874bc7 Mon Sep 17 00:00:00 2001
From: alexm
Date: Thu, 9 Feb 2023 10:26:55 +0100
Subject: [PATCH 001/300] feat: sendEmail checkBox and docuware open
clientBalanceCreate with default data
---
db/changes/230601/00-acl_receiptEmail.sql | 3 +
.../back/methods/receipt/receiptEmail.js | 57 +++++++++++++++++++
.../client/back/methods/receipt/receiptPdf.js | 2 +-
modules/client/back/models/receipt.js | 1 +
.../client/front/balance/create/index.html | 12 ++--
modules/client/front/balance/create/index.js | 35 ++++++++++--
.../client/front/balance/create/locale/es.yml | 4 +-
modules/ticket/front/descriptor-menu/index.js | 7 ++-
.../email/receipt/assets/css/import.js | 11 ++++
.../templates/email/receipt/attachments.json | 6 ++
print/templates/email/receipt/locale/es.yml | 5 ++
print/templates/email/receipt/receipt.html | 9 +++
print/templates/email/receipt/receipt.js | 15 +++++
13 files changed, 155 insertions(+), 12 deletions(-)
create mode 100644 db/changes/230601/00-acl_receiptEmail.sql
create mode 100644 modules/client/back/methods/receipt/receiptEmail.js
create mode 100644 print/templates/email/receipt/assets/css/import.js
create mode 100644 print/templates/email/receipt/attachments.json
create mode 100644 print/templates/email/receipt/locale/es.yml
create mode 100644 print/templates/email/receipt/receipt.html
create mode 100755 print/templates/email/receipt/receipt.js
diff --git a/db/changes/230601/00-acl_receiptEmail.sql b/db/changes/230601/00-acl_receiptEmail.sql
new file mode 100644
index 000000000..2de8adf50
--- /dev/null
+++ b/db/changes/230601/00-acl_receiptEmail.sql
@@ -0,0 +1,3 @@
+INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
+ VALUES
+ ('Receipt', 'receiptEmail', '*', 'ALLOW', 'ROLE', 'salesAssistant');
diff --git a/modules/client/back/methods/receipt/receiptEmail.js b/modules/client/back/methods/receipt/receiptEmail.js
new file mode 100644
index 000000000..cd529eece
--- /dev/null
+++ b/modules/client/back/methods/receipt/receiptEmail.js
@@ -0,0 +1,57 @@
+const {Email} = require('vn-print');
+
+module.exports = Self => {
+ Self.remoteMethodCtx('receiptEmail', {
+ description: 'Returns the receipt pdf',
+ accepts: [
+ {
+ arg: 'id',
+ type: 'number',
+ required: true,
+ description: 'The claim id',
+ http: {source: 'path'}
+ },
+ {
+ arg: 'recipient',
+ type: 'string',
+ description: 'The recipient email',
+ required: true,
+ }
+ ],
+ 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: '/:id/receipt-email',
+ verb: 'POST'
+ }
+ });
+
+ Self.receiptEmail = async(ctx, id) => {
+ const args = Object.assign({}, ctx.args);
+ const params = {
+ recipient: args.recipient,
+ lang: ctx.req.getLocale()
+ };
+
+ delete args.ctx;
+ for (const param in args)
+ params[param] = args[param];
+
+ const email = new Email('receipt', params);
+
+ return email.send();
+ };
+};
diff --git a/modules/client/back/methods/receipt/receiptPdf.js b/modules/client/back/methods/receipt/receiptPdf.js
index f55e05040..2dfae4e83 100644
--- a/modules/client/back/methods/receipt/receiptPdf.js
+++ b/modules/client/back/methods/receipt/receiptPdf.js
@@ -8,7 +8,7 @@ module.exports = Self => {
arg: 'id',
type: 'number',
required: true,
- description: 'The claim id',
+ description: 'The receipt id',
http: {source: 'path'}
},
{
diff --git a/modules/client/back/models/receipt.js b/modules/client/back/models/receipt.js
index 3118cc239..feb8ca053 100644
--- a/modules/client/back/models/receipt.js
+++ b/modules/client/back/models/receipt.js
@@ -5,6 +5,7 @@ module.exports = function(Self) {
require('../methods/receipt/balanceCompensationEmail')(Self);
require('../methods/receipt/balanceCompensationPdf')(Self);
require('../methods/receipt/receiptPdf')(Self);
+ require('../methods/receipt/receiptEmail')(Self);
Self.validateBinded('amountPaid', isNotZero, {
message: 'Amount cannot be zero',
diff --git a/modules/client/front/balance/create/index.html b/modules/client/front/balance/create/index.html
index 56e505463..4f9fa07d2 100644
--- a/modules/client/front/balance/create/index.html
+++ b/modules/client/front/balance/create/index.html
@@ -11,7 +11,7 @@
@@ -80,13 +80,17 @@
-
+
+
Accept
-
\ No newline at end of file
+
diff --git a/modules/client/front/balance/create/index.js b/modules/client/front/balance/create/index.js
index 68d19209d..57088c31f 100644
--- a/modules/client/front/balance/create/index.js
+++ b/modules/client/front/balance/create/index.js
@@ -2,10 +2,12 @@ import ngModule from '../../module';
import Dialog from 'core/components/dialog';
class Controller extends Dialog {
- constructor($element, $, $transclude, vnReport) {
+ constructor($element, $, $transclude, vnReport, vnEmail) {
super($element, $, $transclude);
this.viewReceipt = true;
+ this.sendEmail = true;
this.vnReport = vnReport;
+ this.vnEmail = vnEmail;
this.receipt = {};
}
@@ -24,6 +26,18 @@ class Controller extends Dialog {
set clientFk(value) {
this.receipt.clientFk = value;
+
+ const filter = {
+ fields: ['email'],
+ where: {
+ id: value
+ }
+ };
+
+ this.$http.get(`Clients/findOne`, {filter})
+ .then(res => {
+ this.receipt.email = res.data.email;
+ });
}
get clientFk() {
@@ -65,7 +79,8 @@ class Controller extends Dialog {
this.receipt.description.push(accountingType.receiptDescription);
if (this.originalDescription)
this.receipt.description.push(this.originalDescription);
- this.receipt.description.join(', ');
+
+ this.receipt.description = this.receipt.description.join(', ').toString();
this.maxAmount = accountingType && accountingType.maxAmount;
@@ -133,10 +148,13 @@ class Controller extends Dialog {
return super.responseHandler(response);
const exceededAmount = this.receipt.amountPaid > this.maxAmount;
-
- if (this.bankSelection.accountingType.code == 'cash' && exceededAmount)
+ const isCash = this.bankSelection.accountingType.code == 'cash';
+ if (isCash && exceededAmount)
return this.vnApp.showError(this.$t('Amount exceeded', {maxAmount: this.maxAmount}));
+ if (isCash && this.sendEmail && !this.receipt.email)
+ return this.vnApp.showError(this.$t('There is no assigned email for this client'));
+
let receiptId;
return this.$http.post(`Clients/${this.clientFk}/createReceipt`, this.receipt)
.then(res => {
@@ -144,6 +162,13 @@ class Controller extends Dialog {
super.responseHandler(response);
})
.then(() => this.vnApp.showSuccess(this.$t('Data saved!')))
+ .then(() => {
+ if (!this.sendEmail || !isCash) return;
+ const params = {
+ recipient: this.receipt.email
+ };
+ this.vnEmail.send(`Receipts/${receiptId}/receipt-email`, params);
+ })
.then(() => {
if (this.viewReceipt)
this.vnReport.show(`Receipts/${receiptId}/receipt-pdf`);
@@ -157,7 +182,7 @@ class Controller extends Dialog {
}
}
-Controller.$inject = ['$element', '$scope', '$transclude', 'vnReport'];
+Controller.$inject = ['$element', '$scope', '$transclude', 'vnReport', 'vnEmail'];
ngModule.vnComponent('vnClientBalanceCreate', {
slotTemplate: require('./index.html'),
diff --git a/modules/client/front/balance/create/locale/es.yml b/modules/client/front/balance/create/locale/es.yml
index 056590966..f8c23afdb 100644
--- a/modules/client/front/balance/create/locale/es.yml
+++ b/modules/client/front/balance/create/locale/es.yml
@@ -1,2 +1,4 @@
View receipt: Ver recibo
-Amount exceeded: Según ley contra el fraude no se puede recibir cobros por importe igual o superior a {{maxAmount}}
\ No newline at end of file
+Amount exceeded: Según ley contra el fraude no se puede recibir cobros por importe igual o superior a {{maxAmount}}
+Send email: Enviar correo
+There is no assigned email for this client: No hay correo asignado para este cliente
diff --git a/modules/ticket/front/descriptor-menu/index.js b/modules/ticket/front/descriptor-menu/index.js
index ff029db78..1a88b00d5 100644
--- a/modules/ticket/front/descriptor-menu/index.js
+++ b/modules/ticket/front/descriptor-menu/index.js
@@ -326,8 +326,13 @@ class Controller extends Section {
return this.$http.post(`Docuwares/${this.id}/upload`, {fileCabinet: 'deliveryNote'})
.then(() => {
- this.vnApp.showSuccess(this.$t('PDF sent!'));
+ this.$.balanceCreate.amountPaid = this.ticket.totalWithVat;
+ this.$.balanceCreate.clientFk = this.ticket.clientFk;
+ this.$.balanceCreate.description = 'Albaran: ';
+ this.$.balanceCreate.description += this.ticket.id;
+
this.$.balanceCreate.show();
+ this.vnApp.showSuccess(this.$t('PDF sent!'));
});
}
}
diff --git a/print/templates/email/receipt/assets/css/import.js b/print/templates/email/receipt/assets/css/import.js
new file mode 100644
index 000000000..4b4bb7086
--- /dev/null
+++ b/print/templates/email/receipt/assets/css/import.js
@@ -0,0 +1,11 @@
+const Stylesheet = require(`vn-print/core/stylesheet`);
+
+const path = require('path');
+const vnPrintPath = path.resolve('print');
+
+module.exports = new Stylesheet([
+ `${vnPrintPath}/common/css/spacing.css`,
+ `${vnPrintPath}/common/css/misc.css`,
+ `${vnPrintPath}/common/css/layout.css`,
+ `${vnPrintPath}/common/css/email.css`])
+ .mergeStyles();
diff --git a/print/templates/email/receipt/attachments.json b/print/templates/email/receipt/attachments.json
new file mode 100644
index 000000000..9930596e0
--- /dev/null
+++ b/print/templates/email/receipt/attachments.json
@@ -0,0 +1,6 @@
+[
+ {
+ "filename": "receipt.pdf",
+ "component": "receipt"
+ }
+]
diff --git a/print/templates/email/receipt/locale/es.yml b/print/templates/email/receipt/locale/es.yml
new file mode 100644
index 000000000..95883afaa
--- /dev/null
+++ b/print/templates/email/receipt/locale/es.yml
@@ -0,0 +1,5 @@
+subject: Recibo
+title: Recibo
+dear: Estimado cliente
+description: Ya está disponible el recibo {0} .
+ Puedes descargarlo haciendo clic en el adjunto de este correo.
diff --git a/print/templates/email/receipt/receipt.html b/print/templates/email/receipt/receipt.html
new file mode 100644
index 000000000..734552014
--- /dev/null
+++ b/print/templates/email/receipt/receipt.html
@@ -0,0 +1,9 @@
+
+
+
+
{{ $t('title') }}
+
{{$t('dear')}},
+
+
+
+
diff --git a/print/templates/email/receipt/receipt.js b/print/templates/email/receipt/receipt.js
new file mode 100755
index 000000000..606534f4d
--- /dev/null
+++ b/print/templates/email/receipt/receipt.js
@@ -0,0 +1,15 @@
+const Component = require(`vn-print/core/component`);
+const emailBody = new Component('email-body');
+
+module.exports = {
+ name: 'receipt',
+ components: {
+ 'email-body': emailBody.build(),
+ },
+ props: {
+ id: {
+ type: Number,
+ required: true
+ }
+ }
+};
From f496242fcbfa0794e0dfc28330db26c511257d40 Mon Sep 17 00:00:00 2001
From: alexm
Date: Thu, 9 Feb 2023 10:28:37 +0100
Subject: [PATCH 002/300] fix description
---
modules/client/back/methods/receipt/receiptPdf.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/client/back/methods/receipt/receiptPdf.js b/modules/client/back/methods/receipt/receiptPdf.js
index 2dfae4e83..2bb4059a1 100644
--- a/modules/client/back/methods/receipt/receiptPdf.js
+++ b/modules/client/back/methods/receipt/receiptPdf.js
@@ -2,7 +2,7 @@ const {Report} = require('vn-print');
module.exports = Self => {
Self.remoteMethodCtx('receiptPdf', {
- description: 'Returns the receipt pdf',
+ description: 'Send the receipt pdf to client',
accepts: [
{
arg: 'id',
From e231b0e12b47d12affdd00ad37d2a88fda6007df Mon Sep 17 00:00:00 2001
From: guillermo
Date: Wed, 1 Mar 2023 10:11:22 +0100
Subject: [PATCH 003/300] refs #5237 Added greuge notify
---
.../email/greuge-wrong/greuge-wrong.html | 14 +++++++++++++
.../email/greuge-wrong/greuge-wrong.js | 21 +++++++++++++++++++
.../email/greuge-wrong/locale/en.yml | 5 +++++
.../email/greuge-wrong/locale/es.yml | 5 +++++
4 files changed, 45 insertions(+)
create mode 100644 print/templates/email/greuge-wrong/greuge-wrong.html
create mode 100644 print/templates/email/greuge-wrong/greuge-wrong.js
create mode 100644 print/templates/email/greuge-wrong/locale/en.yml
create mode 100644 print/templates/email/greuge-wrong/locale/es.yml
diff --git a/print/templates/email/greuge-wrong/greuge-wrong.html b/print/templates/email/greuge-wrong/greuge-wrong.html
new file mode 100644
index 000000000..4f0874268
--- /dev/null
+++ b/print/templates/email/greuge-wrong/greuge-wrong.html
@@ -0,0 +1,14 @@
+
+
+
+
+
+ {{ $t('subject') }}
+
+
+ {{ $t('title') }} {{name}}
+ {{ $t('ticketId') }} {{ticketId}}
+ {{ $t('amount') }} {{amount}}
+ {{ $t('description') }} {{description}}
+
+
\ No newline at end of file
diff --git a/print/templates/email/greuge-wrong/greuge-wrong.js b/print/templates/email/greuge-wrong/greuge-wrong.js
new file mode 100644
index 000000000..ac18c4e9b
--- /dev/null
+++ b/print/templates/email/greuge-wrong/greuge-wrong.js
@@ -0,0 +1,21 @@
+module.exports = {
+ name: 'greuge-wrong',
+ props: {
+ ticketId: {
+ type: [Number],
+ required: false
+ },
+ clientId: {
+ type: [Number],
+ required: true
+ },
+ description: {
+ type: [String],
+ required: true
+ },
+ amount: {
+ type: [Number],
+ required: true
+ }
+ },
+};
diff --git a/print/templates/email/greuge-wrong/locale/en.yml b/print/templates/email/greuge-wrong/locale/en.yml
new file mode 100644
index 000000000..67fb74ccb
--- /dev/null
+++ b/print/templates/email/greuge-wrong/locale/en.yml
@@ -0,0 +1,5 @@
+subject: A wrong greuge has been created
+title: A wrong greuge has been created for the client
+ticketId: The ticket is
+amount: The amount is
+description: The description is
\ No newline at end of file
diff --git a/print/templates/email/greuge-wrong/locale/es.yml b/print/templates/email/greuge-wrong/locale/es.yml
new file mode 100644
index 000000000..4282fd3af
--- /dev/null
+++ b/print/templates/email/greuge-wrong/locale/es.yml
@@ -0,0 +1,5 @@
+subject: Se ha creado una gruge anormal
+title: Se ha creado una gruge anormal para el cliente
+ticketId: El ticket es
+amount: El importe es
+description: La descripción es
\ No newline at end of file
From 8679aefb4881b70f46659813e3e71e52cb40846e Mon Sep 17 00:00:00 2001
From: alexandre
Date: Fri, 3 Mar 2023 07:36:04 +0100
Subject: [PATCH 004/300] refs #4713 procs deprecated, originalQuantity deleted
---
back/methods/collection/setSaleQuantity.js | 3 +--
db/changes/231001/00-saleTracking.sql | 5 +++++
2 files changed, 6 insertions(+), 2 deletions(-)
create mode 100644 db/changes/231001/00-saleTracking.sql
diff --git a/back/methods/collection/setSaleQuantity.js b/back/methods/collection/setSaleQuantity.js
index 4ac3d6d4b..0638539e3 100644
--- a/back/methods/collection/setSaleQuantity.js
+++ b/back/methods/collection/setSaleQuantity.js
@@ -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();
diff --git a/db/changes/231001/00-saleTracking.sql b/db/changes/231001/00-saleTracking.sql
new file mode 100644
index 000000000..ce9bd8505
--- /dev/null
+++ b/db/changes/231001/00-saleTracking.sql
@@ -0,0 +1,5 @@
+DROP PROCEDURE `vn`.`sale_setQuantity`;
+DROP PROCEDURE `vn`.`collection_updateSale`;
+DROP PROCEDURE `vn`.`replaceMovimientosMark`;
+DROP PROCEDURE `vn`.`saleTracking_Replace`;
+DROP PROCEDURE `vn`.`sale_updateOriginalQuantity`;
From 106f96b9a6fb77f5b5b768a8fbe4527eb19cd441 Mon Sep 17 00:00:00 2001
From: alexandre
Date: Wed, 8 Mar 2023 12:10:08 +0100
Subject: [PATCH 005/300] refs #4713 fixed front test
---
back/methods/collection/spec/setSaleQuantity.spec.js | 2 +-
db/changes/231001/.gitkeep | 0
2 files changed, 1 insertion(+), 1 deletion(-)
delete mode 100644 db/changes/231001/.gitkeep
diff --git a/back/methods/collection/spec/setSaleQuantity.spec.js b/back/methods/collection/spec/setSaleQuantity.spec.js
index 63dc3bd2d..516382606 100644
--- a/back/methods/collection/spec/setSaleQuantity.spec.js
+++ b/back/methods/collection/spec/setSaleQuantity.spec.js
@@ -15,7 +15,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();
diff --git a/db/changes/231001/.gitkeep b/db/changes/231001/.gitkeep
deleted file mode 100644
index e69de29bb..000000000
From b1c8f51e353d9f3da26a6c0c74934f165287ef63 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Thu, 9 Mar 2023 13:41:05 +0100
Subject: [PATCH 006/300] refs: #084200 mod del footer y readapatacion heade
---
db/dump/fixtures.sql | 3 +-
.../report-footer/assets/css/style.css | 1 +
.../report-footer/report-footer.html | 6 +-
.../components/report-footer/report-footer.js | 58 ++++++++++++++++++-
.../report-header/report-header.html | 2 +-
.../components/report-header/report-header.js | 3 +-
print/templates/reports/invoice/invoice.html | 2 +-
print/templates/reports/invoice/invoice.js | 7 ++-
.../templates/reports/invoice/sql/invoice.sql | 2 +-
9 files changed, 76 insertions(+), 8 deletions(-)
diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql
index 80983a318..2f1c7a806 100644
--- a/db/dump/fixtures.sql
+++ b/db/dump/fixtures.sql
@@ -543,7 +543,8 @@ INSERT INTO `vn`.`supplier`(`id`, `name`, `nickname`,`account`,`countryFk`,`nif`
VALUES
(1, 'Plants SL', 'Plants nick', 4100000001, 1, '06089160W', 0, util.VN_CURDATE(), 1, 'supplier address 1', 'PONTEVEDRA', 1, 15214, 1, 1, 15, 4, 1, 1, 18, 'flowerPlants', 1, '400664487V'),
(2, 'Farmer King', 'The farmer', 4000020002, 1, '87945234L', 0, util.VN_CURDATE(), 1, 'supplier address 2', 'GOTHAM', 2, 43022, 1, 2, 10, 93, 2, 8, 18, 'animals', 1, '400664487V'),
- (442, 'Verdnatura Levante SL', 'Verdnatura', 5115000442, 1, '06815934E', 0, util.VN_CURDATE(), 1, 'supplier address 3', 'GOTHAM', 1, 43022, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V');
+ (442, 'Verdnatura Levante SL', 'Verdnatura', 5115000442, 1, '06815934E', 0, util.VN_CURDATE(), 1, 'supplier address 3', 'GOTHAM', 1, 43022, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V'),
+ (1381, 'Ornamentales', 'Ornamentales', 7185000440, 1, '03815934E', 0, util.VN_CURDATE(), 1, 'supplier address 4', 'GOTHAM', 1, 43022, 1, 2, 15, 6, 9, 3, 18, 'complements', 1, '400664487V');
INSERT INTO `vn`.`supplierContact`(`id`, `supplierFk`, `phone`, `mobile`, `email`, `observation`, `name`)
VALUES
diff --git a/print/core/components/report-footer/assets/css/style.css b/print/core/components/report-footer/assets/css/style.css
index 9727e6f8f..b260c1b9f 100644
--- a/print/core/components/report-footer/assets/css/style.css
+++ b/print/core/components/report-footer/assets/css/style.css
@@ -4,6 +4,7 @@
margin-right: 2cm;
font-size: 10px;
color: #555;
+ width: 100%;
zoom: 0.65
}
diff --git a/print/core/components/report-footer/report-footer.html b/print/core/components/report-footer/report-footer.html
index 1af8df4d4..d71f04ed2 100644
--- a/print/core/components/report-footer/report-footer.html
+++ b/print/core/components/report-footer/report-footer.html
@@ -5,6 +5,10 @@
{{centerText}}
-
+
diff --git a/print/core/components/report-footer/report-footer.js b/print/core/components/report-footer/report-footer.js
index 1ba36b1d7..da1272673 100755
--- a/print/core/components/report-footer/report-footer.js
+++ b/print/core/components/report-footer/report-footer.js
@@ -1,4 +1,60 @@
+const db = require('../../database');
+
module.exports = {
name: 'report-footer',
- props: ['leftText', 'centerText']
+ async serverPrefetch() {
+ const companyCode = this.companyCode || 'VNL';
+
+ this.company = await this.getCompany(companyCode);
+ this.fiscalAddress = await this.getFiscalAddress(companyCode);
+ },
+ computed: {
+ companyName() {
+ if (this.company.name)
+ return this.company.name.toUpperCase();
+
+ return;
+ },
+ companyGroup() {
+ if (this.company.groupName)
+ return this.company.groupName.toLowerCase();
+
+ return;
+ },
+ companyPhone() {
+ if (!this.company.phone) return;
+
+ let phone = this.company.phone;
+
+ if (phone.length >= 13) {
+ const prefix = parseInt(phone.substr(0, 4));
+ const number = phone.substr(5, phone.length);
+ return `+${prefix} ${number}`;
+ } else
+ return phone;
+ }
+ },
+ methods: {
+ getCompany(code) {
+ return db.findOne(`
+ SELECT
+ s.name,
+ s.street,
+ s.postCode,
+ s.city,
+ s.phone,
+ cg.code AS groupName
+ FROM company c
+ JOIN companyGroup cg ON cg.id = c.companyGroupFk
+ JOIN supplier s ON s.id = c.id
+ WHERE c.code = ?`, [code]);
+ },
+ getFiscalAddress(code) {
+ return db.findOne(`
+ SELECT nif, register FROM company c
+ JOIN supplier s ON s.id = c.id
+ WHERE c.code = ?`, [code]);
+ }
+ },
+ props: ['leftText', 'companyCode', 'centerText']
};
diff --git a/print/core/components/report-header/report-header.html b/print/core/components/report-header/report-header.html
index 0479e5caf..8a3857521 100644
--- a/print/core/components/report-header/report-header.html
+++ b/print/core/components/report-header/report-header.html
@@ -8,7 +8,7 @@
{{companyName}}. {{company.street}}.
{{company.postCode}} {{company.city}}.
☎ {{companyPhone}}
- · {{$t('company.contactData')}}
+ · verdnatura.es - {{company.email}}
CIF: {{fiscalAddress.nif}} {{fiscalAddress.register}}
diff --git a/print/core/components/report-header/report-header.js b/print/core/components/report-header/report-header.js
index 50c3a1337..376495968 100755
--- a/print/core/components/report-header/report-header.js
+++ b/print/core/components/report-header/report-header.js
@@ -43,7 +43,8 @@ module.exports = {
s.postCode,
s.city,
s.phone,
- cg.code AS groupName
+ cg.code AS groupName,
+ c.email
FROM company c
JOIN companyGroup cg ON cg.id = c.companyGroupFk
JOIN supplier s ON s.id = c.id
diff --git a/print/templates/reports/invoice/invoice.html b/print/templates/reports/invoice/invoice.html
index 2d180878a..4056e9ad4 100644
--- a/print/templates/reports/invoice/invoice.html
+++ b/print/templates/reports/invoice/invoice.html
@@ -240,7 +240,7 @@
-
+
diff --git a/print/templates/reports/invoice/invoice.js b/print/templates/reports/invoice/invoice.js
index eaf17527d..a4d96edde 100755
--- a/print/templates/reports/invoice/invoice.js
+++ b/print/templates/reports/invoice/invoice.js
@@ -11,7 +11,12 @@ module.exports = {
this.client = await this.findOneFromDef('client', [this.reference]);
this.taxes = await this.rawSqlFromDef(`taxes`, [this.reference]);
this.hasIntrastat = await this.findValueFromDef(`hasIntrastat`, [this.reference]);
- this.intrastat = await this.rawSqlFromDef(`intrastat`, [this.reference, this.reference, this.reference, this.reference]);
+ this.intrastat = await this.rawSqlFromDef(`intrastat`, [
+ this.reference,
+ this.reference,
+ this.reference,
+ this.reference
+ ]);
this.rectified = await this.rawSqlFromDef(`rectified`, [this.reference]);
this.hasIncoterms = await this.findValueFromDef(`hasIncoterms`, [this.reference]);
diff --git a/print/templates/reports/invoice/sql/invoice.sql b/print/templates/reports/invoice/sql/invoice.sql
index 0f12e4f53..303fa937f 100644
--- a/print/templates/reports/invoice/sql/invoice.sql
+++ b/print/templates/reports/invoice/sql/invoice.sql
@@ -11,7 +11,7 @@ FROM invoiceOut io
JOIN client c ON c.id = io.clientFk
JOIN payMethod pm ON pm.id = c.payMethodFk
JOIN company cny ON cny.id = io.companyFk
- JOIN supplierAccount sa ON sa.id = cny.supplierAccountFk
+ LEFT JOIN supplierAccount sa ON sa.id = cny.supplierAccountFk
LEFT JOIN invoiceOutSerial ios ON ios.code = io.serial
LEFT JOIN ticket t ON t.refFk = io.ref
WHERE t.refFk = ?
\ No newline at end of file
From 9e8150dde369af9d4d53780f8c7e9e9072a1d099 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Thu, 9 Mar 2023 15:59:46 +0100
Subject: [PATCH 007/300] refs #084200 footnotes dinamico
---
print/core/components/report-footer/locale/en.yml | 2 +-
print/core/components/report-footer/locale/es.yml | 2 +-
print/core/components/report-footer/locale/fr.yml | 2 +-
print/core/components/report-footer/locale/pt.yml | 2 +-
print/core/components/report-footer/report-footer.html | 4 ++--
print/core/components/report-footer/report-footer.js | 2 ++
6 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/print/core/components/report-footer/locale/en.yml b/print/core/components/report-footer/locale/en.yml
index 3899f8b98..9a383fb06 100644
--- a/print/core/components/report-footer/locale/en.yml
+++ b/print/core/components/report-footer/locale/en.yml
@@ -1,6 +1,6 @@
numPages: Page of
law:
- privacy: 'In compliance with the provisions of Organic Law 15/1999, on the
+ vn-privacy: 'In compliance with the provisions of Organic Law 15/1999, on the
Protection of Personal Data, we inform you that the personal data you provide
will be included in automated files of VERDNATURA LEVANTE SL, being able at all
times to exercise the rights of access, rectification, cancellation and opposition,
diff --git a/print/core/components/report-footer/locale/es.yml b/print/core/components/report-footer/locale/es.yml
index 985c1e17a..c4b538fe4 100644
--- a/print/core/components/report-footer/locale/es.yml
+++ b/print/core/components/report-footer/locale/es.yml
@@ -1,6 +1,6 @@
numPages: Página de
law:
- privacy: En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección
+ vn-privacy: En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección
de Datos de Carácter Personal, le comunicamos que los datos personales que facilite
se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L., pudiendo en
todo momento ejercitar los derechos de acceso, rectificación, cancelación y oposición,
diff --git a/print/core/components/report-footer/locale/fr.yml b/print/core/components/report-footer/locale/fr.yml
index 861ee5684..da6735340 100644
--- a/print/core/components/report-footer/locale/fr.yml
+++ b/print/core/components/report-footer/locale/fr.yml
@@ -1,6 +1,6 @@
numPages: Page de
law:
- privacy: Conformément aux dispositions de la loi organique 15/1999 sur la protection
+ vn-privacy: Conformément aux dispositions de la loi organique 15/1999 sur la protection
des données personnelles, nous vous informons que les données personnelles que
vous fournissez seront incluses dans des dossiers. VERDNATURA LEVANTE S.L., vous
pouvez à tout moment, exercer les droits d'accès, de rectification, d'annulation
diff --git a/print/core/components/report-footer/locale/pt.yml b/print/core/components/report-footer/locale/pt.yml
index 1c343bb4c..b5353a9bc 100644
--- a/print/core/components/report-footer/locale/pt.yml
+++ b/print/core/components/report-footer/locale/pt.yml
@@ -1,6 +1,6 @@
numPages: Página de
law:
- privacy: Em cumprimento do disposto na lei Orgânica 15/1999, de Protecção de Dados
+ vn-privacy: Em cumprimento do disposto na lei Orgânica 15/1999, de Protecção de Dados
de Carácter Pessoal, comunicamos que os dados pessoais que facilite se incluirão
nos ficheiros automatizados de VERDNATURA LEVANTE S.L., podendo em todo momento
exercer os direitos de acesso, rectificação, cancelação e oposição, comunicando
diff --git a/print/core/components/report-footer/report-footer.html b/print/core/components/report-footer/report-footer.html
index d71f04ed2..e158485f7 100644
--- a/print/core/components/report-footer/report-footer.html
+++ b/print/core/components/report-footer/report-footer.html
@@ -6,8 +6,8 @@
diff --git a/print/core/components/report-footer/report-footer.js b/print/core/components/report-footer/report-footer.js
index da1272673..c4ae68d7e 100755
--- a/print/core/components/report-footer/report-footer.js
+++ b/print/core/components/report-footer/report-footer.js
@@ -43,6 +43,8 @@ module.exports = {
s.postCode,
s.city,
s.phone,
+ c.footnotes,
+ c.code,
cg.code AS groupName
FROM company c
JOIN companyGroup cg ON cg.id = c.companyGroupFk
From 08bda1b05b8229283b487c181598396b0736de61 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Mon, 13 Mar 2023 08:09:28 +0100
Subject: [PATCH 008/300] refs #084200 ultimos cambios footnotes
---
print/core/components/report-footer/locale/en.yml | 6 ++++--
print/core/components/report-footer/locale/es.yml | 5 +++--
print/core/components/report-footer/locale/fr.yml | 5 +++--
print/core/components/report-footer/locale/pt.yml | 5 +++--
print/core/components/report-footer/report-footer.html | 2 +-
5 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/print/core/components/report-footer/locale/en.yml b/print/core/components/report-footer/locale/en.yml
index 9a383fb06..66f361234 100644
--- a/print/core/components/report-footer/locale/en.yml
+++ b/print/core/components/report-footer/locale/en.yml
@@ -1,8 +1,10 @@
numPages: Page of
law:
- vn-privacy: 'In compliance with the provisions of Organic Law 15/1999, on the
+ vnPrivacy: In compliance with the provisions of Organic Law 15/1999, on the
Protection of Personal Data, we inform you that the personal data you provide
will be included in automated files of VERDNATURA LEVANTE SL, being able at all
times to exercise the rights of access, rectification, cancellation and opposition,
communicating it in writing to the registered office of the entity.
- The purpose of the file is administrative management, accounting, and billing.'
+ The purpose of the file is administrative management, accounting, and billing.
+ ornPrivacy: Texto de ejemplo.
+
diff --git a/print/core/components/report-footer/locale/es.yml b/print/core/components/report-footer/locale/es.yml
index c4b538fe4..4fce40b0a 100644
--- a/print/core/components/report-footer/locale/es.yml
+++ b/print/core/components/report-footer/locale/es.yml
@@ -1,8 +1,9 @@
numPages: Página de
law:
- vn-privacy: En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección
+ vnPrivacy: En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección
de Datos de Carácter Personal, le comunicamos que los datos personales que facilite
se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L., pudiendo en
todo momento ejercitar los derechos de acceso, rectificación, cancelación y oposición,
comunicándolo por escrito al domicilio social de la entidad. La finalidad del
- fichero es la gestión administrativa, contabilidad, y facturación.
+ fichero es la gestión administrativa, contabilidad, y facturación.
+ ornPrivacy: Texto de ejemplo.
\ No newline at end of file
diff --git a/print/core/components/report-footer/locale/fr.yml b/print/core/components/report-footer/locale/fr.yml
index da6735340..d7347a813 100644
--- a/print/core/components/report-footer/locale/fr.yml
+++ b/print/core/components/report-footer/locale/fr.yml
@@ -1,8 +1,9 @@
numPages: Page de
law:
- vn-privacy: Conformément aux dispositions de la loi organique 15/1999 sur la protection
+ vnPrivacy: Conformément aux dispositions de la loi organique 15/1999 sur la protection
des données personnelles, nous vous informons que les données personnelles que
vous fournissez seront incluses dans des dossiers. VERDNATURA LEVANTE S.L., vous
pouvez à tout moment, exercer les droits d'accès, de rectification, d'annulation
et d'opposition, en communiquant par écrit au siège social de la société. Le dossier
- a pour objet la gestion administrative, la comptabilité et la facturation.
+ a pour objet la gestion administrative, la comptabilité et la facturation.
+ ornPrivacy: Texto de ejemplo.
\ No newline at end of file
diff --git a/print/core/components/report-footer/locale/pt.yml b/print/core/components/report-footer/locale/pt.yml
index b5353a9bc..f0d5ec48a 100644
--- a/print/core/components/report-footer/locale/pt.yml
+++ b/print/core/components/report-footer/locale/pt.yml
@@ -1,8 +1,9 @@
numPages: Página de
law:
- vn-privacy: Em cumprimento do disposto na lei Orgânica 15/1999, de Protecção de Dados
+ vnPrivacy: Em cumprimento do disposto na lei Orgânica 15/1999, de Protecção de Dados
de Carácter Pessoal, comunicamos que os dados pessoais que facilite se incluirão
nos ficheiros automatizados de VERDNATURA LEVANTE S.L., podendo em todo momento
exercer os direitos de acesso, rectificação, cancelação e oposição, comunicando
por escrito ao domicílio social da entidade. A finalidade do ficheiro é a gestão
- administrativa, contabilidade e facturação.
+ administrativa, contabilidade e facturação.
+ ornPrivacy: Texto de ejemplo.
\ No newline at end of file
diff --git a/print/core/components/report-footer/report-footer.html b/print/core/components/report-footer/report-footer.html
index e158485f7..6461529a9 100644
--- a/print/core/components/report-footer/report-footer.html
+++ b/print/core/components/report-footer/report-footer.html
@@ -7,7 +7,7 @@
From b5394d3925251a50e6a20346a8aa1818a1ccf952 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Mon, 13 Mar 2023 12:52:41 +0100
Subject: [PATCH 009/300] refs #084200 footer finalizado, web personalizado
---
db/changes/231001/00-newTableWeb.sql | 1 +
.../components/report-footer/locale/en.yml | 5 +-
.../components/report-footer/locale/es.yml | 4 +-
.../components/report-footer/locale/fr.yml | 4 +-
.../components/report-footer/locale/pt.yml | 4 +-
.../report-footer/report-footer.html | 11 +++--
.../components/report-footer/report-footer.js | 46 ++-----------------
.../report-header/report-header.html | 2 +-
.../components/report-header/report-header.js | 3 +-
print/templates/reports/invoice/invoice.html | 2 +-
10 files changed, 22 insertions(+), 60 deletions(-)
create mode 100644 db/changes/231001/00-newTableWeb.sql
diff --git a/db/changes/231001/00-newTableWeb.sql b/db/changes/231001/00-newTableWeb.sql
new file mode 100644
index 000000000..305ebec8b
--- /dev/null
+++ b/db/changes/231001/00-newTableWeb.sql
@@ -0,0 +1 @@
+ALTER TABLE vn.company ADD web varchar(100) NULL;
\ No newline at end of file
diff --git a/print/core/components/report-footer/locale/en.yml b/print/core/components/report-footer/locale/en.yml
index 66f361234..df871913e 100644
--- a/print/core/components/report-footer/locale/en.yml
+++ b/print/core/components/report-footer/locale/en.yml
@@ -1,10 +1,9 @@
numPages: Page of
law:
- vnPrivacy: In compliance with the provisions of Organic Law 15/1999, on the
+ vnprivacy: In compliance with the provisions of Organic Law 15/1999, on the
Protection of Personal Data, we inform you that the personal data you provide
will be included in automated files of VERDNATURA LEVANTE SL, being able at all
times to exercise the rights of access, rectification, cancellation and opposition,
communicating it in writing to the registered office of the entity.
The purpose of the file is administrative management, accounting, and billing.
- ornPrivacy: Texto de ejemplo.
-
+ ornprivacy:
diff --git a/print/core/components/report-footer/locale/es.yml b/print/core/components/report-footer/locale/es.yml
index 4fce40b0a..5b72fe78b 100644
--- a/print/core/components/report-footer/locale/es.yml
+++ b/print/core/components/report-footer/locale/es.yml
@@ -1,9 +1,9 @@
numPages: Página de
law:
- vnPrivacy: En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección
+ vnprivacy: En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección
de Datos de Carácter Personal, le comunicamos que los datos personales que facilite
se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L., pudiendo en
todo momento ejercitar los derechos de acceso, rectificación, cancelación y oposición,
comunicándolo por escrito al domicilio social de la entidad. La finalidad del
fichero es la gestión administrativa, contabilidad, y facturación.
- ornPrivacy: Texto de ejemplo.
\ No newline at end of file
+ ornprivacy:
\ No newline at end of file
diff --git a/print/core/components/report-footer/locale/fr.yml b/print/core/components/report-footer/locale/fr.yml
index d7347a813..a4174105f 100644
--- a/print/core/components/report-footer/locale/fr.yml
+++ b/print/core/components/report-footer/locale/fr.yml
@@ -1,9 +1,9 @@
numPages: Page de
law:
- vnPrivacy: Conformément aux dispositions de la loi organique 15/1999 sur la protection
+ vnprivacy: Conformément aux dispositions de la loi organique 15/1999 sur la protection
des données personnelles, nous vous informons que les données personnelles que
vous fournissez seront incluses dans des dossiers. VERDNATURA LEVANTE S.L., vous
pouvez à tout moment, exercer les droits d'accès, de rectification, d'annulation
et d'opposition, en communiquant par écrit au siège social de la société. Le dossier
a pour objet la gestion administrative, la comptabilité et la facturation.
- ornPrivacy: Texto de ejemplo.
\ No newline at end of file
+ ornprivacy:
\ No newline at end of file
diff --git a/print/core/components/report-footer/locale/pt.yml b/print/core/components/report-footer/locale/pt.yml
index f0d5ec48a..e9f6e516f 100644
--- a/print/core/components/report-footer/locale/pt.yml
+++ b/print/core/components/report-footer/locale/pt.yml
@@ -1,9 +1,9 @@
numPages: Página de
law:
- vnPrivacy: Em cumprimento do disposto na lei Orgânica 15/1999, de Protecção de Dados
+ vnprivacy: Em cumprimento do disposto na lei Orgânica 15/1999, de Protecção de Dados
de Carácter Pessoal, comunicamos que os dados pessoais que facilite se incluirão
nos ficheiros automatizados de VERDNATURA LEVANTE S.L., podendo em todo momento
exercer os direitos de acesso, rectificação, cancelação e oposição, comunicando
por escrito ao domicílio social da entidade. A finalidade do ficheiro é a gestão
administrativa, contabilidade e facturação.
- ornPrivacy: Texto de ejemplo.
\ No newline at end of file
+ ornprivacy:
\ No newline at end of file
diff --git a/print/core/components/report-footer/report-footer.html b/print/core/components/report-footer/report-footer.html
index 6461529a9..447091f9b 100644
--- a/print/core/components/report-footer/report-footer.html
+++ b/print/core/components/report-footer/report-footer.html
@@ -5,10 +5,11 @@
{{centerText}}
-
+
+
+
diff --git a/print/core/components/report-footer/report-footer.js b/print/core/components/report-footer/report-footer.js
index c4ae68d7e..4debfce12 100755
--- a/print/core/components/report-footer/report-footer.js
+++ b/print/core/components/report-footer/report-footer.js
@@ -3,60 +3,20 @@ const db = require('../../database');
module.exports = {
name: 'report-footer',
async serverPrefetch() {
- const companyCode = this.companyCode || 'VNL';
-
- this.company = await this.getCompany(companyCode);
- this.fiscalAddress = await this.getFiscalAddress(companyCode);
- },
- computed: {
- companyName() {
- if (this.company.name)
- return this.company.name.toUpperCase();
-
- return;
- },
- companyGroup() {
- if (this.company.groupName)
- return this.company.groupName.toLowerCase();
-
- return;
- },
- companyPhone() {
- if (!this.company.phone) return;
-
- let phone = this.company.phone;
-
- if (phone.length >= 13) {
- const prefix = parseInt(phone.substr(0, 4));
- const number = phone.substr(5, phone.length);
- return `+${prefix} ${number}`;
- } else
- return phone;
- }
+ this.company = await this.getCompany(this.companyCode);
},
methods: {
getCompany(code) {
return db.findOne(`
SELECT
- s.name,
- s.street,
- s.postCode,
- s.city,
- s.phone,
c.footnotes,
- c.code,
- cg.code AS groupName
+ c.code
FROM company c
JOIN companyGroup cg ON cg.id = c.companyGroupFk
JOIN supplier s ON s.id = c.id
WHERE c.code = ?`, [code]);
- },
- getFiscalAddress(code) {
- return db.findOne(`
- SELECT nif, register FROM company c
- JOIN supplier s ON s.id = c.id
- WHERE c.code = ?`, [code]);
}
},
props: ['leftText', 'companyCode', 'centerText']
+
};
diff --git a/print/core/components/report-header/report-header.html b/print/core/components/report-header/report-header.html
index 8a3857521..22f2068e2 100644
--- a/print/core/components/report-header/report-header.html
+++ b/print/core/components/report-header/report-header.html
@@ -8,7 +8,7 @@
{{companyName}}. {{company.street}}.
{{company.postCode}} {{company.city}}.
☎ {{companyPhone}}
- · verdnatura.es - {{company.email}}
+ · {{company.web}} - {{company.email}}
CIF: {{fiscalAddress.nif}} {{fiscalAddress.register}}
diff --git a/print/core/components/report-header/report-header.js b/print/core/components/report-header/report-header.js
index 376495968..d85e2c836 100755
--- a/print/core/components/report-header/report-header.js
+++ b/print/core/components/report-header/report-header.js
@@ -44,7 +44,8 @@ module.exports = {
s.city,
s.phone,
cg.code AS groupName,
- c.email
+ c.email,
+ c.web
FROM company c
JOIN companyGroup cg ON cg.id = c.companyGroupFk
JOIN supplier s ON s.id = c.id
diff --git a/print/templates/reports/invoice/invoice.html b/print/templates/reports/invoice/invoice.html
index 4056e9ad4..4a8257c1d 100644
--- a/print/templates/reports/invoice/invoice.html
+++ b/print/templates/reports/invoice/invoice.html
@@ -3,7 +3,7 @@
-
+
From d05ddef5fae0d3826a2807c151b04b9f6ba88d4f Mon Sep 17 00:00:00 2001
From: carlossa
Date: Wed, 22 Mar 2023 14:54:59 +0100
Subject: [PATCH 010/300] refs #084200 primer commit companyI18n
---
db/changes/231001/00-newCompanyI18n.sql | 9 +++++++++
.../components/report-footer/report-footer.html | 2 +-
.../core/components/report-footer/report-footer.js | 14 +++++++-------
3 files changed, 17 insertions(+), 8 deletions(-)
create mode 100644 db/changes/231001/00-newCompanyI18n.sql
diff --git a/db/changes/231001/00-newCompanyI18n.sql b/db/changes/231001/00-newCompanyI18n.sql
new file mode 100644
index 000000000..0aad8527b
--- /dev/null
+++ b/db/changes/231001/00-newCompanyI18n.sql
@@ -0,0 +1,9 @@
+-- vn.companyI18n definition
+
+CREATE TABLE `companyI18n` (
+ `companyFk` smallint(5) unsigned NOT NULL,
+ `lang` char(2) CHARACTER SET utf8mb3 NOT NULL,
+ `footnotes` longtext COLLATE utf8mb3_unicode_ci DEFAULT NULL,
+ PRIMARY KEY (`companyFk`,`lang`),
+ CONSTRAINT `companyI18n_FK` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
\ No newline at end of file
diff --git a/print/core/components/report-footer/report-footer.html b/print/core/components/report-footer/report-footer.html
index 447091f9b..62d0d9ae6 100644
--- a/print/core/components/report-footer/report-footer.html
+++ b/print/core/components/report-footer/report-footer.html
@@ -8,7 +8,7 @@
+ v-html="$18n.locale(`${company.footnotes}`)">
diff --git a/print/core/components/report-footer/report-footer.js b/print/core/components/report-footer/report-footer.js
index 4debfce12..5027bcf7a 100755
--- a/print/core/components/report-footer/report-footer.js
+++ b/print/core/components/report-footer/report-footer.js
@@ -8,13 +8,13 @@ module.exports = {
methods: {
getCompany(code) {
return db.findOne(`
- SELECT
- c.footnotes,
- c.code
- FROM company c
- JOIN companyGroup cg ON cg.id = c.companyGroupFk
- JOIN supplier s ON s.id = c.id
- WHERE c.code = ?`, [code]);
+ SELECT
+ (SELECT ci.footnotes FROM companyI18n ci WHERE ci.companyFk = c.id) AS footnotes,
+ c.code
+ FROM company c
+ JOIN companyGroup cg ON cg.id = c.companyGroupFk
+ JOIN supplier s ON s.id = c.id
+ WHERE c.code = ?`);
}
},
props: ['leftText', 'companyCode', 'centerText']
From e1f7ba134363bcac2c0983573385c022317ed161 Mon Sep 17 00:00:00 2001
From: vicent
Date: Thu, 23 Mar 2023 10:37:46 +0100
Subject: [PATCH 011/300] =?UTF-8?q?refs=20#5456=20feat:=20actualizada=20tr?=
=?UTF-8?q?aduccion=20en=20castellano=20y=20a=C3=B1adida=20en=20portugues?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../email/client-welcome/locale/es.yml | 8 ++--
.../email/client-welcome/locale/pt.yml | 47 +++++++++++++++++++
2 files changed, 52 insertions(+), 3 deletions(-)
create mode 100644 print/templates/email/client-welcome/locale/pt.yml
diff --git a/print/templates/email/client-welcome/locale/es.yml b/print/templates/email/client-welcome/locale/es.yml
index 478fd242c..1f3ef3704 100644
--- a/print/templates/email/client-welcome/locale/es.yml
+++ b/print/templates/email/client-welcome/locale/es.yml
@@ -24,9 +24,11 @@ sections:
dicho stock puede variar en función de la fecha seleccionada al configurar el
pedido. Es importante CONFIRMAR los pedidos para que la mercancía quede reservada.
delivery: El reparto se realiza de lunes a sábado según la zona en la que te encuentres.
- Por regla general, los pedidos que se entregan por agencia, deben estar confirmados
- y pagados antes de las 17h del día en que se preparan (el día anterior a recibirlos),
- aunque esto puede variar si el pedido se envía a través de nuestro reparto y
+ Los pedidos que se entregan por agencia o por reparto Verdnatura deben estar confirmados y pagados
+ antes del cierre de la correspondiente ruta el mismo día de preparación del pedido. Este horario
+ puede variar mucho en función de la ruta y del volumen de pedidos para ese día, por lo que es
+ recomendable no apurar el tiempo y dejar todo listo a primera hora del día de preparación del pedido.
+ Aunque esto puede variar si el pedido se envía a través de nuestro reparto y
según la zona.
howToPay:
title: Cómo pagar
diff --git a/print/templates/email/client-welcome/locale/pt.yml b/print/templates/email/client-welcome/locale/pt.yml
new file mode 100644
index 000000000..708878d8b
--- /dev/null
+++ b/print/templates/email/client-welcome/locale/pt.yml
@@ -0,0 +1,47 @@
+subject: Bem-Vindo à Verdnatura
+title: "Damos-te as boas-vindas!"
+dearClient: Estimado cliente
+clientData: 'Os teus dados para poder comprar no site da Verdnatura (https://shop.verdnatura.es) ou nas apps para iOS e Android, são'
+clientId: Identificador de cliente
+user: Utilizador
+password: Palavra-passe
+passwordResetText: Clique em 'Esqueceu a sua palavra-passe?'
+sections:
+ howToBuy:
+ title: Como fazer uma encomenda
+ description: 'Para realizar uma encomenda no nosso site, deves configurá-la indicando:'
+ requeriments:
+ - Se queres receber a encomenda (por agência ou o nosso próprio transporte) ou se preferes levantá-lo em algum dos nossos armazéns.
+ - A data que queres receber a encomenda (se preparará no dia anterior).
+ - A morada de entrega ou armazém aonde queres levantar a encomenda.
+ stock: No nosso site e apps podes visualizar o estoque disponível de
+ flor-de-corte, verduras, plantas, acessórios e artificial. Tenha presente que
+ dito estoque pode variar em função da data escolhida ao configurar a
+ encomenda. É importante confirmar as encomendas para que a mercadoria fique reservada.
+ delivery: O transporte se realiza de terça a sabado. As encomendas que se entreguem por agências ou transporte Verdnatura, devem estar confirmadas e pagas até
+ antes do horário de encerre da correspondente rota do dia de preparação da mesma. Este horario
+ pode variar muito em função da rota e o volume de encomendas deste dia, pelo qual é
+ recomendável não esperar à última hora e deixar tudo pronto à primeira hora do dia de preparação. Ainda que isto possa variar se a encomenda se envia através do nosso transporte
+ dependendo da zona.
+ howToPay:
+ title: Como pagar
+ description: 'As formas de pagamentos admitidas na Verdnatura são:'
+ options:
+ - Com cartão através da plataforma de pagamentos (ao confirmar a encomenda ou entrando em Encomendas > Confirmadas).
+ - Mediante débito automatico mensual , modalidade que deve-se solicitar e tramitar.
+ toConsider:
+ title: Coisas a ter em conta
+ description: A Verdnatura vende EXCLUSIVAMENTE a profissionais, pelo qual deves
+ remetir-nos o documento de Inicio de Actividade, para comprobar-mos que o vosso CAE
+ esteja relacionado com o mundo das flores.
+ claimsPolicy:
+ title: POLÍTICA DE RECLAMAÇÕES
+ description: A Verdnatura aceitará as reclamações que se realizem dentro dos
+ dois dias naturais seguintes à recepção da encomenda (incluindo o mesmo
+ dia da receção). Passado este prazo não se aceitará nenhuma reclamação.
+help: Qualquer dúvida que lhe surja, não hesite em consultá-la estamos
+ para atender-te!
+salesPersonName: Sou o seu asesor comercial e o meu nome é
+salesPersonPhone: Telemovel e whatsapp
+salesPersonEmail: Correio eletrônico
+
From 1302665d9860544b12d9b2f8fd8eaa1e13b85e67 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Mon, 27 Mar 2023 10:00:00 +0200
Subject: [PATCH 012/300] refs #5436 showSucces
---
modules/claim/front/descriptor/index.js | 4 ++++
modules/claim/front/locale/es.yml | 1 +
2 files changed, 5 insertions(+)
diff --git a/modules/claim/front/descriptor/index.js b/modules/claim/front/descriptor/index.js
index 0dddadbe1..95eb7e977 100644
--- a/modules/claim/front/descriptor/index.js
+++ b/modules/claim/front/descriptor/index.js
@@ -17,6 +17,10 @@ class Controller extends Descriptor {
}
sendPickupOrder() {
+ if (!this.claim.client.email) {
+ this.vnApp.showSuccess(this.$t('The client does not have an email'));
+ return;
+ }
return this.vnEmail.send(`Claims/${this.claim.id}/claim-pickup-email`, {
recipient: this.claim.client.email,
recipientId: this.claim.clientFk
diff --git a/modules/claim/front/locale/es.yml b/modules/claim/front/locale/es.yml
index 419e62f56..f6dac2b83 100644
--- a/modules/claim/front/locale/es.yml
+++ b/modules/claim/front/locale/es.yml
@@ -20,3 +20,4 @@ Photos: Fotos
Go to the claim: Ir a la reclamación
Sale tracking: Líneas preparadas
Ticket tracking: Estados del ticket
+The client does not have an email: El cliente no tiene email
From aad8fb0a66c4d90f9a045d449cb80198cc3b26e2 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Mon, 27 Mar 2023 13:11:38 +0200
Subject: [PATCH 013/300] refs #084200 i18n
---
db/changes/231001/00-newCompanyI18n.sql | 4 +++-
print/core/components/report-footer/report-footer.html | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/db/changes/231001/00-newCompanyI18n.sql b/db/changes/231001/00-newCompanyI18n.sql
index 0aad8527b..b420fafb3 100644
--- a/db/changes/231001/00-newCompanyI18n.sql
+++ b/db/changes/231001/00-newCompanyI18n.sql
@@ -1,4 +1,5 @@
-- vn.companyI18n definition
+USE vn;
CREATE TABLE `companyI18n` (
`companyFk` smallint(5) unsigned NOT NULL,
@@ -6,4 +7,5 @@ CREATE TABLE `companyI18n` (
`footnotes` longtext COLLATE utf8mb3_unicode_ci DEFAULT NULL,
PRIMARY KEY (`companyFk`,`lang`),
CONSTRAINT `companyI18n_FK` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
\ No newline at end of file
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+
diff --git a/print/core/components/report-footer/report-footer.html b/print/core/components/report-footer/report-footer.html
index 62d0d9ae6..957fe106a 100644
--- a/print/core/components/report-footer/report-footer.html
+++ b/print/core/components/report-footer/report-footer.html
@@ -8,7 +8,7 @@
+ v-html="$i18n.locale(`${company.footnotes}`)">
From 14f8f98fe987e9d5a3a90b81b5dde2d95dd4e48d Mon Sep 17 00:00:00 2001
From: carlossa
Date: Mon, 27 Mar 2023 15:15:15 +0200
Subject: [PATCH 014/300] refs #084200 findOne
---
.../components/report-footer/report-footer.js | 24 ++++++++-----------
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/print/core/components/report-footer/report-footer.js b/print/core/components/report-footer/report-footer.js
index 5027bcf7a..d8bc9ea3d 100755
--- a/print/core/components/report-footer/report-footer.js
+++ b/print/core/components/report-footer/report-footer.js
@@ -3,20 +3,16 @@ const db = require('../../database');
module.exports = {
name: 'report-footer',
async serverPrefetch() {
- this.company = await this.getCompany(this.companyCode);
- },
- methods: {
- getCompany(code) {
- return db.findOne(`
- SELECT
- (SELECT ci.footnotes FROM companyI18n ci WHERE ci.companyFk = c.id) AS footnotes,
- c.code
- FROM company c
- JOIN companyGroup cg ON cg.id = c.companyGroupFk
- JOIN supplier s ON s.id = c.id
- WHERE c.code = ?`);
- }
+ const company = await db.findOne(`
+ SELECT
+ (SELECT ci.footnotes FROM companyI18n ci WHERE ci.companyFk = c.id) AS footnotes,
+ c.code
+ FROM company c
+ JOIN companyGroup cg ON cg.id = c.companyGroupFk
+ JOIN supplier s ON s.id = c.id
+ WHERE c.code = ?`, [this.companyCode]);
+
+ this.company = company;
},
props: ['leftText', 'companyCode', 'centerText']
-
};
From 71220c58f7b27dcb76490141bce945443284caa1 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Wed, 29 Mar 2023 12:00:01 +0200
Subject: [PATCH 015/300] refs #084200 inserts
---
db/changes/231001/00-insertI18n.sql | 9 +++++++++
1 file changed, 9 insertions(+)
create mode 100644 db/changes/231001/00-insertI18n.sql
diff --git a/db/changes/231001/00-insertI18n.sql b/db/changes/231001/00-insertI18n.sql
new file mode 100644
index 000000000..2baa6c9ab
--- /dev/null
+++ b/db/changes/231001/00-insertI18n.sql
@@ -0,0 +1,9 @@
+-- Auto-generated SQL script #202303291013
+INSERT INTO vn.companyI18n (companyFk,lang,footnotes)
+ VALUES (442,'en','In compliance with the provisions of Organic Law 15/1999, on the Protection of Personal Data, we inform you that the personal data you provide will be included in automated files of VERDNATURA LEVANTE SL, being able at all times to exercise the rights of access, rectification, cancellation and opposition, communicating it in writing to the registered office of the entity. The purpose of the file is administrative management, accounting, and billing.');
+INSERT INTO vn.companyI18n (companyFk,lang,footnotes)
+ VALUES (442,'es','En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección de Datos de Carácter Personal, le comunicamos que los datos personales que facilite se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L., pudiendo en todo momento ejercitar los derechos de acceso, rectificación, cancelación y oposición, comunicándolo por escrito al domicilio social de la entidad. La finalidad del fichero es la gestión administrativa, contabilidad, y facturación.');
+INSERT INTO vn.companyI18n (companyFk,lang,footnotes)
+ VALUES (442,'fr','Conformément aux dispositions de la loi organique 15/1999 sur la protection des données personnelles, nous vous informons que les données personnelles que vous fournissez seront incluses dans des dossiers. VERDNATURA LEVANTE S.L., vous pouvez à tout moment, exercer les droits d``accès, de rectification, d``annulation et d``opposition, en communiquant par écrit au siège social de la société. Le dossier a pour objet la gestion administrative, la comptabilité et la facturation.');
+INSERT INTO vn.companyI18n (companyFk,lang,footnotes)
+ VALUES (442,'pt','Em cumprimento do disposto na lei Orgânica 15/1999, de Protecção de Dados de Carácter Pessoal, comunicamos que os dados pessoais que facilite se incluirão nos ficheiros automatizados de VERDNATURA LEVANTE S.L., podendo em todo momento exercer os direitos de acesso, rectificação, cancelação e oposição, comunicando por escrito ao domicílio social da entidade. A finalidade do ficheiro é a gestão administrativa, contabilidade e facturação.');
From 9be06c6f4b615277af3cb18154b644a599bee2fe Mon Sep 17 00:00:00 2001
From: carlossa
Date: Wed, 29 Mar 2023 12:07:45 +0200
Subject: [PATCH 016/300] refs #084200 arreglo lang
---
print/core/components/report-footer/report-footer.js | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/print/core/components/report-footer/report-footer.js b/print/core/components/report-footer/report-footer.js
index d8bc9ea3d..be40d376e 100755
--- a/print/core/components/report-footer/report-footer.js
+++ b/print/core/components/report-footer/report-footer.js
@@ -5,11 +5,12 @@ module.exports = {
async serverPrefetch() {
const company = await db.findOne(`
SELECT
- (SELECT ci.footnotes FROM companyI18n ci WHERE ci.companyFk = c.id) AS footnotes,
+ ci.footnotes,
c.code
FROM company c
- JOIN companyGroup cg ON cg.id = c.companyGroupFk
- JOIN supplier s ON s.id = c.id
+ JOIN companyI18n ci ON ci.companyFk = c.id AND ci.lang = ?
+ JOIN companyGroup cg ON cg.id = c.companyGroupFk
+ JOIN supplier s ON s.id = c.id
WHERE c.code = ?`, [this.companyCode]);
this.company = company;
From 5b80951e3eaf1a4734a9894111f914db75cff888 Mon Sep 17 00:00:00 2001
From: Juan Ferrer Toribio
Date: Mon, 3 Apr 2023 03:54:35 +0200
Subject: [PATCH 017/300] refs #5517 vnLog: View improved
---
front/core/components/index.js | 1 +
front/core/components/json-value/index.html | 1 +
front/core/components/json-value/index.js | 56 +++++++
front/core/components/json-value/style.scss | 21 +++
front/core/components/table/style.scss | 21 ++-
front/salix/components/log/index.html | 144 ++++++++++-------
front/salix/components/log/index.js | 44 +++---
front/salix/components/log/locale/es.yml | 1 +
front/salix/components/log/style.scss | 161 ++++++++++++++------
9 files changed, 313 insertions(+), 137 deletions(-)
create mode 100644 front/core/components/json-value/index.html
create mode 100644 front/core/components/json-value/index.js
create mode 100644 front/core/components/json-value/style.scss
diff --git a/front/core/components/index.js b/front/core/components/index.js
index 86ab89212..44b8beb45 100644
--- a/front/core/components/index.js
+++ b/front/core/components/index.js
@@ -32,6 +32,7 @@ import './float-button';
import './icon-menu';
import './icon-button';
import './input-number';
+import './json-value';
import './label-value';
import './range';
import './input-time';
diff --git a/front/core/components/json-value/index.html b/front/core/components/json-value/index.html
new file mode 100644
index 000000000..dc1c97709
--- /dev/null
+++ b/front/core/components/json-value/index.html
@@ -0,0 +1 @@
+
diff --git a/front/core/components/json-value/index.js b/front/core/components/json-value/index.js
new file mode 100644
index 000000000..c92227ed3
--- /dev/null
+++ b/front/core/components/json-value/index.js
@@ -0,0 +1,56 @@
+import ngModule from '../../module';
+import Component from 'core/lib/component';
+import './style.scss';
+
+const maxStrLen = 25;
+
+/**
+ * Displays pretty JSON value.
+ *
+ * @property {*} value The value
+ */
+export default class Controller extends Component {
+ get value() {
+ return this._value;
+ }
+
+ set value(value) {
+ this._value = value;
+ const span = this.element;
+ const formattedValue = this.formatValue(value);
+ span.textContent = formattedValue;
+ span.title = typeof value == 'string' && value.length > maxStrLen ? value : '';
+ span.className = `js-${value == null ? 'null' : typeof value}`;
+ }
+
+ formatValue(value) {
+ if (value == null) return '∅';
+ switch (typeof value) {
+ case 'boolean':
+ return value ? '✓' : '✗';
+ case 'string':
+ return value.length <= maxStrLen
+ ? value
+ : value.substring(0, maxStrLen) + '...';
+ case 'object':
+ if (value instanceof Date) {
+ const hasZeroTime =
+ value.getHours() === 0 &&
+ value.getMinutes() === 0 &&
+ value.getSeconds() === 0;
+ const format = hasZeroTime ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm:ss';
+ return this.$filter('date')(value, format);
+ } else
+ return value;
+ default:
+ return value;
+ }
+ }
+}
+
+ngModule.vnComponent('vnJsonValue', {
+ controller: Controller,
+ bindings: {
+ value: ''
+ }
+});
diff --git a/front/core/components/json-value/style.scss b/front/core/components/json-value/style.scss
new file mode 100644
index 000000000..cd9b5fae6
--- /dev/null
+++ b/front/core/components/json-value/style.scss
@@ -0,0 +1,21 @@
+vn-json-value {
+ display: inline;
+
+ &.js-string {
+ color: #d172cc;
+ }
+ &.js-object {
+ /*color: #d1a572;*/
+ color: #d172cc;
+ }
+ &.js-number {
+ color: #85d0ff;
+ }
+ &.js-boolean {
+ color: #7dc489;
+ }
+ &.js-null {
+ color: #cd7c7c;
+ font-style: italic;
+ }
+}
diff --git a/front/core/components/table/style.scss b/front/core/components/table/style.scss
index 557268661..2e5d225fd 100644
--- a/front/core/components/table/style.scss
+++ b/front/core/components/table/style.scss
@@ -41,10 +41,15 @@ vn-table {
display: table-row;
height: 48px;
}
- vn-thead, .vn-thead,
- vn-tbody, .vn-tbody,
- vn-tfoot, .vn-tfoot,
- thead, tbody, tfoot {
+ & > thead,
+ & > tbody,
+ & > tfoot,
+ & > vn-thead,
+ & > vn-tbody,
+ & > vn-tfoot,
+ & > .vn-thead,
+ & > .vn-tbody,
+ & > .vn-tfoot {
& > * {
display: table-row;
@@ -111,14 +116,14 @@ vn-table {
color: inherit;
}
}
- a.vn-tbody {
+ & > a.vn-tbody {
&.clickable {
@extend %clickable;
}
}
- vn-tbody > *,
- .vn-tbody > *,
- tbody > * {
+ & > vn-tbody > *,
+ & > .vn-tbody > *,
+ & > tbody > * {
border-bottom: $border-thin;
&:last-child {
diff --git a/front/salix/components/log/index.html b/front/salix/components/log/index.html
index 79dfcef8c..1bb8b1705 100644
--- a/front/salix/components/log/index.html
+++ b/front/salix/components/log/index.html
@@ -9,63 +9,99 @@
limit="20"
auto-load="true">
-
+
-
-
-
- Date
- User
- Model
- Action
- Name
- Changes
-
-
-
-
-
- {{::log.creationDate | date:'dd/MM/yyyy HH:mm'}}
-
-
- {{::log.user.name || 'System' | translate}}
+
+
+
+
+ Action
+
+
+ Model
+
+
+ Date
+
+
+
+
+
+
+
+
+ {{::$ctrl.actionsText[log.action]}}
+
+
+
+
+
+
+
+
+
+
+
+ {{::prop.name}}:
+ ,
+
+
+
+ {{::prop.name}}:
+
+
+ ←
+
+
+
+
+
+ {{::log.description}}
+
+
+ No changes
+
+
-
-
-
-
+
+
+
+
diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js
index 1c54aa9b8..f1eedf72e 100644
--- a/front/salix/components/log/index.js
+++ b/front/salix/components/log/index.js
@@ -13,6 +13,12 @@ export default class Controller extends Section {
delete: 'Deletes',
select: 'Views'
};
+ this.actionsClass = {
+ insert: 'success',
+ update: 'warning',
+ delete: 'alert',
+ select: 'notice'
+ };
this.filter = {
include: [{
relation: 'user',
@@ -50,8 +56,8 @@ export default class Controller extends Section {
for (const prop of props) {
log.props.push({
name: locale[prop] || prop,
- old: this.formatValue(oldValues[prop]),
- new: this.formatValue(newValues[prop])
+ old: this.castValue(oldValues[prop]),
+ new: this.castValue(newValues[prop])
});
}
}
@@ -61,31 +67,19 @@ export default class Controller extends Section {
return !(this.changedModel && this.changedModelId);
}
- formatValue(value) {
- let type = typeof value;
+ castValue(value) {
+ return typeof value === 'string' && validDate.test(value)
+ ? new Date(value)
+ : value;
+ }
- if (type === 'string' && validDate.test(value)) {
- value = new Date(value);
- type = typeof value;
- }
+ mainVal(prop, action) {
+ return action == 'delete' ? prop.old : prop.new;
+ }
- switch (type) {
- case 'boolean':
- return value ? '✓' : '✗';
- case 'object':
- if (value instanceof Date) {
- const hasZeroTime =
- value.getHours() === 0 &&
- value.getMinutes() === 0 &&
- value.getSeconds() === 0;
- const format = hasZeroTime ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm:ss';
- return this.$filter('date')(value, format);
- }
- else
- return value;
- default:
- return value;
- }
+ toggleAttributes(log, changesEl, force) {
+ log.expand = force;
+ changesEl.classList.toggle('expanded', force);
}
showWorkerDescriptor(event, workerId) {
diff --git a/front/salix/components/log/locale/es.yml b/front/salix/components/log/locale/es.yml
index d341095d8..142175888 100644
--- a/front/salix/components/log/locale/es.yml
+++ b/front/salix/components/log/locale/es.yml
@@ -13,3 +13,4 @@ Views: Visualiza
System: Sistema
note: nota
Changes: Cambios
+No changes: No hay cambios
diff --git a/front/salix/components/log/style.scss b/front/salix/components/log/style.scss
index 68cd5a047..00b08df64 100644
--- a/front/salix/components/log/style.scss
+++ b/front/salix/components/log/style.scss
@@ -1,66 +1,127 @@
@import "variables";
vn-log {
- vn-td {
- vertical-align: initial !important;
+ .vn-table {
+ table-layout: fixed;
+
+ & > thead,
+ & > tbody {
+ & > tr {
+ td, th {
+ &:first-child {
+ padding-left: 16px;
+ }
+ &:last-child {
+ padding-right: 16px;
+ }
+ }
+ }
+ }
+ & > thead > tr > th {
+ max-width: initial;
+ }
+ & > tbody {
+ border-bottom: 1px solid rgba(0, 0, 0, 0.3);
+
+ &:last-child {
+ border-bottom: none;
+ }
+ & > tr {
+ border-bottom: none;
+ height: initial;
+
+ & > td {
+ padding-top: 16px;
+ padding-bottom: 16px;
+
+ &.action > .chip {
+ display: inline-block;
+ }
+ }
+ &.change-header > td {
+ padding-bottom: 0;
+ }
+ &.change-detail > td {
+ padding-top: 6px;
+ vertical-align: top;
+ }
+ }
+ }
+ th, td {
+ &.action,
+ &.user {
+ width: 90px;
+ }
+ &.date {
+ width: 120px;
+ text-align: right;
+ }
+ }
+ }
+ .model-value {
+ font-style: italic;
+ color: #c7bd2b;
+ }
+ .model-id {
+ color: $color-font-secondary;
+ font-size: .9em;
}
.changes {
- display: none;
- }
- .label {
+ overflow: hidden;
+ background-color: rgba(255, 255, 255, .05);
+ border-radius: 4px;
color: $color-font-secondary;
- }
- .value {
- color: $color-font;
- }
+ transition: max-height 150ms ease-in-out;
+ max-height: 28px;
+ position: relative;
- @media screen and (max-width: 1570px) {
- vn-table .expendable {
+ & > .expand-button,
+ & > .shrink-button {
display: none;
}
- .changes {
- padding-top: 10px;
- display: block;
+ &.props {
+ padding-right: 24px;
+
+ & > .expand-button,
+ & > .shrink-button {
+ position: absolute;
+ top: 6px;
+ right: 8px;
+ font-size: inherit;
+ float: right;
+ cursor: pointer;
+ }
+ & > .expand-button {
+ display: block;
+ }
+ &.expanded {
+ max-height: 500px;
+ padding-right: 0;
+
+ & > .changes-wrapper {
+ text-overflow: initial;
+ white-space: initial;
+ }
+ & > .shrink-button {
+ display: block;
+ }
+ & > .expand-button {
+ display: none;
+ }
+ }
}
- }
- .attributes {
- width: 100%;
+ & > .changes-wrapper {
+ padding: 4px 6px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
- tr {
- height: 10px;
-
- & > td {
- padding: 2px;
+ & > .no-changes {
+ font-style: italic;
}
- & > td.field,
- & > th.field {
- width: 20%;
- color: gray;
- }
- & > td.before,
- & > th.before,
- & > td.after,
- & > th.after {
- width: 40%;
- white-space: pre-line;
+ .json-field {
+ text-transform: capitalize;
}
}
}
}
-.ellipsis {
- white-space: nowrap;
- overflow: hidden;
- max-width: 400px;
- text-overflow: ellipsis;
- display: inline-block;
-}
-.no-ellipsize,
-[no-ellipsize] {
- text-overflow: '';
- white-space: normal;
- overflow: auto;
-}
-.alignSpan {
- overflow: hidden;
- display: inline-block;
-}
From 12074bd0f4cf896b9cf9dc7a415e0f148b33449c Mon Sep 17 00:00:00 2001
From: Juan Ferrer Toribio
Date: Mon, 3 Apr 2023 04:13:09 +0200
Subject: [PATCH 018/300] refs #5517 vnLog: watchers fixes
---
front/salix/components/log/index.html | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/front/salix/components/log/index.html b/front/salix/components/log/index.html
index 1bb8b1705..8174e19cc 100644
--- a/front/salix/components/log/index.html
+++ b/front/salix/components/log/index.html
@@ -74,15 +74,15 @@
{{::prop.name}}:
- ,
+ ,
{{::prop.name}}:
-
+
- ←
+ ←
@@ -91,7 +91,7 @@
class="description">
{{::log.description}}
-
No changes
From 7f18366ece0d61df0aaf92607966bf0f8c257036 Mon Sep 17 00:00:00 2001
From: Juan Ferrer Toribio
Date: Mon, 3 Apr 2023 18:40:50 +0200
Subject: [PATCH 019/300] refs #5517 Relative dates, style fixes
---
front/salix/components/log/index.html | 4 ++--
front/salix/components/log/index.js | 25 ++++++++++++++++++++++++
front/salix/components/log/locale/es.yml | 2 ++
front/salix/components/log/style.scss | 8 +++++++-
4 files changed, 36 insertions(+), 3 deletions(-)
diff --git a/front/salix/components/log/index.html b/front/salix/components/log/index.html
index 8174e19cc..14a3fbe61 100644
--- a/front/salix/components/log/index.html
+++ b/front/salix/components/log/index.html
@@ -48,8 +48,8 @@
#{{::log.changedModelId}}
-
- {{::log.creationDate | date:'dd/MM/yyyy HH:mm'}}
+
+ {{::$ctrl.relativeDate(log.creationDate)}}
diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js
index f1eedf72e..63b4cedf4 100644
--- a/front/salix/components/log/index.js
+++ b/front/salix/components/log/index.js
@@ -33,6 +33,10 @@ export default class Controller extends Section {
},
}],
};
+ this.dateFilter = this.$filter('date');
+ this.lang = this.$translate.use();
+ this.today = Date.vnNew();
+ this.today.setHours(0, 0, 0, 0);
}
get logs() {
@@ -82,6 +86,27 @@ export default class Controller extends Section {
changesEl.classList.toggle('expanded', force);
}
+ relativeDate(dateVal) {
+ const date = new Date(dateVal);
+ const dateZeroTime = new Date(dateVal);
+ dateZeroTime.setHours(0, 0, 0, 0);
+ const diff = Math.trunc((this.today.getTime() - dateZeroTime.getTime()) / (1000 * 3600 * 24));
+
+ let format;
+ if (diff == 0)
+ format = `'${this.$t('today')}'`;
+ else if (diff == 1)
+ format = `'${this.$t('yesterday')}'`;
+ else if (diff >= 2 && diff <= 5)
+ format = `'${date.toLocaleDateString(this.lang, {weekday: 'short'})}'`;
+ else if (this.today.getFullYear() == date.getFullYear())
+ format = `dd/MM`;
+ else
+ format = `dd/MM/yyyy`;
+
+ return this.dateFilter(date, `${format} HH:mm`);
+ }
+
showWorkerDescriptor(event, workerId) {
if (!workerId) return;
this.$.workerDescriptor.show(event.target, workerId);
diff --git a/front/salix/components/log/locale/es.yml b/front/salix/components/log/locale/es.yml
index 142175888..385b42147 100644
--- a/front/salix/components/log/locale/es.yml
+++ b/front/salix/components/log/locale/es.yml
@@ -14,3 +14,5 @@ System: Sistema
note: nota
Changes: Cambios
No changes: No hay cambios
+today: hoy
+yesterday: ayer
diff --git a/front/salix/components/log/style.scss b/front/salix/components/log/style.scss
index 00b08df64..1573218f4 100644
--- a/front/salix/components/log/style.scss
+++ b/front/salix/components/log/style.scss
@@ -37,6 +37,12 @@ vn-log {
&.action > .chip {
display: inline-block;
}
+ &.date {
+ color: $color-font-secondary;
+ text-transform: capitalize;
+ font-style: italic;
+ font-size: .9em;
+ }
}
&.change-header > td {
padding-bottom: 0;
@@ -53,7 +59,7 @@ vn-log {
width: 90px;
}
&.date {
- width: 120px;
+ width: 115px;
text-align: right;
}
}
From ae22c58ecbe2c7c40797797b7834f5db815efb19 Mon Sep 17 00:00:00 2001
From: Juan Ferrer Toribio
Date: Mon, 3 Apr 2023 18:48:40 +0200
Subject: [PATCH 020/300] refs #5517 JSON value component code clean, max str
len increased
---
front/core/components/json-value/index.html | 1 -
front/core/components/json-value/index.js | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)
delete mode 100644 front/core/components/json-value/index.html
diff --git a/front/core/components/json-value/index.html b/front/core/components/json-value/index.html
deleted file mode 100644
index dc1c97709..000000000
--- a/front/core/components/json-value/index.html
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/front/core/components/json-value/index.js b/front/core/components/json-value/index.js
index c92227ed3..02c693e54 100644
--- a/front/core/components/json-value/index.js
+++ b/front/core/components/json-value/index.js
@@ -2,7 +2,7 @@ import ngModule from '../../module';
import Component from 'core/lib/component';
import './style.scss';
-const maxStrLen = 25;
+const maxStrLen = 50;
/**
* Displays pretty JSON value.
From 3cc61916961dae2f06101df1af6b26bb6ef291b7 Mon Sep 17 00:00:00 2001
From: Juan Ferrer Toribio
Date: Tue, 4 Apr 2023 19:01:19 +0200
Subject: [PATCH 021/300] refs #5517 Show abr month name in relative date
---
front/salix/components/log/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js
index 63b4cedf4..bb5ff691f 100644
--- a/front/salix/components/log/index.js
+++ b/front/salix/components/log/index.js
@@ -100,7 +100,7 @@ export default class Controller extends Section {
else if (diff >= 2 && diff <= 5)
format = `'${date.toLocaleDateString(this.lang, {weekday: 'short'})}'`;
else if (this.today.getFullYear() == date.getFullYear())
- format = `dd/MM`;
+ format = `d '${date.toLocaleDateString(this.lang, {month: 'short'})}'`;
else
format = `dd/MM/yyyy`;
From 1e71f7487a01620423f4ceda243aa280ccad2980 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Wed, 5 Apr 2023 11:16:07 +0200
Subject: [PATCH 022/300] refs #084200 I18n footer
---
print/core/components/report-footer/locale/en.yml | 10 +---------
print/core/components/report-footer/locale/es.yml | 10 +---------
print/core/components/report-footer/locale/fr.yml | 8 --------
print/core/components/report-footer/locale/pt.yml | 8 --------
print/core/components/report-footer/report-footer.html | 8 +++++---
print/core/components/report-footer/report-footer.js | 2 +-
6 files changed, 8 insertions(+), 38 deletions(-)
diff --git a/print/core/components/report-footer/locale/en.yml b/print/core/components/report-footer/locale/en.yml
index df871913e..8ca14b4d7 100644
--- a/print/core/components/report-footer/locale/en.yml
+++ b/print/core/components/report-footer/locale/en.yml
@@ -1,9 +1 @@
-numPages: Page of
-law:
- vnprivacy: In compliance with the provisions of Organic Law 15/1999, on the
- Protection of Personal Data, we inform you that the personal data you provide
- will be included in automated files of VERDNATURA LEVANTE SL, being able at all
- times to exercise the rights of access, rectification, cancellation and opposition,
- communicating it in writing to the registered office of the entity.
- The purpose of the file is administrative management, accounting, and billing.
- ornprivacy:
+numPages: Page of
\ No newline at end of file
diff --git a/print/core/components/report-footer/locale/es.yml b/print/core/components/report-footer/locale/es.yml
index 5b72fe78b..5ac6544ad 100644
--- a/print/core/components/report-footer/locale/es.yml
+++ b/print/core/components/report-footer/locale/es.yml
@@ -1,9 +1 @@
-numPages: Página de
-law:
- vnprivacy: En cumplimiento de lo dispuesto en la Ley Orgánica 15/1999, de Protección
- de Datos de Carácter Personal, le comunicamos que los datos personales que facilite
- se incluirán en ficheros automatizados de VERDNATURA LEVANTE S.L., pudiendo en
- todo momento ejercitar los derechos de acceso, rectificación, cancelación y oposición,
- comunicándolo por escrito al domicilio social de la entidad. La finalidad del
- fichero es la gestión administrativa, contabilidad, y facturación.
- ornprivacy:
\ No newline at end of file
+numPages: Página de
\ No newline at end of file
diff --git a/print/core/components/report-footer/locale/fr.yml b/print/core/components/report-footer/locale/fr.yml
index a4174105f..6fb644b2c 100644
--- a/print/core/components/report-footer/locale/fr.yml
+++ b/print/core/components/report-footer/locale/fr.yml
@@ -1,9 +1 @@
numPages: Page de
-law:
- vnprivacy: Conformément aux dispositions de la loi organique 15/1999 sur la protection
- des données personnelles, nous vous informons que les données personnelles que
- vous fournissez seront incluses dans des dossiers. VERDNATURA LEVANTE S.L., vous
- pouvez à tout moment, exercer les droits d'accès, de rectification, d'annulation
- et d'opposition, en communiquant par écrit au siège social de la société. Le dossier
- a pour objet la gestion administrative, la comptabilité et la facturation.
- ornprivacy:
\ No newline at end of file
diff --git a/print/core/components/report-footer/locale/pt.yml b/print/core/components/report-footer/locale/pt.yml
index e9f6e516f..9354ba3e9 100644
--- a/print/core/components/report-footer/locale/pt.yml
+++ b/print/core/components/report-footer/locale/pt.yml
@@ -1,9 +1 @@
numPages: Página de
-law:
- vnprivacy: Em cumprimento do disposto na lei Orgânica 15/1999, de Protecção de Dados
- de Carácter Pessoal, comunicamos que os dados pessoais que facilite se incluirão
- nos ficheiros automatizados de VERDNATURA LEVANTE S.L., podendo em todo momento
- exercer os direitos de acesso, rectificação, cancelação e oposição, comunicando
- por escrito ao domicílio social da entidade. A finalidade do ficheiro é a gestão
- administrativa, contabilidade e facturação.
- ornprivacy:
\ No newline at end of file
diff --git a/print/core/components/report-footer/report-footer.html b/print/core/components/report-footer/report-footer.html
index 957fe106a..ffef3e435 100644
--- a/print/core/components/report-footer/report-footer.html
+++ b/print/core/components/report-footer/report-footer.html
@@ -1,3 +1,5 @@
+
+
+
diff --git a/print/core/components/report-footer/report-footer.js b/print/core/components/report-footer/report-footer.js
index be40d376e..bb1ef2213 100755
--- a/print/core/components/report-footer/report-footer.js
+++ b/print/core/components/report-footer/report-footer.js
@@ -8,7 +8,7 @@ module.exports = {
ci.footnotes,
c.code
FROM company c
- JOIN companyI18n ci ON ci.companyFk = c.id AND ci.lang = ?
+ JOIN companyI18n ci ON ci.companyFk = c.id AND ci.lang = (SELECT lang FROM account.user LIMIT 1)
JOIN companyGroup cg ON cg.id = c.companyGroupFk
JOIN supplier s ON s.id = c.id
WHERE c.code = ?`, [this.companyCode]);
From 014998952e67a97e2eb99a1d2d53057cd0acf00f Mon Sep 17 00:00:00 2001
From: carlossa
Date: Wed, 5 Apr 2023 14:39:51 +0200
Subject: [PATCH 023/300] refs #084200 recipientId
---
.../report-footer/report-footer.html | 8 +++----
.../components/report-footer/report-footer.js | 22 +++++++++----------
print/templates/reports/invoice/invoice.html | 2 ++
3 files changed, 15 insertions(+), 17 deletions(-)
diff --git a/print/core/components/report-footer/report-footer.html b/print/core/components/report-footer/report-footer.html
index ffef3e435..67b5f3cd0 100644
--- a/print/core/components/report-footer/report-footer.html
+++ b/print/core/components/report-footer/report-footer.html
@@ -1,5 +1,3 @@
-
-
-
+
diff --git a/print/core/components/report-footer/report-footer.js b/print/core/components/report-footer/report-footer.js
index bb1ef2213..0eaab8ce4 100755
--- a/print/core/components/report-footer/report-footer.js
+++ b/print/core/components/report-footer/report-footer.js
@@ -1,19 +1,17 @@
+/* eslint-disable no-tabs */
const db = require('../../database');
module.exports = {
name: 'report-footer',
async serverPrefetch() {
- const company = await db.findOne(`
- SELECT
- ci.footnotes,
- c.code
- FROM company c
- JOIN companyI18n ci ON ci.companyFk = c.id AND ci.lang = (SELECT lang FROM account.user LIMIT 1)
- JOIN companyGroup cg ON cg.id = c.companyGroupFk
- JOIN supplier s ON s.id = c.id
- WHERE c.code = ?`, [this.companyCode]);
-
- this.company = company;
+ this.company = await db.findOne(
+ `SELECT
+ ci.footnotes
+ FROM companyI18n ci
+ JOIN company c ON c.id = ci.companyFk
+ WHERE c.code = ? AND ci.lang = (SELECT lang FROM account.user WHERE id = ?)`,
+ [this.companyCode, this.recipientId]);
},
- props: ['leftText', 'companyCode', 'centerText']
+
+ props: ['leftText', 'companyCode', 'recipientId', 'centerText']
};
diff --git a/print/templates/reports/invoice/invoice.html b/print/templates/reports/invoice/invoice.html
index 4a8257c1d..771229c01 100644
--- a/print/templates/reports/invoice/invoice.html
+++ b/print/templates/reports/invoice/invoice.html
@@ -259,7 +259,9 @@
v-bind:company-code="invoice.companyCode"
v-bind:left-text="$t('invoiceRef', [invoice.ref])"
v-bind:center-text="client.socialName"
+ v-bind:recipient-id="client.id"
v-bind="$props"
+
>
From f7191f0f7fc7e4e054d3de1cce6e2fc1530c4f00 Mon Sep 17 00:00:00 2001
From: Juan Ferrer Toribio
Date: Thu, 6 Apr 2023 08:37:26 +0200
Subject: [PATCH 024/300] refs #5517 log relativeDate function fixes
---
front/salix/components/log/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js
index bb5ff691f..94b600325 100644
--- a/front/salix/components/log/index.js
+++ b/front/salix/components/log/index.js
@@ -97,7 +97,7 @@ export default class Controller extends Section {
format = `'${this.$t('today')}'`;
else if (diff == 1)
format = `'${this.$t('yesterday')}'`;
- else if (diff >= 2 && diff <= 5)
+ else if (diff < 7)
format = `'${date.toLocaleDateString(this.lang, {weekday: 'short'})}'`;
else if (this.today.getFullYear() == date.getFullYear())
format = `d '${date.toLocaleDateString(this.lang, {month: 'short'})}'`;
From 9f4d027014e206ef8b281354f94550bac4d2046f Mon Sep 17 00:00:00 2001
From: carlossa
Date: Thu, 6 Apr 2023 15:36:14 +0200
Subject: [PATCH 025/300] refs #5316 sql
---
db/changes/231401/00-kkearEntryNotes.sql | 1 +
1 file changed, 1 insertion(+)
create mode 100644 db/changes/231401/00-kkearEntryNotes.sql
diff --git a/db/changes/231401/00-kkearEntryNotes.sql b/db/changes/231401/00-kkearEntryNotes.sql
new file mode 100644
index 000000000..ff5c7ce29
--- /dev/null
+++ b/db/changes/231401/00-kkearEntryNotes.sql
@@ -0,0 +1 @@
+ALTER TABLE `vn`.`entry` DROP COLUMN `notes`;
\ No newline at end of file
From d7d4b9515eef07db6b9af3d00baa13a5356fe1e7 Mon Sep 17 00:00:00 2001
From: Juan Ferrer Toribio
Date: Thu, 6 Apr 2023 17:02:45 +0200
Subject: [PATCH 026/300] refs #5517 json value and date format fixes
---
front/core/components/json-value/index.js | 71 +++++++++++++--------
front/core/components/json-value/style.scss | 13 ++--
front/salix/components/log/index.js | 2 +-
3 files changed, 53 insertions(+), 33 deletions(-)
diff --git a/front/core/components/json-value/index.js b/front/core/components/json-value/index.js
index 02c693e54..6bf0ae4aa 100644
--- a/front/core/components/json-value/index.js
+++ b/front/core/components/json-value/index.js
@@ -15,36 +15,53 @@ export default class Controller extends Component {
}
set value(value) {
+ const wasEmpty = this._value === undefined;
this._value = value;
- const span = this.element;
- const formattedValue = this.formatValue(value);
- span.textContent = formattedValue;
- span.title = typeof value == 'string' && value.length > maxStrLen ? value : '';
- span.className = `js-${value == null ? 'null' : typeof value}`;
- }
- formatValue(value) {
- if (value == null) return '∅';
- switch (typeof value) {
- case 'boolean':
- return value ? '✓' : '✗';
- case 'string':
- return value.length <= maxStrLen
- ? value
- : value.substring(0, maxStrLen) + '...';
- case 'object':
- if (value instanceof Date) {
- const hasZeroTime =
- value.getHours() === 0 &&
- value.getMinutes() === 0 &&
- value.getSeconds() === 0;
- const format = hasZeroTime ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm:ss';
- return this.$filter('date')(value, format);
- } else
- return value;
- default:
- return value;
+ let text;
+ let cssClass;
+ const type = typeof value;
+
+ if (value == null) {
+ text = '∅';
+ cssClass = 'null';
+ } else {
+ cssClass = type;
+ switch (type) {
+ case 'boolean':
+ text = value ? '✓' : '✗';
+ cssClass = value ? 'true' : 'false';
+ break;
+ case 'string':
+ text = value.length <= maxStrLen
+ ? value
+ : value.substring(0, maxStrLen) + '...';
+ break;
+ case 'object':
+ if (value instanceof Date) {
+ const hasZeroTime =
+ value.getHours() === 0 &&
+ value.getMinutes() === 0 &&
+ value.getSeconds() === 0;
+ const format = hasZeroTime ? 'dd/MM/yyyy' : 'dd/MM/yyyy HH:mm:ss';
+ text = this.$filter('date')(value, format);
+ } else
+ text = value;
+ break;
+ default:
+ text = value;
+ }
}
+
+ const el = this.element;
+ el.textContent = text;
+ el.title = type == 'string' && value.length > maxStrLen ? value : '';
+
+ cssClass = `json-${cssClass}`;
+ if (wasEmpty)
+ el.classList.add(cssClass);
+ else
+ el.classList.replace(this.className, cssClass);
}
}
diff --git a/front/core/components/json-value/style.scss b/front/core/components/json-value/style.scss
index cd9b5fae6..2d6c4023c 100644
--- a/front/core/components/json-value/style.scss
+++ b/front/core/components/json-value/style.scss
@@ -1,20 +1,23 @@
vn-json-value {
display: inline;
- &.js-string {
+ &.json-string {
color: #d172cc;
}
- &.js-object {
+ &.json-object {
/*color: #d1a572;*/
color: #d172cc;
}
- &.js-number {
+ &.json-number {
color: #85d0ff;
}
- &.js-boolean {
+ &.json-true {
color: #7dc489;
}
- &.js-null {
+ &.json-false {
+ color: #c74949;
+ }
+ &.json-null {
color: #cd7c7c;
font-style: italic;
}
diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js
index 94b600325..d768b2195 100644
--- a/front/salix/components/log/index.js
+++ b/front/salix/components/log/index.js
@@ -97,7 +97,7 @@ export default class Controller extends Section {
format = `'${this.$t('today')}'`;
else if (diff == 1)
format = `'${this.$t('yesterday')}'`;
- else if (diff < 7)
+ else if (diff > 1 && diff < 7)
format = `'${date.toLocaleDateString(this.lang, {weekday: 'short'})}'`;
else if (this.today.getFullYear() == date.getFullYear())
format = `d '${date.toLocaleDateString(this.lang, {month: 'short'})}'`;
From d21ab7a5a7f4f8db7922000a11b82321835dc4a3 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Tue, 11 Apr 2023 10:32:21 +0200
Subject: [PATCH 027/300] refs #5316 primer kkeo
---
db/dump/fixtures.sql | 18 +++++++++---------
e2e/helpers/selectors.js | 2 +-
e2e/paths/12-entry/05_basicData.spec.js | 10 +++++-----
modules/entry/back/methods/entry/filter.js | 1 -
modules/entry/back/models/entry.json | 6 +++---
modules/entry/front/basic-data/index.html | 4 ++--
modules/entry/front/index/locale/es.yml | 2 +-
modules/entry/front/routes.json | 2 +-
modules/entry/front/summary/index.html | 4 ++--
modules/travel/front/summary/index.html | 4 ++--
.../reports/entry-order/entry-order.html | 4 ++--
11 files changed, 28 insertions(+), 29 deletions(-)
diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql
index 9006c6676..e9ad6d974 100644
--- a/db/dump/fixtures.sql
+++ b/db/dump/fixtures.sql
@@ -1407,16 +1407,16 @@ INSERT INTO `vn`.`travel`(`id`,`shipped`, `landed`, `warehouseInFk`, `warehouseO
(7, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 4, 1, 50.00, 500, 'seventh travel', 2, 1),
(8, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 1, 1, 50.00, 500, 'eight travel', 1, 2);
-INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `isConfirmed`, `companyFk`, `invoiceNumber`, `reference`, `isExcludedFromAvailable`, `isRaid`, `notes`, `evaNotes`)
+INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `isConfirmed`, `companyFk`, `invoiceNumber`, `reference`, `isExcludedFromAvailable`, `isRaid`, `evaNotes`)
VALUES
- (1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 1, 442, 'IN2001', 'Movement 1', 0, 0, '', ''),
- (2, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 0, 442, 'IN2002', 'Movement 2', 0, 0, 'this is the note two', 'observation two'),
- (3, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 3, 0, 442, 'IN2003', 'Movement 3', 0, 0, 'this is the note three', 'observation three'),
- (4, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 0, 69, 'IN2004', 'Movement 4', 0, 0, 'this is the note four', 'observation four'),
- (5, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 0, 442, 'IN2005', 'Movement 5', 0, 0, 'this is the note five', 'observation five'),
- (6, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 6, 0, 442, 'IN2006', 'Movement 6', 0, 0, 'this is the note six', 'observation six'),
- (7, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'IN2007', 'Movement 7', 0, 0, 'this is the note seven', 'observation seven'),
- (8, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'IN2008', 'Movement 8', 1, 1, '', '');
+ (1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 1, 442, 'IN2001', 'Movement 1', 0, 0, ''),
+ (2, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 0, 442, 'IN2002', 'Movement 2', 0, 0, 'observation two'),
+ (3, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 3, 0, 442, 'IN2003', 'Movement 3', 0, 0, 'observation three'),
+ (4, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 0, 69, 'IN2004', 'Movement 4', 0, 0, 'observation four'),
+ (5, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 0, 442, 'IN2005', 'Movement 5', 0, 0, 'observation five'),
+ (6, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 6, 0, 442, 'IN2006', 'Movement 6', 0, 0, 'observation six'),
+ (7, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'IN2007', 'Movement 7', 0, 0, 'observation seven'),
+ (8, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'IN2008', 'Movement 8', 1, 1, '');
INSERT INTO `bs`.`waste`(`buyer`, `year`, `week`, `family`, `itemFk`, `itemTypeFk`, `saleTotal`, `saleWaste`, `rate`)
VALUES
diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js
index 32a60a4e2..5f86443ab 100644
--- a/e2e/helpers/selectors.js
+++ b/e2e/helpers/selectors.js
@@ -1240,7 +1240,7 @@ export default {
entryBasicData: {
reference: 'vn-entry-basic-data vn-textfield[ng-model="$ctrl.entry.reference"]',
invoiceNumber: 'vn-entry-basic-data vn-textfield[ng-model="$ctrl.entry.invoiceNumber"]',
- notes: 'vn-entry-basic-data vn-textfield[ng-model="$ctrl.entry.notes"]',
+ // notes: 'vn-entry-basic-data vn-textfield[ng-model="$ctrl.entry.notes"]',
observations: 'vn-entry-basic-data vn-textarea[ng-model="$ctrl.entry.observation"]',
supplier: 'vn-entry-basic-data vn-autocomplete[ng-model="$ctrl.entry.supplierFk"]',
currency: 'vn-entry-basic-data vn-autocomplete[ng-model="$ctrl.entry.currencyFk"]',
diff --git a/e2e/paths/12-entry/05_basicData.spec.js b/e2e/paths/12-entry/05_basicData.spec.js
index 3b5f40c35..eec00ca96 100644
--- a/e2e/paths/12-entry/05_basicData.spec.js
+++ b/e2e/paths/12-entry/05_basicData.spec.js
@@ -20,7 +20,7 @@ describe('Entry basic data path', () => {
it('should edit the basic data', async() => {
await page.write(selectors.entryBasicData.reference, 'new movement 8');
await page.write(selectors.entryBasicData.invoiceNumber, 'new movement 8');
- await page.write(selectors.entryBasicData.notes, 'new notes');
+ // await page.write(selectors.entryBasicData.notes, 'new notes');
await page.write(selectors.entryBasicData.observations, ' edited');
await page.autocompleteSearch(selectors.entryBasicData.supplier, 'Plants nick');
await page.autocompleteSearch(selectors.entryBasicData.currency, 'eur');
@@ -53,11 +53,11 @@ describe('Entry basic data path', () => {
expect(result).toEqual('new movement 8');
});
- it('should confirm the note was edited', async() => {
- const result = await page.waitToGetProperty(selectors.entryBasicData.notes, 'value');
+ // it('should confirm the note was edited', async() => {
+ // const result = await page.waitToGetProperty(selectors.entryBasicData.notes, 'value');
- expect(result).toEqual('new notes');
- });
+ // expect(result).toEqual('new notes');
+ // });
it('should confirm the observation was edited', async() => {
const result = await page.waitToGetProperty(selectors.entryBasicData.observations, 'value');
diff --git a/modules/entry/back/methods/entry/filter.js b/modules/entry/back/methods/entry/filter.js
index e90043074..1cd12b737 100644
--- a/modules/entry/back/methods/entry/filter.js
+++ b/modules/entry/back/methods/entry/filter.js
@@ -158,7 +158,6 @@ module.exports = Self => {
e.invoiceNumber,
e.isBooked,
e.isExcludedFromAvailable,
- e.notes,
e.evaNotes AS observation,
e.isConfirmed,
e.isOrdered,
diff --git a/modules/entry/back/models/entry.json b/modules/entry/back/models/entry.json
index 5aa175758..7747b81f9 100644
--- a/modules/entry/back/models/entry.json
+++ b/modules/entry/back/models/entry.json
@@ -31,9 +31,9 @@
"isExcludedFromAvailable": {
"type": "boolean"
},
- "notes": {
- "type": "string"
- },
+ // "notes": {
+ // "type": "string"
+ // },
"isConfirmed": {
"type": "boolean"
},
diff --git a/modules/entry/front/basic-data/index.html b/modules/entry/front/basic-data/index.html
index 68a65e890..6fd23a4f7 100644
--- a/modules/entry/front/basic-data/index.html
+++ b/modules/entry/front/basic-data/index.html
@@ -52,13 +52,13 @@
rule
vn-focus>
-
-
+ -->
-
-
+ -->
diff --git a/modules/travel/front/summary/index.html b/modules/travel/front/summary/index.html
index 113128e0e..c19a075fc 100644
--- a/modules/travel/front/summary/index.html
+++ b/modules/travel/front/summary/index.html
@@ -100,12 +100,12 @@
{{entry.pallet}}
{{entry.m3}}
-
-
+ -->
-
+
From 1770b8c0387c2df9e351f9aa61f50022197bcef2 Mon Sep 17 00:00:00 2001
From: pablone
Date: Tue, 11 Apr 2023 13:42:28 +0200
Subject: [PATCH 028/300] refs #5075
---
modules/client/front/balance/create/index.js | 5 -----
1 file changed, 5 deletions(-)
diff --git a/modules/client/front/balance/create/index.js b/modules/client/front/balance/create/index.js
index 8ef799c62..7fdf67680 100644
--- a/modules/client/front/balance/create/index.js
+++ b/modules/client/front/balance/create/index.js
@@ -4,11 +4,6 @@ import Dialog from 'core/components/dialog';
class Controller extends Dialog {
constructor($element, $, $transclude, vnReport, vnEmail) {
super($element, $, $transclude);
-<<<<<<< HEAD
- this.viewReceipt = true;
- this.sendEmail = true;
-=======
->>>>>>> dev
this.vnReport = vnReport;
this.vnEmail = vnEmail;
this.receipt = {};
From d03ca01b73f2899c80a14972bd7de43794d5df5e Mon Sep 17 00:00:00 2001
From: vicent
Date: Tue, 11 Apr 2023 14:57:56 +0200
Subject: [PATCH 029/300] =?UTF-8?q?refs=20#5128=20a=C3=B1adida=20subseccio?=
=?UTF-8?q?n=20"Gesti=C3=B3n=20de=20cr=C3=A9dito"?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
db/changes/231401/00-aclClientInforma.sql | 3 +
db/changes/231401/00-clientInforma.sql | 16 ++
modules/client/back/model-config.json | 3 +
.../client/back/models/client-informa.json | 42 +++++
modules/client/back/models/client.js | 56 ++++++-
modules/client/back/models/client.json | 8 +-
.../client/front/credit-management/index.html | 91 +++++++++++
.../client/front/credit-management/index.js | 32 ++++
.../front/credit-management/index.spec.js | 38 +++++
.../front/credit-management/locale/es.yml | 2 +
modules/client/front/index.js | 2 +
modules/client/front/locale/es.yml | 1 +
modules/client/front/routes.json | 13 +-
modules/client/front/summary/index.html | 145 ++++++++++--------
modules/client/front/summary/locale/es.yml | 3 +
15 files changed, 383 insertions(+), 72 deletions(-)
create mode 100644 db/changes/231401/00-aclClientInforma.sql
create mode 100644 db/changes/231401/00-clientInforma.sql
create mode 100644 modules/client/back/models/client-informa.json
create mode 100644 modules/client/front/credit-management/index.html
create mode 100644 modules/client/front/credit-management/index.js
create mode 100644 modules/client/front/credit-management/index.spec.js
create mode 100644 modules/client/front/credit-management/locale/es.yml
diff --git a/db/changes/231401/00-aclClientInforma.sql b/db/changes/231401/00-aclClientInforma.sql
new file mode 100644
index 000000000..6222d2632
--- /dev/null
+++ b/db/changes/231401/00-aclClientInforma.sql
@@ -0,0 +1,3 @@
+INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
+VALUES ('ClientInforma', '*', 'READ', 'ALLOW', 'ROLE', 'employee'),
+ ('ClientInforma', '*', 'WRITE', 'ALLOW', 'ROLE', 'financial');
diff --git a/db/changes/231401/00-clientInforma.sql b/db/changes/231401/00-clientInforma.sql
new file mode 100644
index 000000000..25405ef4d
--- /dev/null
+++ b/db/changes/231401/00-clientInforma.sql
@@ -0,0 +1,16 @@
+ALTER TABLE `vn`.`client` ADD rating INT UNSIGNED DEFAULT NULL NULL COMMENT 'información proporcionada por Informa';
+ALTER TABLE `vn`.`client` ADD recommendedCredit INT UNSIGNED DEFAULT NULL NULL COMMENT 'información proporcionada por Informa';
+
+CREATE TABLE `vn`.`clientInforma` (
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `clientFk` int(11) NOT NULL,
+ `rating` int(10) unsigned DEFAULT NULL,
+ `recommendedCredit` int(10) unsigned DEFAULT NULL,
+ `workerFk` int(10) unsigned NOT NULL,
+ `created` timestamp NOT NULL DEFAULT current_timestamp(),
+ PRIMARY KEY (`id`),
+ KEY `informaWorkers_fk_idx` (`workerFk`),
+ KEY `informaClientFk` (`clientFk`),
+ CONSTRAINT `informa_ClienteFk` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `informa_workers_fk` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE
+) ENGINE=InnoDB CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
diff --git a/modules/client/back/model-config.json b/modules/client/back/model-config.json
index b466aa5a1..1e06ea1c0 100644
--- a/modules/client/back/model-config.json
+++ b/modules/client/back/model-config.json
@@ -32,6 +32,9 @@
"ClientConsumptionQueue": {
"dataSource": "vn"
},
+ "ClientInforma": {
+ "dataSource": "vn"
+ },
"ClientLog": {
"dataSource": "vn"
},
diff --git a/modules/client/back/models/client-informa.json b/modules/client/back/models/client-informa.json
new file mode 100644
index 000000000..0c652484e
--- /dev/null
+++ b/modules/client/back/models/client-informa.json
@@ -0,0 +1,42 @@
+{
+ "name": "ClientInforma",
+ "base": "Loggable",
+ "log": {
+ "model":"ClientLog",
+ "relation": "client",
+ "showField": "clientFk"
+ },
+ "options": {
+ "mysql": {
+ "table": "clientInforma"
+ }
+ },
+ "properties": {
+ "id": {
+ "type": "number",
+ "id": true,
+ "description": "Identifier"
+ },
+ "rating": {
+ "type": "number"
+ },
+ "recommendedCredit": {
+ "type": "number"
+ },
+ "created": {
+ "type": "date"
+ }
+ },
+ "relations": {
+ "worker": {
+ "type": "belongsTo",
+ "model": "Worker",
+ "foreignKey": "workerFk"
+ },
+ "client": {
+ "type": "belongsTo",
+ "model": "Client",
+ "foreignKey": "clientFk"
+ }
+ }
+}
diff --git a/modules/client/back/models/client.js b/modules/client/back/models/client.js
index c41085b79..579c6a8d4 100644
--- a/modules/client/back/models/client.js
+++ b/modules/client/back/models/client.js
@@ -280,6 +280,10 @@ module.exports = Self => {
if (changes.credit !== undefined)
await Self.changeCredit(ctx, finalState, changes);
+ // Credit management changes
+ if (orgData.rating != changes.rating || orgData.recommendedCredit != changes.recommendedCredit)
+ await Self.changeCreditManagement(ctx, finalState, changes);
+
const oldInstance = {};
if (!ctx.isNewInstance) {
const newProps = Object.keys(changes);
@@ -441,6 +445,55 @@ module.exports = Self => {
}, ctx.options);
};
+ Self.changeCreditManagement = async function changeCreditManagement(ctx, finalState, changes) {
+ const models = Self.app.models;
+ const userId = ctx.options.accessToken.userId;
+
+ // const isFinancialBoss = await models.Account.hasRole(userId, 'financialBoss', ctx.options);
+ // if (!isFinancialBoss) {
+ // const lastCredit = await models.ClientCredit.findOne({
+ // where: {
+ // clientFk: finalState.id
+ // },
+ // order: 'id DESC'
+ // }, ctx.options);
+
+ // const lastAmount = lastCredit && lastCredit.amount;
+ // const lastWorkerId = lastCredit && lastCredit.workerFk;
+ // const lastWorkerIsFinancialBoss = await models.Account.hasRole(lastWorkerId, 'financialBoss', ctx.options);
+
+ // if (lastAmount == 0 && lastWorkerIsFinancialBoss)
+ // throw new UserError(`You can't change the credit set to zero from a financialBoss`);
+
+ // const creditLimits = await models.ClientCreditLimit.find({
+ // fields: ['roleFk'],
+ // where: {
+ // maxAmount: {gte: changes.credit}
+ // }
+ // }, ctx.options);
+
+ // const requiredRoles = [];
+ // for (limit of creditLimits)
+ // requiredRoles.push(limit.roleFk);
+
+ // const userRequiredRoles = await models.RoleMapping.count({
+ // roleId: {inq: requiredRoles},
+ // principalType: 'USER',
+ // principalId: userId
+ // }, ctx.options);
+
+ // if (userRequiredRoles <= 0)
+ // throw new UserError(`You don't have enough privileges to set this credit amount`);
+ // }
+
+ await models.ClientInforma.create({
+ clientFk: finalState.id,
+ rating: changes.rating,
+ recommendedCredit: changes.recommendedCredit,
+ workerFk: userId
+ }, ctx.options);
+ };
+
const app = require('vn-loopback/server/server');
app.on('started', function() {
const account = app.models.Account;
@@ -474,7 +527,8 @@ module.exports = Self => {
oldInstance: {name: oldData.name, active: oldData.active},
newInstance: {name: changes.name, active: changes.active}
};
- await Self.app.models.ClientLog.create(logRecord);
+ console.log(logRecord);
+ // await Self.app.models.ClientLog.create(logRecord);
}
}
});
diff --git a/modules/client/back/models/client.json b/modules/client/back/models/client.json
index 21db28eaf..6ad617687 100644
--- a/modules/client/back/models/client.json
+++ b/modules/client/back/models/client.json
@@ -145,6 +145,12 @@
},
"hasElectronicInvoice": {
"type": "boolean"
+ },
+ "rating": {
+ "type": "number"
+ },
+ "recommendedCredit": {
+ "type": "number"
}
},
@@ -260,4 +266,4 @@
}
}
}
-}
\ No newline at end of file
+}
diff --git a/modules/client/front/credit-management/index.html b/modules/client/front/credit-management/index.html
new file mode 100644
index 000000000..78cc6edb5
--- /dev/null
+++ b/modules/client/front/credit-management/index.html
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ Since
+ Employee
+ Rating
+ Recommended credit
+
+
+
+
+ {{::clientInforma.created | date:'dd/MM/yyyy HH:mm'}}
+
+
+ {{::clientInforma.worker.user.nickname}}
+
+
+ {{::clientInforma.rating}}
+ {{::clientInforma.recommendedCredit}}
+
+
+
+
+
+
+
+
+
diff --git a/modules/client/front/credit-management/index.js b/modules/client/front/credit-management/index.js
new file mode 100644
index 000000000..856acd27b
--- /dev/null
+++ b/modules/client/front/credit-management/index.js
@@ -0,0 +1,32 @@
+import ngModule from '../module';
+import Section from 'salix/components/section';
+
+export default class Controller extends Section {
+ constructor($element, $) {
+ super($element, $);
+
+ this.filter = {
+ include: [{
+ relation: 'worker',
+ scope: {
+ fields: ['userFk'],
+ include: {
+ relation: 'user',
+ scope: {
+ fields: ['nickname']
+ }
+ }
+ }
+ }],
+ };
+ }
+ onSubmit() {
+ this.$.watcher.submit()
+ .then(() => this.$state.reload());
+ }
+}
+
+ngModule.vnComponent('vnClientCreditManagement', {
+ template: require('./index.html'),
+ controller: Controller
+});
diff --git a/modules/client/front/credit-management/index.spec.js b/modules/client/front/credit-management/index.spec.js
new file mode 100644
index 000000000..0f6460a03
--- /dev/null
+++ b/modules/client/front/credit-management/index.spec.js
@@ -0,0 +1,38 @@
+import './index';
+
+describe('client unpaid', () => {
+ describe('Component vnClientUnpaid', () => {
+ let controller;
+
+ beforeEach(ngModule('client'));
+
+ beforeEach(inject($componentController => {
+ const $element = angular.element(' ');
+ controller = $componentController('vnClientUnpaid', {$element});
+ }));
+
+ describe('setDefaultDate()', () => {
+ it(`should not set today date if has dated`, () => {
+ const hasData = true;
+ const yesterday = Date.vnNew();
+ yesterday.setDate(yesterday.getDate() - 1);
+
+ controller.clientUnpaid = {
+ dated: yesterday
+ };
+ controller.setDefaultDate(hasData);
+
+ expect(controller.clientUnpaid.dated).toEqual(yesterday);
+ });
+
+ it(`should set today if not has dated`, () => {
+ const hasData = true;
+
+ controller.clientUnpaid = {};
+ controller.setDefaultDate(hasData);
+
+ expect(controller.clientUnpaid.dated).toBeDefined();
+ });
+ });
+ });
+});
diff --git a/modules/client/front/credit-management/locale/es.yml b/modules/client/front/credit-management/locale/es.yml
new file mode 100644
index 000000000..8743a1fb9
--- /dev/null
+++ b/modules/client/front/credit-management/locale/es.yml
@@ -0,0 +1,2 @@
+Recommended credit: Crédito recomendado
+Rating: Clasificación
diff --git a/modules/client/front/index.js b/modules/client/front/index.js
index ff767bc9e..c7e39ea5d 100644
--- a/modules/client/front/index.js
+++ b/modules/client/front/index.js
@@ -47,3 +47,5 @@ import './defaulter';
import './notification';
import './unpaid';
import './extended-list';
+import './credit-management';
+
diff --git a/modules/client/front/locale/es.yml b/modules/client/front/locale/es.yml
index adbca8dbf..f14070f9e 100644
--- a/modules/client/front/locale/es.yml
+++ b/modules/client/front/locale/es.yml
@@ -64,3 +64,4 @@ Compensation Account: Cuenta para compensar
Amount to return: Cantidad a devolver
Delivered amount: Cantidad entregada
Unpaid: Impagado
+Credit management: Gestión de crédito
diff --git a/modules/client/front/routes.json b/modules/client/front/routes.json
index 406ca07d7..1a9b963e9 100644
--- a/modules/client/front/routes.json
+++ b/modules/client/front/routes.json
@@ -34,7 +34,8 @@
{"state": "client.card.contact", "icon": "contact_phone"},
{"state": "client.card.webPayment", "icon": "icon-onlinepayment"},
{"state": "client.card.dms.index", "icon": "cloud_upload"},
- {"state": "client.card.unpaid", "icon": "icon-defaulter"}
+ {"state": "client.card.unpaid", "icon": "icon-defaulter"},
+ {"state": "client.card.creditManagement", "icon": "contact_support"}
]
}
]
@@ -416,7 +417,8 @@
"state": "client.notification",
"component": "vn-client-notification",
"description": "Notifications"
- }, {
+ },
+ {
"url": "/unpaid",
"state": "client.card.unpaid",
"component": "vn-client-unpaid",
@@ -428,6 +430,13 @@
"state": "client.extendedList",
"component": "vn-client-extended-list",
"description": "Extended list"
+ },
+ {
+ "url": "/credit-management",
+ "state": "client.card.creditManagement",
+ "component": "vn-client-credit-management",
+ "acl": ["financial"],
+ "description": "Credit management"
}
]
}
diff --git a/modules/client/front/summary/index.html b/modules/client/front/summary/index.html
index ed4b89ee4..b8f88fa3c 100644
--- a/modules/client/front/summary/index.html
+++ b/modules/client/front/summary/index.html
@@ -22,75 +22,75 @@
-
Basic data
-
-
-
-
-
-
{{$ctrl.summary.salesPersonUser.name}}
-
-
Fiscal address
-
-
-
-
-
-
-
Fiscal data
-
Billing data
-
-
-
-
-
- Web access
-
@@ -236,52 +236,61 @@
Business data
-
-
-
-
-
- Financial information
-
+
+ Financial information
+
+
+
+ info="Invoices minus payments plus orders not yet invoiced">
-
-
-
-
-
+
+
@@ -341,7 +350,7 @@
class="link">
{{::ticket.refFk}}
-
{{::ticket.ticketState.state.name}}
@@ -355,8 +364,8 @@
-
-
@@ -397,4 +406,4 @@
ticket="$ctrl.selectedTicket"
model="model">
-
\ No newline at end of file
+
diff --git a/modules/client/front/summary/locale/es.yml b/modules/client/front/summary/locale/es.yml
index b6233d4b3..ca6e96fef 100644
--- a/modules/client/front/summary/locale/es.yml
+++ b/modules/client/front/summary/locale/es.yml
@@ -20,3 +20,6 @@ Invoices minus payments: Facturas menos recibos
Deviated invoices minus payments: Facturas fuera de plazo menos recibos
Go to the client: Ir al cliente
Latest tickets: Últimos tickets
+Rating: Clasificación
+Value from 1 to 20. The higher the better value: Valor del 1 al 20. Cuanto más alto mejor valoración
+Go to grafana: Ir a grafana
From 1ce27058699599ef885eacdebd5e1ee1fb7df338 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Tue, 11 Apr 2023 15:04:49 +0200
Subject: [PATCH 030/300] refs #5316 last kkentry
---
modules/entry/back/models/entry.json | 3 ---
modules/entry/front/routes.json | 11 -----------
.../back/methods/travel/extraCommunityFilter.js | 1 -
modules/travel/back/methods/travel/getEntries.js | 1 -
print/templates/reports/entry-order/sql/entry.sql | 1 -
5 files changed, 17 deletions(-)
diff --git a/modules/entry/back/models/entry.json b/modules/entry/back/models/entry.json
index 7747b81f9..e489981a6 100644
--- a/modules/entry/back/models/entry.json
+++ b/modules/entry/back/models/entry.json
@@ -31,9 +31,6 @@
"isExcludedFromAvailable": {
"type": "boolean"
},
- // "notes": {
- // "type": "string"
- // },
"isConfirmed": {
"type": "boolean"
},
diff --git a/modules/entry/front/routes.json b/modules/entry/front/routes.json
index d521edeca..c5c5f407a 100644
--- a/modules/entry/front/routes.json
+++ b/modules/entry/front/routes.json
@@ -12,7 +12,6 @@
"card": [
{"state": "entry.card.basicData", "icon": "settings"},
{"state": "entry.card.buy.index", "icon": "icon-lines"},
- {"state": "entry.card.observation", "icon": "insert_drive_file"},
{"state": "entry.card.log", "icon": "history"}
]
},
@@ -74,16 +73,6 @@
},
"acl": ["buyer", "administrative"]
},
- {
- "url": "/observation",
- "state": "entry.card.observation",
- "component": "vn-entry-observation",
- // "description": "Notes",
- "params": {
- "entry": "$ctrl.entry"
- },
- "acl": ["buyer", "administrative"]
- },
{
"url" : "/log",
"state": "entry.card.log",
diff --git a/modules/travel/back/methods/travel/extraCommunityFilter.js b/modules/travel/back/methods/travel/extraCommunityFilter.js
index 5ee51de8e..388ba52a1 100644
--- a/modules/travel/back/methods/travel/extraCommunityFilter.js
+++ b/modules/travel/back/methods/travel/extraCommunityFilter.js
@@ -167,7 +167,6 @@ module.exports = Self => {
s.name AS supplierName,
SUM(b.stickers) AS stickers,
e.evaNotes,
- e.notes,
e.invoiceAmount,
CAST(SUM(b.weight * b.stickers) AS DECIMAL(10,0)) as loadedkg,
CAST(SUM(vc.aerealVolumetricDensity * b.stickers * IF(pkg.volume, pkg.volume, pkg.width * pkg.depth * pkg.height) / 1000000) AS DECIMAL(10,0)) as volumeKg
diff --git a/modules/travel/back/methods/travel/getEntries.js b/modules/travel/back/methods/travel/getEntries.js
index 5ca12f7a1..71bb0d8fb 100644
--- a/modules/travel/back/methods/travel/getEntries.js
+++ b/modules/travel/back/methods/travel/getEntries.js
@@ -31,7 +31,6 @@ module.exports = Self => {
e.isConfirmed,
e.invoiceNumber,
e.reference,
- e.notes,
e.evaNotes AS observation,
s.name AS supplierName,
CAST((SUM(IF(p.volume > 0,p.volume,p.width * p.depth * IF(p.height, p.height, i.size + pconfig.upperGap))
diff --git a/print/templates/reports/entry-order/sql/entry.sql b/print/templates/reports/entry-order/sql/entry.sql
index 57b8d9293..c30eebca8 100644
--- a/print/templates/reports/entry-order/sql/entry.sql
+++ b/print/templates/reports/entry-order/sql/entry.sql
@@ -1,7 +1,6 @@
SELECT
e.id,
e.invoiceNumber,
- e.notes,
c.code companyCode,
t.landed
FROM entry e
From 1456da58f546c811fbc2976db9c34dd74b7a7abd Mon Sep 17 00:00:00 2001
From: pablone
Date: Tue, 11 Apr 2023 15:38:50 +0200
Subject: [PATCH 031/300] refs #5075
---
modules/client/front/balance/create/index.js | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/modules/client/front/balance/create/index.js b/modules/client/front/balance/create/index.js
index 7fdf67680..9113d7605 100644
--- a/modules/client/front/balance/create/index.js
+++ b/modules/client/front/balance/create/index.js
@@ -73,15 +73,6 @@ class Controller extends Dialog {
const accountingType = value.accountingType;
this.receipt.description = [];
-<<<<<<< HEAD
- if (accountingType.receiptDescription != null && accountingType.receiptDescription != '')
- this.receipt.description.push(accountingType.receiptDescription);
- if (this.originalDescription)
- this.receipt.description.push(this.originalDescription);
-
- this.receipt.description = this.receipt.description.join(', ').toString();
-
-=======
this.viewReceipt = accountingType.code == 'cash';
if (accountingType.code == 'compensation')
this.receipt.description = '';
@@ -92,7 +83,6 @@ class Controller extends Dialog {
this.receipt.description.push(this.originalDescription);
this.receipt.description = this.receipt.description.join(', ');
}
->>>>>>> dev
this.maxAmount = accountingType && accountingType.maxAmount;
this.receipt.payed = Date.vnNew();
From 58750aa065bc68addc416e4d0fd0895aa0516e49 Mon Sep 17 00:00:00 2001
From: vicent
Date: Wed, 12 Apr 2023 10:02:06 +0200
Subject: [PATCH 032/300] =?UTF-8?q?refs=20#5318=20eliminido=20triggers=20y?=
=?UTF-8?q?=20a=C3=B1adido=20loggable=20en=20salix?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
db/changes/231401/00-deviceProduction.sql | 5 ++
modules/worker/back/model-config.json | 3 +
.../back/models/device-production-log.json | 55 +++++++++++++++++++
.../back/models/device-production-user.json | 6 +-
.../worker/back/models/device-production.json | 5 +-
modules/worker/front/pda/index.html | 11 ++--
6 files changed, 78 insertions(+), 7 deletions(-)
create mode 100644 db/changes/231401/00-deviceProduction.sql
create mode 100644 modules/worker/back/models/device-production-log.json
diff --git a/db/changes/231401/00-deviceProduction.sql b/db/changes/231401/00-deviceProduction.sql
new file mode 100644
index 000000000..37a2f1371
--- /dev/null
+++ b/db/changes/231401/00-deviceProduction.sql
@@ -0,0 +1,5 @@
+DROP TRIGGER `vn`.`deviceProduction_afterInsert`;
+DROP TRIGGER `vn`.`deviceProduction_afterUpdate`;
+
+DROP TRIGGER `vn`.`deviceProductionUser_afterDelete`;
+
diff --git a/modules/worker/back/model-config.json b/modules/worker/back/model-config.json
index 145934700..fd34c013b 100644
--- a/modules/worker/back/model-config.json
+++ b/modules/worker/back/model-config.json
@@ -23,6 +23,9 @@
"DeviceProduction": {
"dataSource": "vn"
},
+ "DeviceProductionLog": {
+ "dataSource": "vn"
+ },
"DeviceProductionModels": {
"dataSource": "vn"
},
diff --git a/modules/worker/back/models/device-production-log.json b/modules/worker/back/models/device-production-log.json
new file mode 100644
index 000000000..c935398fc
--- /dev/null
+++ b/modules/worker/back/models/device-production-log.json
@@ -0,0 +1,55 @@
+{
+ "name": "DeviceProductionLog",
+ "base": "VnModel",
+ "options": {
+ "mysql": {
+ "table": "deviceProductionLog"
+ }
+ },
+ "properties": {
+ "id": {
+ "id": true,
+ "type": "number",
+ "forceId": false
+ },
+ "originFk": {
+ "type": "number",
+ "required": true
+ },
+ "userFk": {
+ "type": "number"
+ },
+ "deviceProduction": {
+ "type": "number"
+ },
+ "action": {
+ "type": "string",
+ "required": true
+ },
+ "created": {
+ "type": "date"
+ },
+ "oldInstance": {
+ "type": "object"
+ },
+ "newInstance": {
+ "type": "object"
+ },
+ "changedModel": {
+ "type": "string"
+ },
+ "changedModelId": {
+ "type": "number"
+ }
+ },
+ "relations": {
+ "user": {
+ "type": "belongsTo",
+ "model": "Account",
+ "foreignKey": "userFk"
+ }
+ },
+ "scope": {
+ "order": ["created DESC", "id DESC"]
+ }
+}
diff --git a/modules/worker/back/models/device-production-user.json b/modules/worker/back/models/device-production-user.json
index 568e79413..3eeaae137 100644
--- a/modules/worker/back/models/device-production-user.json
+++ b/modules/worker/back/models/device-production-user.json
@@ -1,6 +1,10 @@
{
"name": "DeviceProductionUser",
- "base": "VnModel",
+ "base": "Loggable",
+ "log": {
+ "model": "DeviceProductionLog",
+ "relation": "deviceProduction"
+ },
"options": {
"mysql": {
"table": "deviceProductionUser"
diff --git a/modules/worker/back/models/device-production.json b/modules/worker/back/models/device-production.json
index 63672500b..35787cccc 100644
--- a/modules/worker/back/models/device-production.json
+++ b/modules/worker/back/models/device-production.json
@@ -1,6 +1,9 @@
{
"name": "DeviceProduction",
- "base": "VnModel",
+ "base": "Loggable",
+ "log": {
+ "model": "DeviceProductionLog"
+ },
"options": {
"mysql": {
"table": "deviceProduction"
diff --git a/modules/worker/front/pda/index.html b/modules/worker/front/pda/index.html
index 2f1626ba8..be67dd903 100644
--- a/modules/worker/front/pda/index.html
+++ b/modules/worker/front/pda/index.html
@@ -31,11 +31,12 @@
value-field="id"
show-field="serialNumber">
- ID: {{id}}
-
- {{'Model' | translate}}: {{modelFk}}
-
- {{'Serial Number' | translate}}: {{serialNumber}}
+
+ ID: {{id}}
+
+
+ {{modelFk}}, {{serialNumber}}
+
From 117849f09395aee737df62efbd1a615907252bc1 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Wed, 12 Apr 2023 12:03:55 +0200
Subject: [PATCH 033/300] refs #5540 supplier js
---
db/changes/231401/00-updateIsVies.sql | 5 +++++
modules/supplier/back/models/supplier.js | 12 ++++++++++++
modules/supplier/front/fiscal-data/index.html | 7 +++++--
modules/supplier/front/fiscal-data/locale/es.yml | 4 +++-
4 files changed, 25 insertions(+), 3 deletions(-)
create mode 100644 db/changes/231401/00-updateIsVies.sql
diff --git a/db/changes/231401/00-updateIsVies.sql b/db/changes/231401/00-updateIsVies.sql
new file mode 100644
index 000000000..efe008101
--- /dev/null
+++ b/db/changes/231401/00-updateIsVies.sql
@@ -0,0 +1,5 @@
+UPDATE vn.supplier s
+ JOIN vn.country c ON c.id = s.countryFk
+ SET s.nif = MID(REPLACE(s.nif, ' ', ''), 3, LENGTH(REPLACE(s.nif, ' ', '')) - 1)
+ WHERE s.isVies = TRUE
+ AND c.code = LEFT(REPLACE(s.nif, ' ', ''), 2);
\ No newline at end of file
diff --git a/modules/supplier/back/models/supplier.js b/modules/supplier/back/models/supplier.js
index 4e509aafc..745a2f7e3 100644
--- a/modules/supplier/back/models/supplier.js
+++ b/modules/supplier/back/models/supplier.js
@@ -73,6 +73,18 @@ module.exports = Self => {
done();
}
+ Self.validateAsync('nif', areFirstTwoCharsLetters, nifInvalid, {
+ message: 'The first two values are letters.'});
+
+ function areFirstTwoCharsLetters(str) {
+ return /^[a-zA-Z]{2}/.test(str);
+ }
+
+ async function nifInvalid(err, areFirstTwoCharsLetters) {
+ if (this.isVies == 1 && areFirstTwoCharsLetters(this.nif))
+ err();
+ }
+
function isAlpha(value) {
const regexp = new RegExp(/^[ñça-zA-Z0-9\s]*$/i);
diff --git a/modules/supplier/front/fiscal-data/index.html b/modules/supplier/front/fiscal-data/index.html
index ccbd5b0d9..f84a1890e 100644
--- a/modules/supplier/front/fiscal-data/index.html
+++ b/modules/supplier/front/fiscal-data/index.html
@@ -52,7 +52,8 @@
label="Tax number"
ng-model="$ctrl.supplier.nif"
required="true"
- rule>
+ rule
+ >
@@ -188,7 +189,9 @@
+ info="When activating it, do not enter the country code in the ID field."
+ ng-model="$ctrl.supplier.isVies"
+ >
diff --git a/modules/supplier/front/fiscal-data/locale/es.yml b/modules/supplier/front/fiscal-data/locale/es.yml
index 5232dd95d..ee641231f 100644
--- a/modules/supplier/front/fiscal-data/locale/es.yml
+++ b/modules/supplier/front/fiscal-data/locale/es.yml
@@ -3,4 +3,6 @@ Sage transaction type: Tipo de transacción Sage
Sage withholding: Retención Sage
Supplier activity: Actividad proveedor
Healt register: Pasaporte sanitario
-Trucker: Transportista
\ No newline at end of file
+Trucker: Transportista
+When activating it, do not enter the country code in the ID field.: Al activarlo, no informar el código del país en el campo nif
+The first two values are letters.: Los dos primeros valores son letras
\ No newline at end of file
From 60103fa80ac08ce1ac39909fd2f14b5cf71cc9bf Mon Sep 17 00:00:00 2001
From: carlossa
Date: Wed, 12 Apr 2023 14:39:40 +0200
Subject: [PATCH 034/300] refs #5540 validacion nif
---
loopback/locale/es.json | 3 ++-
modules/supplier/back/models/supplier.js | 13 +++++--------
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/loopback/locale/es.json b/loopback/locale/es.json
index 42276efe7..8e2672bc4 100644
--- a/loopback/locale/es.json
+++ b/loopback/locale/es.json
@@ -274,5 +274,6 @@
"This ticket cannot be signed because it has not been boxed": "Este ticket no puede firmarse porque no ha sido encajado",
"Insert a date range": "Inserte un rango de fechas",
"Added observation": "{{user}} añadió esta observacion: {{text}}",
- "Comment added to client": "Observación añadida al cliente {{clientFk}}"
+ "Comment added to client": "Observación añadida al cliente {{clientFk}}",
+ "The first two values are letters": "Los dos primeros carácteres del NIF son letras"
}
diff --git a/modules/supplier/back/models/supplier.js b/modules/supplier/back/models/supplier.js
index 745a2f7e3..7f12e86ef 100644
--- a/modules/supplier/back/models/supplier.js
+++ b/modules/supplier/back/models/supplier.js
@@ -73,16 +73,13 @@ module.exports = Self => {
done();
}
- Self.validateAsync('nif', areFirstTwoCharsLetters, nifInvalid, {
- message: 'The first two values are letters.'});
+ Self.validateAsync('nif', nifInvalid, {
+ message: 'The first two values are letters'});
- function areFirstTwoCharsLetters(str) {
- return /^[a-zA-Z]{2}/.test(str);
- }
-
- async function nifInvalid(err, areFirstTwoCharsLetters) {
- if (this.isVies == 1 && areFirstTwoCharsLetters(this.nif))
+ async function nifInvalid(err, done) {
+ if (this.isVies && /^[a-zA-Z]{2}/.test(this.nif))
err();
+ done();
}
function isAlpha(value) {
From 747efc4342ac8da8994c8ac096f50f48cf655a0e Mon Sep 17 00:00:00 2001
From: carlossa
Date: Wed, 12 Apr 2023 14:52:59 +0200
Subject: [PATCH 035/300] refs #5540 sql mod
---
db/changes/231401/00-updateIsVies.sql | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/db/changes/231401/00-updateIsVies.sql b/db/changes/231401/00-updateIsVies.sql
index efe008101..1d2e55441 100644
--- a/db/changes/231401/00-updateIsVies.sql
+++ b/db/changes/231401/00-updateIsVies.sql
@@ -1,5 +1,3 @@
-UPDATE vn.supplier s
- JOIN vn.country c ON c.id = s.countryFk
- SET s.nif = MID(REPLACE(s.nif, ' ', ''), 3, LENGTH(REPLACE(s.nif, ' ', '')) - 1)
- WHERE s.isVies = TRUE
- AND c.code = LEFT(REPLACE(s.nif, ' ', ''), 2);
\ No newline at end of file
+UPDATE vn.supplier
+SET nif = SUBSTRING(nif, IF(ASCII(SUBSTRING(nif, 1, 1)) BETWEEN 65 AND 90 AND ASCII(SUBSTRING(nif, 2, 1)) BETWEEN 65 AND 90, 3, 1), LENGTH(nif))
+WHERE isVies = 1 AND nif REGEXP '^[a-zA-Z]{2}';
From 2a2d03e05a645375b1998e659e25504395dacf21 Mon Sep 17 00:00:00 2001
From: vicent
Date: Wed, 12 Apr 2023 15:02:21 +0200
Subject: [PATCH 036/300] =?UTF-8?q?refs=20#5517=20a=C3=B1adidas=20traducci?=
=?UTF-8?q?ones=20de=20algunos=20modelos?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
back/locale/account/en.yml | 17 ++++++
back/locale/account/es.yml | 17 ++++++
front/salix/components/log/index.js | 3 +-
modules/account/back/locale/mail/en.yml | 7 +++
modules/account/back/locale/mail/es.yml | 7 +++
.../claim/back/locale/claim-beginning/en.yml | 6 +++
.../claim/back/locale/claim-beginning/es.yml | 6 +++
.../back/locale/claim-development/en.yml | 9 ++++
.../back/locale/claim-development/es.yml | 9 ++++
modules/claim/back/locale/claim-dms/en.yml | 4 ++
modules/claim/back/locale/claim-dms/es.yml | 4 ++
modules/claim/back/locale/claim-end/en.yml | 7 +++
modules/claim/back/locale/claim-end/es.yml | 7 +++
.../back/locale/claim-observation/en.yml | 7 +++
.../back/locale/claim-observation/es.yml | 7 +++
modules/claim/back/locale/claim/en.yml | 16 ++++++
modules/claim/back/locale/claim/es.yml | 16 ++++++
modules/client/back/locale/address/en.yml | 20 +++++++
modules/client/back/locale/address/es.yml | 20 +++++++
.../client/back/locale/client-contact/en.yml | 6 +++
.../client/back/locale/client-contact/es.yml | 6 +++
modules/client/back/locale/client-dms/en.yml | 4 ++
modules/client/back/locale/client-dms/es.yml | 4 ++
.../back/locale/client-observation/en.yml | 7 +++
.../back/locale/client-observation/es.yml | 7 +++
.../client/back/locale/client-sample/en.yml | 8 +++
.../client/back/locale/client-sample/es.yml | 8 +++
modules/client/back/locale/client/en.yml | 50 ++++++++++++++++++
modules/client/back/locale/client/es.yml | 50 ++++++++++++++++++
modules/client/back/locale/greuge/en.yml | 11 ++++
modules/client/back/locale/greuge/es.yml | 11 ++++
modules/client/back/locale/recovery/en.yml | 8 +++
modules/client/back/locale/recovery/es.yml | 8 +++
.../client/back/locale/tpv-transaction/en.yml | 15 ++++++
.../client/back/locale/tpv-transaction/es.yml | 15 ++++++
modules/entry/back/locale/buy/en.yml | 18 +++++++
modules/entry/back/locale/buy/es.yml | 18 +++++++
.../back/locale/entry-observation/en.yml | 6 +++
.../back/locale/entry-observation/es.yml | 6 +++
modules/entry/back/locale/entry/en.yml | 26 ++++++++++
modules/entry/back/locale/entry/es.yml | 24 +++++++++
modules/item/back/locale/item/en.yml | 47 +++++++++++++++++
modules/item/back/locale/item/es.yml | 47 +++++++++++++++++
modules/ticket/back/locale/expedition/en.yml | 10 ++++
modules/ticket/back/locale/expedition/es.yml | 10 ++++
modules/ticket/back/locale/sale/en.yml | 24 +++++----
modules/ticket/back/locale/sale/es.yml | 24 +++++----
modules/ticket/back/locale/ticket-dms/en.yml | 4 ++
modules/ticket/back/locale/ticket-dms/es.yml | 4 ++
.../back/locale/ticket-observation/en.yml | 6 +++
.../back/locale/ticket-observation/es.yml | 6 +++
.../back/locale/ticket-packaging/en.yml | 8 +++
.../back/locale/ticket-packaging/es.yml | 8 +++
.../ticket/back/locale/ticket-refund/en.yml | 5 ++
.../ticket/back/locale/ticket-refund/es.yml | 5 ++
.../ticket/back/locale/ticket-request/en.yml | 15 ++++++
.../ticket/back/locale/ticket-request/es.yml | 15 ++++++
.../ticket/back/locale/ticket-service/en.yml | 10 ++++
.../ticket/back/locale/ticket-service/es.yml | 10 ++++
.../ticket/back/locale/ticket-tracking/en.yml | 7 +++
.../ticket/back/locale/ticket-tracking/es.yml | 7 +++
.../ticket/back/locale/ticket-weekly/en.yml | 5 ++
.../ticket/back/locale/ticket-weekly/es.yml | 5 ++
modules/ticket/back/locale/ticket/en.yml | 48 +++++++++--------
modules/ticket/back/locale/ticket/es.yml | 52 ++++++++++---------
modules/worker/back/locale/worker-dms/en.yml | 6 +++
modules/worker/back/locale/worker-dms/es.yml | 6 +++
67 files changed, 828 insertions(+), 71 deletions(-)
create mode 100644 back/locale/account/en.yml
create mode 100644 back/locale/account/es.yml
create mode 100644 modules/account/back/locale/mail/en.yml
create mode 100644 modules/account/back/locale/mail/es.yml
create mode 100644 modules/claim/back/locale/claim-beginning/en.yml
create mode 100644 modules/claim/back/locale/claim-beginning/es.yml
create mode 100644 modules/claim/back/locale/claim-development/en.yml
create mode 100644 modules/claim/back/locale/claim-development/es.yml
create mode 100644 modules/claim/back/locale/claim-dms/en.yml
create mode 100644 modules/claim/back/locale/claim-dms/es.yml
create mode 100644 modules/claim/back/locale/claim-end/en.yml
create mode 100644 modules/claim/back/locale/claim-end/es.yml
create mode 100644 modules/claim/back/locale/claim-observation/en.yml
create mode 100644 modules/claim/back/locale/claim-observation/es.yml
create mode 100644 modules/claim/back/locale/claim/en.yml
create mode 100644 modules/claim/back/locale/claim/es.yml
create mode 100644 modules/client/back/locale/address/en.yml
create mode 100644 modules/client/back/locale/address/es.yml
create mode 100644 modules/client/back/locale/client-contact/en.yml
create mode 100644 modules/client/back/locale/client-contact/es.yml
create mode 100644 modules/client/back/locale/client-dms/en.yml
create mode 100644 modules/client/back/locale/client-dms/es.yml
create mode 100644 modules/client/back/locale/client-observation/en.yml
create mode 100644 modules/client/back/locale/client-observation/es.yml
create mode 100644 modules/client/back/locale/client-sample/en.yml
create mode 100644 modules/client/back/locale/client-sample/es.yml
create mode 100644 modules/client/back/locale/client/en.yml
create mode 100644 modules/client/back/locale/client/es.yml
create mode 100644 modules/client/back/locale/greuge/en.yml
create mode 100644 modules/client/back/locale/greuge/es.yml
create mode 100644 modules/client/back/locale/recovery/en.yml
create mode 100644 modules/client/back/locale/recovery/es.yml
create mode 100644 modules/client/back/locale/tpv-transaction/en.yml
create mode 100644 modules/client/back/locale/tpv-transaction/es.yml
create mode 100644 modules/entry/back/locale/buy/en.yml
create mode 100644 modules/entry/back/locale/buy/es.yml
create mode 100644 modules/entry/back/locale/entry-observation/en.yml
create mode 100644 modules/entry/back/locale/entry-observation/es.yml
create mode 100644 modules/entry/back/locale/entry/en.yml
create mode 100644 modules/entry/back/locale/entry/es.yml
create mode 100644 modules/item/back/locale/item/en.yml
create mode 100644 modules/item/back/locale/item/es.yml
create mode 100644 modules/ticket/back/locale/expedition/en.yml
create mode 100644 modules/ticket/back/locale/expedition/es.yml
create mode 100644 modules/ticket/back/locale/ticket-dms/en.yml
create mode 100644 modules/ticket/back/locale/ticket-dms/es.yml
create mode 100644 modules/ticket/back/locale/ticket-observation/en.yml
create mode 100644 modules/ticket/back/locale/ticket-observation/es.yml
create mode 100644 modules/ticket/back/locale/ticket-packaging/en.yml
create mode 100644 modules/ticket/back/locale/ticket-packaging/es.yml
create mode 100644 modules/ticket/back/locale/ticket-refund/en.yml
create mode 100644 modules/ticket/back/locale/ticket-refund/es.yml
create mode 100644 modules/ticket/back/locale/ticket-request/en.yml
create mode 100644 modules/ticket/back/locale/ticket-request/es.yml
create mode 100644 modules/ticket/back/locale/ticket-service/en.yml
create mode 100644 modules/ticket/back/locale/ticket-service/es.yml
create mode 100644 modules/ticket/back/locale/ticket-tracking/en.yml
create mode 100644 modules/ticket/back/locale/ticket-tracking/es.yml
create mode 100644 modules/ticket/back/locale/ticket-weekly/en.yml
create mode 100644 modules/ticket/back/locale/ticket-weekly/es.yml
create mode 100644 modules/worker/back/locale/worker-dms/en.yml
create mode 100644 modules/worker/back/locale/worker-dms/es.yml
diff --git a/back/locale/account/en.yml b/back/locale/account/en.yml
new file mode 100644
index 000000000..0d6c5db80
--- /dev/null
+++ b/back/locale/account/en.yml
@@ -0,0 +1,17 @@
+name: account
+columns:
+ id: id
+ name: name
+ roleFk: role
+ nickname: nickname
+ lang: lang
+ password: password
+ bcryptPassword: bcrypt password
+ active: active
+ email: email
+ emailVerified: email verified
+ created: created
+ updated: updated
+ image: image
+ hasGrant: has grant
+ userFk: user
diff --git a/back/locale/account/es.yml b/back/locale/account/es.yml
new file mode 100644
index 000000000..79e8a8cc6
--- /dev/null
+++ b/back/locale/account/es.yml
@@ -0,0 +1,17 @@
+name: cuenta
+columns:
+ id: id
+ name: nombre
+ roleFk: rol
+ nickname: apodo
+ lang: idioma
+ password: contraseña
+ bcryptPassword: contraseña bcrypt
+ active: activo
+ email: email
+ emailVerified: email verificado
+ created: creado
+ updated: actualizado
+ image: imagen
+ hasGrant: tiene permiso
+ userFk: usuario
diff --git a/front/salix/components/log/index.js b/front/salix/components/log/index.js
index d768b2195..8c75664c8 100644
--- a/front/salix/components/log/index.js
+++ b/front/salix/components/log/index.js
@@ -52,6 +52,7 @@ export default class Controller extends Section {
const oldValues = log.oldInstance || empty;
const newValues = log.newInstance || empty;
const locale = validations[log.changedModel]?.locale || empty;
+ log.changedModel = locale.name ? locale.name : log.changedModel
let props = Object.keys(oldValues).concat(Object.keys(newValues));
props = [...new Set(props)];
@@ -59,7 +60,7 @@ export default class Controller extends Section {
log.props = [];
for (const prop of props) {
log.props.push({
- name: locale[prop] || prop,
+ name: locale.columns?.[prop] || prop,
old: this.castValue(oldValues[prop]),
new: this.castValue(newValues[prop])
});
diff --git a/modules/account/back/locale/mail/en.yml b/modules/account/back/locale/mail/en.yml
new file mode 100644
index 000000000..b492ea640
--- /dev/null
+++ b/modules/account/back/locale/mail/en.yml
@@ -0,0 +1,7 @@
+name: mail
+columns:
+ id: id
+ receiver: receiver
+ replyTo: reply to
+ subject: subject
+ body: body
diff --git a/modules/account/back/locale/mail/es.yml b/modules/account/back/locale/mail/es.yml
new file mode 100644
index 000000000..a0b02b45f
--- /dev/null
+++ b/modules/account/back/locale/mail/es.yml
@@ -0,0 +1,7 @@
+name: mail
+columns:
+ id: id
+ receiver: receptor
+ replyTo: responder a
+ subject: asunto
+ body: cuerpo
diff --git a/modules/claim/back/locale/claim-beginning/en.yml b/modules/claim/back/locale/claim-beginning/en.yml
new file mode 100644
index 000000000..47cc29c69
--- /dev/null
+++ b/modules/claim/back/locale/claim-beginning/en.yml
@@ -0,0 +1,6 @@
+name: claim beginning
+columns:
+ id: id
+ quantity: quantity
+ claimFk: claim
+ saleFk: sale
diff --git a/modules/claim/back/locale/claim-beginning/es.yml b/modules/claim/back/locale/claim-beginning/es.yml
new file mode 100644
index 000000000..5e898c25e
--- /dev/null
+++ b/modules/claim/back/locale/claim-beginning/es.yml
@@ -0,0 +1,6 @@
+name: comienzo reclamación
+columns:
+ id: id
+ quantity: cantidad
+ claimFk: reclamación
+ saleFk: línea
diff --git a/modules/claim/back/locale/claim-development/en.yml b/modules/claim/back/locale/claim-development/en.yml
new file mode 100644
index 000000000..054381e67
--- /dev/null
+++ b/modules/claim/back/locale/claim-development/en.yml
@@ -0,0 +1,9 @@
+name: claim development
+columns:
+ id: id
+ claimFk: claim
+ claimResponsibleFk: responsible
+ claimReasonFk: reason
+ claimResultFk: result
+ claimRedeliveryFk: redelivery
+ workerFk: worker
diff --git a/modules/claim/back/locale/claim-development/es.yml b/modules/claim/back/locale/claim-development/es.yml
new file mode 100644
index 000000000..d5223e755
--- /dev/null
+++ b/modules/claim/back/locale/claim-development/es.yml
@@ -0,0 +1,9 @@
+name: desarrollo reclamación
+columns:
+ id: id
+ claimFk: reclamación
+ claimResponsibleFk: responsable
+ claimReasonFk: motivo
+ claimResultFk: resultado
+ claimRedeliveryFk: reenvío
+ workerFk: trabajador
diff --git a/modules/claim/back/locale/claim-dms/en.yml b/modules/claim/back/locale/claim-dms/en.yml
new file mode 100644
index 000000000..c76c364e7
--- /dev/null
+++ b/modules/claim/back/locale/claim-dms/en.yml
@@ -0,0 +1,4 @@
+name: claim dms
+columns:
+ dmsFk: dms
+ claimFk: claim
diff --git a/modules/claim/back/locale/claim-dms/es.yml b/modules/claim/back/locale/claim-dms/es.yml
new file mode 100644
index 000000000..949e20a36
--- /dev/null
+++ b/modules/claim/back/locale/claim-dms/es.yml
@@ -0,0 +1,4 @@
+name: documento reclamación
+columns:
+ dmsFk: dms
+ claimFk: reclamación
diff --git a/modules/claim/back/locale/claim-end/en.yml b/modules/claim/back/locale/claim-end/en.yml
new file mode 100644
index 000000000..f9e736d76
--- /dev/null
+++ b/modules/claim/back/locale/claim-end/en.yml
@@ -0,0 +1,7 @@
+name: claim end
+columns:
+ id: id
+ claimFk: claim
+ saleFk: sale
+ workerFk: worker
+ claimDestinationFk: destination
diff --git a/modules/claim/back/locale/claim-end/es.yml b/modules/claim/back/locale/claim-end/es.yml
new file mode 100644
index 000000000..9855eca03
--- /dev/null
+++ b/modules/claim/back/locale/claim-end/es.yml
@@ -0,0 +1,7 @@
+name: final reclamación
+columns:
+ id: id
+ claimFk: reclamación
+ saleFk: línea
+ workerFk: trabajador
+ claimDestinationFk: destino
diff --git a/modules/claim/back/locale/claim-observation/en.yml b/modules/claim/back/locale/claim-observation/en.yml
new file mode 100644
index 000000000..772ea038c
--- /dev/null
+++ b/modules/claim/back/locale/claim-observation/en.yml
@@ -0,0 +1,7 @@
+name: claim observation
+columns:
+ id: id
+ claimFk: claim
+ text: text
+ created: created
+ workerFk: worker
diff --git a/modules/claim/back/locale/claim-observation/es.yml b/modules/claim/back/locale/claim-observation/es.yml
new file mode 100644
index 000000000..fae3a1ae9
--- /dev/null
+++ b/modules/claim/back/locale/claim-observation/es.yml
@@ -0,0 +1,7 @@
+name: observación reclamación
+columns:
+ id: id
+ claimFk: reclamación
+ text: texto
+ created: creado
+ workerFk: tabajador
diff --git a/modules/claim/back/locale/claim/en.yml b/modules/claim/back/locale/claim/en.yml
new file mode 100644
index 000000000..7c3ee7555
--- /dev/null
+++ b/modules/claim/back/locale/claim/en.yml
@@ -0,0 +1,16 @@
+name: claim
+columns:
+ id: id
+ observation: observation
+ ticketCreated: ticket created
+ isChargedToMana: charged to mana
+ created: created
+ responsibility: responsibility
+ hasToPickUp: has to pickUp
+ ticketFk: ticket
+ claimStateFk: claim state
+ workerFk: worker
+ packages: packages
+ rma: rma
+ clientFk: client
+ claimFk: claim
diff --git a/modules/claim/back/locale/claim/es.yml b/modules/claim/back/locale/claim/es.yml
new file mode 100644
index 000000000..27fd76ceb
--- /dev/null
+++ b/modules/claim/back/locale/claim/es.yml
@@ -0,0 +1,16 @@
+name: reclamación
+columns:
+ id: id
+ observation: observación
+ ticketCreated: ticket creado
+ isChargedToMana: cargado al maná
+ created: creado
+ responsibility: responsabilidad
+ hasToPickUp: es recogida
+ ticketFk: ticket
+ claimStateFk: estado reclamación
+ workerFk: trabajador
+ packages: paquetes
+ rma: rma
+ clientFk: cliente
+ claimFk: reclamación
diff --git a/modules/client/back/locale/address/en.yml b/modules/client/back/locale/address/en.yml
new file mode 100644
index 000000000..3d090ba89
--- /dev/null
+++ b/modules/client/back/locale/address/en.yml
@@ -0,0 +1,20 @@
+name: address
+columns:
+ id: id
+ nickname: nickname
+ street: street
+ city: city
+ postalCode: postal code
+ phone: phone
+ mobile: mobile
+ isActive: active
+ longitude: longitude
+ latitude: latitude
+ isEqualizated: equalizated
+ isLogifloraAllowed: logiflora allowed
+ provinceFk: province
+ clientFk: client
+ agencyModeFk: agency
+ addressFk: address
+ incotermsFk: incoterms
+ customsAgentFk: customs agent
diff --git a/modules/client/back/locale/address/es.yml b/modules/client/back/locale/address/es.yml
new file mode 100644
index 000000000..1379f75a4
--- /dev/null
+++ b/modules/client/back/locale/address/es.yml
@@ -0,0 +1,20 @@
+name: dirección
+columns:
+ id: id
+ nickname: apodo
+ street: calle
+ city: ciudad
+ postalCode: código postal
+ phone: teléfono
+ mobile: móvil
+ isActive: activo
+ longitude: longitud
+ latitude: latitud
+ isEqualizated: igualado
+ isLogifloraAllowed: logiflora permitido
+ provinceFk: provincia
+ clientFk: cliente
+ agencyModeFk: agencia
+ addressFk: dirección
+ incotermsFk: incoterms
+ customsAgentFk: agente adunanas
diff --git a/modules/client/back/locale/client-contact/en.yml b/modules/client/back/locale/client-contact/en.yml
new file mode 100644
index 000000000..5bd6e25db
--- /dev/null
+++ b/modules/client/back/locale/client-contact/en.yml
@@ -0,0 +1,6 @@
+name: client contact
+columns:
+ id: id
+ name: name
+ phone: phone
+ clientFk: client
diff --git a/modules/client/back/locale/client-contact/es.yml b/modules/client/back/locale/client-contact/es.yml
new file mode 100644
index 000000000..5802c0dde
--- /dev/null
+++ b/modules/client/back/locale/client-contact/es.yml
@@ -0,0 +1,6 @@
+name: contacto cliente
+columns:
+ id: id
+ name: nombre
+ phone: teléfono
+ clientFk: cliente
diff --git a/modules/client/back/locale/client-dms/en.yml b/modules/client/back/locale/client-dms/en.yml
new file mode 100644
index 000000000..c8ad68635
--- /dev/null
+++ b/modules/client/back/locale/client-dms/en.yml
@@ -0,0 +1,4 @@
+name: client dms
+columns:
+ dmsFk: dms
+ clientFk: client
diff --git a/modules/client/back/locale/client-dms/es.yml b/modules/client/back/locale/client-dms/es.yml
new file mode 100644
index 000000000..c683f4764
--- /dev/null
+++ b/modules/client/back/locale/client-dms/es.yml
@@ -0,0 +1,4 @@
+name: documento cliente
+columns:
+ dmsFk: dms
+ clientFk: client
diff --git a/modules/client/back/locale/client-observation/en.yml b/modules/client/back/locale/client-observation/en.yml
new file mode 100644
index 000000000..2dd8393ae
--- /dev/null
+++ b/modules/client/back/locale/client-observation/en.yml
@@ -0,0 +1,7 @@
+name: client observation
+columns:
+ id: id
+ clientFk: client
+ text: text
+ created: created
+ workerFk: worker
diff --git a/modules/client/back/locale/client-observation/es.yml b/modules/client/back/locale/client-observation/es.yml
new file mode 100644
index 000000000..0fc6bbf04
--- /dev/null
+++ b/modules/client/back/locale/client-observation/es.yml
@@ -0,0 +1,7 @@
+name: observación cliente
+columns:
+ id: id
+ clientFk: cliente
+ text: texto
+ created: creado
+ workerFk: trabajador
diff --git a/modules/client/back/locale/client-sample/en.yml b/modules/client/back/locale/client-sample/en.yml
new file mode 100644
index 000000000..77639fbb4
--- /dev/null
+++ b/modules/client/back/locale/client-sample/en.yml
@@ -0,0 +1,8 @@
+name: client sample
+columns:
+ id: id
+ created: created
+ clientFk: client
+ typeFk: type
+ userFk: user
+ companyFk: company
diff --git a/modules/client/back/locale/client-sample/es.yml b/modules/client/back/locale/client-sample/es.yml
new file mode 100644
index 000000000..6311eb25a
--- /dev/null
+++ b/modules/client/back/locale/client-sample/es.yml
@@ -0,0 +1,8 @@
+name: muestra cliente
+columns:
+ id: id
+ created: creado
+ clientFk: cliente
+ typeFk: tipo
+ userFk: usuario
+ companyFk: compañia
diff --git a/modules/client/back/locale/client/en.yml b/modules/client/back/locale/client/en.yml
new file mode 100644
index 000000000..71048f657
--- /dev/null
+++ b/modules/client/back/locale/client/en.yml
@@ -0,0 +1,50 @@
+name: client
+columns:
+ id: id
+ name: name
+ fi: fi
+ socialName: socialName
+ contact: contact
+ street: street
+ city: city
+ postcode: postcode
+ email: email
+ phone: phone
+ mobile: mobile
+ isActive: active
+ credit: credit
+ creditInsurance: credit insurance
+ iban: iban
+ dueDay: due day
+ isEqualizated: equalizated
+ isFreezed: freezed
+ hasToInvoiceByAddress: invoice by address
+ hasToInvoice: has to invoice
+ isToBeMailed: be mailed
+ hasSepaVnl: sepa nnl
+ hasLcr: lcr
+ hasCoreVnl: core vnl
+ hasCoreVnh: core vnh
+ hasIncoterms: incoterms
+ isTaxDataChecked: tax data checked
+ eypbc: eypbc
+ quality: quality
+ isVies: vies
+ isRelevant: relevant
+ accountingAccount: accounting account
+ created: created
+ sageTaxTypeFk: sage tax type
+ sageTransactionTypeFk: sage transaction type
+ businessTypeFk: business type
+ salesPersonFk: sales person
+ hasElectronicInvoice: electronic invoice
+ payMethodFk: pay method
+ provinceFk: province
+ countryFk: country
+ contactChannelFk: contact channel
+ clientTypeFk: client type
+ clientFk: client
+ defaultAddressFk: default address
+ bankEntityFk: bank entity
+ transferorFk: transferor
+
diff --git a/modules/client/back/locale/client/es.yml b/modules/client/back/locale/client/es.yml
new file mode 100644
index 000000000..04e391af0
--- /dev/null
+++ b/modules/client/back/locale/client/es.yml
@@ -0,0 +1,50 @@
+name: cliente
+columns:
+ id: id
+ name: nombre
+ fi: fi
+ socialName: nombre social
+ contact: contacto
+ street: calle
+ city: ciudad
+ postcode: código postal
+ email: email
+ phone: teléfono
+ mobile: móvil
+ isActive: activo
+ credit: crédito
+ creditInsurance: seguro crédito
+ iban: iban
+ dueDay: día vencimiento
+ isEqualizated: igualado
+ isFreezed: congelado
+ hasToInvoiceByAddress: factura por dirección
+ hasToInvoice: tiene que facturar
+ isToBeMailed: envío por email
+ hasSepaVnl: sepa nnl
+ hasLcr: lcr
+ hasCoreVnl: centro vnl
+ hasCoreVnh: cenrto vnh
+ hasIncoterms: incoterms
+ isTaxDataChecked: datos fiscales comprobados
+ eypbc: eypbc
+ quality: calidad
+ isVies: vies
+ isRelevant: importante
+ accountingAccount: cuenta contable
+ created: creado
+ sageTaxTypeFk: tipo impuesto sage
+ sageTransactionTypeFk: tipo transacción sage
+ businessTypeFk: tipo negocio
+ salesPersonFk: comercial
+ hasElectronicInvoice: factura electrónica
+ payMethodFk: método pago
+ provinceFk: provincia
+ countryFk: país
+ contactChannelFk: canal de contacto
+ clientTypeFk: tipo de cliente
+ clientFk: cliente
+ defaultAddressFk: dirección predeterminada
+ bankEntityFk: entidad bancaria
+ transferorFk: cedente
+
diff --git a/modules/client/back/locale/greuge/en.yml b/modules/client/back/locale/greuge/en.yml
new file mode 100644
index 000000000..5c84ef4ee
--- /dev/null
+++ b/modules/client/back/locale/greuge/en.yml
@@ -0,0 +1,11 @@
+name: greuge
+columns:
+ id: id
+ description: description
+ amount: amount
+ shipped: shipped
+ created: created
+ greugeTypeFk: greuge type
+ clientFk: client
+ ticketFk: ticket
+ userFk: user
diff --git a/modules/client/back/locale/greuge/es.yml b/modules/client/back/locale/greuge/es.yml
new file mode 100644
index 000000000..ffb29eb61
--- /dev/null
+++ b/modules/client/back/locale/greuge/es.yml
@@ -0,0 +1,11 @@
+name: greuge
+columns:
+ id: id
+ description: descripción
+ amount: cantidad
+ shipped: enviado
+ created: creado
+ greugeTypeFk: tipo de greuge
+ clientFk: cliente
+ ticketFk: ticket
+ userFk: usuario
diff --git a/modules/client/back/locale/recovery/en.yml b/modules/client/back/locale/recovery/en.yml
new file mode 100644
index 000000000..ba02df7c2
--- /dev/null
+++ b/modules/client/back/locale/recovery/en.yml
@@ -0,0 +1,8 @@
+name: recovery
+columns:
+ id: id
+ started: started
+ finished: finished
+ amount: amount
+ period: period
+ clientFk: client
diff --git a/modules/client/back/locale/recovery/es.yml b/modules/client/back/locale/recovery/es.yml
new file mode 100644
index 000000000..6d84b00da
--- /dev/null
+++ b/modules/client/back/locale/recovery/es.yml
@@ -0,0 +1,8 @@
+name: recuperación
+columns:
+ id: id
+ started: comenzado
+ finished: terminado
+ amount: cantidad
+ period: período
+ clientFk: cliente
diff --git a/modules/client/back/locale/tpv-transaction/en.yml b/modules/client/back/locale/tpv-transaction/en.yml
new file mode 100644
index 000000000..fbe1bbadc
--- /dev/null
+++ b/modules/client/back/locale/tpv-transaction/en.yml
@@ -0,0 +1,15 @@
+name: tpv transaction
+columns:
+ id: id
+ merchantFk: merchant
+ clientFk: client
+ receiptFk: receipt
+ amount: amount
+ response: response
+ errorCode: error code
+ status: status
+ created: created
+ merchantParameters: merchant parameters
+ signature: signature
+ signatureVersion: signature version
+ responseError: response error
diff --git a/modules/client/back/locale/tpv-transaction/es.yml b/modules/client/back/locale/tpv-transaction/es.yml
new file mode 100644
index 000000000..c751b354d
--- /dev/null
+++ b/modules/client/back/locale/tpv-transaction/es.yml
@@ -0,0 +1,15 @@
+name: transacción tpv
+columns:
+ id: id
+ merchantFk: comerciante
+ clientFk: cliente
+ receiptFk: recibo
+ amount: cantidad
+ response: respuesta
+ errorCode: código error
+ status: estado
+ created: creado
+ merchantParameters: parámetros comerciante
+ signature: firma
+ signatureVersion: versión firma
+ responseError: error de respuesta
diff --git a/modules/entry/back/locale/buy/en.yml b/modules/entry/back/locale/buy/en.yml
new file mode 100644
index 000000000..2db7c7be5
--- /dev/null
+++ b/modules/entry/back/locale/buy/en.yml
@@ -0,0 +1,18 @@
+name: buy
+columns:
+ id: id
+ quantity: quantity
+ buyingValue: buying value
+ freightValue: freight value
+ packing: packing
+ grouping: grouping
+ stickers: stickers
+ groupingMode: grouping mode
+ comissionValue: comission value
+ packageValue: package value
+ price2: price2
+ price3: price3
+ weight: weight
+ entryFk: entry
+ itemFk: item
+ packageFk: package
diff --git a/modules/entry/back/locale/buy/es.yml b/modules/entry/back/locale/buy/es.yml
new file mode 100644
index 000000000..666bf7640
--- /dev/null
+++ b/modules/entry/back/locale/buy/es.yml
@@ -0,0 +1,18 @@
+name: compra
+columns:
+ id: id
+ quantity: cantidad
+ buyingValue: valor compra
+ freightValue: valor flete
+ packing: embalaje
+ grouping: agrupación
+ stickers: pegatinas
+ groupingMode: modo agrupación
+ comissionValue: valor comisión
+ packageValue: valor paquete
+ price2: precio2
+ price3: precio3
+ weight: peso
+ entryFk: entrada
+ itemFk: artículo
+ packageFk: paquete
diff --git a/modules/entry/back/locale/entry-observation/en.yml b/modules/entry/back/locale/entry-observation/en.yml
new file mode 100644
index 000000000..efe908c9f
--- /dev/null
+++ b/modules/entry/back/locale/entry-observation/en.yml
@@ -0,0 +1,6 @@
+name: entry observation
+columns:
+ id: id
+ description: description
+ entryFk: entry
+ observationTypeFk: observation type
diff --git a/modules/entry/back/locale/entry-observation/es.yml b/modules/entry/back/locale/entry-observation/es.yml
new file mode 100644
index 000000000..43799ae00
--- /dev/null
+++ b/modules/entry/back/locale/entry-observation/es.yml
@@ -0,0 +1,6 @@
+name: observación entrada
+columns:
+ id: id
+ description: descripción
+ entryFk: entrada
+ observationTypeFk: tipo observación
diff --git a/modules/entry/back/locale/entry/en.yml b/modules/entry/back/locale/entry/en.yml
new file mode 100644
index 000000000..71f75b1bb
--- /dev/null
+++ b/modules/entry/back/locale/entry/en.yml
@@ -0,0 +1,26 @@
+name: entry
+columns:
+ id: id
+ dated: dated
+ reference: reference
+ invoiceNumber: invoice number
+ isBooked: booked
+ isExcludedFromAvailable: excluded from available
+ notes: notes
+ isConfirmed: confirmed
+ isVirtual: virtual
+ isRaid: raid
+ commission: commission
+ isOrdered: price3
+ created: created
+ observation: observation
+ isBlocked: blocked
+ loadPriority: load priority
+ supplierFk: supplier
+ travelFk: travel
+ companyFk: company
+ observationEditorFk: observation editor
+ supplierFk: supplier
+ travelFk: travel
+ companyFk: company
+ currencyFk: currency
diff --git a/modules/entry/back/locale/entry/es.yml b/modules/entry/back/locale/entry/es.yml
new file mode 100644
index 000000000..e01ded738
--- /dev/null
+++ b/modules/entry/back/locale/entry/es.yml
@@ -0,0 +1,24 @@
+name: entrada
+columns:
+ id: id
+ dated: fecha
+ reference: referencia
+ invoiceNumber: número factura
+ isBooked: reservado
+ isExcludedFromAvailable: excluido del disponible
+ notes: notas
+ isConfirmed: confirmado
+ isVirtual: virtual
+ isRaid: incursión
+ commission: comisión
+ isOrdered: precio3
+ created: creado
+ observation: observación
+ isBlocked: bloqueado
+ loadPriority: prioridad de carga
+ supplierFk: proveedor
+ travelFk: envío
+ companyFk: empresa
+ observationEditorFk: editor observación
+ supplierFk: proveedor
+ currencyFk: moneda
diff --git a/modules/item/back/locale/item/en.yml b/modules/item/back/locale/item/en.yml
new file mode 100644
index 000000000..d63c95c70
--- /dev/null
+++ b/modules/item/back/locale/item/en.yml
@@ -0,0 +1,47 @@
+name: item
+columns:
+ id: id
+ name: name
+ quantity: quantity
+ size: size
+ category: category
+ typeFk: type
+ stems: stems
+ description: description
+ isActive: active
+ relevancy: relevancy
+ weightByPiece: weight by piece
+ stemMultiplier: stem multiplier
+ image: image
+ longName: long name
+ subName: sub name
+ tag5: tag5
+ value5: value5
+ tag6: tag6
+ value6: value6
+ tag7: tag7
+ value7: value7
+ tag8: tag8
+ value8: value8
+ tag9: tag9
+ value9: value9
+ tag10: tag10
+ value10: value10
+ itemPackingTypeFk: item packing type
+ hasKgPrice: has kg price
+ family: family
+ expenseFk: expense
+ minPrice: min price
+ packingOut: packing out
+ hasMinPrice: has min price
+ isFragile: fragile
+ isFloramondo: is floramondo
+ packingShelve: packing shelve
+ isLaid: laid
+ inkFk: ink
+ originFk: origin
+ producerFk: producer
+ intrastatFk: intrastat
+ genericFk: generic
+ itemFk: item
+
diff --git a/modules/item/back/locale/item/es.yml b/modules/item/back/locale/item/es.yml
new file mode 100644
index 000000000..d65288954
--- /dev/null
+++ b/modules/item/back/locale/item/es.yml
@@ -0,0 +1,47 @@
+name: artículo
+columns:
+ id: id
+ name: nombre
+ quantity: cantidad
+ size: tamaño
+ category: categoría
+ typeFk: tipo
+ stems: tallos
+ description: descripción
+ isActive: activo
+ relevancy: relevancia
+ weightByPiece: peso por pieza
+ stemMultiplier: multiplicador de tallo
+ image: imagen
+ longName: nombre largo
+ subName: subnombre
+ tag5: etiqueta5
+ value5: valor5
+ tag6: etiqueta6
+ value6: valor6
+ tag7: etiqueta7
+ value7: valor7
+ tag8: etiqueta8
+ value8: valor8
+ tag9: etiqueta9
+ value9: valor9
+ tag10: etiqueta10
+ value10: valor10
+ itemPackingTypeFk: embalaje del artículo
+ hasKgPrice: tiene precio kg
+ family: familia
+ expenseFk: gasto
+ minPrice: precio mínimo
+ packingOut: empaquetar
+ hasMinPrice: tiene precio mínimo
+ isFragile: frágil
+ isFloramondo: es floramondo
+ packingShelve: estantería embalaje
+ isLaid: puesto
+ inkFk: tinta
+ originFk: origen
+ producerFk: productor
+ intrastatFk: intrastat
+ genericFk: genérico
+ itemFk: artículo
+
diff --git a/modules/ticket/back/locale/expedition/en.yml b/modules/ticket/back/locale/expedition/en.yml
new file mode 100644
index 000000000..1834984ea
--- /dev/null
+++ b/modules/ticket/back/locale/expedition/en.yml
@@ -0,0 +1,10 @@
+name: expedition
+columns:
+ id: id
+ freightItemFk: freight item
+ created: created
+ counter: counter
+ ticketFk: ticket
+ agencyModeFk: agency
+ workerFk: worker
+ packagingFk: packaging
diff --git a/modules/ticket/back/locale/expedition/es.yml b/modules/ticket/back/locale/expedition/es.yml
new file mode 100644
index 000000000..32f72b943
--- /dev/null
+++ b/modules/ticket/back/locale/expedition/es.yml
@@ -0,0 +1,10 @@
+name: expedición
+columns:
+ id: id
+ freightItemFk: artículo de carga
+ created: creado
+ counter: contador
+ ticketFk: ticket
+ agencyModeFk: agencia
+ workerFk: trabajador
+ packagingFk: embalaje
diff --git a/modules/ticket/back/locale/sale/en.yml b/modules/ticket/back/locale/sale/en.yml
index ae8f67d5e..f844bf0c5 100644
--- a/modules/ticket/back/locale/sale/en.yml
+++ b/modules/ticket/back/locale/sale/en.yml
@@ -1,11 +1,13 @@
-concept: concept
-quantity: quantity
-price: price
-discount: discount
-reserved: reserved
-isPicked: is picked
-created: created
-originalQuantity: original quantity
-itemFk: item
-ticketFk: ticket
-saleFk: sale
+name: sale
+columns:
+ concept: concept
+ quantity: quantity
+ price: price
+ discount: discount
+ reserved: reserved
+ isPicked: is picked
+ created: created
+ originalQuantity: original quantity
+ itemFk: item
+ ticketFk: ticket
+ saleFk: sale
diff --git a/modules/ticket/back/locale/sale/es.yml b/modules/ticket/back/locale/sale/es.yml
index ff8cc5466..8196a089c 100644
--- a/modules/ticket/back/locale/sale/es.yml
+++ b/modules/ticket/back/locale/sale/es.yml
@@ -1,11 +1,13 @@
-concept: concepto
-quantity: cantidad
-price: precio
-discount: descuento
-reserved: reservado
-isPicked: esta seleccionado
-created: creado
-originalQuantity: cantidad original
-itemFk: artículo
-ticketFk: ticket
-saleFk: línea
+name: línea
+columns:
+ concept: concepto
+ quantity: cantidad
+ price: precio
+ discount: descuento
+ reserved: reservado
+ isPicked: esta seleccionado
+ created: creado
+ originalQuantity: cantidad original
+ itemFk: artículo
+ ticketFk: ticket
+ saleFk: línea
diff --git a/modules/ticket/back/locale/ticket-dms/en.yml b/modules/ticket/back/locale/ticket-dms/en.yml
new file mode 100644
index 000000000..771e4daf3
--- /dev/null
+++ b/modules/ticket/back/locale/ticket-dms/en.yml
@@ -0,0 +1,4 @@
+name: ticket dms
+columns:
+ dmsFk: dms
+ ticketFk: ticket
diff --git a/modules/ticket/back/locale/ticket-dms/es.yml b/modules/ticket/back/locale/ticket-dms/es.yml
new file mode 100644
index 000000000..360268428
--- /dev/null
+++ b/modules/ticket/back/locale/ticket-dms/es.yml
@@ -0,0 +1,4 @@
+name: documento ticket
+columns:
+ dmsFk: dms
+ ticketFk: ticket
diff --git a/modules/ticket/back/locale/ticket-observation/en.yml b/modules/ticket/back/locale/ticket-observation/en.yml
new file mode 100644
index 000000000..40bd567bf
--- /dev/null
+++ b/modules/ticket/back/locale/ticket-observation/en.yml
@@ -0,0 +1,6 @@
+name: ticket observation
+columns:
+ id: id
+ description: description
+ ticketFk: ticket
+ observationTypeFk: observation type
diff --git a/modules/ticket/back/locale/ticket-observation/es.yml b/modules/ticket/back/locale/ticket-observation/es.yml
new file mode 100644
index 000000000..155eb58e2
--- /dev/null
+++ b/modules/ticket/back/locale/ticket-observation/es.yml
@@ -0,0 +1,6 @@
+name: observación ticket
+columns:
+ id: id
+ description: descripción
+ ticketFk: ticket
+ observationTypeFk: tipo observación
diff --git a/modules/ticket/back/locale/ticket-packaging/en.yml b/modules/ticket/back/locale/ticket-packaging/en.yml
new file mode 100644
index 000000000..4dd018524
--- /dev/null
+++ b/modules/ticket/back/locale/ticket-packaging/en.yml
@@ -0,0 +1,8 @@
+name: ticket packaging
+columns:
+ id: id
+ quantity: quantity
+ created: created
+ pvp: pvp
+ ticketFk: ticket
+ packagingFk: packaging
diff --git a/modules/ticket/back/locale/ticket-packaging/es.yml b/modules/ticket/back/locale/ticket-packaging/es.yml
new file mode 100644
index 000000000..a31a8c097
--- /dev/null
+++ b/modules/ticket/back/locale/ticket-packaging/es.yml
@@ -0,0 +1,8 @@
+name: embalaje ticket
+columns:
+ id: id
+ quantity: cantidad
+ created: creado
+ pvp: pvp
+ ticketFk: ticket
+ packagingFk: embalaje
diff --git a/modules/ticket/back/locale/ticket-refund/en.yml b/modules/ticket/back/locale/ticket-refund/en.yml
new file mode 100644
index 000000000..961b5c8c3
--- /dev/null
+++ b/modules/ticket/back/locale/ticket-refund/en.yml
@@ -0,0 +1,5 @@
+name: ticket refund
+columns:
+ id: id
+ refundTicketFk: refund ticket
+ originalTicketFk: original ticket
diff --git a/modules/ticket/back/locale/ticket-refund/es.yml b/modules/ticket/back/locale/ticket-refund/es.yml
new file mode 100644
index 000000000..8826ef949
--- /dev/null
+++ b/modules/ticket/back/locale/ticket-refund/es.yml
@@ -0,0 +1,5 @@
+name: ticket abono
+columns:
+ id: id
+ refundTicketFk: ticket abono
+ originalTicketFk: ticket original
diff --git a/modules/ticket/back/locale/ticket-request/en.yml b/modules/ticket/back/locale/ticket-request/en.yml
new file mode 100644
index 000000000..56cb297e4
--- /dev/null
+++ b/modules/ticket/back/locale/ticket-request/en.yml
@@ -0,0 +1,15 @@
+name: ticket request
+columns:
+ id: id
+ description: description
+ created: created
+ quantity: quantity
+ price: price
+ isOk: Ok
+ response: response
+ saleFk: sale
+ ticketFk: ticket
+ attenderFk: attender
+ requesterFk: requester
+ itemFk: item
+
diff --git a/modules/ticket/back/locale/ticket-request/es.yml b/modules/ticket/back/locale/ticket-request/es.yml
new file mode 100644
index 000000000..8982a684d
--- /dev/null
+++ b/modules/ticket/back/locale/ticket-request/es.yml
@@ -0,0 +1,15 @@
+name: peticiones ticket
+columns:
+ id: id
+ description: descripción
+ created: creado
+ quantity: cantidad
+ price: precio
+ isOk: Ok
+ response: respuesta
+ saleFk: línea
+ ticketFk: ticket
+ attenderFk: asistente
+ requesterFk: solicitante
+ itemFk: artículo
+
diff --git a/modules/ticket/back/locale/ticket-service/en.yml b/modules/ticket/back/locale/ticket-service/en.yml
new file mode 100644
index 000000000..cf4e6f43f
--- /dev/null
+++ b/modules/ticket/back/locale/ticket-service/en.yml
@@ -0,0 +1,10 @@
+name: ticket service
+columns:
+ id: id
+ ticketFk: ticket
+ description: description
+ quantity: quantity
+ price: price
+ taxClassFk: tax class
+ ticketServiceTypeFk: ticket service type
+
diff --git a/modules/ticket/back/locale/ticket-service/es.yml b/modules/ticket/back/locale/ticket-service/es.yml
new file mode 100644
index 000000000..ee07c13d3
--- /dev/null
+++ b/modules/ticket/back/locale/ticket-service/es.yml
@@ -0,0 +1,10 @@
+name: servicios ticket
+columns:
+ id: id
+ ticketFk: ticket
+ description: descripción
+ quantity: cantidad
+ price: precio
+ taxClassFk: tipo impuestos
+ ticketServiceTypeFk: tipo servicio ticket
+
diff --git a/modules/ticket/back/locale/ticket-tracking/en.yml b/modules/ticket/back/locale/ticket-tracking/en.yml
new file mode 100644
index 000000000..15505a763
--- /dev/null
+++ b/modules/ticket/back/locale/ticket-tracking/en.yml
@@ -0,0 +1,7 @@
+name: ticket tracking
+columns:
+ id: id
+ created: created
+ ticketFk: ticket
+ stateFk: state
+ workerFk: worker
diff --git a/modules/ticket/back/locale/ticket-tracking/es.yml b/modules/ticket/back/locale/ticket-tracking/es.yml
new file mode 100644
index 000000000..3459ab367
--- /dev/null
+++ b/modules/ticket/back/locale/ticket-tracking/es.yml
@@ -0,0 +1,7 @@
+name: seguimiento ticket
+columns:
+ id: id
+ created: creado
+ ticketFk: ticket
+ stateFk: estado
+ workerFk: trabajador
diff --git a/modules/ticket/back/locale/ticket-weekly/en.yml b/modules/ticket/back/locale/ticket-weekly/en.yml
new file mode 100644
index 000000000..af1c94dc9
--- /dev/null
+++ b/modules/ticket/back/locale/ticket-weekly/en.yml
@@ -0,0 +1,5 @@
+name: ticket weekly
+columns:
+ ticketFk: ticket
+ weekDay: week day
+ agencyModeFk: agency
diff --git a/modules/ticket/back/locale/ticket-weekly/es.yml b/modules/ticket/back/locale/ticket-weekly/es.yml
new file mode 100644
index 000000000..597d9d46a
--- /dev/null
+++ b/modules/ticket/back/locale/ticket-weekly/es.yml
@@ -0,0 +1,5 @@
+name: ticket semanal
+columns:
+ ticketFk: ticket
+ weekDay: día semana
+ agencyModeFk: agencia
diff --git a/modules/ticket/back/locale/ticket/en.yml b/modules/ticket/back/locale/ticket/en.yml
index c4ad84232..2481c42f8 100644
--- a/modules/ticket/back/locale/ticket/en.yml
+++ b/modules/ticket/back/locale/ticket/en.yml
@@ -1,23 +1,25 @@
-shipped: shipped
-landed: landed
-nickname: nickname
-location: location
-solution: solution
-packages: packages
-updated: updated
-isDeleted: is deleted
-priority: priority
-zoneFk: zone
-zonePrice: zone price
-zoneBonus: zone bonus
-totalWithVat: total with vat
-totalWithoutVat: total without vat
-clientFk: client
-warehouseFk: warehouse
-refFk: reference
-addressFk: address
-routeFk: route
-companyFk: company
-agencyModeFk: agency
-ticketFk: ticket
-mergedTicket: merged ticket
+name: ticket
+columns:
+ shipped: shipped
+ landed: landed
+ nickname: nickname
+ location: location
+ solution: solution
+ packages: packages
+ updated: updated
+ isDeleted: is deleted
+ priority: priority
+ zoneFk: zone
+ zonePrice: zone price
+ zoneBonus: zone bonus
+ totalWithVat: total with vat
+ totalWithoutVat: total without vat
+ clientFk: client
+ warehouseFk: warehouse
+ refFk: reference
+ addressFk: address
+ routeFk: route
+ companyFk: company
+ agencyModeFk: agency
+ ticketFk: ticket
+ mergedTicket: merged ticket
diff --git a/modules/ticket/back/locale/ticket/es.yml b/modules/ticket/back/locale/ticket/es.yml
index 15b5a39bf..558378612 100644
--- a/modules/ticket/back/locale/ticket/es.yml
+++ b/modules/ticket/back/locale/ticket/es.yml
@@ -1,25 +1,27 @@
-shipped: fecha salida
-landed: fecha entrega
-nickname: alias
-location: ubicación
-solution: solución
-packages: embalajes
-updated: fecha última actualización
-isDeleted: esta eliminado
-priority: prioridad
-zoneFk: zona
-zonePrice: precio zona
-zoneBonus: bonus zona
-totalWithVat: total con IVA
-totalWithoutVat: total sin IVA
-clientFk: cliente
-warehouseFk: almacén
-refFk: referencia
-addressFk: dirección
-routeFk: ruta
-companyFk: empresa
-agencyModeFk: agencia
-ticketFk: ticket
-mergedTicket: ticket fusionado
-withWarningAccept: aviso negativos
-isWithoutNegatives: sin negativos
+name: ticket
+columns:
+ shipped: salida
+ landed: entrega
+ nickname: alias
+ location: ubicación
+ solution: solución
+ packages: embalajes
+ updated: última actualización
+ isDeleted: eliminado
+ priority: prioridad
+ zoneFk: zona
+ zonePrice: precio zona
+ zoneBonus: bonus zona
+ totalWithVat: total con IVA
+ totalWithoutVat: total sin IVA
+ clientFk: cliente
+ warehouseFk: almacén
+ refFk: referencia
+ addressFk: dirección
+ routeFk: ruta
+ companyFk: empresa
+ agencyModeFk: agencia
+ ticketFk: ticket
+ mergedTicket: ticket fusionado
+ withWarningAccept: aviso negativos
+ isWithoutNegatives: sin negativos
diff --git a/modules/worker/back/locale/worker-dms/en.yml b/modules/worker/back/locale/worker-dms/en.yml
new file mode 100644
index 000000000..f870adaf0
--- /dev/null
+++ b/modules/worker/back/locale/worker-dms/en.yml
@@ -0,0 +1,6 @@
+name: worker dms
+columns:
+ id: id
+ dmsFk: dms
+ workerFk: worker
+ isReadableByWorker: readable by worker
diff --git a/modules/worker/back/locale/worker-dms/es.yml b/modules/worker/back/locale/worker-dms/es.yml
new file mode 100644
index 000000000..c3bdea5af
--- /dev/null
+++ b/modules/worker/back/locale/worker-dms/es.yml
@@ -0,0 +1,6 @@
+name: documento trabajador
+columns:
+ id: id
+ dmsFk: dms
+ workerFk: trabajador
+ isReadableByWorker: legible por trabajador
From 9594bd68b5333866d1eff8309f3a1979e1f01be4 Mon Sep 17 00:00:00 2001
From: pablone
Date: Wed, 12 Apr 2023 21:10:50 +0200
Subject: [PATCH 038/300] refs #4795
---
modules/client/back/methods/client/getCard.js | 2 +-
modules/client/back/methods/client/getDebt.js | 2 +-
modules/monitor/back/methods/sales-monitor/salesFilter.js | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules/client/back/methods/client/getCard.js b/modules/client/back/methods/client/getCard.js
index a2365ee25..414cbe058 100644
--- a/modules/client/back/methods/client/getCard.js
+++ b/modules/client/back/methods/client/getCard.js
@@ -76,7 +76,7 @@ module.exports = function(Self) {
const date = Date.vnNew();
date.setHours(0, 0, 0, 0);
- const query = `SELECT vn.clientGetDebt(?, ?) AS debt`;
+ const query = `SELECT vn.client_getDebt(?, ?) AS debt`;
const data = await Self.rawSql(query, [id, date], myOptions);
client.debt = data[0].debt;
diff --git a/modules/client/back/methods/client/getDebt.js b/modules/client/back/methods/client/getDebt.js
index 5f8a8c569..859746083 100644
--- a/modules/client/back/methods/client/getDebt.js
+++ b/modules/client/back/methods/client/getDebt.js
@@ -27,7 +27,7 @@ module.exports = Self => {
const date = Date.vnNew();
date.setHours(0, 0, 0, 0);
- const query = `SELECT vn.clientGetDebt(?, ?) AS debt`;
+ const query = `SELECT vn.client_getDebt(?, ?) AS debt`;
const [debt] = await Self.rawSql(query, [clientFk, date], myOptions);
return debt;
diff --git a/modules/monitor/back/methods/sales-monitor/salesFilter.js b/modules/monitor/back/methods/sales-monitor/salesFilter.js
index 8f7b336ab..4f9edd11c 100644
--- a/modules/monitor/back/methods/sales-monitor/salesFilter.js
+++ b/modules/monitor/back/methods/sales-monitor/salesFilter.js
@@ -238,7 +238,7 @@ module.exports = Self => {
ENGINE = MEMORY
SELECT DISTINCT clientFk FROM tmp.filter`);
- stmt = new ParameterizedSQL('CALL clientGetDebt(?)', [args.to]);
+ stmt = new ParameterizedSQL('CALL client_getDebt(?)', [args.to]);
stmts.push(stmt);
stmts.push('DROP TEMPORARY TABLE tmp.clientGetDebt');
From ad267c933c68149e7c693ff031e1edc8c2af24f6 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Thu, 13 Apr 2023 08:30:33 +0200
Subject: [PATCH 039/300] refs #5540 country.code
---
db/changes/231401/00-updateIsVies.sql | 8 +++++---
modules/supplier/back/models/supplier.js | 9 ++++++++-
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/db/changes/231401/00-updateIsVies.sql b/db/changes/231401/00-updateIsVies.sql
index 1d2e55441..83fde7352 100644
--- a/db/changes/231401/00-updateIsVies.sql
+++ b/db/changes/231401/00-updateIsVies.sql
@@ -1,3 +1,5 @@
-UPDATE vn.supplier
-SET nif = SUBSTRING(nif, IF(ASCII(SUBSTRING(nif, 1, 1)) BETWEEN 65 AND 90 AND ASCII(SUBSTRING(nif, 2, 1)) BETWEEN 65 AND 90, 3, 1), LENGTH(nif))
-WHERE isVies = 1 AND nif REGEXP '^[a-zA-Z]{2}';
+ UPDATE vn.supplier s
+ JOIN vn.country c ON c.id = s.countryFk
+ SET s.nif = MID(REPLACE(s.nif, ' ', ''), 3, LENGTH(REPLACE(s.nif, ' ', '')) - 1)
+ WHERE s.isVies = TRUE
+ AND c.code = LEFT(REPLACE(s.nif, ' ', ''), 2);
\ No newline at end of file
diff --git a/modules/supplier/back/models/supplier.js b/modules/supplier/back/models/supplier.js
index 7f12e86ef..c889fd420 100644
--- a/modules/supplier/back/models/supplier.js
+++ b/modules/supplier/back/models/supplier.js
@@ -77,7 +77,14 @@ module.exports = Self => {
message: 'The first two values are letters'});
async function nifInvalid(err, done) {
- if (this.isVies && /^[a-zA-Z]{2}/.test(this.nif))
+ const filter = {
+ fields: ['code'],
+ where: {id: this.countryFk}
+ };
+ const countryCode = this.nif.toUpperCase().substring(0, 2);
+ const country = await Self.app.models.Country.findOne(filter);
+ const code = country ? country.code : null;
+ if (this.isVies && countryCode == code)
err();
done();
}
From 3790e3457f54b4d65b5667b0a1bd878bc9b10ab3 Mon Sep 17 00:00:00 2001
From: vicent
Date: Thu, 13 Apr 2023 08:43:42 +0200
Subject: [PATCH 040/300] =?UTF-8?q?refs=20#5517=20a=C3=B1adidas=20m=C3=A1s?=
=?UTF-8?q?=20traducciones?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
modules/entry/back/locale/entry/en.yml | 3 --
modules/entry/back/locale/entry/es.yml | 1 -
modules/item/back/locale/item-barcode/en.yml | 5 +++
modules/item/back/locale/item-barcode/es.yml | 5 +++
.../item/back/locale/item-botanical/en.yml | 5 +++
.../item/back/locale/item-botanical/es.yml | 5 +++
modules/item/back/locale/item-tag/en.yml | 7 ++++
modules/item/back/locale/item-tag/es.yml | 7 ++++
.../item/back/locale/item-tax-country/en.yml | 7 ++++
.../item/back/locale/item-tax-country/es.yml | 7 ++++
modules/route/back/locale/route/en.yml | 19 ++++++++++
modules/route/back/locale/route/es.yml | 19 ++++++++++
.../back/locale/supplier-account/en.yml | 7 ++++
.../back/locale/supplier-account/es.yml | 7 ++++
.../back/locale/supplier-contact/en.yml | 9 +++++
.../back/locale/supplier-contact/es.yml | 9 +++++
modules/supplier/back/locale/supplier/en.yml | 38 +++++++++++++++++++
modules/supplier/back/locale/supplier/es.yml | 38 +++++++++++++++++++
.../ticket/back/locale/ticket-request/en.yml | 2 +-
.../ticket/back/locale/ticket-request/es.yml | 2 +-
.../back/locale/travel-thermograph/en.yml | 10 +++++
.../back/locale/travel-thermograph/es.yml | 10 +++++
modules/travel/back/locale/travel/en.yml | 15 ++++++++
modules/travel/back/locale/travel/es.yml | 15 ++++++++
modules/worker/back/locale/calendar/en.yml | 6 +++
modules/worker/back/locale/calendar/es.yml | 6 +++
.../locale/worker-time-control-mail/en.yml | 10 +++++
.../locale/worker-time-control-mail/es.yml | 10 +++++
modules/worker/back/locale/worker/en.yml | 20 ++++++++++
modules/worker/back/locale/worker/es.yml | 20 ++++++++++
modules/zone/back/locale/zone-event/en.yml | 14 +++++++
modules/zone/back/locale/zone-event/es.yml | 14 +++++++
.../zone/back/locale/zone-exclusion/en.yml | 5 +++
.../zone/back/locale/zone-exclusion/es.yml | 5 +++
modules/zone/back/locale/zone-included/en.yml | 5 +++
modules/zone/back/locale/zone-included/es.yml | 5 +++
.../zone/back/locale/zone-warehouse/en.yml | 5 +++
.../zone/back/locale/zone-warehouse/es.yml | 5 +++
modules/zone/back/locale/zone/en.yml | 14 +++++++
modules/zone/back/locale/zone/es.yml | 14 +++++++
40 files changed, 404 insertions(+), 6 deletions(-)
create mode 100644 modules/item/back/locale/item-barcode/en.yml
create mode 100644 modules/item/back/locale/item-barcode/es.yml
create mode 100644 modules/item/back/locale/item-botanical/en.yml
create mode 100644 modules/item/back/locale/item-botanical/es.yml
create mode 100644 modules/item/back/locale/item-tag/en.yml
create mode 100644 modules/item/back/locale/item-tag/es.yml
create mode 100644 modules/item/back/locale/item-tax-country/en.yml
create mode 100644 modules/item/back/locale/item-tax-country/es.yml
create mode 100644 modules/route/back/locale/route/en.yml
create mode 100644 modules/route/back/locale/route/es.yml
create mode 100644 modules/supplier/back/locale/supplier-account/en.yml
create mode 100644 modules/supplier/back/locale/supplier-account/es.yml
create mode 100644 modules/supplier/back/locale/supplier-contact/en.yml
create mode 100644 modules/supplier/back/locale/supplier-contact/es.yml
create mode 100644 modules/supplier/back/locale/supplier/en.yml
create mode 100644 modules/supplier/back/locale/supplier/es.yml
create mode 100644 modules/travel/back/locale/travel-thermograph/en.yml
create mode 100644 modules/travel/back/locale/travel-thermograph/es.yml
create mode 100644 modules/travel/back/locale/travel/en.yml
create mode 100644 modules/travel/back/locale/travel/es.yml
create mode 100644 modules/worker/back/locale/calendar/en.yml
create mode 100644 modules/worker/back/locale/calendar/es.yml
create mode 100644 modules/worker/back/locale/worker-time-control-mail/en.yml
create mode 100644 modules/worker/back/locale/worker-time-control-mail/es.yml
create mode 100644 modules/worker/back/locale/worker/en.yml
create mode 100644 modules/worker/back/locale/worker/es.yml
create mode 100644 modules/zone/back/locale/zone-event/en.yml
create mode 100644 modules/zone/back/locale/zone-event/es.yml
create mode 100644 modules/zone/back/locale/zone-exclusion/en.yml
create mode 100644 modules/zone/back/locale/zone-exclusion/es.yml
create mode 100644 modules/zone/back/locale/zone-included/en.yml
create mode 100644 modules/zone/back/locale/zone-included/es.yml
create mode 100644 modules/zone/back/locale/zone-warehouse/en.yml
create mode 100644 modules/zone/back/locale/zone-warehouse/es.yml
create mode 100644 modules/zone/back/locale/zone/en.yml
create mode 100644 modules/zone/back/locale/zone/es.yml
diff --git a/modules/entry/back/locale/entry/en.yml b/modules/entry/back/locale/entry/en.yml
index 71f75b1bb..6bc2333e6 100644
--- a/modules/entry/back/locale/entry/en.yml
+++ b/modules/entry/back/locale/entry/en.yml
@@ -20,7 +20,4 @@ columns:
travelFk: travel
companyFk: company
observationEditorFk: observation editor
- supplierFk: supplier
- travelFk: travel
- companyFk: company
currencyFk: currency
diff --git a/modules/entry/back/locale/entry/es.yml b/modules/entry/back/locale/entry/es.yml
index e01ded738..3a0c3d9c1 100644
--- a/modules/entry/back/locale/entry/es.yml
+++ b/modules/entry/back/locale/entry/es.yml
@@ -20,5 +20,4 @@ columns:
travelFk: envío
companyFk: empresa
observationEditorFk: editor observación
- supplierFk: proveedor
currencyFk: moneda
diff --git a/modules/item/back/locale/item-barcode/en.yml b/modules/item/back/locale/item-barcode/en.yml
new file mode 100644
index 000000000..c1b20855f
--- /dev/null
+++ b/modules/item/back/locale/item-barcode/en.yml
@@ -0,0 +1,5 @@
+name: item barcode
+columns:
+ id: id
+ code: code
+ itemFk: item
diff --git a/modules/item/back/locale/item-barcode/es.yml b/modules/item/back/locale/item-barcode/es.yml
new file mode 100644
index 000000000..c1557f6d8
--- /dev/null
+++ b/modules/item/back/locale/item-barcode/es.yml
@@ -0,0 +1,5 @@
+name: código barras artículo
+columns:
+ id: id
+ code: código
+ itemFk: artículo
diff --git a/modules/item/back/locale/item-botanical/en.yml b/modules/item/back/locale/item-botanical/en.yml
new file mode 100644
index 000000000..f5a9e4c5a
--- /dev/null
+++ b/modules/item/back/locale/item-botanical/en.yml
@@ -0,0 +1,5 @@
+name: item botanical
+columns:
+ itemFk: item
+ genusFk: genus
+ specieFk: specie
diff --git a/modules/item/back/locale/item-botanical/es.yml b/modules/item/back/locale/item-botanical/es.yml
new file mode 100644
index 000000000..8e0a45491
--- /dev/null
+++ b/modules/item/back/locale/item-botanical/es.yml
@@ -0,0 +1,5 @@
+name: artículo botánico
+columns:
+ itemFk: artículo
+ genusFk: género
+ specieFk: especie
diff --git a/modules/item/back/locale/item-tag/en.yml b/modules/item/back/locale/item-tag/en.yml
new file mode 100644
index 000000000..fee588b4c
--- /dev/null
+++ b/modules/item/back/locale/item-tag/en.yml
@@ -0,0 +1,7 @@
+name: item tag
+columns:
+ id: id
+ value: value
+ itemFk: item
+ tagFk: tag
+ priority: priority
diff --git a/modules/item/back/locale/item-tag/es.yml b/modules/item/back/locale/item-tag/es.yml
new file mode 100644
index 000000000..3e1d1a9cf
--- /dev/null
+++ b/modules/item/back/locale/item-tag/es.yml
@@ -0,0 +1,7 @@
+name: etiqueta artículo
+columns:
+ id: id
+ value: valor
+ itemFk: artículo
+ tagFk: etiqueta
+ priority: prioridad
diff --git a/modules/item/back/locale/item-tax-country/en.yml b/modules/item/back/locale/item-tax-country/en.yml
new file mode 100644
index 000000000..060ad9910
--- /dev/null
+++ b/modules/item/back/locale/item-tax-country/en.yml
@@ -0,0 +1,7 @@
+name: item tax country
+columns:
+ id: id
+ effectived: effectived
+ itemFk: item
+ countryFk: country
+ taxClassFk: tax class
diff --git a/modules/item/back/locale/item-tax-country/es.yml b/modules/item/back/locale/item-tax-country/es.yml
new file mode 100644
index 000000000..2a0e6b5e2
--- /dev/null
+++ b/modules/item/back/locale/item-tax-country/es.yml
@@ -0,0 +1,7 @@
+name: impuesto país del artículo
+columns:
+ id: id
+ effectived: efectivo
+ itemFk: artículo
+ countryFk: país
+ taxClassFk: clase impuestos
diff --git a/modules/route/back/locale/route/en.yml b/modules/route/back/locale/route/en.yml
new file mode 100644
index 000000000..96aaddb72
--- /dev/null
+++ b/modules/route/back/locale/route/en.yml
@@ -0,0 +1,19 @@
+name: route
+columns:
+ id: id
+ created: created
+ time: time
+ kmStart: km start
+ kmEnd: km end
+ started: started
+ finished: finished
+ gestdoc: gestdoc
+ cost: cost
+ m3: m3
+ description: description
+ isOk: ok
+ workerFk: worker
+ vehicleFk: vehicle
+ agencyModeFk: agency
+ routeFk: route
+ zoneFk: zone
diff --git a/modules/route/back/locale/route/es.yml b/modules/route/back/locale/route/es.yml
new file mode 100644
index 000000000..d1e38ff7e
--- /dev/null
+++ b/modules/route/back/locale/route/es.yml
@@ -0,0 +1,19 @@
+name: ruta
+columns:
+ id: id
+ created: creado
+ time: tiempo
+ kmStart: km inicio
+ kmEnd: km fin
+ started: comenzado
+ finished: terminado
+ gestdoc: gestdoc
+ cost: costo
+ m3: m3
+ description: descripción
+ isOk: ok
+ workerFk: trabajador
+ vehicleFk: vehículo
+ agencyModeFk: agencia
+ routeFk: ruta
+ zoneFk: zona
diff --git a/modules/supplier/back/locale/supplier-account/en.yml b/modules/supplier/back/locale/supplier-account/en.yml
new file mode 100644
index 000000000..bc2add833
--- /dev/null
+++ b/modules/supplier/back/locale/supplier-account/en.yml
@@ -0,0 +1,7 @@
+name: supplier account
+columns:
+ id: id
+ iban: iban
+ beneficiary: beneficiary
+ supplierFk: supplier
+ bankEntityFk: bank entity
diff --git a/modules/supplier/back/locale/supplier-account/es.yml b/modules/supplier/back/locale/supplier-account/es.yml
new file mode 100644
index 000000000..0d751b387
--- /dev/null
+++ b/modules/supplier/back/locale/supplier-account/es.yml
@@ -0,0 +1,7 @@
+name: cuenta proveedor
+columns:
+ id: id
+ iban: iban
+ beneficiary: beneficiario
+ supplierFk: proveedor
+ bankEntityFk: entidad bancaria
diff --git a/modules/supplier/back/locale/supplier-contact/en.yml b/modules/supplier/back/locale/supplier-contact/en.yml
new file mode 100644
index 000000000..62f923293
--- /dev/null
+++ b/modules/supplier/back/locale/supplier-contact/en.yml
@@ -0,0 +1,9 @@
+name: supplier contact
+columns:
+ id: id
+ supplierFk: supplier
+ phone: phone
+ mobile: mobile
+ email: email
+ observation: observation
+ name: name
diff --git a/modules/supplier/back/locale/supplier-contact/es.yml b/modules/supplier/back/locale/supplier-contact/es.yml
new file mode 100644
index 000000000..d35f0bf2e
--- /dev/null
+++ b/modules/supplier/back/locale/supplier-contact/es.yml
@@ -0,0 +1,9 @@
+name: contacto proveedor
+columns:
+ id: id
+ supplierFk: proveedor
+ phone: teléfono
+ mobile: móvil
+ email: email
+ observation: observación
+ name: nombre
diff --git a/modules/supplier/back/locale/supplier/en.yml b/modules/supplier/back/locale/supplier/en.yml
new file mode 100644
index 000000000..292d7d0b6
--- /dev/null
+++ b/modules/supplier/back/locale/supplier/en.yml
@@ -0,0 +1,38 @@
+name: supplier
+columns:
+ id: id
+ name: name
+ account: account
+ countryFk: country
+ nif: nif
+ phone: phone
+ retAccount: ret account
+ commission: commission
+ postcodeFk: postcode
+ isActive: active
+ isOfficial: official
+ isSerious: serious
+ isTrucker: trucker
+ note: note
+ street: street
+ city: city
+ provinceFk: province
+ postCode: postcode
+ payMethodFk: pay method
+ payDemFk: pay dem
+ payDay: pay day
+ nickname: nickname
+ workerFk: worker
+ sageTaxTypeFk: sage tax type
+ taxTypeSageFk: sage tax type
+ sageTransactionTypeFk: sage transaction type
+ transactionTypeSageFk: sage transaction type
+ sageWithholdingFk: sage with holding
+ withholdingSageFk: sage with holding
+ isPayMethodChecked: pay method checked
+ supplierActivityFk: supplier activity
+ healthRegister: health register
+ isVies: vies
+ provinceFk: province
+ countryFk: country
+ supplierFk: supplier
diff --git a/modules/supplier/back/locale/supplier/es.yml b/modules/supplier/back/locale/supplier/es.yml
new file mode 100644
index 000000000..57c534aa5
--- /dev/null
+++ b/modules/supplier/back/locale/supplier/es.yml
@@ -0,0 +1,38 @@
+name: proveedor
+columns:
+ id: id
+ name: nombre
+ account: cuenta
+ countryFk: país
+ nif: nif
+ phone: teléfono
+ retAccount: cuenta ret
+ commission: comisión
+ postcodeFk: código postal
+ isActive: activo
+ isOfficial: oficial
+ isSerious: serio
+ isTrucker: camionero
+ note: nota
+ street: calle
+ city: ciudad
+ provinceFk: provincia
+ postCode: código postal
+ payMethodFk: método pago
+ payDemFk: pagar dem
+ payDay: día pago
+ nickname: apodo
+ workerFk: trabajador
+ sageTaxTypeFk: tipo de impuesto sage
+ taxTypeSageFk: tipo de impuesto sage
+ sageTransactionTypeFk: tipo de transacción sage
+ transactionTypeSageFk: tipo de transacción sage
+ sageWithholdingFk: sage con tenencia
+ withholdingSageFk: sage con tenencia
+ isPayMethodChecked: método pago verificado
+ supplierActivityFk: actividad del proveedor
+ healthRegister: registro sanitario
+ isVies: vies
+ provinceFk: provincia
+ countryFk: país
+ supplierFk: proveedor
diff --git a/modules/ticket/back/locale/ticket-request/en.yml b/modules/ticket/back/locale/ticket-request/en.yml
index 56cb297e4..498a933ac 100644
--- a/modules/ticket/back/locale/ticket-request/en.yml
+++ b/modules/ticket/back/locale/ticket-request/en.yml
@@ -5,7 +5,7 @@ columns:
created: created
quantity: quantity
price: price
- isOk: Ok
+ isOk: ok
response: response
saleFk: sale
ticketFk: ticket
diff --git a/modules/ticket/back/locale/ticket-request/es.yml b/modules/ticket/back/locale/ticket-request/es.yml
index 8982a684d..b2871e737 100644
--- a/modules/ticket/back/locale/ticket-request/es.yml
+++ b/modules/ticket/back/locale/ticket-request/es.yml
@@ -5,7 +5,7 @@ columns:
created: creado
quantity: cantidad
price: precio
- isOk: Ok
+ isOk: ok
response: respuesta
saleFk: línea
ticketFk: ticket
diff --git a/modules/travel/back/locale/travel-thermograph/en.yml b/modules/travel/back/locale/travel-thermograph/en.yml
new file mode 100644
index 000000000..92acee896
--- /dev/null
+++ b/modules/travel/back/locale/travel-thermograph/en.yml
@@ -0,0 +1,10 @@
+name: travel thermograph
+columns:
+ id: id
+ created: created
+ temperatureFk: temperature
+ result: result
+ warehouseFk: warehouse
+ travelFk: travel
+ dmsFk: dms
+ thermographFk: thermograph
diff --git a/modules/travel/back/locale/travel-thermograph/es.yml b/modules/travel/back/locale/travel-thermograph/es.yml
new file mode 100644
index 000000000..0d08863b6
--- /dev/null
+++ b/modules/travel/back/locale/travel-thermograph/es.yml
@@ -0,0 +1,10 @@
+name: travel thermograph
+columns:
+ id: id
+ created: creado
+ temperatureFk: temperatura
+ result: resultado
+ warehouseFk: almacén
+ travelFk: envío
+ dmsFk: dms
+ thermographFk: termógrafo
diff --git a/modules/travel/back/locale/travel/en.yml b/modules/travel/back/locale/travel/en.yml
new file mode 100644
index 000000000..f3bab57d1
--- /dev/null
+++ b/modules/travel/back/locale/travel/en.yml
@@ -0,0 +1,15 @@
+name: travel
+columns:
+ id: id
+ shipped: shipped
+ landed: landed
+ isDelivered: delivered
+ isReceived: received
+ ref: ref
+ totalEntries: total entries
+ m3: m3
+ kg: kg
+ cargoSupplierFk: cargo supplier
+ agencyModeFk: agency
+ warehouseInFk: warehouse in
+ warehouseOutFk: warehouse out
diff --git a/modules/travel/back/locale/travel/es.yml b/modules/travel/back/locale/travel/es.yml
new file mode 100644
index 000000000..ac86c003d
--- /dev/null
+++ b/modules/travel/back/locale/travel/es.yml
@@ -0,0 +1,15 @@
+name: envío
+columns:
+ id: id
+ shipped: enviado
+ landed: entregado
+ isDelivered: está entregado
+ isReceived: está recibido
+ ref: referencia
+ totalEntries: entradas totales
+ m3: m3
+ kg: kg
+ cargoSupplierFk: proveedor carga
+ agencyModeFk: agencia
+ warehouseInFk: almacén entrega
+ warehouseOutFk: almacén salida
diff --git a/modules/worker/back/locale/calendar/en.yml b/modules/worker/back/locale/calendar/en.yml
new file mode 100644
index 000000000..b475768de
--- /dev/null
+++ b/modules/worker/back/locale/calendar/en.yml
@@ -0,0 +1,6 @@
+name: calendar
+columns:
+ id: id
+ businessFk: business
+ dated: dated
+ dayOffTypeFk: day off type
diff --git a/modules/worker/back/locale/calendar/es.yml b/modules/worker/back/locale/calendar/es.yml
new file mode 100644
index 000000000..106c5c371
--- /dev/null
+++ b/modules/worker/back/locale/calendar/es.yml
@@ -0,0 +1,6 @@
+name: calendario
+columns:
+ id: id
+ businessFk: negocio
+ dated: fecha
+ dayOffTypeFk: tipo de día libre
diff --git a/modules/worker/back/locale/worker-time-control-mail/en.yml b/modules/worker/back/locale/worker-time-control-mail/en.yml
new file mode 100644
index 000000000..821a3a3c9
--- /dev/null
+++ b/modules/worker/back/locale/worker-time-control-mail/en.yml
@@ -0,0 +1,10 @@
+name: worker time control mail
+columns:
+ id: id
+ workerFk: worker
+ year: year
+ week: week
+ state: state
+ updated: updated
+ reason: reason
+
diff --git a/modules/worker/back/locale/worker-time-control-mail/es.yml b/modules/worker/back/locale/worker-time-control-mail/es.yml
new file mode 100644
index 000000000..159fcddf5
--- /dev/null
+++ b/modules/worker/back/locale/worker-time-control-mail/es.yml
@@ -0,0 +1,10 @@
+name: correo de control de tiempo del trabajador
+columns:
+ id: id
+ workerFk: trabajador
+ year: año
+ week: semana
+ state: estado
+ updated: actualizado
+ reason: razón
+
diff --git a/modules/worker/back/locale/worker/en.yml b/modules/worker/back/locale/worker/en.yml
new file mode 100644
index 000000000..f46aed678
--- /dev/null
+++ b/modules/worker/back/locale/worker/en.yml
@@ -0,0 +1,20 @@
+name: worker
+columns:
+ id: id
+ firstName: first name
+ lastName: last name
+ phone: phone
+ userFk: user
+ bossFk: boss
+ maritalStatus: marital status
+ originCountryFk: origin country
+ educationLevelFk: education level
+ SSN: SSN
+ labelerFk: labeler
+ mobileExtension: mobile extension
+ code: code
+ locker: locker
+ workerFk: worker
+ sectorFk: sector
+
+
diff --git a/modules/worker/back/locale/worker/es.yml b/modules/worker/back/locale/worker/es.yml
new file mode 100644
index 000000000..182bc5f53
--- /dev/null
+++ b/modules/worker/back/locale/worker/es.yml
@@ -0,0 +1,20 @@
+name: trabajador
+columns:
+ id: id
+ firstName: nombre
+ lastName: apellido
+ phone: teléfono
+ userFk: usuario
+ bossFk: jefe
+ maritalStatus: estado civil
+ originCountryFk: país origen
+ educationLevelFk: nivel educativo
+ SSN: SSN
+ labelerFk: etiquetadora
+ mobileExtension: extensión móvil
+ code: código
+ locker: casillero
+ workerFk: trabajador
+ sectorFk: sector
+
+
diff --git a/modules/zone/back/locale/zone-event/en.yml b/modules/zone/back/locale/zone-event/en.yml
new file mode 100644
index 000000000..2d6ef39ab
--- /dev/null
+++ b/modules/zone/back/locale/zone-event/en.yml
@@ -0,0 +1,14 @@
+name: zone event
+columns:
+ id: id
+ zoneFk: zone
+ type: type
+ dated: dated
+ started: started
+ ended: ended
+ weekDays: week days
+ hour: hour
+ travelingDays: traveling days
+ price: price
+ bonus: bonus
+ m3Max: max m3
diff --git a/modules/zone/back/locale/zone-event/es.yml b/modules/zone/back/locale/zone-event/es.yml
new file mode 100644
index 000000000..9bc8db9fe
--- /dev/null
+++ b/modules/zone/back/locale/zone-event/es.yml
@@ -0,0 +1,14 @@
+name: evento zona
+columns:
+ id: id
+ zoneFk: zona
+ type: tipo
+ dated: fecha
+ started: comenzado
+ ended: terminado
+ weekDays: días semana
+ hour: hora
+ travelingDays: días de viaje
+ price: precio
+ bonus: bono
+ m3Max: máx. m3
diff --git a/modules/zone/back/locale/zone-exclusion/en.yml b/modules/zone/back/locale/zone-exclusion/en.yml
new file mode 100644
index 000000000..4389d8b93
--- /dev/null
+++ b/modules/zone/back/locale/zone-exclusion/en.yml
@@ -0,0 +1,5 @@
+name: zone exclusion
+columns:
+ id: id
+ dated: dated
+ zoneFk: zone
diff --git a/modules/zone/back/locale/zone-exclusion/es.yml b/modules/zone/back/locale/zone-exclusion/es.yml
new file mode 100644
index 000000000..4e59cba46
--- /dev/null
+++ b/modules/zone/back/locale/zone-exclusion/es.yml
@@ -0,0 +1,5 @@
+name: zone exclusion
+columns:
+ id: id
+ dated: fecha
+ zoneFk: zona
diff --git a/modules/zone/back/locale/zone-included/en.yml b/modules/zone/back/locale/zone-included/en.yml
new file mode 100644
index 000000000..0e44989e9
--- /dev/null
+++ b/modules/zone/back/locale/zone-included/en.yml
@@ -0,0 +1,5 @@
+name: zone included
+columns:
+ id: id
+ dated: dated
+ zoneFk: zone
diff --git a/modules/zone/back/locale/zone-included/es.yml b/modules/zone/back/locale/zone-included/es.yml
new file mode 100644
index 000000000..30a89373a
--- /dev/null
+++ b/modules/zone/back/locale/zone-included/es.yml
@@ -0,0 +1,5 @@
+name: zona incluida
+columns:
+ id: id
+ dated: fecha
+ zoneFk: zona
diff --git a/modules/zone/back/locale/zone-warehouse/en.yml b/modules/zone/back/locale/zone-warehouse/en.yml
new file mode 100644
index 000000000..b9c4f7609
--- /dev/null
+++ b/modules/zone/back/locale/zone-warehouse/en.yml
@@ -0,0 +1,5 @@
+name: zone warehouse
+columns:
+ id: id
+ warehouseFk: warehouse
+ zoneFk: zone
diff --git a/modules/zone/back/locale/zone-warehouse/es.yml b/modules/zone/back/locale/zone-warehouse/es.yml
new file mode 100644
index 000000000..ec8dec2dd
--- /dev/null
+++ b/modules/zone/back/locale/zone-warehouse/es.yml
@@ -0,0 +1,5 @@
+name: almacén zona
+columns:
+ id: id
+ warehouseFk: almacén
+ zoneFk: zona
diff --git a/modules/zone/back/locale/zone/en.yml b/modules/zone/back/locale/zone/en.yml
new file mode 100644
index 000000000..649631faa
--- /dev/null
+++ b/modules/zone/back/locale/zone/en.yml
@@ -0,0 +1,14 @@
+name: zone
+columns:
+ id: id
+ name: name
+ hour: hour
+ travelingDays: traveling days
+ price: price
+ bonus: bonus
+ isVolumetric: volumetric
+ inflation: inflation
+ m3Max: max m3
+ itemMaxSize: item max size
+ agencyModeFk: agency
+ zoneFk: zone
diff --git a/modules/zone/back/locale/zone/es.yml b/modules/zone/back/locale/zone/es.yml
new file mode 100644
index 000000000..3534c2e12
--- /dev/null
+++ b/modules/zone/back/locale/zone/es.yml
@@ -0,0 +1,14 @@
+name: zona
+columns:
+ id: id
+ name: nombre
+ hour: hora
+ travelingDays: días viaje
+ price: precio
+ bonus: bono
+ isVolumetric: volumétrico
+ inflation: inflación
+ m3Max: máx. m3
+ itemMaxSize: tamaño máximo artículo
+ agencyModeFk: agencia
+ zoneFk: zona
From 2ada64e1bf7ca8389c208150dc96277871ee1c7d Mon Sep 17 00:00:00 2001
From: vicent
Date: Thu, 13 Apr 2023 08:49:50 +0200
Subject: [PATCH 041/300] refs #5517 eliminadas traducciones duplicadas
---
modules/supplier/back/locale/supplier/en.yml | 2 --
modules/supplier/back/locale/supplier/es.yml | 2 --
2 files changed, 4 deletions(-)
diff --git a/modules/supplier/back/locale/supplier/en.yml b/modules/supplier/back/locale/supplier/en.yml
index 292d7d0b6..1be941a70 100644
--- a/modules/supplier/back/locale/supplier/en.yml
+++ b/modules/supplier/back/locale/supplier/en.yml
@@ -33,6 +33,4 @@ columns:
supplierActivityFk: supplier activity
healthRegister: health register
isVies: vies
- provinceFk: province
- countryFk: country
supplierFk: supplier
diff --git a/modules/supplier/back/locale/supplier/es.yml b/modules/supplier/back/locale/supplier/es.yml
index 57c534aa5..6ac8379f5 100644
--- a/modules/supplier/back/locale/supplier/es.yml
+++ b/modules/supplier/back/locale/supplier/es.yml
@@ -33,6 +33,4 @@ columns:
supplierActivityFk: actividad del proveedor
healthRegister: registro sanitario
isVies: vies
- provinceFk: provincia
- countryFk: país
supplierFk: proveedor
From e6355e32320b4f7f8e10bd97b1f27b1fa07e8d73 Mon Sep 17 00:00:00 2001
From: alexandre
Date: Fri, 14 Apr 2023 09:50:07 +0200
Subject: [PATCH 042/300] hotfix paginate negative bases
---
modules/invoiceIn/back/methods/invoice-in/negativeBases.js | 1 +
modules/invoiceIn/front/negative-bases/index.html | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/modules/invoiceIn/back/methods/invoice-in/negativeBases.js b/modules/invoiceIn/back/methods/invoice-in/negativeBases.js
index 4d5975fab..4c9a8984b 100644
--- a/modules/invoiceIn/back/methods/invoice-in/negativeBases.js
+++ b/modules/invoiceIn/back/methods/invoice-in/negativeBases.js
@@ -98,6 +98,7 @@ module.exports = Self => {
stmt.merge(conn.makeWhere(args.filter.where));
stmt.merge(conn.makeOrderBy(args.filter.order));
+ stmt.merge(conn.makeLimit(args.filter));
const negativeBasesIndex = stmts.push(stmt) - 1;
diff --git a/modules/invoiceIn/front/negative-bases/index.html b/modules/invoiceIn/front/negative-bases/index.html
index 368f44461..5da8e7aad 100644
--- a/modules/invoiceIn/front/negative-bases/index.html
+++ b/modules/invoiceIn/front/negative-bases/index.html
@@ -2,7 +2,8 @@
vn-id="model"
url="InvoiceIns/negativeBases"
auto-load="true"
- params="$ctrl.params">
+ params="$ctrl.params"
+ limit="20">
From 4c18efa5894cea23d3600d8c7711deabd46ead49 Mon Sep 17 00:00:00 2001
From: vicent
Date: Fri, 14 Apr 2023 13:05:57 +0200
Subject: [PATCH 043/300] =?UTF-8?q?refs=20#5128=20creado=20m=C3=A9todo=20s?=
=?UTF-8?q?etRating?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../00-aclClientInforma.sql | 0
.../{231401 => 231601}/00-clientInforma.sql | 2 +-
.../client/back/methods/client/setRating.js | 62 +++++++++++++++++++
modules/client/back/models/client-methods.js | 1 +
modules/client/back/models/client.js | 40 +-----------
.../client/front/credit-management/index.html | 5 +-
modules/client/front/locale/es.yml | 2 +
modules/client/front/routes.json | 14 +++--
8 files changed, 81 insertions(+), 45 deletions(-)
rename db/changes/{231401 => 231601}/00-aclClientInforma.sql (100%)
rename db/changes/{231401 => 231601}/00-clientInforma.sql (85%)
create mode 100644 modules/client/back/methods/client/setRating.js
diff --git a/db/changes/231401/00-aclClientInforma.sql b/db/changes/231601/00-aclClientInforma.sql
similarity index 100%
rename from db/changes/231401/00-aclClientInforma.sql
rename to db/changes/231601/00-aclClientInforma.sql
diff --git a/db/changes/231401/00-clientInforma.sql b/db/changes/231601/00-clientInforma.sql
similarity index 85%
rename from db/changes/231401/00-clientInforma.sql
rename to db/changes/231601/00-clientInforma.sql
index 25405ef4d..9bf757fc3 100644
--- a/db/changes/231401/00-clientInforma.sql
+++ b/db/changes/231601/00-clientInforma.sql
@@ -13,4 +13,4 @@ CREATE TABLE `vn`.`clientInforma` (
KEY `informaClientFk` (`clientFk`),
CONSTRAINT `informa_ClienteFk` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `informa_workers_fk` FOREIGN KEY (`workerFk`) REFERENCES `worker` (`id`) ON DELETE RESTRICT ON UPDATE CASCADE
-) ENGINE=InnoDB CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
+) ENGINE=InnoDB CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='información proporcionada por Informa, se actualiza desde el hook de client (salix)';
diff --git a/modules/client/back/methods/client/setRating.js b/modules/client/back/methods/client/setRating.js
new file mode 100644
index 000000000..06e7ebf1e
--- /dev/null
+++ b/modules/client/back/methods/client/setRating.js
@@ -0,0 +1,62 @@
+const UserError = require('vn-loopback/util/user-error');
+
+module.exports = Self => {
+ Self.remoteMethodCtx('setRating', {
+ description: 'Change role and hasGrant if user has setRating',
+ accepts: [
+ {
+ arg: 'id',
+ type: 'number',
+ required: true,
+ description: 'The user id',
+ http: {source: 'path'}
+ },
+ {
+ arg: 'rating',
+ type: 'number'
+ },
+ {
+ arg: 'recommendedCredit',
+ type: 'number'
+ }
+ ],
+ http: {
+ path: `/:id/setRating`,
+ verb: 'POST'
+ }
+ });
+
+ Self.setRating = async function(ctx, id, rating, recommendedCredit, options) {
+ const models = Self.app.models;
+ const userId = ctx.req.accessToken.userId;
+ let tx;
+ const myOptions = {};
+
+ if (typeof options == 'object')
+ Object.assign(myOptions, options);
+
+ if (!myOptions.transaction) {
+ tx = await Self.beginTransaction({});
+ myOptions.transaction = tx;
+ }
+
+ try {
+ const isFinancial = await models.Account.hasRole(userId, 'financial', myOptions);
+ if (!isFinancial)
+ throw new UserError(`You don't have enough privileges`);
+
+ const client = await Self.findById(id, null, myOptions);
+ const clientUpdated = await client.updateAttributes({
+ rating: rating,
+ recommendedCredit: recommendedCredit
+ }, myOptions);
+
+ if (tx) await tx.commit();
+
+ return clientUpdated;
+ } catch (e) {
+ if (tx) await tx.rollback();
+ throw e;
+ }
+ };
+};
diff --git a/modules/client/back/models/client-methods.js b/modules/client/back/models/client-methods.js
index 3538dbeb8..3b1a588ac 100644
--- a/modules/client/back/models/client-methods.js
+++ b/modules/client/back/models/client-methods.js
@@ -47,4 +47,5 @@ module.exports = Self => {
require('../methods/client/consumptionSendQueued')(Self);
require('../methods/client/filter')(Self);
require('../methods/client/getClientOrSupplierReference')(Self);
+ require('../methods/client/setRating')(Self);
};
diff --git a/modules/client/back/models/client.js b/modules/client/back/models/client.js
index 579c6a8d4..94c583dcc 100644
--- a/modules/client/back/models/client.js
+++ b/modules/client/back/models/client.js
@@ -447,44 +447,8 @@ module.exports = Self => {
Self.changeCreditManagement = async function changeCreditManagement(ctx, finalState, changes) {
const models = Self.app.models;
- const userId = ctx.options.accessToken.userId;
-
- // const isFinancialBoss = await models.Account.hasRole(userId, 'financialBoss', ctx.options);
- // if (!isFinancialBoss) {
- // const lastCredit = await models.ClientCredit.findOne({
- // where: {
- // clientFk: finalState.id
- // },
- // order: 'id DESC'
- // }, ctx.options);
-
- // const lastAmount = lastCredit && lastCredit.amount;
- // const lastWorkerId = lastCredit && lastCredit.workerFk;
- // const lastWorkerIsFinancialBoss = await models.Account.hasRole(lastWorkerId, 'financialBoss', ctx.options);
-
- // if (lastAmount == 0 && lastWorkerIsFinancialBoss)
- // throw new UserError(`You can't change the credit set to zero from a financialBoss`);
-
- // const creditLimits = await models.ClientCreditLimit.find({
- // fields: ['roleFk'],
- // where: {
- // maxAmount: {gte: changes.credit}
- // }
- // }, ctx.options);
-
- // const requiredRoles = [];
- // for (limit of creditLimits)
- // requiredRoles.push(limit.roleFk);
-
- // const userRequiredRoles = await models.RoleMapping.count({
- // roleId: {inq: requiredRoles},
- // principalType: 'USER',
- // principalId: userId
- // }, ctx.options);
-
- // if (userRequiredRoles <= 0)
- // throw new UserError(`You don't have enough privileges to set this credit amount`);
- // }
+ const loopBackContext = LoopBackContext.getCurrentContext();
+ const userId = loopBackContext.active.accessToken.userId;
await models.ClientInforma.create({
clientFk: finalState.id,
diff --git a/modules/client/front/credit-management/index.html b/modules/client/front/credit-management/index.html
index 78cc6edb5..85ecb1f96 100644
--- a/modules/client/front/credit-management/index.html
+++ b/modules/client/front/credit-management/index.html
@@ -1,11 +1,11 @@
-
+
+ save="post">
+
Date: Mon, 17 Apr 2023 08:35:44 +0200
Subject: [PATCH 044/300] refs #5439 inheritedRole
---
modules/item/front/request-search-panel/index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/item/front/request-search-panel/index.html b/modules/item/front/request-search-panel/index.html
index a431d4fd6..dfafb02f3 100644
--- a/modules/item/front/request-search-panel/index.html
+++ b/modules/item/front/request-search-panel/index.html
@@ -42,7 +42,7 @@
Date: Mon, 17 Apr 2023 08:44:24 +0200
Subject: [PATCH 045/300] refs #4617 use temporary instead of vn
---
db/.archive/225201/00-invoiceOut_new.sql | 20 +++---
db/changes/231001/02-invoiceOut_new.sql | 60 ++++++++--------
db/dump/structure.sql | 72 +++++++++----------
.../ticket/back/methods/ticket/makeInvoice.js | 4 +-
package-lock.json | 4 +-
5 files changed, 80 insertions(+), 80 deletions(-)
diff --git a/db/.archive/225201/00-invoiceOut_new.sql b/db/.archive/225201/00-invoiceOut_new.sql
index 10a42d40d..4c60b50bc 100644
--- a/db/.archive/225201/00-invoiceOut_new.sql
+++ b/db/.archive/225201/00-invoiceOut_new.sql
@@ -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 ;
diff --git a/db/changes/231001/02-invoiceOut_new.sql b/db/changes/231001/02-invoiceOut_new.sql
index 0fd91ef58..d2b96eff7 100644
--- a/db/changes/231001/02-invoiceOut_new.sql
+++ b/db/changes/231001/02-invoiceOut_new.sql
@@ -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 ;
\ No newline at end of file
+DELIMITER ;
diff --git a/db/dump/structure.sql b/db/dump/structure.sql
index 90e4c4bc9..3256ecdca 100644
--- a/db/dump/structure.sql
+++ b/db/dump/structure.sql
@@ -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;
diff --git a/modules/ticket/back/methods/ticket/makeInvoice.js b/modules/ticket/back/methods/ticket/makeInvoice.js
index 9739f5985..bd899ef7b 100644
--- a/modules/ticket/back/methods/ticket/makeInvoice.js
+++ b/modules/ticket/back/methods/ticket/makeInvoice.js
@@ -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
diff --git a/package-lock.json b/package-lock.json
index 7e86dbba9..6a87b4b25 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "salix-back",
- "version": "23.08.01",
+ "version": "23.16.01",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "salix-back",
- "version": "23.08.01",
+ "version": "23.16.01",
"license": "GPL-3.0",
"dependencies": {
"axios": "^1.2.2",
From d399cda050089b619faef36ec10eeece6ba27f53 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Mon, 17 Apr 2023 10:34:08 +0200
Subject: [PATCH 046/300] refs #5316 quitar comment
---
e2e/helpers/selectors.js | 1 -
e2e/paths/12-entry/05_basicData.spec.js | 7 -------
loopback/locale/en.json | 5 +++--
modules/entry/front/basic-data/index.html | 7 -------
modules/entry/front/index/locale/es.yml | 1 -
modules/entry/front/summary/index.html | 3 ---
modules/travel/front/summary/index.html | 6 ------
print/templates/reports/entry-order/entry-order.html | 10 ----------
8 files changed, 3 insertions(+), 37 deletions(-)
diff --git a/e2e/helpers/selectors.js b/e2e/helpers/selectors.js
index e47235ef0..9d3410f2b 100644
--- a/e2e/helpers/selectors.js
+++ b/e2e/helpers/selectors.js
@@ -1247,7 +1247,6 @@ export default {
entryBasicData: {
reference: 'vn-entry-basic-data vn-textfield[ng-model="$ctrl.entry.reference"]',
invoiceNumber: 'vn-entry-basic-data vn-textfield[ng-model="$ctrl.entry.invoiceNumber"]',
- // notes: 'vn-entry-basic-data vn-textfield[ng-model="$ctrl.entry.notes"]',
observations: 'vn-entry-basic-data vn-textarea[ng-model="$ctrl.entry.observation"]',
supplier: 'vn-entry-basic-data vn-autocomplete[ng-model="$ctrl.entry.supplierFk"]',
currency: 'vn-entry-basic-data vn-autocomplete[ng-model="$ctrl.entry.currencyFk"]',
diff --git a/e2e/paths/12-entry/05_basicData.spec.js b/e2e/paths/12-entry/05_basicData.spec.js
index eec00ca96..0272446d9 100644
--- a/e2e/paths/12-entry/05_basicData.spec.js
+++ b/e2e/paths/12-entry/05_basicData.spec.js
@@ -20,7 +20,6 @@ describe('Entry basic data path', () => {
it('should edit the basic data', async() => {
await page.write(selectors.entryBasicData.reference, 'new movement 8');
await page.write(selectors.entryBasicData.invoiceNumber, 'new movement 8');
- // await page.write(selectors.entryBasicData.notes, 'new notes');
await page.write(selectors.entryBasicData.observations, ' edited');
await page.autocompleteSearch(selectors.entryBasicData.supplier, 'Plants nick');
await page.autocompleteSearch(selectors.entryBasicData.currency, 'eur');
@@ -53,12 +52,6 @@ describe('Entry basic data path', () => {
expect(result).toEqual('new movement 8');
});
- // it('should confirm the note was edited', async() => {
- // const result = await page.waitToGetProperty(selectors.entryBasicData.notes, 'value');
-
- // expect(result).toEqual('new notes');
- // });
-
it('should confirm the observation was edited', async() => {
const result = await page.waitToGetProperty(selectors.entryBasicData.observations, 'value');
diff --git a/loopback/locale/en.json b/loopback/locale/en.json
index e9fd67209..c3c8d234d 100644
--- a/loopback/locale/en.json
+++ b/loopback/locale/en.json
@@ -154,5 +154,6 @@
"Valid priorities: 1,2,3": "Valid priorities: 1,2,3",
"Warehouse inventory not set": "Almacén inventario no está establecido",
"Component cost not set": "Componente coste no está estabecido",
- "Tickets with associated refunds can't be deleted. This ticket is associated with refund Nº 2": "Tickets with associated refunds can't be deleted. This ticket is associated with refund Nº 2"
-}
+ "Tickets with associated refunds can't be deleted. This ticket is associated with refund Nº 2": "Tickets with associated refunds can't be deleted. This ticket is associated with refund Nº 2",
+ "Description cannot be blank": "Description cannot be blank"
+}
\ No newline at end of file
diff --git a/modules/entry/front/basic-data/index.html b/modules/entry/front/basic-data/index.html
index 6fd23a4f7..4e4631a3c 100644
--- a/modules/entry/front/basic-data/index.html
+++ b/modules/entry/front/basic-data/index.html
@@ -52,13 +52,6 @@
rule
vn-focus>
-
-
diff --git a/modules/travel/front/summary/index.html b/modules/travel/front/summary/index.html
index c19a075fc..5d38ed08f 100644
--- a/modules/travel/front/summary/index.html
+++ b/modules/travel/front/summary/index.html
@@ -100,12 +100,6 @@
{{entry.pallet}}
{{entry.m3}}
-
-
From 0dcbc9fc8b0b3fa0866ad58705875e7757bfa497 Mon Sep 17 00:00:00 2001
From: alexandre
Date: Mon, 17 Apr 2023 10:46:26 +0200
Subject: [PATCH 047/300] refs #5293 redirected claim.photos to lilium
---
db/dump/fixtures.sql | 2 +-
modules/claim/front/photos/index.html | 49 +-----------
modules/claim/front/photos/index.js | 96 +-----------------------
modules/claim/front/photos/index.spec.js | 70 -----------------
modules/claim/front/photos/locale/es.yml | 5 --
modules/claim/front/photos/style.scss | 47 ------------
6 files changed, 6 insertions(+), 263 deletions(-)
delete mode 100644 modules/claim/front/photos/index.spec.js
delete mode 100644 modules/claim/front/photos/locale/es.yml
delete mode 100644 modules/claim/front/photos/style.scss
diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql
index 59d0a5eaa..19bf3fc83 100644
--- a/db/dump/fixtures.sql
+++ b/db/dump/fixtures.sql
@@ -2788,7 +2788,7 @@ INSERT INTO `vn`.`profileType` (`id`, `name`)
INSERT INTO `salix`.`url` (`appName`, `environment`, `url`)
VALUES
- ('lilium', 'dev', 'http://localhost:8080/#/'),
+ ('lilium', 'dev', 'http://localhost:9000/#/'),
('salix', 'dev', 'http://localhost:5000/#!/');
INSERT INTO `vn`.`report` (`id`, `name`, `paperSizeFk`, `method`)
diff --git a/modules/claim/front/photos/index.html b/modules/claim/front/photos/index.html
index 9e00ee02f..8b1378917 100644
--- a/modules/claim/front/photos/index.html
+++ b/modules/claim/front/photos/index.html
@@ -1,48 +1 @@
-
-
-
-
-
- Drag & Drop photos here...
-
-
-
-
-
-
-
+
diff --git a/modules/claim/front/photos/index.js b/modules/claim/front/photos/index.js
index 62e439a91..573abdf0e 100644
--- a/modules/claim/front/photos/index.js
+++ b/modules/claim/front/photos/index.js
@@ -1,105 +1,17 @@
import ngModule from '../module';
import Section from 'salix/components/section';
-import './style.scss';
class Controller extends Section {
- constructor($element, $, vnFile) {
+ constructor($element, $) {
super($element, $);
- this.vnFile = vnFile;
- this.filter = {
- include: [
- {
- relation: 'dms'
- }
- ]
- };
}
- deleteDms(index) {
- const dmsFk = this.photos[index].dmsFk;
- return this.$http.post(`ClaimDms/${dmsFk}/removeFile`)
- .then(() => {
- this.$.model.remove(index);
- this.vnApp.showSuccess(this.$t('File deleted'));
- });
- }
-
- onDrop($event) {
- const files = $event.dataTransfer.files;
- this.setDefaultParams().then(() => {
- this.dms.files = files;
- this.create();
- });
- }
-
- setDefaultParams() {
- const filter = {
- where: {code: 'claim'}
- };
- return this.$http.get('DmsTypes/findOne', {filter}).then(res => {
- const dmsTypeId = res.data && res.data.id;
- const companyId = this.vnConfig.companyFk;
- const warehouseId = this.vnConfig.warehouseFk;
- this.dms = {
- hasFile: false,
- hasFileAttached: false,
- reference: this.claim.id,
- warehouseId: warehouseId,
- companyId: companyId,
- dmsTypeId: dmsTypeId,
- description: this.$t('FileDescription', {
- claimId: this.claim.id,
- clientId: this.claim.client.id,
- clientName: this.claim.client.name
- }).toUpperCase()
- };
- });
- }
-
- openUploadDialog() {
- const element = document.createElement('input');
- element.setAttribute('type', 'file');
- element.setAttribute('multiple', true);
- element.click();
-
- element.addEventListener('change', () =>
- this.setDefaultParams().then(() => {
- this.dms.files = element.files;
- this.create();
- })
- );
- }
-
- create() {
- const query = `claims/${this.claim.id}/uploadFile`;
- const options = {
- method: 'POST',
- url: query,
- params: this.dms,
- headers: {'Content-Type': undefined},
- transformRequest: files => {
- const formData = new FormData();
-
- for (let i = 0; i < files.length; i++)
- formData.append(files[i].name, files[i]);
-
- return formData;
- },
- data: this.dms.files
- };
- this.$http(options).then(() => {
- this.vnApp.showSuccess(this.$t('File uploaded!'));
- this.$.model.refresh();
- });
- }
-
- getImagePath(dmsId) {
- return this.vnFile.getPath(`/api/Claims/${dmsId}/downloadFile`);
+ async $onInit() {
+ const url = await this.vnApp.getUrl(`claim/${this.$params.id}/photos`);
+ window.open(url).focus();
}
}
-Controller.$inject = ['$element', '$scope', 'vnFile'];
-
ngModule.vnComponent('vnClaimPhotos', {
template: require('./index.html'),
controller: Controller,
diff --git a/modules/claim/front/photos/index.spec.js b/modules/claim/front/photos/index.spec.js
deleted file mode 100644
index 84df48b44..000000000
--- a/modules/claim/front/photos/index.spec.js
+++ /dev/null
@@ -1,70 +0,0 @@
-import './index';
-import crudModel from 'core/mocks/crud-model';
-
-describe('Claim', () => {
- describe('Component vnClaimPhotos', () => {
- let $scope;
- let $httpBackend;
- let controller;
-
- beforeEach(ngModule('claim'));
-
- beforeEach(inject(($componentController, $rootScope, _$httpBackend_) => {
- $httpBackend = _$httpBackend_;
- $scope = $rootScope.$new();
- controller = $componentController('vnClaimPhotos', {$element: null, $scope});
- controller.$.model = crudModel;
- controller.claim = {
- id: 1,
- client: {id: 1101, name: 'Bruce Wayne'}
- };
- }));
-
- describe('deleteDms()', () => {
- it('should make an HTTP Post query', () => {
- jest.spyOn(controller.vnApp, 'showSuccess');
- jest.spyOn(controller.$.model, 'remove');
-
- const dmsId = 1;
- const dmsIndex = 0;
- controller.photos = [{dmsFk: 1}];
-
- $httpBackend.expectPOST(`ClaimDms/${dmsId}/removeFile`).respond();
- controller.deleteDms(dmsIndex);
- $httpBackend.flush();
-
- expect(controller.$.model.remove).toHaveBeenCalledWith(dmsIndex);
- expect(controller.vnApp.showSuccess).toHaveBeenCalled();
- });
- });
-
- describe('setDefaultParams()', () => {
- it('should make an HTTP GET query, then set all dms properties', () => {
- $httpBackend.expectRoute('GET', `DmsTypes/findOne`).respond({});
- controller.setDefaultParams();
- $httpBackend.flush();
-
- expect(controller.dms).toBeDefined();
- });
- });
-
- describe('create()', () => {
- it('should make an HTTP Post query, then refresh the model data', () => {
- const claimId = 1;
- const dmsIndex = 0;
- jest.spyOn(controller.vnApp, 'showSuccess');
- jest.spyOn(controller.$.model, 'refresh');
- controller.photos = [{dmsFk: 1}];
- controller.dmsIndex = dmsIndex;
- controller.dms = {files: []};
-
- $httpBackend.expectPOST(`claims/${claimId}/uploadFile`).respond({});
- controller.create();
- $httpBackend.flush();
-
- expect(controller.$.model.refresh).toHaveBeenCalled();
- expect(controller.vnApp.showSuccess).toHaveBeenCalled();
- });
- });
- });
-});
diff --git a/modules/claim/front/photos/locale/es.yml b/modules/claim/front/photos/locale/es.yml
deleted file mode 100644
index d2ee9ffbd..000000000
--- a/modules/claim/front/photos/locale/es.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-Are you sure you want to continue?: ¿Seguro que quieres continuar?
-Drag & Drop photos here...: Arrastra y suelta fotos aquí...
-File deleted: Archivo eliminado
-File uploaded!: Archivo subido!
-Select file: Seleccionar fichero
\ No newline at end of file
diff --git a/modules/claim/front/photos/style.scss b/modules/claim/front/photos/style.scss
deleted file mode 100644
index 101cb0da2..000000000
--- a/modules/claim/front/photos/style.scss
+++ /dev/null
@@ -1,47 +0,0 @@
-@import "./variables";
-
-vn-claim-photos {
- height: 100%;
-
- .drop-zone {
- color: $color-font-secondary;
- box-sizing: border-box;
- border-radius: 8px;
- text-align: center;
- min-height: 100%;
-
- .empty-rows {
- padding: 80px $spacing-md;
- font-size: 1.375rem
- }
-
- vn-icon {
- font-size: 3rem
- }
- }
-
- .photo-list {
- padding: $spacing-md;
- min-height: 100%;
-
- .photo {
- width: 512px;
- height: 288px;
- }
- }
-
- .video {
- width: 100%;
- height: 100%;
- object-fit: cover;
- cursor: pointer;
- box-shadow: 0 2px 2px 0 rgba(0,0,0,.14),
- 0 3px 1px -2px rgba(0,0,0,.2),
- 0 1px 5px 0 rgba(0,0,0,.12);
- border: 2px solid transparent;
-
- }
- .video:hover {
- border: 2px solid $color-primary
- }
-}
From 0423fac88c910447e9f102c0ba32de8535133a0a Mon Sep 17 00:00:00 2001
From: Juan Ferrer Toribio
Date: Mon, 17 Apr 2023 14:33:07 +0200
Subject: [PATCH 048/300] refs #5553 Image clean method Image/scrub
---
back/methods/image/scrub.js | 70 ++++++++++++++++++++++++++++++++++++
back/methods/image/upload.js | 6 ++--
back/models/image.js | 1 +
3 files changed, 74 insertions(+), 3 deletions(-)
create mode 100644 back/methods/image/scrub.js
diff --git a/back/methods/image/scrub.js b/back/methods/image/scrub.js
new file mode 100644
index 000000000..a9c2c6125
--- /dev/null
+++ b/back/methods/image/scrub.js
@@ -0,0 +1,70 @@
+const fs = require('fs-extra');
+const path = require('path');
+
+module.exports = Self => {
+ Self.remoteMethod('scrub', {
+ description: 'Cleans collection images directory',
+ accessType: 'WRITE',
+ accepts: [
+ {
+ arg: 'collection',
+ type: 'string',
+ description: 'The collection name',
+ required: true
+ }, {
+ arg: 'limit',
+ type: 'number',
+ description: 'Maximun number of image to clean'
+ }
+ ],
+ returns: {
+ type: 'number',
+ root: true
+ },
+ http: {
+ path: `/scrub`,
+ verb: 'POST'
+ }
+ });
+
+ Self.scrub = async function(collection, limit) {
+ const models = Self.app.models;
+ const container = await models.ImageContainer.container(
+ collection
+ );
+ const rootPath = container.client.root;
+
+ const now = Date.vnNew().toJSON();
+ const scrubDir = path.join(rootPath, '.scrub', now);
+
+ const collectionDir = path.join(rootPath, collection);
+ const sizes = await fs.readdir(collectionDir);
+ let cleanCount = 0;
+
+ mainLoop: for (const size of sizes) {
+ const sizeDir = path.join(collectionDir, size);
+ const scrubSizeDir = path.join(scrubDir, collection, size);
+ const images = await fs.readdir(sizeDir);
+ for (const image of images) {
+ const imageName = path.parse(image).name;
+ const count = await models.Image.count({
+ collectionFk: collection,
+ name: imageName
+ });
+ const exists = count > 0;
+ if (!exists) {
+ cleanCount++;
+ const srcDir = path.join(sizeDir, image);
+ const dstDir = path.join(scrubSizeDir, image);
+ await fs.mkdir(scrubSizeDir, {recursive: true});
+ await fs.rename(srcDir, dstDir);
+
+ if (limit && cleanCount == limit)
+ break mainLoop;
+ }
+ }
+ }
+
+ return cleanCount;
+ };
+};
diff --git a/back/methods/image/upload.js b/back/methods/image/upload.js
index 1de0064f6..51da327f6 100644
--- a/back/methods/image/upload.js
+++ b/back/methods/image/upload.js
@@ -12,13 +12,13 @@ module.exports = Self => {
type: 'Number',
description: 'The entity id',
required: true
- },
- {
+ }, {
arg: 'collection',
type: 'string',
description: 'The collection name',
required: true
- }],
+ }
+ ],
returns: {
type: 'Object',
root: true
diff --git a/back/models/image.js b/back/models/image.js
index 61c6199b8..a7ad69482 100644
--- a/back/models/image.js
+++ b/back/models/image.js
@@ -5,6 +5,7 @@ const gm = require('gm');
module.exports = Self => {
require('../methods/image/download')(Self);
require('../methods/image/upload')(Self);
+ require('../methods/image/scrub')(Self);
Self.resize = async function({collectionName, srcFile, fileName, entityId}) {
const models = Self.app.models;
From 378400c6d2c8447e743e77ef69d8bca7ac3b2b1f Mon Sep 17 00:00:00 2001
From: Juan Ferrer Toribio
Date: Mon, 17 Apr 2023 18:19:25 +0200
Subject: [PATCH 049/300] refs #5553 Image scrubing method improved Remove &
dryRun options, check that collection exists, performance improved, exclusive
lock
---
back/methods/image/scrub.js | 135 +++++++++++++++++++++++++++---------
loopback/locale/es.json | 6 +-
2 files changed, 105 insertions(+), 36 deletions(-)
diff --git a/back/methods/image/scrub.js b/back/methods/image/scrub.js
index a9c2c6125..893c536ff 100644
--- a/back/methods/image/scrub.js
+++ b/back/methods/image/scrub.js
@@ -1,9 +1,10 @@
const fs = require('fs-extra');
const path = require('path');
+const UserError = require('vn-loopback/util/user-error');
module.exports = Self => {
Self.remoteMethod('scrub', {
- description: 'Cleans collection images directory',
+ description: 'Deletes images without database reference',
accessType: 'WRITE',
accepts: [
{
@@ -11,14 +12,22 @@ module.exports = Self => {
type: 'string',
description: 'The collection name',
required: true
+ }, {
+ arg: 'remove',
+ type: 'boolean',
+ description: 'Delete instead of move images to trash'
}, {
arg: 'limit',
- type: 'number',
- description: 'Maximun number of image to clean'
+ type: 'integer',
+ description: 'Maximum number of images to clean'
+ }, {
+ arg: 'dryRun',
+ type: 'boolean',
+ description: 'Simulate actions'
}
],
returns: {
- type: 'number',
+ type: 'integer',
root: true
},
http: {
@@ -27,44 +36,102 @@ module.exports = Self => {
}
});
- Self.scrub = async function(collection, limit) {
- const models = Self.app.models;
- const container = await models.ImageContainer.container(
- collection
- );
+ Self.scrub = async function(collection, remove, limit, dryRun) {
+ const $ = Self.app.models;
+
+ const env = process.env.NODE_ENV;
+ dryRun = dryRun || (env && env !== 'production');
+
+ const instance = await $.ImageCollection.findOne({
+ fields: ['id'],
+ where: {name: collection}
+ });
+ if (!instance)
+ throw new UserError('Collection does not exist');
+
+ const container = await $.ImageContainer.container(collection);
const rootPath = container.client.root;
- const now = Date.vnNew().toJSON();
- const scrubDir = path.join(rootPath, '.scrub', now);
+ const conn = await getConnection();
+ const lockName = 'salix.Image.scrub';
+ let lockObtained;
- const collectionDir = path.join(rootPath, collection);
- const sizes = await fs.readdir(collectionDir);
- let cleanCount = 0;
+ try {
+ const [row] = await query(conn,
+ `SELECT GET_LOCK(?, 0) hasLock`,
+ [lockName]
+ );
+ lockObtained = !!row.hasLock;
+ if (!lockObtained)
+ throw new UserError('Cannot obtain exclusive lock');
- mainLoop: for (const size of sizes) {
- const sizeDir = path.join(collectionDir, size);
- const scrubSizeDir = path.join(scrubDir, collection, size);
- const images = await fs.readdir(sizeDir);
- for (const image of images) {
- const imageName = path.parse(image).name;
- const count = await models.Image.count({
- collectionFk: collection,
- name: imageName
- });
- const exists = count > 0;
- if (!exists) {
- cleanCount++;
- const srcDir = path.join(sizeDir, image);
- const dstDir = path.join(scrubSizeDir, image);
- await fs.mkdir(scrubSizeDir, {recursive: true});
- await fs.rename(srcDir, dstDir);
+ const now = Date.vnNew().toJSON();
+ const scrubDir = path.join(rootPath, '.scrub', now);
- if (limit && cleanCount == limit)
- break mainLoop;
+ const collectionDir = path.join(rootPath, collection);
+ const sizes = await fs.readdir(collectionDir);
+ let cleanCount = 0;
+
+ mainLoop: for (const size of sizes) {
+ const sizeDir = path.join(collectionDir, size);
+ const scrubSizeDir = path.join(scrubDir, collection, size);
+ const images = await fs.readdir(sizeDir);
+ for (const image of images) {
+ const imageName = path.parse(image).name;
+ const count = await Self.count({
+ collectionFk: collection,
+ name: imageName
+ });
+ const exists = count > 0;
+ let scrubDirCreated = false;
+ if (!exists) {
+ const srcFile = path.join(sizeDir, image);
+ if (remove !== true) {
+ if (!scrubDirCreated) {
+ if (!dryRun)
+ await fs.mkdir(scrubSizeDir, {recursive: true});
+ scrubDirCreated = true;
+ }
+ const dstFile = path.join(scrubSizeDir, image);
+ if (!dryRun)
+ await fs.rename(srcFile, dstFile);
+ } else {
+ if (!dryRun)
+ await fs.unlink(srcFile);
+ }
+
+ cleanCount++;
+ if (limit && cleanCount == limit)
+ break mainLoop;
+ }
}
}
+
+ return cleanCount;
+ } finally {
+ if (lockObtained)
+ await query(conn, `DO RELEASE_LOCK(?)`, [lockName]);
+ conn.release();
}
- return cleanCount;
+ // Promisified datasource functions
+
+ function getConnection() {
+ return new Promise((resolve, reject) => {
+ Self.dataSource.connector.client.getConnection((err, conn) => {
+ if (err) return reject(err);
+ resolve(conn);
+ });
+ });
+ }
+
+ function query(conn, sql, params) {
+ return new Promise((resolve, reject) => {
+ conn.query(sql, params, (err, res) => {
+ if (err) return reject(err);
+ resolve(res);
+ });
+ });
+ }
};
};
diff --git a/loopback/locale/es.json b/loopback/locale/es.json
index 95bf16d66..e4dc74aa3 100644
--- a/loopback/locale/es.json
+++ b/loopback/locale/es.json
@@ -268,8 +268,10 @@
"Exists an invoice with a previous date": "Existe una factura con fecha anterior",
"Invoice date can't be less than max date": "La fecha de factura no puede ser inferior a la fecha límite",
"Warehouse inventory not set": "El almacén inventario no está establecido",
- "This locker has already been assigned": "Esta taquilla ya ha sido asignada",
+ "This locker has already been assigned": "Esta taquilla ya ha sido asignada",
"Tickets with associated refunds": "No se pueden borrar tickets con abonos asociados. Este ticket está asociado al abono Nº {{id}}",
"Not exist this branch": "La rama no existe",
- "This ticket cannot be signed because it has not been boxed": "Este ticket no puede firmarse porque no ha sido encajado"
+ "This ticket cannot be signed because it has not been boxed": "Este ticket no puede firmarse porque no ha sido encajado",
+ "Collection does not exist": "La colección no existe",
+ "Cannot obtain exclusive lock": "No se puede obtener un bloqueo exclusivo"
}
From 1c4f919e892a8136bca5f8df4bd81bb377b7ceda Mon Sep 17 00:00:00 2001
From: Juan Ferrer Toribio
Date: Mon, 17 Apr 2023 22:24:19 +0200
Subject: [PATCH 050/300] refs #5553 Don't save image extension
---
back/models/image.js | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/back/models/image.js b/back/models/image.js
index a7ad69482..e13f9e100 100644
--- a/back/models/image.js
+++ b/back/models/image.js
@@ -30,13 +30,14 @@ module.exports = Self => {
);
// Insert image row
+ const imageName = path.parse(fileName).name;
await models.Image.upsertWithWhere(
{
- name: fileName,
+ name: imageName,
collectionFk: collectionName
},
{
- name: fileName,
+ name: imageName,
collectionFk: collectionName,
updated: Date.vnNow() / 1000,
}
@@ -50,7 +51,7 @@ module.exports = Self => {
if (entity) {
await entity.updateAttribute(
collection.property,
- fileName
+ imageName
);
}
From b3fb661f12c76c04ba292bb08c8a466df5d3f8e9 Mon Sep 17 00:00:00 2001
From: alexandre
Date: Tue, 18 Apr 2023 07:17:36 +0200
Subject: [PATCH 051/300] hotfix minor version delivery
---
db/changes/231402/00-hotfixDelivery.sql | 70 +++++++++++++++++++++++++
1 file changed, 70 insertions(+)
create mode 100644 db/changes/231402/00-hotfixDelivery.sql
diff --git a/db/changes/231402/00-hotfixDelivery.sql b/db/changes/231402/00-hotfixDelivery.sql
new file mode 100644
index 000000000..4628cc1db
--- /dev/null
+++ b/db/changes/231402/00-hotfixDelivery.sql
@@ -0,0 +1,70 @@
+DROP TABLE IF EXISTS `vn`.`dmsRecover`;
+
+ALTER TABLE `vn`.`delivery` DROP COLUMN addressFk;
+ALTER TABLE `vn`.`delivery` DROP CONSTRAINT delivery_ticketFk_FK;
+ALTER TABLE `vn`.`delivery` DROP COLUMN ticketFk;
+ALTER TABLE `vn`.`delivery` ADD ticketFk INT DEFAULT NULL;
+ALTER TABLE `vn`.`delivery` ADD CONSTRAINT delivery_ticketFk_FK FOREIGN KEY (`ticketFk`) REFERENCES `vn`.`ticket`(`id`);
+
+DROP PROCEDURE IF EXISTS vn.route_getTickets;
+
+DELIMITER $$
+$$
+CREATE DEFINER=`root`@`localhost` PROCEDURE `vn`.`route_getTickets`(vRouteFk INT)
+BEGIN
+/**
+ * Pasado un RouteFk devuelve la información
+ * de sus tickets.
+ *
+ * @param vRouteFk
+ *
+ * @select Información de los tickets
+ */
+
+ SELECT
+ t.id Id,
+ t.clientFk Client,
+ a.id Address,
+ t.packages Packages,
+ a.street AddressName,
+ a.postalCode PostalCode,
+ a.city City,
+ sub2.itemPackingTypeFk PackingType,
+ c.phone ClientPhone,
+ c.mobile ClientMobile,
+ a.phone AddressPhone,
+ a.mobile AddressMobile,
+ d.longitude Longitude,
+ d.latitude Latitude,
+ wm.mediaValue SalePersonPhone,
+ tob.Note Note,
+ t.isSigned Signed
+ FROM ticket t
+ JOIN client c ON t.clientFk = c.id
+ JOIN address a ON t.addressFk = a.id
+ LEFT JOIN delivery d ON t.id = d.ticketFk
+ LEFT JOIN workerMedia wm ON wm.workerFk = c.salesPersonFk
+ LEFT JOIN
+ (SELECT tob.description Note, t.id
+ FROM ticketObservation tob
+ JOIN ticket t ON tob.ticketFk = t.id
+ JOIN observationType ot ON ot.id = tob.observationTypeFk
+ WHERE t.routeFk = vRouteFk
+ AND ot.code = 'delivery'
+ )tob ON tob.id = t.id
+ LEFT JOIN
+ (SELECT sub.ticketFk,
+ CONCAT('(', GROUP_CONCAT(DISTINCT sub.itemPackingTypeFk ORDER BY sub.items DESC SEPARATOR ','), ') ') itemPackingTypeFk
+ FROM (SELECT s.ticketFk , i.itemPackingTypeFk, COUNT(*) items
+ FROM ticket t
+ JOIN sale s ON s.ticketFk = t.id
+ JOIN item i ON i.id = s.itemFk
+ WHERE t.routeFk = vRouteFk
+ GROUP BY t.id,i.itemPackingTypeFk)sub
+ GROUP BY sub.ticketFk
+ ) sub2 ON sub2.ticketFk = t.id
+ WHERE t.routeFk = vRouteFk
+ GROUP BY t.id
+ ORDER BY t.priority;
+END$$
+DELIMITER ;
From 5a2dbbabfde6203fd4caf2d8315284cafa759420 Mon Sep 17 00:00:00 2001
From: alexandre
Date: Tue, 18 Apr 2023 07:19:33 +0200
Subject: [PATCH 052/300] template string
---
db/changes/231402/00-hotfixDelivery.sql | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/db/changes/231402/00-hotfixDelivery.sql b/db/changes/231402/00-hotfixDelivery.sql
index 4628cc1db..447294ab6 100644
--- a/db/changes/231402/00-hotfixDelivery.sql
+++ b/db/changes/231402/00-hotfixDelivery.sql
@@ -6,7 +6,7 @@ ALTER TABLE `vn`.`delivery` DROP COLUMN ticketFk;
ALTER TABLE `vn`.`delivery` ADD ticketFk INT DEFAULT NULL;
ALTER TABLE `vn`.`delivery` ADD CONSTRAINT delivery_ticketFk_FK FOREIGN KEY (`ticketFk`) REFERENCES `vn`.`ticket`(`id`);
-DROP PROCEDURE IF EXISTS vn.route_getTickets;
+DROP PROCEDURE IF EXISTS `vn`.`route_getTickets`;
DELIMITER $$
$$
From d99815356aebb68e195679c31f257f2306979b87 Mon Sep 17 00:00:00 2001
From: vicent
Date: Tue, 18 Apr 2023 07:26:35 +0200
Subject: [PATCH 053/300] refs #5144 manejado que el usuario sea NULL
---
db/changes/231205/00-printQueueArgs.sql | 1 +
modules/ticket/back/methods/ticket/expeditionPalletLabel.js | 3 +--
.../expedition-pallet-label/expedition-pallet-label.html | 4 ++--
.../expedition-pallet-label/expedition-pallet-label.js | 3 +--
4 files changed, 5 insertions(+), 6 deletions(-)
create mode 100644 db/changes/231205/00-printQueueArgs.sql
diff --git a/db/changes/231205/00-printQueueArgs.sql b/db/changes/231205/00-printQueueArgs.sql
new file mode 100644
index 000000000..972031325
--- /dev/null
+++ b/db/changes/231205/00-printQueueArgs.sql
@@ -0,0 +1 @@
+ALTER TABLE `vn`.`printQueueArgs` MODIFY COLUMN value varchar(255) CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NULL;
diff --git a/modules/ticket/back/methods/ticket/expeditionPalletLabel.js b/modules/ticket/back/methods/ticket/expeditionPalletLabel.js
index 9830364d6..0790ff7d4 100644
--- a/modules/ticket/back/methods/ticket/expeditionPalletLabel.js
+++ b/modules/ticket/back/methods/ticket/expeditionPalletLabel.js
@@ -11,8 +11,7 @@ module.exports = Self => {
http: {source: 'path'}
}, {
arg: 'userFk',
- type: 'number',
- required: true,
+ type: 'any',
description: 'The user id'
}
],
diff --git a/print/templates/reports/expedition-pallet-label/expedition-pallet-label.html b/print/templates/reports/expedition-pallet-label/expedition-pallet-label.html
index e4360c79d..07dffd042 100644
--- a/print/templates/reports/expedition-pallet-label/expedition-pallet-label.html
+++ b/print/templates/reports/expedition-pallet-label/expedition-pallet-label.html
@@ -30,7 +30,7 @@
Pallet: {{id}}
-
User: {{username.name || '---'}}
+
User: {{username?.name || '---'}}
Day: {{labelData.dayName.toUpperCase() || '---'}}
@@ -38,4 +38,4 @@