diff --git a/forms/ecomerce/basket/basket.js b/forms/ecomerce/basket/basket.js index 20f8db30..ea5e98ef 100644 --- a/forms/ecomerce/basket/basket.js +++ b/forms/ecomerce/basket/basket.js @@ -39,9 +39,14 @@ Hedera.Basket = new Class this.hash.setAll ({form: 'ecomerce/confirm'}); } - ,repeaterFunc: function (res, form) + ,repeaterFunc: function (res, lot) { - res.$.subtotal.value = this.subtotal (form); + res.$.subtotal.value = this.subtotal (lot); + + if (lot.$.amount > lot.$.available) + Vn.Node.addClass (res.$.available, 'unavailable'); + else + Vn.Node.removeClass (res.$.available, 'unavailable'); } ,onDeleteClick: function (button) @@ -50,9 +55,9 @@ Hedera.Basket = new Class button.lot.deleteRow (); } - ,subtotal: function (form) + ,subtotal: function (lot) { - return form.$.amount * form.$.price; + return lot.$.amount * lot.$.price; } }); diff --git a/forms/ecomerce/basket/style.css b/forms/ecomerce/basket/style.css index 6beaf9e9..56d6abde 100644 --- a/forms/ecomerce/basket/style.css +++ b/forms/ecomerce/basket/style.css @@ -54,9 +54,14 @@ /* Fields */ -.basket td.available-exceeded input +.basket ._available { - background-color: #FCC; + visibility: hidden; +} +.basket ._available.unavailable +{ + color: red; + visibility: visible; } .basket .icon > img { diff --git a/forms/ecomerce/basket/ui.xml b/forms/ecomerce/basket/ui.xml index 41b0fc16..e6d67324 100755 --- a/forms/ecomerce/basket/ui.xml +++ b/forms/ecomerce/basket/ui.xml @@ -28,11 +28,10 @@ - SELECT i.id, i.amount, i.price, a.Article, a.Categoria, - a.Medida, a.Tallos, a.Color, o.Abreviatura, a.Foto - FROM basket_item i - JOIN vn2008.Articles a ON a.Id_Article = i.item_id - LEFT JOIN vn2008.Origen o ON a.id_origen = o.id + SELECT r.id, r.amount, r.price, 0 available, + i.name, i.size, i.category, i.image + FROM basket_item r + JOIN vn.item i ON i.id = r.item_id
@@ -43,21 +42,24 @@ icon="delete" on-click="onDeleteClick"/>

- {{Article}} {{Medida}} {{Categoria}} + {{name}} {{size}} {{category}}

- {{amount}} x + {{amount}} x

+ + {{available}} _availables +
diff --git a/forms/ecomerce/catalog/catalog.js b/forms/ecomerce/catalog/catalog.js index 71c65d85..260eda30 100644 --- a/forms/ecomerce/catalog/catalog.js +++ b/forms/ecomerce/catalog/catalog.js @@ -109,10 +109,10 @@ Hedera.Catalog = new Class ,onBasketReady: function (form) { - if (form.get ('method') != 'PICKUP') + if (form.$.method != 'PICKUP') Vn.Node.setText (this.$.method, _('Agency')); else - Vn.Node.setText (this.$.method, _('Warehouse')); + Vn.Node.setText (this.$.method, _('Store')); } ,onOrderChange: function (combo) @@ -137,7 +137,7 @@ Hedera.Catalog = new Class if (shouldRefresh) { - this.$.items.query = this.buildQuery ('CALL catalogGetItems ()'); + this.$.items.query = this.buildQuery ('CALL catalogGetItems'); this.$.items.refresh (); var nTags = maxFilters - this.nFilters; @@ -509,7 +509,7 @@ Hedera.Catalog = new Class { this.conn.execQuery (sql); - var itemName = this.$.card.$.Article; + var itemName = this.$.card.$.name; Htk.Toast.showMessage ( Vn.Value.sprintf (_('Added%dOf%s'), amountSum, itemName)); } diff --git a/forms/ecomerce/catalog/style.css b/forms/ecomerce/catalog/style.css index ce3e7465..7767c0ae 100644 --- a/forms/ecomerce/catalog/style.css +++ b/forms/ecomerce/catalog/style.css @@ -48,6 +48,10 @@ white-space: nowrap; overflow: hidden; } +.right-panel .filter +{ + padding: 1em 1.8em; +} .right-panel .categories { width: 95%; diff --git a/forms/ecomerce/catalog/ui.xml b/forms/ecomerce/catalog/ui.xml index a19b0f85..f0772328 100755 --- a/forms/ecomerce/catalog/ui.xml +++ b/forms/ecomerce/catalog/ui.xml @@ -39,38 +39,16 @@ result-index="2" auto-load="false"> - - - SELECT o.id, o.date_send, ag.description agency, v.code method - FROM basket o - JOIN vn2008.Agencias ag ON ag.Id_Agencia = o.agency_id - JOIN vn2008.Vistas v ON v.vista_id = o.delivery_method_id - - - - SELECT item_id, warehouse_id, SUM(amount) amount - FROM basket_item - GROUP BY warehouse_id - - - SELECT it.tagFk, SUM(it.priority) priority - FROM vn.itemTag it - JOIN vn.item i ON i.id = it.itemFk - WHERE #filter - GROUP BY tagFk - ORDER BY priority DESC - LIMIT 6 - - - - SELECT i.description, o.name origin - FROM vn.item i - LEFT JOIN vn.originL10n o ON o.id = i.originFk - WHERE i.id = #item - - + + SELECT o.id, o.date_send, ag.description agency, v.code method + FROM basket o + JOIN vn.agencyMode ag ON ag.id = o.agency_id + JOIN vn2008.Vistas v ON v.vista_id = o.delivery_method_id + + + SELECT i.description + FROM vn.item i WHERE i.id = #item + -

{{item.name}}

+

{{name}}

- {{item.producer}} + {{producer}}

- @{{item.id}} + @{{id}}

- _Size {{item.size}} - _Category {{item.category}} + {{tag1}} {{val1}}, {{tag2}} {{val2}}

-

- _Color {{item.inkFk}} +

+ {{tag3}} {{val3}}

- {{item.available}} + {{available}} _from @@ -262,17 +239,23 @@

{{card.producer}}

+ + + SELECT t.name, it.value + FROM vn.itemTag it + JOIN vn.tag t ON t.id = it.tagFk + WHERE it.id = #item + ORDER BY it.priority + + +

+ {{name}} {{value}} +

+
+

- _Size {{card.size}}, - _Category {{card.category}} -

-

- _Color {{card.inkFk}}

-

- _Origin {{card.origin}} -

{{cardExtend.description}} diff --git a/js/hedera/gui.css b/js/hedera/gui.css index 488b1824..32e4f3b1 100644 --- a/js/hedera/gui.css +++ b/js/hedera/gui.css @@ -1,23 +1,23 @@ @media screen { -.vn-gui +.hedera-gui { height: inherit; } /* Font */ -.vn-gui .user-info, -.vn-gui .menu-title, -.vn-gui .main-menu +.hedera-gui .user-info, +.hedera-gui .menu-title, +.hedera-gui ._main-menu { font-size: 1.1em; } /* Navigation bar */ -.vn-gui .navbar +.hedera-gui ._navbar { position: fixed; background-color: #009688; @@ -34,7 +34,7 @@ transition-duration: 200ms; transition-timing-function: ease-in-out; } -.vn-gui .navbar .menu-button +.hedera-gui ._navbar .menu-button { position: absolute; left: 0; @@ -44,16 +44,16 @@ margin: 0; height: 100%; } -.vn-gui .navbar .menu-button img +.hedera-gui ._navbar .menu-button img { vertical-align: middle; height: 1.8em; } -.vn-gui .navbar .title +.hedera-gui ._navbar ._title { float: left; } -.vn-gui .navbar .title > h1 +.hedera-gui ._navbar ._title > h1 { font-weight: normal; font-size: 1.4em; @@ -64,7 +64,7 @@ white-space: nowrap; text-overflow: ellipsis; } -.vn-gui .navbar > .htk-spinner +.hedera-gui ._navbar > .htk-spinner { float: left; margin: 1.05em .8em; @@ -72,29 +72,29 @@ /* Action bar */ -.action-bar +._action-bar { float: right; padding: 0; margin: 0; height: 100%; } -.action-bar > div +._action-bar > div { padding: 0; margin: 0; height: 100%; } -.action-bar > div > * +._action-bar > div > * { float: right; } -.action-bar button +._action-bar button { margin: 0; padding: 1.25em .5em; } -.action-bar button > img +._action-bar button > img { vertical-align: middle; height: 1.4em; @@ -102,7 +102,7 @@ /* Background */ -.vn-gui > .background +.hedera-gui > ._background { z-index: 10; position: fixed; @@ -114,16 +114,17 @@ background-color: rgba(1, 1, 1, .7); opacity: 0; } -.vn-gui > .background.show +.hedera-gui > ._background.show { visibility: visible; - transition: opacity 200ms ease-out; opacity: 1; + transition: opacity 200ms ease-out; + -webkit-transition: opacity 200ms ease-out; } /* Left panel */ -.vn-gui .left-panel +.hedera-gui ._left-panel { z-index: 20; position: fixed; @@ -135,7 +136,7 @@ box-shadow: 0 .2em .2em rgba(1, 1, 1, .4); width: 15em; } -.vn-gui .menu-overflow +.hedera-gui .menu-overflow { position: absolute; top: 0; @@ -144,24 +145,24 @@ bottom: 4em; overflow: auto; } -.vn-gui .menu-header +.hedera-gui ._menu-header { background-color: #333; color: white; padding: 1em; } -.vn-gui .logo +.hedera-gui .logo { display: block; width: 12em; margin-bottom: .8em; } -.vn-gui .user-info +.hedera-gui .user-info { width: 100%; overflow: hidden; } -.vn-gui .user-info > p +.hedera-gui .user-info > p { margin: 0; margin-top: .2em; @@ -169,19 +170,19 @@ text-overflow: ellipsis; white-space: nowrap; } -.vn-gui button.logout +.hedera-gui button.logout { float: right; margin: 0; padding: .2em; display: block; } -.vn-gui button.logout > img +.hedera-gui button.logout > img { height: 1.2em; display: block; } -.vn-gui .supplant +.hedera-gui ._supplant { margin-top: .2em; display: none; @@ -189,7 +190,7 @@ /* Test link */ -.vn-gui .test-link +.hedera-gui ._test-link { display: block; margin: 1em auto; @@ -201,43 +202,43 @@ border-radius: .1em; text-align: center; } -.vn-gui .test-link:hover +.hedera-gui ._test-link:hover { background-color: #4f61c5; } /* Menu */ -.vn-gui .main-menu, -.vn-gui ul.submenu +.hedera-gui ._main-menu, +.hedera-gui ul.submenu { list-style-type: none; padding: 0; margin: 0; } -.vn-gui .main-menu > li +.hedera-gui ._main-menu > li { display: block; padding: 0; margin: 0; width: 100%; } -.vn-gui .main-menu a +.hedera-gui ._main-menu a { width: 70%; padding: 0 15%; display: block; line-height: 2.8em; } -.vn-gui .main-menu a.selected +.hedera-gui ._main-menu a.selected { background-color: rgba(1, 1, 1, .1); } -.vn-gui ul.submenu +.hedera-gui ul.submenu { display: none; } -.vn-gui ul.submenu.popup +.hedera-gui ul.submenu.popup { display: inline; position: fixed; @@ -252,7 +253,7 @@ /* Social */ -.vn-gui .social +.hedera-gui .social { position: absolute; bottom: 0; @@ -262,7 +263,7 @@ /* Body */ - .vn-gui > .body + .hedera-gui > .body { margin-left: 15em; padding-top: 3.9em; @@ -274,11 +275,11 @@ transition-duration: 200ms; } -.vn-gui .form-holder +.hedera-gui ._form-holder { height: inherit; } -.vn-gui .form-holder > * +.hedera-gui ._form-holder > * { position: relative; height: inherit; @@ -292,25 +293,25 @@ @media screen and (max-width: 960px) { - .vn-gui .action-bar span.label, - .vn-gui .htk-button > span + .hedera-gui ._action-bar span.label, + .hedera-gui .htk-button > span { display: none; } - .vn-gui > .navbar + .hedera-gui > ._navbar { padding-left: 2.8em; left: 0; } - .vn-gui > .body + .hedera-gui > .body { margin-left: 0; } - .vn-gui .navbar .menu-button + .hedera-gui ._navbar .menu-button { display: block; } - .vn-gui .left-panel + .hedera-gui ._left-panel { top: 0; left: -15em; @@ -319,16 +320,16 @@ transition: transform 200ms ease-out; -webkit-transition: transform 200ms ease-out; } - .vn-gui .left-panel.show + .hedera-gui ._left-panel.show { transform: translateZ(0) translateX(15em); -webkit-transform: translateZ(0) translateX(15em); } - .vn-gui .form-holder + .hedera-gui ._form-holder { left: 0; } - .vn-gui ul.submenu + .hedera-gui ul.submenu { display: block; background-color: #888; @@ -340,7 +341,7 @@ transition: max-height 300ms ease-out; -webkit-transition: max-height 300ms ease-out; } - .vn-gui .main-menu li:hover > ul.submenu + .hedera-gui ._main-menu li:hover > ul.submenu { max-height: 20em; } @@ -350,8 +351,8 @@ @media print { - .vn-gui .navbar, - .vn-gui .left-panel + .hedera-gui ._navbar, + .hedera-gui ._left-panel { display: none; } diff --git a/js/hedera/gui.js b/js/hedera/gui.js index b0b1bc9d..5c43de88 100644 --- a/js/hedera/gui.js +++ b/js/hedera/gui.js @@ -13,6 +13,7 @@ require ('./gui.css'); module.exports = new Class ({ Extends: Vn.Component, + Tag: 'hedera-gui', Properties: { /** diff --git a/js/hedera/gui.xml b/js/hedera/gui.xml index 82ee799b..86b4824c 100755 --- a/js/hedera/gui.xml +++ b/js/hedera/gui.xml @@ -7,18 +7,18 @@ SELECT default_form, image_dir, image_host FROM config; SELECT production_domain, test_domain FROM config; -

-