diff --git a/forms/account/address/ui.xml b/forms/account/address/ui.xml index f7080c21..f8742327 100755 --- a/forms/account/address/ui.xml +++ b/forms/account/address/ui.xml @@ -41,19 +41,19 @@
- +
- +
- +
- +
@@ -74,7 +74,7 @@
- + SELECT province_id, name FROM vn2008.province diff --git a/forms/admin/items/items.js b/forms/admin/items/items.js index b029e140..80f4e900 100644 --- a/forms/admin/items/items.js +++ b/forms/admin/items/items.js @@ -5,19 +5,16 @@ Hedera.Items = new Class ,activate: function () { - this.$('warehouse').value = 7; - this.$('realm').value = null; + var set = this.$('set'); + set.set ('warehouse', 7); + set.set ('realm', null); } - ,onPreviewClick: function () + ,onShowClick: function () { - var batch = new Sql.Batch (); - batch.addValues ({ - 'warehouse': this.$('warehouse').value - ,'realm': this.$('realm').value - ,'rate': this.$('rate').value - }); - this.gui.openReport ('items-report', batch); + var set = this.$('set'); + set.set ('rate', this.$('rate').value); + this.gui.openReport ('items-report', set.params); } }); diff --git a/forms/admin/items/locale/en.json b/forms/admin/items/locale/en.json index 53a2579c..d87369f0 100644 --- a/forms/admin/items/locale/en.json +++ b/forms/admin/items/locale/en.json @@ -5,5 +5,5 @@ ,"Realm": "Realm" ,"Rate": "Rate" - ,"Preview": "Preview" + ,"Show": "Show" } diff --git a/forms/admin/items/locale/es.json b/forms/admin/items/locale/es.json index 68eee4ef..fa098f43 100644 --- a/forms/admin/items/locale/es.json +++ b/forms/admin/items/locale/es.json @@ -5,5 +5,5 @@ ,"Realm": "Reino" ,"Rate": "Tarifa" - ,"Preview": "Mostrar" + ,"Show": "Mostrar" } diff --git a/forms/admin/items/locale/mn.json b/forms/admin/items/locale/mn.json index 53a2579c..d87369f0 100644 --- a/forms/admin/items/locale/mn.json +++ b/forms/admin/items/locale/mn.json @@ -5,5 +5,5 @@ ,"Realm": "Realm" ,"Rate": "Rate" - ,"Preview": "Preview" + ,"Show": "Show" } diff --git a/forms/admin/items/locale/pt.json b/forms/admin/items/locale/pt.json index 8bf6f7f2..67e01480 100644 --- a/forms/admin/items/locale/pt.json +++ b/forms/admin/items/locale/pt.json @@ -5,5 +5,5 @@ ,"Realm": "Reino" ,"Rate": "Tarifa" - ,"Preview": "Mostrar" + ,"Show": "Mostrar" } diff --git a/forms/admin/items/ui.xml b/forms/admin/items/ui.xml index 36d90a56..6639f827 100755 --- a/forms/admin/items/ui.xml +++ b/forms/admin/items/ui.xml @@ -1,19 +1,19 @@ +

Item list

+ icon="show" + tip="_Show" + on-click="onShowClick"/>
- - + SELECT id, name FROM vn2008.warehouse @@ -24,8 +24,7 @@
- - + SELECT id, reino FROM vn2008.reinos diff --git a/forms/admin/shelves/locale/en.json b/forms/admin/shelves/locale/en.json index 7fb6f425..a9d21599 100644 --- a/forms/admin/shelves/locale/en.json +++ b/forms/admin/shelves/locale/en.json @@ -12,7 +12,7 @@ ,"Show packing": "Show packing" ,"Stack different items": "Stack different items" - ,"Preview": "Preview" + ,"Show": "Show" ,"Pallets": "Pallets" diff --git a/forms/admin/shelves/locale/es.json b/forms/admin/shelves/locale/es.json index edf194ad..2a97e803 100644 --- a/forms/admin/shelves/locale/es.json +++ b/forms/admin/shelves/locale/es.json @@ -12,7 +12,7 @@ ,"Show packing": "Mostrar unidades por caja" ,"Stack different items": "Apilar artículos distintos" - ,"Preview": "Mostrar" + ,"Show": "Mostrar" ,"Pallets": "Palets" diff --git a/forms/admin/shelves/locale/mn.json b/forms/admin/shelves/locale/mn.json index 7fb6f425..a9d21599 100644 --- a/forms/admin/shelves/locale/mn.json +++ b/forms/admin/shelves/locale/mn.json @@ -12,7 +12,7 @@ ,"Show packing": "Show packing" ,"Stack different items": "Stack different items" - ,"Preview": "Preview" + ,"Show": "Show" ,"Pallets": "Pallets" diff --git a/forms/admin/shelves/locale/pt.json b/forms/admin/shelves/locale/pt.json index 791de63d..fd55c26d 100644 --- a/forms/admin/shelves/locale/pt.json +++ b/forms/admin/shelves/locale/pt.json @@ -12,7 +12,7 @@ ,"Show packing": "Mostrar unidades por caixa" ,"Stack different items": "Empilhar ítens diferentes" - ,"Preview": "Mostrar" + ,"Show": "Mostrar" ,"Pallets": "Palets" diff --git a/forms/admin/shelves/shelves.js b/forms/admin/shelves/shelves.js index 483ebdfb..fcfa19b0 100644 --- a/forms/admin/shelves/shelves.js +++ b/forms/admin/shelves/shelves.js @@ -5,49 +5,19 @@ Hedera.Shelves = new Class ,activate: function () { - this.$('date').value = new Date (); - this.$('useIds').value = false; + var set = this.$('set'); + set.set ('date', new Date ()); + set.set ('useIds', false); } ,onConfigChange: function () { - var fields = [ - 'realm' - ,'family' - ,'warehouse' - ,'shelf' - ,'namePrefix' - ,'maxAmount' - ,'reportTitle' - ,'showPacking' - ,'stack' - ]; - - for (var i = 0; i < fields.length; i++) - this.$(fields[i]).value = this.$('config').get (fields[i]); + this.$('set').assign (this.$('config')); } - ,onPreviewClick: function () - { - var fields = [ - 'family' - ,'warehouse' - ,'shelf' - ,'namePrefix' - ,'maxAmount' - ,'reportTitle' - ,'showPacking' - ,'stack' - ,'useIds' - ,'date' - ]; - - var batch = new Sql.Batch (); - - for (var i = 0; i < fields.length; i++) - batch.addValue (fields[i], this.$(fields[i]).value); - - this.gui.openReport ('shelves-report', batch); + ,onShowClick: function () + { + this.gui.openReport ('shelves-report', this.$('set').params); } }); diff --git a/forms/admin/shelves/ui.xml b/forms/admin/shelves/ui.xml index c793fbb4..b288f575 100755 --- a/forms/admin/shelves/ui.xml +++ b/forms/admin/shelves/ui.xml @@ -1,23 +1,13 @@ - - - - SELECT c.id, c.name reportTitle, c.namePrefix, c.warehouse, c.family, - c.shelf, c.maxAmount, c.showPacking, c.stack, t.reino_id realm - FROM shelfConfig c - JOIN vn2008.Tipos t ON t.tipo_id = c.family - - - - +

Shelves

+ icon="show" + tip="_Show" + on-click="onShowClick"/>
@@ -28,16 +18,25 @@ placeholder="_Select config" model="configs-model" on-changed="onConfigChange" - on-ready="onConfigChange"/> + on-ready="onConfigChange"> + + + SELECT c.id, c.name reportTitle, c.namePrefix, c.warehouse, c.family, + c.shelf, c.maxAmount, c.showPacking, c.stack, t.reino_id realm + FROM shelfConfig c + JOIN vn2008.Tipos t ON t.tipo_id = c.family + + +
- +
- - + + SELECT id, reino FROM vn2008.reinos WHERE display != FALSE ORDER BY reino @@ -47,7 +46,7 @@
- + SELECT tipo_id, Tipo FROM vn2008.Tipos @@ -63,7 +62,7 @@
- + SELECT id, name FROM vn2008.warehouse @@ -74,7 +73,7 @@
- + SELECT id, name FROM shelf @@ -84,27 +83,27 @@
- +
- +
- +
- +
- +
- +
diff --git a/forms/ecomerce/catalog/style.css b/forms/ecomerce/catalog/style.css index 3572dde8..4a0e7a65 100644 --- a/forms/ecomerce/catalog/style.css +++ b/forms/ecomerce/catalog/style.css @@ -90,10 +90,6 @@ display: block; float: left; width: 33.33%; -} -.right-panel .realms a:hover -{ - background-color: rgba(1, 1, 1, .05); border-radius: .1em; } .right-panel .realms a > img diff --git a/forms/ecomerce/catalog/ui.xml b/forms/ecomerce/catalog/ui.xml index 5f0215ff..c69f4eee 100755 --- a/forms/ecomerce/catalog/ui.xml +++ b/forms/ecomerce/catalog/ui.xml @@ -225,7 +225,7 @@ - + diff --git a/forms/ecomerce/confirm/ui.xml b/forms/ecomerce/confirm/ui.xml index 754321f6..25e8d42d 100755 --- a/forms/ecomerce/confirm/ui.xml +++ b/forms/ecomerce/confirm/ui.xml @@ -7,7 +7,7 @@ SELECT o.id, o.date_send, o.note, o.company_id, ag.description agency, v.code method, ad.consignee, ad.zip_code, ad.city, ad.name address, - t.*, c.credit, customer_get_debt() debt + t.*, c.credit, clientGetDebt() debt FROM basket o JOIN vn2008.Agencias ag ON ag.Id_Agencia = o.agency_id LEFT JOIN address_view ad ON ad.id = o.address_id diff --git a/forms/ecomerce/orders/orders.js b/forms/ecomerce/orders/orders.js index b06e3d56..ae533025 100644 --- a/forms/ecomerce/orders/orders.js +++ b/forms/ecomerce/orders/orders.js @@ -8,9 +8,13 @@ Hedera.Orders = new Class this.tpv = new Hedera.Tpv ({conn: this.conn}); this.tpv.check (this._onTpvCheck.bind (this)); - var from = new Date (); - from.setDate (from.getDate () - 25); - this.$('from').value = from; + if (!this.$('from').value) + { + var from = new Date (); + from.setDate (from.getDate () - 25); + from.setHours (0, 0, 0, 0); + this.$('from').value = from; + } } ,_onTpvCheck: function (tpv, tpvOrder, tpvStatus) diff --git a/forms/preview/preview.js b/forms/preview/preview.js index 16c877db..99056385 100644 --- a/forms/preview/preview.js +++ b/forms/preview/preview.js @@ -16,8 +16,14 @@ Hedera.Preview = new Class this.gui.loaderPush (); var module = new Hedera.Module ('reports', reportName); + this.reportModule = module; module.load (this._onReportLoad.bind (this)); } + + ,deactivate: function () + { + this.reportModule.unload (); + } ,_onReportLoad: function (module) { @@ -32,12 +38,15 @@ Hedera.Preview = new Class var batch = new Sql.Batch (); batch.addValues (Vn.Hash._hashMap); - var report = new module.klass (module, this.gui); - report.open (batch, this.node); + this.report = new module.klass ({ + info: module, + conn: this.conn + }); + this.report.open (batch, this.node); } ,onPrintClick: function () { - this.doc.defaultView.print (); + this.report.print (); } }); diff --git a/forms/preview/ui.xml b/forms/preview/ui.xml index 54dfa8fe..1a8b5955 100755 --- a/forms/preview/ui.xml +++ b/forms/preview/ui.xml @@ -8,5 +8,5 @@ tip="_Print" on-click="onPrintClick"/>
-
+
diff --git a/image/icon/dark/show.svg b/image/icon/dark/show.svg new file mode 100644 index 00000000..ea9eb301 --- /dev/null +++ b/image/icon/dark/show.svg @@ -0,0 +1,130 @@ + + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + + + + Gnome Symbolic Icon Theme + + + + + + + + + + + + + diff --git a/js/db/form.js b/js/db/form.js index 53affd10..ad1c4c4f 100644 --- a/js/db/form.js +++ b/js/db/form.js @@ -42,7 +42,7 @@ module.exports = new Class return; this._row = x; - this.iterChanged (); + this.changed (); } ,get: function () { @@ -99,14 +99,14 @@ module.exports = new Class if (ready) this.signalEmit ('ready'); - this.iterChanged (); + this.changed (); } } - ,onRowUpdate: function (model, row, column) + ,onRowUpdate: function (model, row) { if (row == this._row) - this.iterChanged (); + this.changed (); } }); diff --git a/js/db/iterator.js b/js/db/iterator.js index ccb90268..96dcae26 100644 --- a/js/db/iterator.js +++ b/js/db/iterator.js @@ -45,11 +45,11 @@ module.exports = new Class } /** - * Emits the 'iter-changed' signal on the form. + * Emits the 'change' signal on the form. */ - ,iterChanged: function () + ,changed: function () { - this.signalEmit ('iter-changed'); + this.signalEmit ('change'); } /** @@ -130,5 +130,13 @@ module.exports = new Class { return this._model.setByIndex (this._row, column, value); } + + ,keys: function () + { + if (this._model) + return Object.keys (this._model.columnMap); + + return []; + } }); diff --git a/js/db/model.js b/js/db/model.js index 53a3ff09..28f3e5b5 100644 --- a/js/db/model.js +++ b/js/db/model.js @@ -438,7 +438,7 @@ Model.implement * * @param {String} field The destination field name * @param {String} table The destination table name - * @param {Object} value The default value + * @param {*} value The default value */ ,setDefaultFromValue: function (field, table, value) { @@ -527,8 +527,8 @@ Model.implement * Gets a value from the model. * * @param {number} rowIndex The row index - * @param {string} columnName The column name - * @return {mixed} The value + * @param {String} columnName The column name + * @return {*} The value */ ,get: function (rowIndex, columnName) { @@ -544,8 +544,8 @@ Model.implement * Updates a value on the model. * * @param {number} rowIndex The row index - * @param {string} columnName The column name - * @param {mixed} value The new value + * @param {String} columnName The column name + * @param {*} value The new value */ ,set: function (rowIndex, columnName, value) { @@ -562,7 +562,7 @@ Model.implement * * @param {number} rowIndex The row index * @param {number} column The column index - * @return {mixed} The value + * @return {*} The value */ ,getByIndex: function (rowIndex, column) { @@ -577,7 +577,7 @@ Model.implement * * @param {number} rowIndex The row index * @param {number} col The column index - * @param {mixed} value The new value + * @param {*} value The new value */ ,setByIndex: function (rowIndex, col, value) { diff --git a/js/db/param.js b/js/db/param.js index 39943d74..00c77baa 100644 --- a/js/db/param.js +++ b/js/db/param.js @@ -32,17 +32,16 @@ module.exports = new Class type: Form ,set: function (x) { - this.link ({_form: x}, + this.link ({_set: x}, { - 'status-changed': this.onFormChange - ,'iter-changed': this.onIterChange + 'change': this.onSetChange }); this.refresh (); } ,get: function () { - return this._form; + return this._set; } }, /** @@ -64,11 +63,10 @@ module.exports = new Class } ,_columnName: null - ,_form: null - ,_formLock: false - ,_columnIndex: -1 + ,_set: null + ,_setLock: false ,_oneWay: false - ,_formValue: null + ,_setValue: null ,initialize: function (props) { @@ -78,38 +76,22 @@ module.exports = new Class ,refresh: function () { - if (this._form) - { - this.onFormChange (); - this.onIterChange (); - } + if (this._set) + this.onSetChange (); } - ,onFormChange: function () + ,onSetChange: function () { - if (this._columnName != null) - this._columnIndex = this._form.getColumnIndex (this._columnName); - } - - ,onIterChange: function () - { - this._formLock = true; - - var formValue; - - if (this._columnIndex !== -1) - formValue = this._form.getByIndex (this._columnIndex); - else - formValue = undefined; - - this.value = formValue; - this._formLock = false; + this._setLock = true; + var formValue = this._set.get (this._columnName); + this.value = formValue; + this._setLock = false; } ,onChange: function () { - if (!this._formLock && this._columnIndex != -1 && !this.oneWay) - this._form.setByIndex (this._columnIndex, this._value); + if (!this._setLock && this._columnName && !this.oneWay) + this._set.set (this._columnName, this._value); } }); diff --git a/js/hedera/form.js b/js/hedera/form.js index 48d2eaad..786d2fb3 100644 --- a/js/hedera/form.js +++ b/js/hedera/form.js @@ -12,6 +12,7 @@ module.exports = new Class this.conn = gui.conn; this.hash = gui.hash; this.formInfo = formInfo; + this.parent (); } ,loadUi: function () diff --git a/js/hedera/gui.css b/js/hedera/gui.css index 1ee272ea..b554fcf2 100644 --- a/js/hedera/gui.css +++ b/js/hedera/gui.css @@ -1,4 +1,6 @@ +@media screen { + .vn-gui { height: inherit; @@ -32,7 +34,7 @@ transition-duration: 200ms; transition-timing-function: ease-in-out; } -.vn-gui .menu-button +.vn-gui .navbar .menu-button { position: absolute; left: 0; @@ -43,20 +45,16 @@ margin: 0; height: 100%; } -.vn-gui .menu-button:hover -{ - background-color: rgba(0, 0, 0, .2); -} -.vn-gui .menu-button img +.vn-gui .navbar .menu-button img { vertical-align: middle; height: 1.8em; } -.vn-gui .title +.vn-gui .navbar .title { float: left; } -.vn-gui .title > h1 +.vn-gui .navbar .title > h1 { font-weight: normal; font-size: 1.4em; @@ -72,33 +70,29 @@ /* Action bar */ -.vn-gui .action-bar +.action-bar { float: right; padding: 0; margin: 0; height: 100%; } -.vn-gui .action-bar > div +.action-bar > div { padding: 0; margin: 0; height: 100%; } -.vn-gui .action-bar > div > * +.action-bar > div > * { float: right; } -.vn-gui .action-bar button +.action-bar button { margin: 0; padding: 1.25em .5em; } -.vn-gui .action-bar button:hover -{ - background-color: rgba(1, 1, 1, .2); -} -.vn-gui .action-bar button > img +.action-bar button > img { vertical-align: middle; height: 1.4em; @@ -233,7 +227,6 @@ display: block; line-height: 2.8em; } -.vn-gui .main-menu a:hover, .vn-gui .main-menu a.selected { background-color: rgba(1, 1, 1, .1); @@ -267,17 +260,18 @@ /* Body */ -.vn-gui > .body -{ - margin-left: 15em; - padding-top: 3.9em; - height: inherit; - box-sizing: border-box; - height: inherit; + .vn-gui > .body + { + margin-left: 15em; + padding-top: 3.9em; + height: inherit; + box-sizing: border-box; + height: inherit; + + transition-property: margin-left, margin-right; + transition-duration: 200ms; + } - transition-property: margin-left, margin-right; - transition-duration: 200ms; -} .vn-gui .form-holder { height: inherit; @@ -304,9 +298,11 @@ -webkit-transform: translateZ(0) translateX(0em); } +} /*+++++++++ Screen end */ + /* Mobile */ -@media (max-width: 960px) +@media screen and (max-width: 960px) { .vn-gui .action-bar span.label, .vn-gui .htk-button > span @@ -362,3 +358,13 @@ } } +/* Print */ + +@media print +{ + .vn-gui .navbar, + .vn-gui .left-panel + { + display: none; + } +} diff --git a/js/hedera/gui.js b/js/hedera/gui.js index 8dc7c9e3..da9282ac 100644 --- a/js/hedera/gui.js +++ b/js/hedera/gui.js @@ -216,6 +216,7 @@ module.exports = new Class var text = this.createTextNode (_(res.get ('description'))); var a = this.createElement ('a'); + a.className = 'clickable'; if (res.get ('path')) { diff --git a/js/hedera/hedera.js b/js/hedera/hedera.js index 051c3cb2..8038acb9 100644 --- a/js/hedera/hedera.js +++ b/js/hedera/hedera.js @@ -1,6 +1,7 @@ require ('htk/htk'); require ('./style.css'); +require ('./report.css'); Hedera = module.exports = { Login : require ('./login') diff --git a/js/hedera/report.css b/js/hedera/report.css index e2cbfd99..c50e0111 100644 --- a/js/hedera/report.css +++ b/js/hedera/report.css @@ -1,82 +1,54 @@ -@font-face -{ - font-family: 'Roboto'; - src: url('roboto.ttf') format('truetype'); -} @media print { - body + .report { + font-size: 12pt; -webkit-print-color-adjust: exact; } - .sheet + .report .sheet { width: 100%; page-break-after: always; } - #topbar +} +@media screen +{ + .report { - display: none; + background-color: #EEE; + } + .report .sheet + { + /* A4 -> 210x297mm */ + + width: 51em; + height: 72.1em; + background-color: white; + margin: 2em auto; + box-shadow: 0 .1em .1em #CCC; + padding: 5em; } } @media screen { - body - { - background-color: #EEE; - padding-top: 3.9em; - } - .sheet - { - width: 210mm; - height: 297mm; - background-color: white; - margin: 10mm auto; - box-shadow: 0 1mm 1mm #CCC; - padding: 20mm; - } - #topbar - { - position: fixed; - top: 0; - left: 0; - right: 0; - height: 4em; - background-color: #009688; - z-index: 100; - box-shadow: 0 .1em .1em #AAA; - } - #topbar > button - { - float: right; - background-color: transparent; - color: white; - padding: .4em; - z-index: 100; - border: none; - cursor: pointer; - font-size: 1.15em; - height: 100%; - padding: 0 1em; - } - #topbar > button:hover - { - background-color: rgba(1, 1, 1, 0.2); - } + .report { font-size: .8em; } } -* +@media + screen and (min-resolution: 120dpi), + screen and (-webkit-min-device-pixel-ratio: 1.5) { - font-family: 'Roboto'; + .report { font-size: .4em; } } -body + +.report { position: relative; margin: 0; width: 100%; z-index: -2; } -.sheet +.report .sheet { position: relative; overflow: hidden; @@ -86,35 +58,36 @@ body /* Widgets */ -.htk-grid +.report .htk-grid { border-collapse: collapse; width: 100%; margin: 0 auto; padding: 0; } -.htk-grid > thead > tr +.report .htk-grid > thead > tr { - border-bottom: 1px solid #333; - height: 10mm; + border-bottom: .01em solid #333; + height: 2em; + background-color: initial; } -.htk-grid > thead th +.report .htk-grid > thead th { text-align: left; font-weight: normal; + color: initial; } -.htk-grid tr +.report .htk-grid tr { height: 2em; + border: initial; } -.htk-grid > thead th, -.htk-grid td +.report .htk-grid > thead th, +.report .htk-grid td { - padding-left: 3mm; + padding-left: .3em; } -.htk-grid .cell-spin +.report .htk-grid .cell-spin { text-align: right; } - - diff --git a/js/hedera/report.js b/js/hedera/report.js index cade3ee9..36e95631 100644 --- a/js/hedera/report.js +++ b/js/hedera/report.js @@ -3,49 +3,47 @@ module.exports = new Class ({ Extends: Htk.Component - ,initialize: function (moduleInfo, gui) - { - this.info = moduleInfo; - this.gui = gui; - this.conn = gui.conn; - this.parent (null); - } - ,open: function (batch, body) { this.batch = batch; this.body = body; - this.createWindow (); - } - - ,print: function () - { - this.window.print (); + this.reportWindow = body.ownerDocument.defaultView; + this.activate (batch, body); } - ,createWindow: function () + ,activate: function (batch, body) { + this.renderReport (); + } + + ,openIframe: function (batch) + { + this.batch = batch; + var iframe = this.iframe = this.createElement ('iframe'); iframe.src = 'js/hedera/report.html'; iframe.style.display = 'none'; - document.body.appendChild (iframe); + this.doc.body.appendChild (iframe); - var reportWindow = iframe.contentWindow; - - reportWindow.addEventListener ('load', - this._onWindowLoad.bind (this)); - this.window = reportWindow; + this.reportWindow = iframe.contentWindow; + this.reportWindow.addEventListener ('load', + this._onWindowLoad.bind (this)); return true; } ,_onWindowLoad: function () { - this.doc = this.window.document - this.onWindowCreate (); + this.body = this.reportWindow.document.body; + this.renderReport (); } - ,onWindowCreate: function () + ,print: function () + { + this.reportWindow.print (); + } + + ,renderReport: function () { var builder = new Vn.Builder (); builder.signalData = this; diff --git a/js/hedera/social-bar.js b/js/hedera/social-bar.js index d082068c..0ff058f3 100644 --- a/js/hedera/social-bar.js +++ b/js/hedera/social-bar.js @@ -64,6 +64,7 @@ module.exports = new Class var a = this.createElement ('a'); a.href = res.get ('link'); a.target = '_blank'; + a.className = 'clickable-img'; this._node.appendChild (a); var img = this.createElement ('img'); diff --git a/js/hedera/style.css b/js/hedera/style.css index 03a1d48f..8374650c 100644 --- a/js/hedera/style.css +++ b/js/hedera/style.css @@ -14,53 +14,55 @@ } /* Desktop - Laptop 1360x768 */ -@media (max-resolution: 119dpi) and (min-device-width: 1340px) and (max-device-width: 1899px) +@media + screen and (max-resolution: 119dpi) and (min-device-width: 1340px) and (max-device-width: 1899px) { body { font-size: 10pt; } } /* Desktop - FHD 1920x1080 */ -@media (max-resolution: 119dpi) and (min-device-width: 1900px) +@media + screen and (max-resolution: 119dpi) and (min-device-width: 1900px) { body { font-size: 13pt; } } /* Mobile - Low DPI */ @media - (min-resolution: 120dpi), - (-webkit-min-device-pixel-ratio: 1.5) + screen and (min-resolution: 120dpi), + screen and (-webkit-min-device-pixel-ratio: 1.5) { body { font-size: 9pt; } } @media - (min-resolution: 144dpi), - (-webkit-min-device-pixel-ratio: 1.5) + screen and (min-resolution: 144dpi), + screen and (-webkit-min-device-pixel-ratio: 1.5) { body { font-size: 11pt; } } /* Mobile - Normal DPI */ @media - (max-device-width: 383px) and (min-resolution: 192dpi), - (max-device-width: 383px) and (-webkit-min-device-pixel-ratio: 2) + screen and (max-device-width: 383px) and (min-resolution: 192dpi), + screen and (max-device-width: 383px) and (-webkit-min-device-pixel-ratio: 2) { body { font-size: 10pt; } } @media - (min-device-width: 384px) and (min-resolution: 192dpi), - (min-device-width: 384px) and (-webkit-min-device-pixel-ratio: 2) + screen and (min-device-width: 384px) and (min-resolution: 192dpi), + screen and (min-device-width: 384px) and (-webkit-min-device-pixel-ratio: 2) { body { font-size: 11pt; } } /* Mobile - High DPI */ -@media +@media screen and (max-device-width: 411px) and (min-resolution: 249dpi), (max-device-width: 411px) and (-webkit-min-device-pixel-ratio: 3) { body { font-size: 10pt; } } -@media +@media screen and (min-device-width: 412px) and (min-resolution: 249dpi), (min-device-width: 412px) and (-webkit-min-device-pixel-ratio: 3) { @@ -72,14 +74,20 @@ body { font-family: 'Roboto', 'Verdana', 'Sans'; - background-color: #EEE; + margin: 0; + z-index: -2; +} + +@media screen { + +body +{ color: #333; - position: absolute; height: 100%; width: 100%; - margin: 0; + background-color: #EEE; overflow: auto; - z-index: -2; + position: absolute; } label, button, @@ -116,19 +124,10 @@ a:active color: inherit; text-decoration: none; } -a:hover -{ - text-decoration: none; - cursor: pointer; -} a img { padding: 1px; } -a img:hover -{ - opacity: 0.9; -} h1, h2, h3, h4, h5, h6 { margin: 0; @@ -147,6 +146,37 @@ p margin: 0.8em 0; } +/* Efects */ + +button, +.list-row, +.clickable, +.clickable-img +{ + cursor: pointer; +} +button, +.list-row, +.clickable +{ + transition: background-color 200ms ease-out; +} +button:hover, +.list-row:hover, +.clickable:hover +{ + background-color: rgba(1, 1, 1, 0.05); +} + +.clickable-img +{ + transition: opacity 200ms ease-out; +} +.clickable-img:hover +{ + opacity: 0.85; +} + /* Focus outline */ a:focus, @@ -418,7 +448,6 @@ img.editable display: block; padding: 1em; border-bottom: 1px solid #DDD; - transition: background-color 200ms ease-out; } a.list-row:hover { @@ -503,6 +532,26 @@ img.icon display: inline-block; vertical-align: top; } + +/* Social bar */ + +.htk-social-bar +{ + text-align: center; +} +.htk-social-bar a +{ + display: inline-block; + margin: 0 .1em; +} +.htk-social-bar img +{ + height: 1.8em; + width: 1.8em; +} + +} /*+++++++++ Screen end */ + @media screen and (min-width: 1000px) and (max-width: 1399px) { .masonry-box @@ -526,21 +575,3 @@ img.icon { .masonry-box { width: 25%; } } - -/* Social bar */ - -.htk-social-bar -{ - text-align: center; -} -.htk-social-bar a -{ - display: inline-block; - margin: 0 .1em; -} -.htk-social-bar img -{ - height: 1.8em; - width: 1.8em; -} - diff --git a/js/htk/field/combo.js b/js/htk/field/combo.js index 4434dbd0..f64b7ddb 100644 --- a/js/htk/field/combo.js +++ b/js/htk/field/combo.js @@ -44,7 +44,7 @@ module.exports = new Class return; this._row = x; - this.iterChanged (); + this.changed (); } ,get: function () { @@ -139,7 +139,7 @@ module.exports = new Class { this._row = row; this._refreshShowText (); - this.iterChanged (); + this.changed (); } ,_onButtonMouseDown: function (e) diff --git a/js/htk/field/image.js b/js/htk/field/image.js index f53ca78f..cb291031 100644 --- a/js/htk/field/image.js +++ b/js/htk/field/image.js @@ -91,7 +91,7 @@ module.exports = new Class if (this.clickHandler) { - Vn.Node.removeClass (this.node, 'clickable'); + Vn.Node.removeClass (this.node, 'clickable-img'); this.node.removeEventListener ('click', this.clickHandler); this.clickHander = null; } @@ -100,7 +100,7 @@ module.exports = new Class { this.clickHandler = this._onClick.bind (this); this.node.addEventListener ('click', this.clickHandler); - Vn.Node.addClass (this.node, 'clickable'); + Vn.Node.addClass (this.node, 'clickable-img'); } } diff --git a/js/htk/repeater.js b/js/htk/repeater.js index b56cb0c2..57260834 100644 --- a/js/htk/repeater.js +++ b/js/htk/repeater.js @@ -215,7 +215,7 @@ module.exports = new Class ,_onRowUpdate: function (model, row, columns) { - this._childsData[row].set.iterChanged (); + this._childsData[row].set.changed (); } ,_onRowInsert: function (model, row) diff --git a/js/htk/style.css b/js/htk/style.css index 856a1bb3..79e75250 100644 --- a/js/htk/style.css +++ b/js/htk/style.css @@ -1,4 +1,6 @@ +@media screen { + /* Grid */ .htk-grid @@ -24,10 +26,6 @@ { background-color: rgba(1, 1, 1, 0.2); } -.htk-grid tr -{ - height: 3.5em; -} .htk-grid > tfoot a, .htk-grid > thead a { @@ -37,11 +35,12 @@ { background-color: transparent; } -.htk-grid > tbody tr +.htk-grid > tbody > tr { + height: 3.5em; border-top: 1px solid #DDD; } -.htk-grid > tbody tr:first-child +.htk-grid > tbody > tr:first-child { border-top: none; } @@ -287,11 +286,6 @@ td.cell-image .htk-image position: relative; overflow: hidden; } -.htk-image.clickable:hover -{ - cursor: pointer; - opacity: 0.85; -} .htk-image > img { display: block; @@ -637,6 +631,9 @@ td.cell-image .htk-image border-top-color: white; border-left-color: white; } + +} /*+++++++++ Screen end */ + @keyframes spinner { to {transform: rotate(360deg);} diff --git a/js/vn/basic-set.js b/js/vn/basic-set.js index 59e31ef1..093aa3d1 100644 --- a/js/vn/basic-set.js +++ b/js/vn/basic-set.js @@ -7,6 +7,22 @@ module.exports = new Class Extends: Object ,Implements: Set ,Tag: 'vn-basic-set' + ,Properties: + { + params: + { + type: Object + ,set: function (x) + { + this._params = x; + this.changed (); + } + ,get: function () + { + return this._params; + } + } + } ,initialize: function (props) { @@ -14,23 +30,11 @@ module.exports = new Class this.parent (props); } - /** - * Gets a value from the set. - * - * @param {String} paramName The parameter name - * @return {any} The value - */ ,get: function (paramName) { return this._params[paramName]; } - /** - * Sets a value on the set. - * - * @param {String} paramName The parameter name - * @param {any} value The new value - */ ,set: function (paramName, value) { this._params[paramName] = value; @@ -45,5 +49,10 @@ module.exports = new Class this._params = {}; this.changed (); } + + ,keys: function () + { + return Object.keys (this._params); + } }); diff --git a/js/vn/hash-param.js b/js/vn/hash-param.js index 1a02ccb9..4f76666f 100644 --- a/js/vn/hash-param.js +++ b/js/vn/hash-param.js @@ -79,47 +79,12 @@ module.exports = new Class this._onHashChange (); } - ,parseHashValue: function (v, type) - { - if (v === '') - return null; - - if (type && v !== undefined && v !== null) - switch (type) - { - case Boolean: - return (/^(true|1)$/i).test (v); - case Number: - return 0 + new Number (v); - case Date: - return new Date(v); - } - - return v; - } - - ,renderHashValue: function (v) - { - switch (typeof v) - { - case 'number': - return v; - case 'boolean': - return (v) ? 'true' : 'false'; - case 'object': - if (v instanceof Date) - return VnDate.strftime (v, '%Y-%m-%d'); - } - - return v; - } - ,_onHashChange: function () { if (this._hashLock || !this._key || !this._listener) return; - var newValue = this.parseHashValue (Hash.get (this._key), this._type); + var newValue = Hash.get (this._key, this._type); this._hashLock = true; this._setValue (newValue, true); @@ -138,7 +103,7 @@ module.exports = new Class this._hashLock = true; var map = {}; - map[this._key] = this.renderHashValue(newValue); + map[this._key] = newValue; Hash.add (map); this._hashLock = false; diff --git a/js/vn/hash.js b/js/vn/hash.js index 72e9cf46..dff2c86d 100644 --- a/js/vn/hash.js +++ b/js/vn/hash.js @@ -1,5 +1,6 @@ var HashListener = require ('./hash-listener'); +var VnDate = require ('./date'); /** * Class to handle the URL. @@ -34,9 +35,9 @@ module.exports = * * @param {string} key The variable name */ - ,get: function (key) + ,get: function (key, type) { - return this._hashMap[key]; + return this.parseValue (this._hashMap[key], type); } /** @@ -105,7 +106,7 @@ module.exports = if (hash.length > 2) hash += '&'; - hash += key +'='+ map[key]; + hash += key +'='+ this.renderValue (map[key]); } return hash; @@ -126,11 +127,48 @@ module.exports = var kvPair = kvPairs[i].split ('=', 2); if (kvPair[0]) - newMap[kvPair[0]] = decodeURIComponent(kvPair[1]); + newMap[kvPair[0]] = decodeURIComponent (kvPair[1]); } this._hashMap = newMap; this._hash = newHash; this._listener.changed (); } + + ,renderValue: function (v) + { + switch (typeof v) + { + case 'number': + return v; + case 'boolean': + return (v) ? 'true' : 'false'; + case 'object': + if (v instanceof Date) + return VnDate.strftime (v, '%Y-%m-%d'); + } + + return v; + } + + ,parseValue: function (v, type) + { + if (v === '') + return null; + + if (type && v !== undefined && v !== null) + switch (type) + { + case Boolean: + return (/^(true|1)$/i).test (v); + case Number: + return 0 + new Number (v); + case Date: + var date = new Date (v); + date.setHours (0, 0, 0, 0); + return date; + } + + return v; + } }; diff --git a/js/vn/set.js b/js/vn/set.js index 912aa5ba..fa743535 100644 --- a/js/vn/set.js +++ b/js/vn/set.js @@ -1,21 +1,39 @@ 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 {any} The field value + * @return {*} The field value */ - get: function (field) {} + ,get: function () {} /** * Sets a value on the set. * * @param {String} field The field name - * @param {any} value The new field value + * @param {*} value The new field value */ - ,set: function (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. @@ -24,5 +42,22 @@ module.exports = new Class { this.signalEmit ('change'); } + + /** + * Copies all values from another set. + * + * @param {Set} source The source set + */ + ,assign: function (source, keys) + { + if (!keys) + keys = source.keys (); + + for (var i = 0; i < keys.length; i++) + { + var key = keys[i]; + this.set (key, source.get (key)); + } + } }); diff --git a/pages/update-browser/ui.php b/pages/update-browser/ui.php index 98114b5a..62f59301 100755 --- a/pages/update-browser/ui.php +++ b/pages/update-browser/ui.php @@ -1,5 +1,4 @@ - diff --git a/pages/version-menu/ui.php b/pages/version-menu/ui.php index f479aa2e..2e8c5a41 100755 --- a/pages/version-menu/ui.php +++ b/pages/version-menu/ui.php @@ -1,5 +1,4 @@ - diff --git a/reports/delivery-note/style.css b/reports/delivery-note/style.css index 3c96c9af..d480ff85 100644 --- a/reports/delivery-note/style.css +++ b/reports/delivery-note/style.css @@ -1,33 +1,26 @@ -* -{ - font-size: 4mm; -} -.sheet + +.report .sheet { height: auto; } -h2 +.report h2 { - font-size: 1.2em; - margin-bottom: 8mm; + margin-bottom: .8em; font-weight: bold; } -.header +.report .header { margin-bottom: 2em; } -.header > p +.report .header > p { text-align: right; margin: .1em 0; } -.footer +.report .footer { - font-size: 1.2em; font-weight: bold; - margin-top: .2em; border-top: 1px solid #333; padding-top: .3em; text-align: right; } - diff --git a/reports/delivery-note/ui.xml b/reports/delivery-note/ui.xml index 546827ba..08db656d 100755 --- a/reports/delivery-note/ui.xml +++ b/reports/delivery-note/ui.xml @@ -42,6 +42,7 @@ + diff --git a/reports/items-report/style.css b/reports/items-report/style.css index 08419bfb..3a1680a4 100644 --- a/reports/items-report/style.css +++ b/reports/items-report/style.css @@ -1,45 +1,42 @@ -* -{ - font-size: 4mm; -} -.sheet + +.report .sheet { height: auto; } -h1 +.report h1 { font-weight: normal; - font-size: 200%; + font-size: 4em; text-align: center; margin: 0 auto; - margin-bottom: 8mm; + margin-bottom: .8em; } -.htk-grid +.report .htk-grid { border-collapse: collapse; width: 100%; margin: 0 auto; padding: 0; } -thead > tr +.report thead > tr { border-bottom: 1px solid #333; - height: 10mm; + height: .1em; } -th +.report th { font-weight: normal; } -td +.report td { - padding-left: 2mm; + padding-left: .02em; } -tbody > tr +.report tbody > tr { - height: 18mm; + height: .18em; } -.cell-image > img +.report .cell-image > img { - width: 15mm; + width: .15em; } diff --git a/reports/shelves-report/shelves-report.js b/reports/shelves-report/shelves-report.js index 940c41f3..c6136b34 100644 --- a/reports/shelves-report/shelves-report.js +++ b/reports/shelves-report/shelves-report.js @@ -8,9 +8,8 @@ Hedera.ShelvesReport = new Class ,trayThickness: 2 ,trayMargin: 5 - ,open: function (batch) + ,activate: function (batch) { - this.batch = batch; this.title = batch.getValue ('reportTitle'); this.maxAmount = batch.getValue ('maxAmount'); this.showPacking = batch.getValue ('showPacking'); @@ -108,11 +107,11 @@ Hedera.ShelvesReport = new Class // Opens the report - this.createWindow (); + this.renderReport (); } - ,onWindowCreate: function () - { + ,renderReport: function () + { // Remaining amount var remainings = this.remainings; @@ -120,8 +119,8 @@ Hedera.ShelvesReport = new Class if (remainings.length > 0) { var sheet = this.doc.createElement ('div'); - sheet.className = 'sheet'; - this.doc.body.appendChild (sheet); + sheet.className = 'sheet remaining'; + this.body.appendChild (sheet); var title = this.doc.createElement ('h1'); title.className = 'title'; @@ -133,20 +132,20 @@ Hedera.ShelvesReport = new Class subtitle.appendChild (this.doc.createTextNode (_('Pallets'))); sheet.appendChild (subtitle); - var ul = this.doc.createElement ('ul'); + var ul = this.doc.createElement ('table'); sheet.appendChild (ul); for (var i = 0; i < remainings.length; i++) { - var li = this.doc.createElement ('li'); + var li = this.doc.createElement ('tr'); ul.appendChild (li); - var span = this.doc.createElement ('span'); + var span = this.doc.createElement ('td'); span.className = 'item-id'; span.appendChild (this.doc.createTextNode (remainings[i].id.toLocaleString ())); li.appendChild (span); - var span = this.doc.createElement ('span'); + var span = this.doc.createElement ('td'); span.className = 'item'; span.appendChild (this.doc.createTextNode (remainings[i].name)); li.appendChild (span); @@ -154,7 +153,7 @@ Hedera.ShelvesReport = new Class if (this.showPacking) span.appendChild (this.doc.createTextNode (' '+ remainings[i].packing)); - var span = this.doc.createElement ('span'); + var span = this.doc.createElement ('td'); span.className = 'amount'; span.appendChild (this.doc.createTextNode (remainings[i].amount)); li.appendChild (span); @@ -173,7 +172,7 @@ Hedera.ShelvesReport = new Class var sheet = this.doc.createElement ('div'); sheet.className = 'sheet'; - this.doc.body.appendChild (sheet); + this.body.appendChild (sheet); // Draws the title @@ -249,7 +248,8 @@ Hedera.ShelvesReport = new Class ,mm: function (size) { - return size.toFixed (2) +'mm'; + size *= 0.24; + return size.toFixed (2) +'em'; } ,drawBox: function (allocator, item, amount) diff --git a/reports/shelves-report/style.css b/reports/shelves-report/style.css index 475471b6..491a12c6 100644 --- a/reports/shelves-report/style.css +++ b/reports/shelves-report/style.css @@ -1,7 +1,12 @@ +.report .sheet.remaining +{ + height: auto; +} + /* Shelves */ -h1 +.report h1 { font-weight: normal; font-size: 500%; @@ -9,110 +14,110 @@ h1 text-overflow: ellipsis; white-space: nowrap; overflow: hidden; - margin-bottom: 4mm; + margin-bottom: .4em; } -label.range-label +.report label.range-label { color: #777; } -h2.subtitle +.report h2.subtitle { margin: 0; font-size: 200%; - margin-bottom: 2mm; + margin-bottom: .2em; font-weight: normal; color: #333; } -h1.page-number +.report h1.page-number { - padding-left: 4mm; + padding-left: .4em; float: right; text-align: right; } -.shelf +.report .shelf { position: relative; margin: 0 auto; - padding-top: 10mm; + padding-top: 1em; } -.edge, -.tray +.report .edge, +.report .tray { position: absolute; border-top: 2px solid black; box-sizing: border-box; } -.edge +.report .edge { width: 0; } -.box +.report .box { position: absolute; border: 1px solid black; border-bottom: 0; box-sizing: border-box; } -.box-label +.report .box-label { - font-size: 2.55mm; + font-size: .25em; word-wrap: break-word; box-sizing: border-box; padding: 1% 2%; } -.box-label.id +.report .box-label.id { text-align: right; } -.color0 +.report .color0 { background-color: #FDD !important; } -.color1 +.report .color1 { background-color: #DFD !important; } -.color2 +.report .color2 { background-color: #DDF !important; } -.color3 +.report .color3 { background-color: #DFF !important; } -.color4 +.report .color4 { background-color: #FFD !important; } /* Remaining amounts*/ -ul +.report table { list-style-type: none; + padding-left: .5em; } -li * +.report table td { - font-size: 200%; - line-height: 200%; + font-size: 2em; + padding: .2em .5em; } -.item-id +.report .item-id { - display: inline-block; text-align: right; - margin: 0 5mm; - width: 30mm; + width: 1em; } -.item +.report .item { - display: inline-block; - width: 80mm; + max-width: 10em; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; } -.amount +.report .amount { + text-align: right; + width: 1em; color: #666; - width: 10mm; - text-align: right; - padding-right: 1mm; }