From 5e87da735f966f06dc6ae822c813f6957f0e7887 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 3 Oct 2022 14:49:41 +0200 Subject: [PATCH] Fixes --- debian/changelog | 2 +- forms/account/address/ui.xml | 12 +++++---- forms/ecomerce/confirm/confirm.js | 4 +-- forms/ecomerce/confirm/ui.xml | 35 +++++++++----------------- forms/ecomerce/ticket/ticket.js | 2 +- js/htk/field/index.js | 9 +++++++ js/sql/value.js | 9 +++++++ js/vn/param-iface.js | 41 +++++++++++++++++-------------- js/vn/param.js | 9 +++++++ package.json | 2 +- web/json-service.php | 4 +-- web/rest-service.php | 6 ++--- webpack.config.json | 2 +- 13 files changed, 79 insertions(+), 58 deletions(-) diff --git a/debian/changelog b/debian/changelog index d97b3f67..ff97a93d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.408.11) stable; urgency=low +hedera-web (1.408.12) stable; urgency=low * Initial Release. diff --git a/forms/account/address/ui.xml b/forms/account/address/ui.xml index 09edf5c1..64edf97f 100644 --- a/forms/account/address/ui.xml +++ b/forms/account/address/ui.xml @@ -40,28 +40,30 @@
+ form="iter" column="nickname"/>
+ form="iter" column="street"/>
+ form="iter" column="city"/>
+ form="iter" column="postalCode"/>
+ one-way="true" + one-time="true"> SELECT id, country FROM vn.country ORDER BY country diff --git a/forms/ecomerce/confirm/confirm.js b/forms/ecomerce/confirm/confirm.js index 36ec2fee..38784c46 100644 --- a/forms/ecomerce/confirm/confirm.js +++ b/forms/ecomerce/confirm/confirm.js @@ -143,9 +143,9 @@ Hedera.Confirm = new Class({ conn: this.conn, hash: this.hash }); - tpv.pay(payAmount, this.$.orderForm.$.companyFk); + tpv.pay(payAmount, this.$.order.companyFk); } else - this.hash.setAll({'form': 'ecomerce/orders'}); + this.hash.setAll({form: 'ecomerce/orders'}); } }); diff --git a/forms/ecomerce/confirm/ui.xml b/forms/ecomerce/confirm/ui.xml index d54a014a..d8f1d186 100644 --- a/forms/ecomerce/confirm/ui.xml +++ b/forms/ecomerce/confirm/ui.xml @@ -1,6 +1,6 @@ - + CALL myBasket_getTax; SELECT o.id, o.sent, o.notes, o.companyFk, @@ -36,26 +36,17 @@
ShippingInformation

- Delivery at - + Delivery at {{Vn.Value.format(order.sent, _('%D'))}}

- Agency - + Agency {{order.agency}}

DeliveryAddress
-

- -

-

- -

-

- , - -

+

{{order.nickname}}

+

{{order.street}}

+

{{order.postalCode}}, {{order.city}}

@@ -64,9 +55,7 @@ - + @@ -76,7 +65,7 @@ Order total @@ -84,7 +73,7 @@ Order VAT @@ -100,7 +89,7 @@ Credit @@ -183,8 +172,8 @@ diff --git a/forms/ecomerce/ticket/ticket.js b/forms/ecomerce/ticket/ticket.js index f5dc68e3..a59afeb6 100644 --- a/forms/ecomerce/ticket/ticket.js +++ b/forms/ecomerce/ticket/ticket.js @@ -13,7 +13,7 @@ Hedera.Ticket = new Class({ onPrintClick: function() { let params = Vn.Url.makeUri({ authorization: this.conn.token, - ticketId: this.$.ticketId.value, + ticketId: this.hash.$.ticket, recipientId: this.gui.user.id, type: 'deliveryNote' }); diff --git a/js/htk/field/index.js b/js/htk/field/index.js index 81b66f90..aae49706 100644 --- a/js/htk/field/index.js +++ b/js/htk/field/index.js @@ -60,6 +60,15 @@ module.exports = new Class({ return this._oneWay; } }, + oneTime: { + type: Boolean + ,set: function(x) { + this._oneTime = x; + } + ,get: function() { + return this._oneTime; + } + }, editable: { type: Boolean ,set: function(x) { diff --git a/js/sql/value.js b/js/sql/value.js index 1650eead..6e069472 100644 --- a/js/sql/value.js +++ b/js/sql/value.js @@ -64,6 +64,15 @@ module.exports = new Class({ ,get: function() { return this._oneWay; } + }, + oneTime: { + type: Boolean + ,set: function(x) { + this._oneTime = x; + } + ,get: function() { + return this._oneTime; + } } } diff --git a/js/vn/param-iface.js b/js/vn/param-iface.js index 792de330..4800c4d6 100644 --- a/js/vn/param-iface.js +++ b/js/vn/param-iface.js @@ -51,10 +51,9 @@ module.exports = new Class({ ,_value: undefined ,_type: null ,_param: null - ,_paramLock: false ,_lot: null + ,_sourceLock: false ,_name: null - ,_lotLock: false ,_oneWay: false ,_setValue: function(newValue) { @@ -80,53 +79,57 @@ module.exports = new Class({ this._type = type; this._onLotChange(); } + + ,_onSourceChange(newValue) { + if (this._oneTime && this._value !== undefined) + return; + + this._sourceLock = true; + this._setValue(newValue); + this._sourceLock = false; + } ,_setParam: function(param) { + this.link({_lot: null}); this.link({_param: param}, {changed: this._onParamChange}); this._refreshParam(); } ,_onParamChange: function() { - if (this._paramLock || !this._param) - return; - - this._paramLock = true; - this._setValue(this._param.value); - this._paramLock = false; + if (this._sourceLock || !this._param) return; + this._onSourceChange(this._param.value); } ,_refreshParam: function() { - if (this._paramLock || !this._param) + if (this._sourceLock || !this._param || this._oneWay) return; - this._paramLock = true; + this._sourceLock = true; this._param.value = this._value; - this._paramLock = false; + this._sourceLock = false; } ,_setLot: function(lot) { + this.link({_param: null}); this.link({_lot: lot}, {change: this._onLotChange}); this._onLotChange(); } ,_onLotChange: function() { - if (this._lotLock || !this._name || !this._lot) + if (this._sourceLock || !this._lot || !this._name) return; var newValue = this._lot.get(this._name, this._type); - - this._lotLock = true; - this._setValue(newValue); - this._lotLock = false; + this._onSourceChange(newValue); } ,_refreshLot: function() { - if (this._lotLock || !this._name || !this._lot || this._oneWay) + if (this._sourceLock || !this._name || !this._lot || this._oneWay) return; - this._lotLock = true; + this._sourceLock = true; this._lot.set(this._name, this._value); - this._lotLock = false; + this._sourceLock = false; } ,_setName: function(name) { diff --git a/js/vn/param.js b/js/vn/param.js index 1962e427..61da0210 100644 --- a/js/vn/param.js +++ b/js/vn/param.js @@ -74,6 +74,15 @@ module.exports = new Class({ ,get: function() { return this._oneWay; } + }, + oneTime: { + type: Boolean + ,set: function(x) { + this._oneTime = x; + } + ,get: function() { + return this._oneTime; + } } } }); diff --git a/package.json b/package.json index 9a7d26a9..633ba064 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hedera-web", - "version": "1.408.11", + "version": "1.408.12", "description": "Verdnatura web page", "license": "GPL-3.0", "repository": { diff --git a/web/json-service.php b/web/json-service.php index 497d033e..1cc3a8c0 100644 --- a/web/json-service.php +++ b/web/json-service.php @@ -50,7 +50,7 @@ class JsonService extends RestService { if (_ENABLE_DEBUG || $errno & $eUser) $json->message = $message; else - $json->message = s('Something went wrong'); + $json->message = \s('Something went wrong'); if (_ENABLE_DEBUG) { $json->code = $errno; @@ -80,7 +80,7 @@ class JsonService extends RestService { $json->message = $e->getMessage(); } else { $json->exception = 'Exception'; - $json->message = s('Something went wrong'); + $json->message = \s('Something went wrong'); } if (_ENABLE_DEBUG) { diff --git a/web/rest-service.php b/web/rest-service.php index aa32e1cb..409c4788 100644 --- a/web/rest-service.php +++ b/web/rest-service.php @@ -34,7 +34,7 @@ class RestService extends Service { $isAuthorized = $db->getValue('SELECT myUser_checkRestPriv(#)', [$_REQUEST['method']]); if (!$isAuthorized) - throw new ForbiddenException(s('You don\'t have enough privileges')); + throw new ForbiddenException(\s('You don\'t have enough privileges')); if ($method::SECURITY == Security::DEFINER) { $methodDb = $db; @@ -42,7 +42,7 @@ class RestService extends Service { $methodDb = $this->getUserDb($_SESSION['user']); if ($method::PARAMS !== NULL && !$method->checkParams($_REQUEST, $method::PARAMS)) - throw new UserException (s('Missing parameters')); + throw new UserException (\s('Missing parameters')); Locale::addPath('rest/'. dirname($_REQUEST['method'])); @@ -52,7 +52,7 @@ class RestService extends Service { $res = $method->run($methodDb); } catch (Db\Exception $e) { if ($e->getCode() == 1644) - throw new UserException(s($e->getMessage())); + throw new UserException(\s($e->getMessage())); } if ($method::SECURITY == Security::DEFINER) diff --git a/webpack.config.json b/webpack.config.json index c1d31a88..9822dd4d 100644 --- a/webpack.config.json +++ b/webpack.config.json @@ -1,5 +1,5 @@ { "buildDir": "build", - "devServerPort": 9000, + "devServerPort": 9090, "entry": "./app.js" } \ No newline at end of file
- Previous balance - Previous balance - + {{Vn.Value.format(order.taxableBase, _('%.2d€'))}}
- + {{Vn.Value.format(order.tax, _('%.2d€'))}}
- + {{Vn.Value.format(order.credit, _('%.2d€'))}}