|
- Origin |
Destination |
+ Origin |
@@ -45,31 +45,7 @@
|
|
-
- ID
- |
-
- Date
- |
-
- IPT
- |
-
- State
- |
-
- Liters
- |
-
- Stock
- |
-
- Lines
- |
-
- Import
- |
-
+ |
ID
|
@@ -90,6 +66,30 @@
|
Import
|
+
+ ID
+ |
+
+ Date
+ |
+
+ IPT
+ |
+
+ State
+ |
+
+ Liters
+ |
+
+ Not Movable
+ |
+
+ Lines
+ |
+
+ Import
+ |
@@ -104,36 +104,9 @@
+ title="{{$ctrl.agencies(ticket.futureAgency, ticket.agency)}}">
-
-
- {{::ticket.futureId | dashIfEmpty}}
-
- |
-
-
- {{::ticket.futureShipped | date: 'dd/MM/yyyy'}}
-
- |
- {{::ticket.futureIpt | dashIfEmpty}} |
-
-
- {{::ticket.futureState | dashIfEmpty}}
-
- |
- {{::ticket.futureLiters | dashIfEmpty}} |
- {{::ticket.hasStock | dashIfEmpty}} |
- {{::ticket.futureLines | dashIfEmpty}} |
-
-
- {{::(ticket.futureTotalWithVat ? ticket.futureTotalWithVat : 0) | currency: 'EUR': 2}}
-
- |
{{::ticket.liters | dashIfEmpty}} |
{{::ticket.lines | dashIfEmpty}} |
-
+
{{::(ticket.totalWithVat ? ticket.totalWithVat : 0) | currency: 'EUR': 2}}
|
+
+
+ {{::ticket.futureId | dashIfEmpty}}
+
+ |
+
+
+ {{::ticket.futureShipped | date: 'dd/MM/yyyy'}}
+
+ |
+ {{::ticket.futureIpt | dashIfEmpty}} |
+
+
+ {{::ticket.futureState | dashIfEmpty}}
+
+ |
+ {{::ticket.futureLiters | dashIfEmpty}} |
+ {{::ticket.notMovableLines | dashIfEmpty}} |
+ {{::ticket.futureLines | dashIfEmpty}} |
+
+
+ {{::(ticket.futureTotalWithVat ? ticket.futureTotalWithVat : 0) | currency: 'EUR': 2}}
+
+ |
+
diff --git a/modules/ticket/front/advance/index.js b/modules/ticket/front/advance/index.js
index 1b9272bcc..7b8008426 100644
--- a/modules/ticket/front/advance/index.js
+++ b/modules/ticket/front/advance/index.js
@@ -119,9 +119,15 @@ export default class Controller extends Section {
}
totalPriceColor(totalWithVat) {
- const total = parseInt(totalWithVat);
- if (total > 0 && total < 50)
- return 'warning';
+ return this.isLessThan50(totalWithVat) ? 'warning' : '';
+ }
+
+ totalPriceTitle(totalWithVat) {
+ return this.isLessThan50(totalWithVat) ? 'Less than 50€' : '';
+ }
+
+ isLessThan50(totalWithVat) {
+ return (parseInt(totalWithVat) > 0 && parseInt(totalWithVat) < 50);
}
get confirmationMessage() {
@@ -134,7 +140,7 @@ export default class Controller extends Section {
agencies(futureAgency, agency) {
return this.$t(`Origin agency`, {agency: futureAgency}) +
- '
' + this.$t(`Destination agency`, {agency: agency});
+ '\n' + this.$t(`Destination agency`, {agency: agency});
}
moveTicketsAdvance() {
@@ -171,15 +177,25 @@ export default class Controller extends Section {
case 'futureLines':
return {'futureLines': value};
case 'ipt':
- return {'ipt': value};
+ return {or:
+ [
+ {'ipt': {like: `%${value}%`}},
+ {'ipt': null}
+ ]
+ };
case 'futureIpt':
- return {'futureIpt': value};
+ return {or:
+ [
+ {'futureIpt': {like: `%${value}%`}},
+ {'futureIpt': null}
+ ]
+ };
case 'totalWithVat':
return {'totalWithVat': value};
case 'futureTotalWithVat':
return {'futureTotalWithVat': value};
- case 'hasStock':
- return {'hasStock': value};
+ case 'notMovableLines':
+ return {'notMovableLines': value};
}
}
}
diff --git a/modules/ticket/front/advance/locale/es.yml b/modules/ticket/front/advance/locale/es.yml
index da22cd433..3111d9afd 100644
--- a/modules/ticket/front/advance/locale/es.yml
+++ b/modules/ticket/front/advance/locale/es.yml
@@ -7,3 +7,5 @@ Liters: Litros
Item Packing Type: Encajado
Origin agency: "Agencia origen: {{agency}}"
Destination agency: "Agencia destino: {{agency}}"
+Less than 50€: Menor a 50€
+Not Movable: No movibles
diff --git a/modules/ticket/front/future/index.html b/modules/ticket/front/future/index.html
index c0e1decc2..8628bb34c 100644
--- a/modules/ticket/front/future/index.html
+++ b/modules/ticket/front/future/index.html
@@ -143,7 +143,7 @@
{{::ticket.liters}} |
{{::ticket.lines}} |
-
+ |
diff --git a/modules/ticket/front/future/index.js b/modules/ticket/front/future/index.js
index b588f1e49..8cb7f16aa 100644
--- a/modules/ticket/front/future/index.js
+++ b/modules/ticket/front/future/index.js
@@ -149,9 +149,19 @@ export default class Controller extends Section {
case 'lines':
return {'lines': value};
case 'ipt':
- return {'ipt': value};
+ return {or:
+ [
+ {'ipt': {like: `%${value}%`}},
+ {'ipt': null}
+ ]
+ };
case 'futureIpt':
- return {'futureIpt': value};
+ return {or:
+ [
+ {'futureIpt': {like: `%${value}%`}},
+ {'futureIpt': null}
+ ]
+ };
}
}
}
diff --git a/print/templates/reports/balance-compensation/balance-compensation.html b/print/templates/reports/balance-compensation/balance-compensation.html
index 1e9aa5661..d1a2788ed 100644
--- a/print/templates/reports/balance-compensation/balance-compensation.html
+++ b/print/templates/reports/balance-compensation/balance-compensation.html
@@ -17,8 +17,8 @@
{{$t('Agree') | uppercase}}
- {{$t('Date')}} {{formatDate(client.payed, '%d-%m-%Y')}} {{$t('Compensate')}} {{client.amountPaid}} €
- {{$t('From client')}} {{client.name}} {{$t('Toclient')}} {{company.name}}.
+ {{$t('Date')}} {{client.payed | date('%d-%m-%Y')}} {{$t('Compensate')}} {{client.amountPaid}} €
+ {{$t('From client')}} {{client.name}} {{$t('Against the balance of')}}: {{client.invoiceFk}}.
{{$t('Reception')}} administracion@verdnatura.es
diff --git a/print/templates/reports/balance-compensation/locale/es.yml b/print/templates/reports/balance-compensation/locale/es.yml
index 546e55f06..1c76274ae 100644
--- a/print/templates/reports/balance-compensation/locale/es.yml
+++ b/print/templates/reports/balance-compensation/locale/es.yml
@@ -4,13 +4,13 @@ Compensation: Compensación de saldos deudores y acreedores
In one hand: De una parte
CIF: con CIF
NIF: con NIF
-Home: y domicilio sito en
+Home: y domicilio sito en
In other hand: De la otra
Sr: Don/Doña
Agree: Acuerdan
Date: En fecha de
-Compensate: se ha compensado el saldo de
+Compensate: se ha compensado el saldo de
From client: del cliente/proveedor
-To client: con el cliente/proveedor
+Against the balance of: contra el saldo de
Reception: Por favor, rogamos confirmen la recepción de esta compensación al email
-Greetings: Saludos cordiales,
\ No newline at end of file
+Greetings: Saludos cordiales,
diff --git a/print/templates/reports/balance-compensation/sql/client.sql b/print/templates/reports/balance-compensation/sql/client.sql
index b4463be23..c3679b68a 100644
--- a/print/templates/reports/balance-compensation/sql/client.sql
+++ b/print/templates/reports/balance-compensation/sql/client.sql
@@ -4,6 +4,7 @@ SELECT
c.street,
c.fi,
c.city,
+ r.invoiceFk,
r.amountPaid,
r.payed
FROM client c
diff --git a/print/templates/reports/client-debt-statement/client-debt-statement.html b/print/templates/reports/client-debt-statement/client-debt-statement.html
index fb7bfd625..30fbbe003 100644
--- a/print/templates/reports/client-debt-statement/client-debt-statement.html
+++ b/print/templates/reports/client-debt-statement/client-debt-statement.html
@@ -13,7 +13,7 @@
{{$t('date')}} |
- {{formatDate(new Date(), '%d-%m-%Y');}} |
+ {{formatDate(new Date(), '%d-%m-%Y')}} |
@@ -44,7 +44,7 @@
- {{formatDate(sale.issued, '%d-%m-%Y');}} |
+ {{formatDate(sale.issued, '%d-%m-%Y')}} |
{{sale.ref}} |
{{sale.debtOut}} |
{{sale.debtIn}} |
diff --git a/print/templates/reports/delivery-note/delivery-note.js b/print/templates/reports/delivery-note/delivery-note.js
index d9544a58c..50d5720ad 100755
--- a/print/templates/reports/delivery-note/delivery-note.js
+++ b/print/templates/reports/delivery-note/delivery-note.js
@@ -13,7 +13,7 @@ module.exports = {
this.sales = await this.rawSqlFromDef('sales', [this.id]);
this.address = await this.findOneFromDef(`address`, [this.id]);
this.services = await this.rawSqlFromDef('services', [this.id]);
- this.taxes = await this.rawSqlFromDef('taxes', [this.id]);
+ this.taxes = await this.findOneFromDef('taxes', [this.id]);
this.packagings = await this.rawSqlFromDef('packagings', [this.id]);
this.signature = await this.findOneFromDef('signature', [this.id]);
},
diff --git a/print/templates/reports/invoice/invoice.html b/print/templates/reports/invoice/invoice.html
index a574961c2..2d180878a 100644
--- a/print/templates/reports/invoice/invoice.html
+++ b/print/templates/reports/invoice/invoice.html
@@ -203,7 +203,7 @@
-
+
{{$t('intrastat')}}
diff --git a/print/templates/reports/invoice/invoice.js b/print/templates/reports/invoice/invoice.js
index 7b572d970..eaf17527d 100755
--- a/print/templates/reports/invoice/invoice.js
+++ b/print/templates/reports/invoice/invoice.js
@@ -10,7 +10,8 @@ module.exports = {
this.checkMainEntity(this.invoice);
this.client = await this.findOneFromDef('client', [this.reference]);
this.taxes = await this.rawSqlFromDef(`taxes`, [this.reference]);
- this.intrastat = await this.rawSqlFromDef(`intrastat`, [this.reference, this.reference, 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.rectified = await this.rawSqlFromDef(`rectified`, [this.reference]);
this.hasIncoterms = await this.findValueFromDef(`hasIncoterms`, [this.reference]);
diff --git a/print/templates/reports/invoice/sql/hasIntrastat.sql b/print/templates/reports/invoice/sql/hasIntrastat.sql
new file mode 100644
index 000000000..09eda94c2
--- /dev/null
+++ b/print/templates/reports/invoice/sql/hasIntrastat.sql
@@ -0,0 +1,4 @@
+SELECT taxAreaFk != 'NATIONAL'
+ FROM vn.invoiceOutSerial ios
+ JOIN vn.invoiceOut io ON io.serial = ios.code
+ WHERE io.ref = ?;
diff --git a/print/templates/reports/invoice/sql/intrastat.sql b/print/templates/reports/invoice/sql/intrastat.sql
index f986a9564..211ebfe71 100644
--- a/print/templates/reports/invoice/sql/intrastat.sql
+++ b/print/templates/reports/invoice/sql/intrastat.sql
@@ -1,26 +1,36 @@
SELECT *
- FROM invoiceOut io
- JOIN invoiceOutSerial ios ON io.serial = ios.code
- JOIN(
- SELECT ir.id code,
- ir.description,
- iii.stems,
- iii.net netKg,
- iii.amount subtotal
- FROM vn.invoiceInIntrastat iii
- LEFT JOIN vn.invoiceIn ii ON ii.id = iii.invoiceInFk
- LEFT JOIN vn.invoiceOut io ON io.ref = ii.supplierRef
- LEFT JOIN vn.intrastat ir ON ir.id = iii.intrastatFk
- WHERE io.`ref` = ?
- UNION ALL
- SELECT NULL code,
- 'Servicios' description,
- 0 stems,
- 0 netKg,
- IF(CAST(SUM((ts.quantity * ts.price)) AS DECIMAL(10,2)), CAST(SUM((ts.quantity * ts.price)) AS DECIMAL(10,2)), 0) subtotal
- FROM vn.ticketService ts
- JOIN vn.ticket t ON ts.ticketFk = t.id
- WHERE t.refFk = ?
- ) sub
- WHERE io.ref = ? AND ios.isCEE
- ORDER BY sub.code;
+ FROM (
+ SELECT i.intrastatFk code,
+ it.description,
+ CAST(SUM(ROUND((s.quantity * s.price * (100 - s.discount) / 100 ) , 2))AS DECIMAL(10, 2)) subtotal,
+ SUM(IFNULL(i.stems, 1) * s.quantity) stems,
+ CAST(SUM(IFNULL(i.stems, 1)
+ * s.quantity
+ * IF(ic.grams, ic.grams, IFNULL(i.weightByPiece, 0)) / 1000)
+ * IF(sub.totalWeight, sub.totalWeight / vn.invoiceOut_getWeight(?), 1)
+ AS DECIMAL(10,2)) netKg
+ FROM sale s
+ JOIN ticket t ON s.ticketFk = t.id
+ JOIN supplier su ON su.id = t.companyFk
+ JOIN item i ON i.id = s.itemFk
+ JOIN intrastat it ON it.id = i.intrastatFk
+ LEFT JOIN itemCost ic ON ic.itemFk = i.id AND ic.warehouseFk = t.warehouseFk
+ LEFT JOIN (
+ SELECT SUM(weight)totalWeight
+ FROM vn.ticket
+ WHERE refFk = ?
+ AND weight
+ ) sub ON TRUE
+ WHERE t.refFk =?
+ GROUP BY i.intrastatFk
+ UNION ALL
+ SELECT NULL ,
+ IF((SUM((ts.quantity * ts.price))), 'Servicios', NULL),
+ IFNULL(CAST(SUM((ts.quantity * ts.price)) AS DECIMAL(10,2)), 0),
+ 0 ,
+ 0
+ FROM vn.ticketService ts
+ JOIN vn.ticket t ON ts.ticketFk = t.id
+ WHERE t.refFk = ?
+ ) sub2
+ WHERE `description` IS NOT NULL;
|