From b0e614894e35c2d2aa745095939cac3688dff964 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Sat, 24 Oct 2015 01:41:11 +0200 Subject: [PATCH] =?UTF-8?q?Secci=C3=B3n=20estanterias=20acabada?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/changelog | 2 +- web/forms/admin/shelves/shelves.js | 47 ++++++++++++++++----- web/forms/admin/shelves/style.css | 2 +- web/forms/admin/shelves/ui.xml | 58 +++++++++++++++----------- web/js/htk/field/select.js | 3 +- web/locale/ca/forms/admin/shelves.json | 12 +----- web/locale/ca/js/vn.js | 2 +- web/locale/es/forms/admin/shelves.json | 15 ++++--- web/locale/fr/forms/admin/shelves.json | 12 +----- web/locale/fr/js/vn.js | 4 +- web/reports/shelves/style.css | 21 ++++++---- 11 files changed, 101 insertions(+), 77 deletions(-) diff --git a/debian/changelog b/debian/changelog index 712507f4..63465437 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (1.234-deb8) stable; urgency=low +hedera-web (1.235-deb8) stable; urgency=low * Initial Release. diff --git a/web/forms/admin/shelves/shelves.js b/web/forms/admin/shelves/shelves.js index 02fdf032..47c6d84c 100755 --- a/web/forms/admin/shelves/shelves.js +++ b/web/forms/admin/shelves/shelves.js @@ -5,14 +5,20 @@ Vn.Shelves = new Class ,activate: function () { - this.$('report-title').value = 'Anthuriums'; 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.$('filter').value = 'Ant '; this.$('max-amount').value = 50; + this.$('show-packing').value = true; + this.$('stack').value = true; + } + + ,onFamilyChange: function () + { + this.$('report-title').value = this.$('family').get ('Tipo'); } ,onPreviewClick: function () @@ -28,6 +34,8 @@ Vn.Shelves = new Class report.setParams ( this.$('report-title').value, this.$('max-amount').value, + this.$('show-packing').value, + this.$('stack').value, batch ); report.open (); @@ -41,11 +49,13 @@ Vn.ShelvesReport = new Class ,nItem: -1 ,nColors: 4 - ,setParams: function (title, maxAmount, batch) + ,setParams: function (title, maxAmount, showPacking, stack, batch) { this.title = title; this.maxAmount = maxAmount; this.batch = batch; + this.showPacking = showPacking; + this.stack = stack; } ,open: function () @@ -88,7 +98,8 @@ Vn.ShelvesReport = new Class if (res.get ('etiquetas') <= this.maxAmount) { items.push ({ - name: res.get ('Article') +' x'+ res.get ('Medida') + name: res.get ('Article') + ,packing: res.get ('packing') ,boxHeight: res.get ('z') * 10 * scale ,boxWidth: res.get ('x') * 10 * scale ,amount: res.get ('etiquetas') @@ -97,7 +108,8 @@ Vn.ShelvesReport = new Class else { remainings.push ({ - name: res.get ('Article') +' x'+ res.get ('Medida') + name: res.get ('Article') + ,packing: res.get ('packing') ,amount: res.get ('etiquetas') }); } @@ -108,6 +120,7 @@ Vn.ShelvesReport = new Class alloc.items = items; alloc.shelfFunc = this.drawShelf.bind (this); alloc.boxFunc = this.drawBox.bind (this); + alloc.stack = this.stack; alloc.nTrays = Math.ceil ( (shelf.height - shelf.firstTrayElevation) / (shelf.trayHeight + shelf.trayDensity) @@ -130,7 +143,8 @@ Vn.ShelvesReport = new Class this.doc.body.appendChild (sheet); var title = this.doc.createElement ('h1'); - title.appendChild (this.doc.createTextNode (_('Palets'))); + title.appendChild (this.doc.createTextNode (this.title +' - ')); + title.appendChild (this.doc.createTextNode (_('Pallets'))); sheet.appendChild (title); var ul = this.doc.createElement ('ul'); @@ -145,7 +159,10 @@ Vn.ShelvesReport = new Class span.className = 'item'; span.appendChild (this.doc.createTextNode (remainings[i].name)); li.appendChild (span); - + + if (this.showPacking) + span.appendChild (this.doc.createTextNode (' '+ remainings[i].packing)); + var span = this.doc.createElement ('span'); span.className = 'amount'; span.appendChild (this.doc.createTextNode (remainings[i].amount)); @@ -247,11 +264,18 @@ 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'); + boxLabel.className = 'box-label'; + boxLabel.appendChild (this.doc.createTextNode (item.name)); box.appendChild (boxLabel); - - var text = this.doc.createTextNode (item.name); - boxLabel.appendChild (text); } } }); @@ -301,7 +325,8 @@ Vn.Allocator = new Class trayHeight = this.topTrayHeight; if (this.trayY + item.boxHeight > trayHeight - || item.boxWidth > this.lastBoxWidth) + || item.boxWidth > this.lastBoxWidth + || (!this.stack && amount == 0)) this.addColumn (item.boxWidth); if (this.boxFunc) diff --git a/web/forms/admin/shelves/style.css b/web/forms/admin/shelves/style.css index 635d0571..b2f20fec 100755 --- a/web/forms/admin/shelves/style.css +++ b/web/forms/admin/shelves/style.css @@ -23,7 +23,7 @@ display: block; margin-bottom: 0.5em; } -.shelves input, +.shelves input[type=text], .shelves select { margin: 0; diff --git a/web/forms/admin/shelves/ui.xml b/web/forms/admin/shelves/ui.xml index b3b1879d..64418240 100755 --- a/web/forms/admin/shelves/ui.xml +++ b/web/forms/admin/shelves/ui.xml @@ -6,8 +6,25 @@
- - + + + + SELECT id, reino FROM vn2008.reinos + WHERE display != FALSE ORDER BY reino + + +
+
+ + + + SELECT tipo_id, Tipo FROM vn2008.Tipos + WHERE reino_id = #reign ORDER BY Tipo + + + + +
@@ -31,34 +48,25 @@
- - - - SELECT id, reino FROM vn2008.reinos - WHERE display != FALSE ORDER BY reino - - -
-
- - - - SELECT tipo_id, Tipo FROM vn2008.Tipos - WHERE reino_id = #reign ORDER BY Tipo - - - - - -
-
- +
- +
+
+ + +
+
+ + +
+
+ + +