From 73b2fed9108fcf7e26fd047a8e0327423c34190f Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 10 Apr 2017 18:23:40 +0200 Subject: [PATCH] Backup --- forms/admin/items/ui.xml | 2 +- forms/admin/shelves/ui.xml | 4 +- forms/ecomerce/catalog/catalog.js | 2 +- forms/ecomerce/catalog/ui.xml | 9 +--- forms/ecomerce/checkout/ui.xml | 2 +- forms/ecomerce/confirm/ui.xml | 2 +- js/db/iterator.js | 2 +- js/db/model.js | 2 +- js/vn/basic-lot.js | 66 ------------------------ js/vn/hash.js | 4 +- js/vn/lot-iface.js | 64 +++++++++++++++++++++++ js/vn/lot.js | 84 ++++++++++++++++--------------- js/vn/vn.js | 2 +- 13 files changed, 120 insertions(+), 125 deletions(-) delete mode 100644 js/vn/basic-lot.js create mode 100644 js/vn/lot-iface.js diff --git a/forms/admin/items/ui.xml b/forms/admin/items/ui.xml index 97f8ca06..fda8e084 100755 --- a/forms/admin/items/ui.xml +++ b/forms/admin/items/ui.xml @@ -1,5 +1,5 @@ - +

Item list

diff --git a/forms/admin/shelves/ui.xml b/forms/admin/shelves/ui.xml index b366d773..eb7912a4 100755 --- a/forms/admin/shelves/ui.xml +++ b/forms/admin/shelves/ui.xml @@ -1,5 +1,5 @@ - +

Shelves

@@ -35,7 +35,7 @@
- + SELECT id, reino FROM vn2008.reinos WHERE display != FALSE ORDER BY reino diff --git a/forms/ecomerce/catalog/catalog.js b/forms/ecomerce/catalog/catalog.js index e50423d1..432a9203 100644 --- a/forms/ecomerce/catalog/catalog.js +++ b/forms/ecomerce/catalog/catalog.js @@ -269,7 +269,7 @@ Hedera.Catalog = new Class this.onEraseClick (); this.$('card').row = form.row; - this.$('card-item').value = form.get ('item_id'); + this.$('card-lot').assign ({item: form.get ('item_id')}); this.$('card-popup').show (button.node); } diff --git a/forms/ecomerce/catalog/ui.xml b/forms/ecomerce/catalog/ui.xml index 428d711c..0b2a7cf0 100755 --- a/forms/ecomerce/catalog/ui.xml +++ b/forms/ecomerce/catalog/ui.xml @@ -1,6 +1,6 @@ - + @@ -82,15 +82,10 @@ - - - - - SELECT a.description, o.str origin FROM vn2008.Articles a diff --git a/forms/ecomerce/checkout/ui.xml b/forms/ecomerce/checkout/ui.xml index 2c870ff9..12975571 100755 --- a/forms/ecomerce/checkout/ui.xml +++ b/forms/ecomerce/checkout/ui.xml @@ -1,6 +1,6 @@ - + SELECT delivery_method, agency_id, address_id diff --git a/forms/ecomerce/confirm/ui.xml b/forms/ecomerce/confirm/ui.xml index 2bddad18..f1623a41 100755 --- a/forms/ecomerce/confirm/ui.xml +++ b/forms/ecomerce/confirm/ui.xml @@ -1,6 +1,6 @@ - + CALL basket_get_vat (); diff --git a/js/db/iterator.js b/js/db/iterator.js index 477b7821..8536caa2 100644 --- a/js/db/iterator.js +++ b/js/db/iterator.js @@ -3,7 +3,7 @@ var Model = require ('./model'); module.exports = new Class ({ - Implements: Vn.Lot + Implements: Vn.LotIface ,Properties: { /** diff --git a/js/db/model.js b/js/db/model.js index d447c452..4d4acdcd 100644 --- a/js/db/model.js +++ b/js/db/model.js @@ -106,7 +106,7 @@ Model.implement */ lot: { - type: Vn.Lot + type: Vn.LotIface ,set: function (x) { this.link ({_lot: x}, {'change': this._onLotChange}); diff --git a/js/vn/basic-lot.js b/js/vn/basic-lot.js deleted file mode 100644 index 8ab2baa2..00000000 --- a/js/vn/basic-lot.js +++ /dev/null @@ -1,66 +0,0 @@ - -var Object = require ('./object'); -var Lot = require ('./lot'); - -module.exports = new Class -({ - Extends: Object - ,Implements: Lot - ,Tag: 'vn-basic-set' - ,Properties: - { - params: - { - type: Object - ,set: function (x) - { - this._params = x; - this.changed (); - } - ,get: function () - { - return this._params; - } - } - } - - ,initialize: function (props) - { - this._params = {}; - this.parent (props); - } - - ,get: function (paramName) - { - return this._params[paramName]; - } - - ,set: function (paramName, value) - { - this._params[paramName] = value; - this.changed (); - } - - /** - * Resets all values. - */ - ,reset: function () - { - this._params = {}; - this.changed (); - } - - ,keys: function () - { - return Object.keys (this._params); - } - - ,assign: function (object) - { - for (var key in object) - this._params[key] = object[key]; - - this.changed (); - } -}); - diff --git a/js/vn/hash.js b/js/vn/hash.js index 982507d8..48236ce9 100644 --- a/js/vn/hash.js +++ b/js/vn/hash.js @@ -1,7 +1,7 @@ var VnObject = require ('./object'); var VnDate = require ('./date'); -var Lot = require ('./lot'); +var LotIface = require ('./lot-iface'); var Value = require ('./value'); /** @@ -10,7 +10,7 @@ var Value = require ('./value'); module.exports = new Class ({ Extends: VnObject - ,Implements: Lot + ,Implements: LotIface ,Properties: { window: { diff --git a/js/vn/lot-iface.js b/js/vn/lot-iface.js new file mode 100644 index 00000000..dfc12168 --- /dev/null +++ b/js/vn/lot-iface.js @@ -0,0 +1,64 @@ + +module.exports = new Class +({ + Properties: + { + /** + * The internal object with the params. + */ + params: + { + type: Object + } + } + + /** + * Gets a value from the set. + * + * @param {String} field The field name + * @return {*} The field value + */ + ,get: function () {} + + /** + * Sets a value on the set. + * + * @param {String} field The field name + * @param {*} value The new field value + */ + ,set: function () {} + + /** + * Returns an array with the set keys. + * + * @return {Array} The set keys + */ + ,keys: function () {} + + /** + * Emits the 'change' signal on the set. + */ + ,changed: function () + { + this.signalEmit ('change'); + } + + /** + * Copies all values from another set. + * + * @param {Object} object The source object + */ + ,assign: function (object) + { + for (var key in object) + this.set (key, object[key]); + + this.changed (); + } + + ,assignLot: function (lot) + { + this.assign (lot.params); + } +}); + diff --git a/js/vn/lot.js b/js/vn/lot.js index dfc12168..65594326 100644 --- a/js/vn/lot.js +++ b/js/vn/lot.js @@ -1,64 +1,66 @@ +var Object = require ('./object'); +var LotIface = require ('./lot-iface'); + module.exports = new Class ({ - Properties: + Extends: Object + ,Implements: LotIface + ,Tag: 'vn-lot' + ,Properties: { - /** - * The internal object with the params. - */ params: { type: Object + ,set: function (x) + { + this._params = x; + this.changed (); + } + ,get: function () + { + return this._params; + } } } - /** - * Gets a value from the set. - * - * @param {String} field The field name - * @return {*} The field value - */ - ,get: function () {} - - /** - * Sets a value on the set. - * - * @param {String} field The field name - * @param {*} value The new field value - */ - ,set: function () {} - - /** - * Returns an array with the set keys. - * - * @return {Array} The set keys - */ - ,keys: function () {} - - /** - * Emits the 'change' signal on the set. - */ - ,changed: function () + ,initialize: function (props) { - this.signalEmit ('change'); + this._params = {}; + this.parent (props); } + ,get: function (paramName) + { + return this._params[paramName]; + } + + ,set: function (paramName, value) + { + this._params[paramName] = value; + this.changed (); + } + /** - * Copies all values from another set. - * - * @param {Object} object The source object + * Resets all values. */ + ,reset: function () + { + this._params = {}; + this.changed (); + } + + ,keys: function () + { + return Object.keys (this._params); + } + ,assign: function (object) { for (var key in object) - this.set (key, object[key]); + this._params[key] = object[key]; this.changed (); } - - ,assignLot: function (lot) - { - this.assign (lot.params); - } }); diff --git a/js/vn/vn.js b/js/vn/vn.js index 60c29b95..1fd84735 100644 --- a/js/vn/vn.js +++ b/js/vn/vn.js @@ -12,8 +12,8 @@ Vn = module.exports = { ,Date : require ('./date') ,Value : require ('./value') ,Url : require ('./url') + ,LotIface : require ('./lot-iface') ,Lot : require ('./lot') - ,BasicLot : require ('./basic-lot') ,Hash : require ('./hash') ,Param : require ('./param') ,Node : require ('./node')