diff --git a/web/forms/admin/shelves/shelves.js b/web/forms/admin/shelves/shelves.js index 47c6d84c..5b9c3613 100755 --- a/web/forms/admin/shelves/shelves.js +++ b/web/forms/admin/shelves/shelves.js @@ -2,33 +2,36 @@ Vn.Shelves = new Class ({ Extends: Vn.Module - + ,activate: function () { - this.$('warehouse').value = 44; this.$('date').value = new Date (); - this.$('shelf').value = 4; - this.$('reign').value = 1; - this.$('family').value = 2; - this.$('filter').value = 'Ant '; - this.$('max-amount').value = 50; - this.$('show-packing').value = true; - this.$('stack').value = true; } - ,onFamilyChange: function () + ,onConfigChange: function () { - this.$('report-title').value = this.$('family').get ('Tipo'); + var c = this.$('config'); + this.$('warehouse').value = c.get ('warehouse_id'); + this.$('shelf').value = c.get ('shelf_id'); + this.$('reign').value = c.get ('reino_id'); + this.$('family').value = c.get ('family_id'); + this.$('filter').value = c.get ('name_prefix'); + this.$('max-amount').value = c.get ('max_amount'); + this.$('show-packing').value = c.get ('show_packing'); + this.$('stack').value = c.get ('stack'); + this.$('report-title').value = c.get ('name'); } ,onPreviewClick: function () { var batch = new Sql.Batch (); - batch.addParam ('shelf', this.$('shelf')); - batch.addParam ('wh', this.$('warehouse')); - batch.addParam ('date', this.$('date')); - batch.addParam ('family', this.$('family')); - batch.addValue ('filter', this.$('filter').value); + batch.addParams ({ + 'shelf': this.$('shelf'), + 'wh': this.$('warehouse'), + 'date': this.$('date'), + 'family': this.$('family'), + 'filter': this.$('filter') + }); var report = new Vn.ShelvesReport ({conn: this.conn}); report.setParams ( @@ -47,7 +50,7 @@ Vn.ShelvesReport = new Class Extends: Vn.Report ,nItem: -1 - ,nColors: 4 + ,nColors: 5 ,setParams: function (title, maxAmount, showPacking, stack, batch) { @@ -61,9 +64,9 @@ Vn.ShelvesReport = new Class ,open: function () { var query = - 'SELECT id, name, width, height, max_height, tray_height, '+ + 'SELECT id, name, width, height, depth, max_height, tray_height, '+ 'first_tray_elevation, tray_density, vspacing, hspacing '+ - 'FROM vn2008.shelf WHERE id = #shelf; '+ + 'FROM shelf WHERE id = #shelf; '+ 'CALL item_organizer (#wh, #date, #family, #filter)'; this.conn.execQuery (query, this.onQueryExec.bind (this), this.batch); @@ -76,12 +79,19 @@ Vn.ShelvesReport = new Class var res = resultSet.fetchResult (); res.next (); - var scale = 0.065; + var maxWidth = 170; + var maxHeight = 200; + + var scale = maxWidth / res.get ('width'); + + if (res.get ('max_height') * scale > maxHeight) + scale = maxHeight / res.get ('max_height'); var shelf = this.shelf = { width: res.get ('width') * scale ,height: res.get ('height') * scale + ,depth: res.get ('depth') * scale ,maxHeight: res.get ('max_height') * scale ,trayHeight: res.get ('tray_height') * scale ,firstTrayElevation: res.get ('first_tray_elevation') * scale @@ -94,21 +104,32 @@ Vn.ShelvesReport = new Class var remainings = []; var res = resultSet.fetchResult (); + if (res.data.length == 0) + { + Htk.Toast.showError (_('No items found, check that all fields are correct')); + return; + } + + var boxScale = scale * 10; + while (res.next ()) - if (res.get ('etiquetas') <= this.maxAmount) + if (!this.maxAmount || res.get ('etiquetas') <= this.maxAmount) { items.push ({ - name: res.get ('Article') + id: res.get ('Id_Article') + ,name: res.get ('Article') ,packing: res.get ('packing') - ,boxHeight: res.get ('z') * 10 * scale - ,boxWidth: res.get ('x') * 10 * scale ,amount: res.get ('etiquetas') + ,boxHeight: res.get ('z') * boxScale + ,boxWidth: res.get ('x') * boxScale + ,boxDepth: res.get ('y') * boxScale }); } else { remainings.push ({ - name: res.get ('Article') + id: res.get ('Id_Article') + ,name: res.get ('Article') ,packing: res.get ('packing') ,amount: res.get ('etiquetas') }); @@ -125,14 +146,16 @@ Vn.ShelvesReport = new Class (shelf.height - shelf.firstTrayElevation) / (shelf.trayHeight + shelf.trayDensity) ); - alloc.trayWidth = shelf.width - shelf.hspacing * 2; + alloc.width = shelf.width - shelf.hspacing * 2; + alloc.depth = shelf.depth; alloc.trayHeight = shelf.trayHeight - shelf.vspacing; alloc.topTrayHeight = shelf.maxHeight - shelf.vspacing - shelf.firstTrayElevation - (alloc.nTrays - 1) * shelf.trayHeight; // Opens the report - this.createWindow ('shelves'); + if (!this.createWindow ('shelves')) + return; // Remaining amount @@ -143,9 +166,14 @@ Vn.ShelvesReport = new Class this.doc.body.appendChild (sheet); var title = this.doc.createElement ('h1'); - title.appendChild (this.doc.createTextNode (this.title +' - ')); - title.appendChild (this.doc.createTextNode (_('Pallets'))); + title.className = 'title'; + title.appendChild (this.doc.createTextNode (this.title)); sheet.appendChild (title); + + var subtitle = this.doc.createElement ('h2'); + subtitle.className = 'subtitle'; + subtitle.appendChild (this.doc.createTextNode (_('Pallets'))); + sheet.appendChild (subtitle); var ul = this.doc.createElement ('ul'); sheet.appendChild (ul); @@ -154,6 +182,11 @@ Vn.ShelvesReport = new Class { var li = this.doc.createElement ('li'); ul.appendChild (li); + + var span = this.doc.createElement ('span'); + span.className = 'item-id'; + span.appendChild (this.doc.createTextNode (remainings[i].id.toLocaleString ())); + li.appendChild (span); var span = this.doc.createElement ('span'); span.className = 'item'; @@ -173,9 +206,10 @@ Vn.ShelvesReport = new Class // Draws the shelves alloc.run (); + this.drawShelfEnding (); } - ,drawShelf: function (allocator) + ,drawShelf: function (allocator, item) { var shelf = this.shelf; @@ -185,27 +219,32 @@ Vn.ShelvesReport = new Class // Draws the title + var pageNumber = this.doc.createElement ('h1'); + pageNumber.className = 'page-number'; + pageNumber.appendChild (this.doc.createTextNode (allocator.currentShelf + 1)); + sheet.appendChild (pageNumber); + var title = this.doc.createElement ('h1'); title.className = 'title'; title.appendChild (this.doc.createTextNode (this.title)); sheet.appendChild (title); - var pageNumber = this.doc.createElement ('h1'); - pageNumber.className = 'page-number'; - pageNumber.appendChild (this.doc.createTextNode (allocator.currentShelf + 1)); - sheet.appendChild (pageNumber); + var subtitle = this.doc.createElement ('h2'); + subtitle.className = 'subtitle'; + subtitle.appendChild (this.doc.createTextNode (item.id.toLocaleString ())); + sheet.appendChild (subtitle); + + this.drawShelfEnding (); + this.lastSubtitle = subtitle; // Draws the shelf var shelfDiv = this.shelfDiv = this.doc.createElement ('div'); shelfDiv.className = 'shelf'; - shelfDiv.style.width = this.shelf.width +'mm'; - shelfDiv.style.height = this.shelf.maxHeight +'mm'; + shelfDiv.style.width = this.mm (shelf.width); + shelfDiv.style.height = this.mm (shelf.maxHeight); sheet.appendChild (shelfDiv); - this.drawEdge ().style.left = 0; - this.drawEdge ().style.right = 0; - // Draws trays var lastTrayY = shelf.firstTrayElevation; @@ -215,24 +254,25 @@ Vn.ShelvesReport = new Class { var tray = this.doc.createElement ('div'); tray.className = 'tray'; - tray.style.width = this.shelf.width +'mm'; - tray.style.height = '1mm'; - tray.style.bottom = lastTrayY +'mm'; + tray.style.width = this.mm (shelf.width); + tray.style.height = this.mm (shelf.trayDensity); + tray.style.bottom = this.mm (lastTrayY); shelfDiv.appendChild (tray); lastTrayY += shelf.trayHeight + shelf.trayDensity; } } - ,drawEdge: function (shelfDiv) + ,drawShelfEnding: function () { - var edge = this.doc.createElement ('div'); - edge.className = 'edge'; - edge.style.width = '1mm'; - edge.style.height = this.shelf.height +'mm'; - edge.style.bottom = 0; - this.shelfDiv.appendChild (edge); - return edge; + if (this.lastSubtitle) + this.lastSubtitle.appendChild ( + this.doc.createTextNode (' - '+ this.lastItem.id.toLocaleString ())); + } + + ,mm: function (size) + { + return size.toFixed (2) +'mm'; } ,drawBox: function (allocator, item, amount) @@ -251,10 +291,10 @@ Vn.ShelvesReport = new Class box.className = 'box'; this.shelfDiv.appendChild (box); - box.style.left = x +'mm'; - box.style.bottom = y +'mm'; - box.style.width = item.boxWidth +'mm'; - box.style.height = item.boxHeight +'mm'; + box.style.left = this.mm (x); + box.style.bottom = this.mm (y); + box.style.width = this.mm (item.boxWidth); + box.style.height = this.mm (item.boxHeight); if (amount == 0) this.nItem++; @@ -264,38 +304,38 @@ Vn.ShelvesReport = new Class if (amount == 0 || allocator.firstShelfBox) { - if (this.showPacking) - { - var packing = this.doc.createElement ('span'); - packing.className = 'packing'; - packing.appendChild (this.doc.createTextNode (item.packing)); - box.appendChild (packing); - } - - var boxLabel = this.doc.createElement ('span'); + var fontSize = item.boxWidth / 5.2; + + if (fontSize > item.boxHeight - 1) + fontSize = item.boxHeight - 1; + + var boxLabel = this.doc.createElement ('div'); boxLabel.className = 'box-label'; - boxLabel.appendChild (this.doc.createTextNode (item.name)); + boxLabel.style.fontSize = this.mm (fontSize); + boxLabel.appendChild (this.doc.createTextNode (item.id.toLocaleString ())); box.appendChild (boxLabel); } + + this.lastItem = item; } }); Vn.Allocator = new Class ({ - addShelf: function () + addShelf: function (item) { this.currentShelf++; this.firstShelfBox = true; if (this.shelfFunc) - this.shelfFunc (this); + this.shelfFunc (this, item); } - ,addTray: function () + ,addTray: function (item) { if (this.currentTray <= 0) { - this.addShelf (); + this.addShelf (item); this.currentTray = this.nTrays - 1; } else @@ -304,17 +344,17 @@ Vn.Allocator = new Class this.trayX = 0; } - ,addColumn: function (width) + ,addColumn: function (item) { - if (this.trayX + this.columnWidth + width > this.trayWidth + if (this.trayX + this.columnWidth + item.boxWidth > this.width || this.currentTray == -1) - this.addTray (); + this.addTray (item); else this.trayX += this.columnWidth; this.trayY = 0; - this.columnWidth = width; - this.lastBoxWidth = width; + this.columnWidth = item.boxWidth; + this.lastBoxWidth = item.boxWidth; } ,addBox: function (item, amount) @@ -327,7 +367,7 @@ Vn.Allocator = new Class if (this.trayY + item.boxHeight > trayHeight || item.boxWidth > this.lastBoxWidth || (!this.stack && amount == 0)) - this.addColumn (item.boxWidth); + this.addColumn (item); if (this.boxFunc) this.boxFunc (this, item, amount); @@ -352,8 +392,12 @@ Vn.Allocator = new Class for (var i = 0; i < this.items.length; i++) { var item = this.items[i]; + var boxIncrement = Math.floor (this.depth / item.boxDepth); + + if (boxIncrement < 1) + boxIncrement = 1; - for (var amount = 0; amount < item.amount; amount++) + for (var amount = 0; amount < item.amount; amount += boxIncrement) { this.addBox (item, amount); this.firstShelfBox = false; diff --git a/web/forms/admin/shelves/ui.xml b/web/forms/admin/shelves/ui.xml index 64418240..6a3a9a37 100755 --- a/web/forms/admin/shelves/ui.xml +++ b/web/forms/admin/shelves/ui.xml @@ -1,10 +1,31 @@ + + + SELECT c.id, c.name, c.name_prefix, c.warehouse_id, c.family_id, + c.shelf_id, c.max_amount, c.show_packing, c.stack, t.reino_id + FROM shelf_config c + JOIN vn2008.Tipos t ON t.tipo_id = c.family_id + +

Shelves

+
+ + +
+
+ + +
@@ -16,7 +37,7 @@
- + SELECT tipo_id, Tipo FROM vn2008.Tipos WHERE reino_id = #reign ORDER BY Tipo @@ -35,21 +56,17 @@
-
- - -
- SELECT id, name FROM vn2008.shelf + SELECT id, name FROM shelf
- +
diff --git a/web/forms/ecomerce/catalog/ui.xml b/web/forms/ecomerce/catalog/ui.xml index 3ea5d480..0452aaa6 100755 --- a/web/forms/ecomerce/catalog/ui.xml +++ b/web/forms/ecomerce/catalog/ui.xml @@ -36,12 +36,14 @@ - diff --git a/web/forms/ecomerce/orders/orders.js b/web/forms/ecomerce/orders/orders.js index f1b163c1..f34a07f9 100755 --- a/web/forms/ecomerce/orders/orders.js +++ b/web/forms/ecomerce/orders/orders.js @@ -5,9 +5,6 @@ Vn.Orders = new Class ,activate: function () { - this.payPopup = new Htk.Popup (); - this.payPopup.setChildNode (this.$('balance-popup')); - Vn.Tpv.check (this.conn); } @@ -40,14 +37,8 @@ Vn.Orders = new Class ,onPayButtonClick: function () { - this.payPopup.show (this.$('pay-button').getNode ()); - } - - ,onCompanyPayClick: function (column, value, row) - { - var model = this.$('balance'); - var company = model.get (row, 'id'); - var amount = model.get (row, 'amount'); + var company = 442; + var amount = this.$('debt').value; amount = amount <= 0 ? null : amount; diff --git a/web/forms/ecomerce/orders/ui.xml b/web/forms/ecomerce/orders/ui.xml index ab2be929..4cd53c16 100755 --- a/web/forms/ecomerce/orders/ui.xml +++ b/web/forms/ecomerce/orders/ui.xml @@ -1,4 +1,11 @@ + + + CALL customer_get_debt_by_company (); + SELECT * FROM t_customer_debt; + DROP TEMPORARY TABLE t_customer_debt; + +

LastOrders

@@ -6,7 +13,7 @@
PendingBalance: - + Info
@@ -39,16 +46,4 @@
-
- - - CALL customer_get_debt_by_company (); - SELECT * FROM t_customer_debt; - DROP TEMPORARY TABLE t_customer_debt; - - - - - -
diff --git a/web/js/hedera/opensans.ttf b/web/js/hedera/opensans.ttf new file mode 100755 index 00000000..db433349 Binary files /dev/null and b/web/js/hedera/opensans.ttf differ diff --git a/web/js/hedera/report.css b/web/js/hedera/report.css index 9f33ac9d..973d54ef 100755 --- a/web/js/hedera/report.css +++ b/web/js/hedera/report.css @@ -33,21 +33,22 @@ background-color: white; margin: 10mm auto; box-shadow: 0 1mm 1mm #CCC; - padding: 15mm; + padding: 20mm; } .print-button { position: fixed; - top: 6mm; - right: 6mm; + top: 1.5em; + right: 1.5em; border-radius: 2px; background-color: #009688; color: white; - padding: 2mm; + padding: .4em; z-index: 100; border: none; cursor: pointer; - box-shadow: 0 1mm 1mm #AAA; + box-shadow: 0 .1em .1em #AAA; + font-size: 1.4em; } .print-button:hover { @@ -56,7 +57,7 @@ } * { - font-family: 'Droid Sans', 'Sans'; + font-family: 'Open Sans'; } body { diff --git a/web/js/hedera/report.js b/web/js/hedera/report.js index 7a331a28..844d7ecd 100755 --- a/web/js/hedera/report.js +++ b/web/js/hedera/report.js @@ -29,13 +29,13 @@ Vn.Report = new Class ,createWindow: function (reportPath) { var reportWindow = window.open (''/*'js/hedera/report.html'*/, '_blank'/*reportPath*/, - 'resizable=yes,height=900,width=900,scrollbars=yes,menubar=true'); + 'resizable=yes,height=900,width=900,scrollbars=yes,menubar=false'); if (!reportWindow) { Htk.Toast.showError ( - _('Can\'t open the report, please unlock popup block and try again')); - return; + _('Please unlock popups and try again')); + return null; } this.window = reportWindow; diff --git a/web/js/sql/batch.js b/web/js/sql/batch.js index 27d5f3ec..4209c970 100755 --- a/web/js/sql/batch.js +++ b/web/js/sql/batch.js @@ -78,6 +78,12 @@ Sql.Batch = new Class this._addObject (id, new Sql.Value ({value: value})); } + + ,addValues: function (values) + { + for (var id in values) + this.addValue (id, values[id]); + } ,addParam: function (id, param) { @@ -85,6 +91,12 @@ Sql.Batch = new Class new Sql.Value ({param: param})); } + ,addParams: function (params) + { + for (var id in params) + this.addParam (id, params[id]); + } + ,remove: function (id) { if (this.objects[id]) diff --git a/web/js/vn/builder.js b/web/js/vn/builder.js index b4881bd2..9d7b0c5e 100755 --- a/web/js/vn/builder.js +++ b/web/js/vn/builder.js @@ -243,6 +243,73 @@ Vn.Builder = new Class //+++++++++++++++++++++++++++++++++++++++++++ Alpha + ,compile: function (node, dstDocument) + { + this.contexts = []; + this.contextMap = {}; + this.propLinks = []; + this.childLinks = []; + this.document = dstDocument ? dstDocument : document; + + this.compileRec (node, null); + + for (var i = 0; i < this.propLinks.length; i++) + { + var pl = this.propLinks[i]; + var contextId = this.contextMap[pl.value]; + + if (contextId) + { + pl.context.objectProps[pl.prop] = contextId; + continue; + } + + var object = this.parentBuilder.get (pl.value); + + if (object) + { + pl.context.props[pl.prop] = object; + continue; + } + + console.warn ('Vn.Builder: Referenced unexistent object with id \'%s\'', + pl.value); + } + + delete this.propLinks; + + for (var i = 0; i < this.childLinks.length; i++) + { + var cl = this.childLinks[i]; + var contextId = this.contextMap[pl.value]; + + if (contextId) + pl.context.childs.push (contextId); + else + console.warn ('Vn.Builder: Referenced unexistent object with id \'%s\'', + pl.value); + } + + delete this.childLinks; + } + + ,compileRec: function (node) + { + var tagName = null; + + if (node.tagName) + tagName = node.tagName.toLowerCase (); + + var nextId = this.contexts.length; + var context = + createTextTemplate (nextId, node, tagName) + || createObjectTemplate (nextId, node, tagName) + || createHtmlTemplate (nextId, node, tagName); + + this.contexts.push (context); + return context; + } + ,load: function (thisData) { var contexts = this.contexts; @@ -251,97 +318,24 @@ Vn.Builder = new Class for (var i = 0; i < contexts.length; i++) { var context = contexts[i]; - objects[i] = context.func (context.template); + + if (context.func) + objects[i] = context.func (context); } - var links = this.links; - - for (var i = 0; i < links.length; i++) + for (var i = 0; i < contexts.length; i++) { - var link = links[i]; - objects[link.contextId][link.propName] = objects[link.valueContext]; - } - } - - ,compile: function (node, dstDocument) - { - this.contexts = []; - this.contextMap = {}; - this.pointers = []; - this.links = []; - this.document = dstDocument ? dstDocument : document; - - this.compileRec (node, null); - - for (var i = 0; i < this.pointers.length; i++) - { - var pointerId = this.pointers[i].template; - var refContext = this.contextMap[pointerId]; + var context = contexts[i]; + + if (context.linkFunc) + context.linkFunc (context, objects[i]); } } - ,compileRec: function (node, parentContext) - { - var tagName = null; - - if (node.tagName) - tagName = node.tagName.toLowerCase (); - - var context = { - node: node - ,parent: parentContext - ,template: template - ,id: this.contexts.length - ,func: null - }; - this.contexts.push (context); - - var template = - createTextTemplate (context, node, tagName) - || createPointerTemplate (context, node, tagName) - || createObjectTemplate (context, node, tagName) - || createHtmlTemplate (context, node, tagName); - - var id = node.getAttribute ('id'); - - if (id) - this.contextMap[id] = context; - - if (parentContext) - { - var parentProperty = node.getAttribute ('property'); - - if (!parentProperty && parentContext.template.klass) - parentProperty = parentContext.template.klass.Child; - - if (parentProperty) - { - this.links.push ({ - contextId: context.id, - propName: propName, - valueContext: valueContext.id - }); - } - - this.registerLink (parentContext, parentProperty, context); - - if (klass.Parent) - this.registerLink (context, klass.Parent, parentContext); - } - - var childs = node.childNodes; - - if (childs) - for (var i = 0; i < childs.length; i++) - this.compileRec (childs[i], context); - - return context; - } - /** * Creates a text node template. **/ - ,createTextTemplate: function (context, node, tagName) + ,createTextTemplate: function (contextId, node, tagName) { if (tagName === 't') var text = _(node.firstChild.textContent); @@ -349,43 +343,29 @@ Vn.Builder = new Class var text = node.textContent; else return null; - - return - - context.func = createTextInstance; - return text; - } - - ,createTextInstance: function (template) - { - return this.document.createTextNode (template); - } - - /** - * Creates a object pointer template. - **/ - ,createPointerTemplate: function (context, node, tagName) - { - if (tagName !== 'pointer') - return null; - this.pointers.push (context); - return node.getAttribute ('object'); + return { + id: contextId, + text: text, + func: this.createTextInstance + }; } - ,createPointerInstance: function (template) + ,createTextInstance: function (context) { - return this.objectMap[template]; + return this.document.createTextNode (context.text); } /** * Creates a object template. **/ - ,createObjectTemplate: function (context, node, tagName) + ,createObjectTemplate: function (contextId, node, tagName) { var id = null; var handler; var props = {}; + var objectProps = {}; + var childs = []; var events = null; var klass = Vn.customTags[tagName]; @@ -401,7 +381,7 @@ Vn.Builder = new Class if (attribute === 'id') { - id = value; + this.contextMap[value] = contextId; } else if ((handler = this.getEventHandler (attribute, value))) { @@ -416,13 +396,50 @@ Vn.Builder = new Class node, attribute, value); } } - - context.func = createObjectInstance; - return { + + var context = { + id: contextId, + func: this.createObjectInstance, + linkFunc: this.createObjectLink, klass: klass, + props: props, events: events, - id: id + objectProps: objectProps, + childs: childs }; + + var childs = node.childNodes; + + if (childs) + for (var i = 0; i < childs.length; i++) + { + var child = childs[i]; + var childTagName = child.tagName.toLowerCase (); + + if (childTagName === 'pointer') + { + this.childLinks.push ({ + context: context, + objectId: child.getAttribute ('object') + }); + } + else if (childTagName === 'custom') + { + context.custom = child.firstElementChild; + } + else + { + var childContext = this.compileRec (child); + var prop = child.getAttribute ('property'); + + if (prop) + objectProps[prop] = childContext.id; + else + childs.push (childContext.id); + } + } + + return context; } ,createPropTemplate: function (context, klass, props, node, attribute, value) @@ -469,37 +486,56 @@ Vn.Builder = new Class } else if (propInfo.type instanceof Function) { - this.registerLink (context, attribute, value); + this.propLinks.push ({ + context: context, + prop: attribute, + value: value + }); } else console.warn ('Vn.Builder: Attribute \'%s\' invalid for tag \'%s\'', attribute, node.tagName); } - ,createObjectInstance: function (template) + ,createObjectInstance: function (context) { - var object = new template.klass (template.props); + var object = new context.klass (context.props); - var events = template.events; + var events = context.events; for (var event in events) object.on (event, events[event].bind (this.signalData)); - - if (template.id) - this.objectMap[id] = object; - + return object; } + ,createObjectLink: function (context, object) + { + var objectProps = context.objectProps; + + if (objectProps) + for (var prop in objectProps) + object[prop] = this.objects[objectProps[prop].id]; + + var childs = context.childs; + + if (childs) + for (var i = 0; i < childs.length; i++) + object.appendChild (childs[i]); + + if (context.custom) + object.loadXml (context.custom); + } + /** * Creates a HTML node template. **/ - ,createHtmlTemplate: function (context, node, tagName) + ,createHtmlTemplate: function (contextId, node, tagName) { - var id = null; var handler; var events = null; + var childs = []; var htmlNode = this.document.createElement (tagName); var a = node.attributes; @@ -511,7 +547,7 @@ Vn.Builder = new Class if (attribute === 'id') { - id = value; + this.contextMap[value] = contextId; } else if ((handler = this.getEventHandler (attribute, value))) { @@ -524,29 +560,46 @@ Vn.Builder = new Class htmlNode.setAttribute (nodeName, this.translateValue (nodeValue)); } - - context.func = createHtmlInstance; + + var childNodes = node.childNodes; + + if (childNodes) + for (var i = 0; i < childNodes.length; i++) + { + var childContext = this.compileRec (childNodes[i]); + childs.push (childContext.id); + } + return { + id: contextId, + func: this.createHtmlInstance, + linkFunc: this.createHtmlLink, node: htmlNode, events: events, - id: id + childs: childs }; } - ,createHtmlInstance: function (template) + ,createHtmlInstance: function (context) { - var node = new template.node.cloneNode (false); + var object = new context.node.cloneNode (false); - var events = template.events; + var events = context.events; for (var event in events) - node.addEventListener (event, + object.addEventListener (event, events[event].bind (this.signalData)); - - if (template.id) - this.objectMap[id] = node; - - return node; + + return object; + } + + ,createHtmlLink: function (context, object) + { + var childs = context.childs; + + if (childs) + for (var i = 0; i < childs.length; i++) + object.appendChild (this.objects[childs[i]]); } //+++++++++++++++++++++++++++++++++++++++++++ Utilities diff --git a/web/locale/es/forms/admin/shelves.json b/web/locale/es/forms/admin/shelves.json index 991b98a1..edf194ad 100644 --- a/web/locale/es/forms/admin/shelves.json +++ b/web/locale/es/forms/admin/shelves.json @@ -1,5 +1,7 @@ { - "Reign": "Reino" + "Configuration": "Configuración" + ,"Select config": "Selecciona configuración" + ,"Reign": "Reino" ,"Family": "Familia" ,"Store": "Almacén" ,"Date": "Fecha" @@ -11,4 +13,9 @@ ,"Stack different items": "Apilar artículos distintos" ,"Preview": "Mostrar" + + ,"Pallets": "Palets" + + ,"No items found, check that all fields are correct": + "No se han encontrado artículos, comprueba que todos los campos son correctos" } diff --git a/web/locale/es/js/hedera.js b/web/locale/es/js/hedera.js index f0bdf697..6c9d61d4 100755 --- a/web/locale/es/js/hedera.js +++ b/web/locale/es/js/hedera.js @@ -17,7 +17,10 @@ Vn.Locale.add ,"TestTheNewWebsite": "¡Prueba la nueva web!" ,"ReturnToOldWebsite": "Web antigua" ,"ChangeLog": "Cambios recientes" + ,"Print": "Imprimir" + ,"Please unlock popups and try again": + "Por favor, desploquea los popups y vuélvelo a intentar" ,"ErrorLoadingForm": "Error al cargar formulario" ,"CookiesNotification": "Al utilizar este sitio web aceptas el uso de cookies para la personalización de contenidos y análisis." diff --git a/web/reports/shelves/style.css b/web/reports/shelves/style.css index 7a4d67c6..9b140684 100644 --- a/web/reports/shelves/style.css +++ b/web/reports/shelves/style.css @@ -4,15 +4,22 @@ h1 { font-weight: normal; - font-size: 15mm; + font-size: 500%; margin: 0; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; } -h1.title +h2.subtitle { - float: left; + margin: 0; + font-size: 400%; + font-weight: normal; + color: #333; } h1.page-number { + padding-left: 4mm; float: right; text-align: right; } @@ -20,50 +27,53 @@ h1.page-number { position: relative; margin: 0 auto; - padding-top: 40mm; + padding-top: 10mm; } .edge, .tray { position: absolute; - border: 1px solid black; + border-top: 2px solid black; box-sizing: border-box; } +.edge +{ + width: 0; +} .box { position: absolute; border: 1px solid black; - padding: .8mm; - box-sizing: padding-box; + border-bottom: 0; + box-sizing: border-box; } .box .box-label { - text-align: left; + text-align: right; font-size: 55%; word-wrap: break-word; -} -.box .packing -{ - margin: 3%; - display: block; - float: right; - font-size: 80%; + box-sizing: border-box; + padding: 0 4%; } .color0 { - background-color: #ECC !important; + background-color: #FDD !important; } .color1 { - background-color: #CEC !important; + background-color: #DFD !important; } .color2 { - background-color: #CCE !important; + background-color: #DDF !important; } .color3 { - background-color: #ECE !important; + background-color: #DFF !important; +} +.color4 +{ + background-color: #FFD !important; } /* Remaining amounts*/ @@ -74,13 +84,20 @@ ul } li * { - font-size: 6mm; - line-height: 12mm; + font-size: 200%; + line-height: 200%; +} +.item-id +{ + display: inline-block; + text-align: right; + margin: 0 5mm; + width: 30mm; } .item { display: inline-block; - width: 100mm; + width: 80mm; } .amount {