From 27aa233237199f1f19bc8d2f2b9de63fa3766a80 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 6 Feb 2018 09:57:05 +0100 Subject: [PATCH] Agency text clarified --- debian/changelog | 2 +- forms/ecomerce/checkout/ui.xml | 6 ++- forms/ecomerce/orders/locale/ca.yml | 3 +- forms/ecomerce/orders/locale/en.yml | 3 +- forms/ecomerce/orders/locale/fr.yml | 3 +- forms/ecomerce/orders/locale/mn.yml | 3 +- forms/ecomerce/ticket/locale/ca.yml | 3 +- forms/ecomerce/ticket/locale/en.yml | 3 +- forms/ecomerce/ticket/locale/es.yml | 3 +- forms/ecomerce/ticket/locale/fr.yml | 3 +- forms/ecomerce/ticket/locale/pt.yml | 3 +- forms/ecomerce/ticket/style.css | 5 +++ forms/ecomerce/ticket/ticket.js | 8 ++++ forms/ecomerce/ticket/ui.xml | 10 ++--- package.json | 2 +- reports/delivery-note/delivery-note.js | 10 ++++- reports/delivery-note/style.css | 6 ++- reports/delivery-note/ui.xml | 40 ++++++++++--------- utils/deploy | 55 ++++++++++++++++++++++++++ utils/upgrade | 21 ++++++++++ 20 files changed, 154 insertions(+), 38 deletions(-) create mode 100755 utils/deploy create mode 100755 utils/upgrade diff --git a/debian/changelog b/debian/changelog index bd52f907..10ad18a3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.405.77) stable; urgency=low +hedera-web (1.405.78) stable; urgency=low * Initial Release. diff --git a/forms/ecomerce/checkout/ui.xml b/forms/ecomerce/checkout/ui.xml index 2ee0214c..964ab0aa 100644 --- a/forms/ecomerce/checkout/ui.xml +++ b/forms/ecomerce/checkout/ui.xml @@ -33,7 +33,8 @@ ON m.agencyFk = a.agencyFk JOIN vn.deliveryMethod d ON d.id = m.deliveryMethodFk - WHERE d.code IN ('AGENCY', 'DELIVERY'); + WHERE d.code IN ('AGENCY', 'DELIVERY') + ORDER BY m.description; DROP TEMPORARY TABLE tmp.agencyAvailable; @@ -55,7 +56,8 @@ ON m.agencyFk = a.agencyFk JOIN vn.deliveryMethod d ON d.id = m.deliveryMethodFk - WHERE d.code IN ('PICKUP'); + WHERE d.code IN ('PICKUP') + ORDER BY m.description; DROP TEMPORARY TABLE tmp.agencyAvailable; diff --git a/forms/ecomerce/orders/locale/ca.yml b/forms/ecomerce/orders/locale/ca.yml index f0a8b635..c93f4817 100644 --- a/forms/ecomerce/orders/locale/ca.yml +++ b/forms/ecomerce/orders/locale/ca.yml @@ -28,7 +28,8 @@ Boxes: Caixes TotalWithVAT: Total amb IVA PayOrder: Pagar encàrrec 'AmountToPay:': 'Quantitat a pagar (€):' -AmountError: La quantitat ha de ser un nombre positiu i inferior o igual a l'import pendent +AmountError: >- + La quantitat ha de ser un nombre positiu i inferior o igual a l'import pendent PayError: Error al realitzar el pagament An error has been in the payment: Sembla que hi ha hagut un error en el pagament Retry: Reintenta diff --git a/forms/ecomerce/orders/locale/en.yml b/forms/ecomerce/orders/locale/en.yml index 1ecab04d..4bb08ce7 100644 --- a/forms/ecomerce/orders/locale/en.yml +++ b/forms/ecomerce/orders/locale/en.yml @@ -31,6 +31,7 @@ AmountError: >- The amount must be a positive number less than or equal to the outstanding amount PayError: Failed to make the payment -An error has been in the payment: It seems that there has been an error in the payment +An error has been in the payment: >- + It seems that there has been an error in the payment Retry: Retry Accept: Accept diff --git a/forms/ecomerce/orders/locale/fr.yml b/forms/ecomerce/orders/locale/fr.yml index 373840f3..e10b5d7c 100644 --- a/forms/ecomerce/orders/locale/fr.yml +++ b/forms/ecomerce/orders/locale/fr.yml @@ -32,6 +32,7 @@ AmountError: >- La quantité doit être un neméro positif et inférieur ou égal à la somme restant à payer PayError: Impossible d'effectuer le paiement -An error has been in the payment: Il semble qu'il ya eu une erreur dans le paiement +An error has been in the payment: >- + Il semble qu'il ya eu une erreur dans le paiement Retry: Réessayez Accept: Accepter diff --git a/forms/ecomerce/orders/locale/mn.yml b/forms/ecomerce/orders/locale/mn.yml index 15c3c949..207a0dac 100644 --- a/forms/ecomerce/orders/locale/mn.yml +++ b/forms/ecomerce/orders/locale/mn.yml @@ -31,6 +31,7 @@ AmountError: >- The amount must be a positive number less than or equal to the outstanding amount PayError: Failed to make the payment -An error has been in the payment: It seems that there has been an error in the payment +An error has been in the payment: >- + It seems that there has been an error in the payment Retry: Retry Accept: Accept diff --git a/forms/ecomerce/ticket/locale/ca.yml b/forms/ecomerce/ticket/locale/ca.yml index 7c7c20a1..a58dc38e 100644 --- a/forms/ecomerce/ticket/locale/ca.yml +++ b/forms/ecomerce/ticket/locale/ca.yml @@ -1,6 +1,7 @@ OrderDetail: Detall de l'encarrec Print delivery note: Imprimir albarà -Delivery: Entrega +Agency: Agència +Warehouse: Magatzem Total: Total Total + tax: Total + IVA Tax base: Base imposable diff --git a/forms/ecomerce/ticket/locale/en.yml b/forms/ecomerce/ticket/locale/en.yml index cf23090c..1df0727f 100644 --- a/forms/ecomerce/ticket/locale/en.yml +++ b/forms/ecomerce/ticket/locale/en.yml @@ -1,6 +1,7 @@ OrderDetail: Order detail Print delivery note: Print delivery note -Delivery: Delivery +Agency: Agency +Warehouse: Store Total: Total Total + tax: Total + tax Tax base: Tax base diff --git a/forms/ecomerce/ticket/locale/es.yml b/forms/ecomerce/ticket/locale/es.yml index c7646033..b6696cd5 100644 --- a/forms/ecomerce/ticket/locale/es.yml +++ b/forms/ecomerce/ticket/locale/es.yml @@ -1,6 +1,7 @@ OrderDetail: Detalle del pedido Print delivery note: Imprimir albarán -Delivery: Entrega +Agency: Agencia +Warehouse: Almacén Total: Total Total + tax: Total + IVA Tax base: Base imponible diff --git a/forms/ecomerce/ticket/locale/fr.yml b/forms/ecomerce/ticket/locale/fr.yml index 5474ba32..d766ae19 100644 --- a/forms/ecomerce/ticket/locale/fr.yml +++ b/forms/ecomerce/ticket/locale/fr.yml @@ -1,6 +1,7 @@ OrderDetail: Détails de la commande Print delivery note: Imprimer bulletin de livraison -Delivery: Livraison +Agency: Agence +Warehouse: Entrepôt Total: Total Total + tax: Total + impôt Tax base: Imposable diff --git a/forms/ecomerce/ticket/locale/pt.yml b/forms/ecomerce/ticket/locale/pt.yml index 6b09c23d..8c3409e1 100644 --- a/forms/ecomerce/ticket/locale/pt.yml +++ b/forms/ecomerce/ticket/locale/pt.yml @@ -1,6 +1,7 @@ OrderDetail: Detalhes da encomenda Print delivery note: Imprimir nota de entrega -Delivery: Entrega +Agency: Agência +Warehouse: Armazém Total: Total Total + tax: Total + IVA Tax base: Base tributável diff --git a/forms/ecomerce/ticket/style.css b/forms/ecomerce/ticket/style.css index f6c6a1b6..3d6b08c7 100644 --- a/forms/ecomerce/ticket/style.css +++ b/forms/ecomerce/ticket/style.css @@ -19,6 +19,11 @@ border-bottom: 1px solid #DDD; margin-bottom: 1em; } +.ticket .address, +.ticket .total +{ + margin-top: .8em; +} .ticket .head > div { padding-bottom: .8em; diff --git a/forms/ecomerce/ticket/ticket.js b/forms/ecomerce/ticket/ticket.js index bd34d1bb..395f64c1 100644 --- a/forms/ecomerce/ticket/ticket.js +++ b/forms/ecomerce/ticket/ticket.js @@ -13,6 +13,14 @@ Hedera.Ticket = new Class this.conn.execQuery ('CALL myTicketLogAccess (#ticket)', null, batch); } + ,onTicketReady: function (form) + { + if (form.get ('method') != 'PICKUP') + Vn.Node.setText (this.$('method'), _('Agency')); + else + Vn.Node.setText (this.$('method'), _('Warehouse')); + } + ,onPrintClick: function () { var batch = new Sql.Batch (); diff --git a/forms/ecomerce/ticket/ui.xml b/forms/ecomerce/ticket/ui.xml index c9bab81d..fb4af84a 100644 --- a/forms/ecomerce/ticket/ui.xml +++ b/forms/ecomerce/ticket/ui.xml @@ -7,7 +7,7 @@ - + CALL myTicketGet (#ticket) @@ -34,11 +34,11 @@

- -

- Delivery +

+
+

@@ -51,7 +51,7 @@ ()

-
+

Total diff --git a/package.json b/package.json index 298cc4e4..996b5bcb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.405.77", + "version": "1.405.78", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/reports/delivery-note/delivery-note.js b/reports/delivery-note/delivery-note.js index 1319c655..9b0d01a0 100644 --- a/reports/delivery-note/delivery-note.js +++ b/reports/delivery-note/delivery-note.js @@ -2,7 +2,15 @@ Hedera.DeliveryNote = new Class ({ Extends: Hedera.Report - + + ,onTicketReady: function (form) + { + if (form.get ('method') != 'PICKUP') + Vn.Node.setText (this.$('method'), _('Agency')); + else + Vn.Node.setText (this.$('method'), _('Warehouse')); + } + ,subtotalRenderer: function (column, form) { column.value = this.subtotal (form); diff --git a/reports/delivery-note/style.css b/reports/delivery-note/style.css index 23eb2f6b..96d47eca 100644 --- a/reports/delivery-note/style.css +++ b/reports/delivery-note/style.css @@ -16,11 +16,15 @@ h2 { margin-bottom: 2em; } -.header > p +.header > div > p { text-align: right; margin: .1em 0; } +.address +{ + margin-top: .8em; +} .important { font-size: 1.2em; diff --git a/reports/delivery-note/ui.xml b/reports/delivery-note/ui.xml index 7869e4c8..c3352706 100644 --- a/reports/delivery-note/ui.xml +++ b/reports/delivery-note/ui.xml @@ -1,6 +1,6 @@ - + CALL myTicketGet (#ticket) @@ -13,23 +13,27 @@

-

- -

-

- -

-

- -

-

- - - () aaa -

-

- Delivery -

+
+

+ +

+

+ +

+
+
+

+ +

+

+ +

+

+ + + () +

+
diff --git a/utils/deploy b/utils/deploy new file mode 100755 index 00000000..a6526e28 --- /dev/null +++ b/utils/deploy @@ -0,0 +1,55 @@ +#!/bin/bash +set -e + +baseDir=$(dirname "$0") +gitDir="$baseDir/.." +projectName=$(basename "$(realpath "$gitDir")") +buildDir="/tmp/git-deploy/$projectName" +srcDir="$buildDir/src" +repreproDir="/var/cache/reprepro" +codename="stable" +logFile="$buildDir/deploy.log" + +echo "Building source code." +echo " * Directory $buildDir" + +rm -f "$logFile" + +mkdir -p "$srcDir" +git --work-tree="$srcDir" --git-dir="$gitDir" checkout -f + +if [ -f "$srcDir/package.json" ] +then + echo "Installing Node dependencies." + (cd "$srcDir" && npm --silent install >> "$logFile") +fi + +if [ -f "$srcDir/debian/changelog" ] +then + echo "Cleaning last build." + rm -f "$buildDir/*.deb" + rm -f "$buildDir/*.changes" + rm -f "$buildDir/*.build" + (cd "$srcDir" && debian/rules clean >> "$logFile") + + echo "Building Debian packages." + (cd "$srcDir" && debuild -uc -us -b >> "$logFile") + + echo "Adding packages to repository." + packages="" + + cut -d" " -f1 "$srcDir/debian/files" | + while read debFile + do + if [[ ! "$debFile" =~ .*\.deb$ ]] + then + continue + fi + + packageName=$(echo $debFile | cut -d"_" -f1) + packages="$packages $packageName" + + echo " * Adding $debFile" + reprepro -b "$repreproDir" includedeb $codename "$buildDir/$debFile" >> "$logFile" + done +fi diff --git a/utils/upgrade b/utils/upgrade new file mode 100755 index 00000000..07bbbef9 --- /dev/null +++ b/utils/upgrade @@ -0,0 +1,21 @@ +#!/bin/bash +set -e + +packages=$1 +hosts="www1.static.verdnatura.es www2.static.verdnatura.es" + +if [ -z "$packages" ] +then + echo "Usage: $(basename $0) package_name..." + exit 1 +fi + +# FIXME: Packages are not upgraded when config files are changed + +echo "Upgrading servers." + +for host in $hosts +do + echo " * Upgrading $host" + ssh root@$host "update-repo vn && apt-get install $packages >> /dev/null" +done