Ahora se muestra la cantidad restante en estanterias
This commit is contained in:
parent
b615c6b2bf
commit
d4c21e866c
|
@ -1,4 +1,4 @@
|
||||||
hedera-web (1.232-deb8) stable; urgency=low
|
hedera-web (1.233-deb8) stable; urgency=low
|
||||||
|
|
||||||
* Initial Release.
|
* Initial Release.
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ Vn.Shelves = new Class
|
||||||
this.$('report-title').value = 'Anthuriums';
|
this.$('report-title').value = 'Anthuriums';
|
||||||
this.$('warehouse').value = 44;
|
this.$('warehouse').value = 44;
|
||||||
this.$('date').value = new Date ();
|
this.$('date').value = new Date ();
|
||||||
this.$('shelf').value = 1;
|
this.$('shelf').value = 4;
|
||||||
this.$('reign').value = 1;
|
this.$('reign').value = 1;
|
||||||
this.$('family').value = 2;
|
this.$('family').value = 2;
|
||||||
this.$('filter').value = 'Ant %';
|
this.$('filter').value = 'Ant %';
|
||||||
|
@ -85,24 +85,33 @@ Vn.ShelvesReport = new Class
|
||||||
};
|
};
|
||||||
|
|
||||||
var items = [];
|
var items = [];
|
||||||
|
var remainings = [];
|
||||||
var res = resultSet.fetchResult ();
|
var res = resultSet.fetchResult ();
|
||||||
|
|
||||||
while (res.next ())
|
while (res.next ())
|
||||||
|
if (res.get ('etiquetas') <= this.maxAmount)
|
||||||
|
{
|
||||||
items.push ({
|
items.push ({
|
||||||
name: res.get ('Article') +' x'+ res.get ('Medida')
|
name: res.get ('Article') +' x'+ res.get ('Medida')
|
||||||
,boxHeight: res.get ('z') * 10 * scale
|
,boxHeight: res.get ('z') * 10 * scale
|
||||||
,boxWidth: res.get ('x') * 10 * scale
|
,boxWidth: res.get ('x') * 10 * scale
|
||||||
,amount: res.get ('etiquetas')
|
,amount: res.get ('etiquetas')
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
remainings.push ({
|
||||||
|
name: res.get ('Article') +' x'+ res.get ('Medida')
|
||||||
|
,amount: res.get ('etiquetas')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Intializes the allocator
|
// Intializes the allocator
|
||||||
|
|
||||||
alloc = new Vn.Allocator ();
|
alloc = new Vn.Allocator ();
|
||||||
alloc.items = items;
|
alloc.items = items;
|
||||||
alloc.maxAmount = this.maxAmount;
|
|
||||||
alloc.shelfFunc = this.drawShelf.bind (this);
|
alloc.shelfFunc = this.drawShelf.bind (this);
|
||||||
alloc.boxFunc = this.drawBox.bind (this);
|
alloc.boxFunc = this.drawBox.bind (this);
|
||||||
|
|
||||||
alloc.nTrays = Math.ceil (
|
alloc.nTrays = Math.ceil (
|
||||||
(shelf.height - shelf.firstTrayElevation) /
|
(shelf.height - shelf.firstTrayElevation) /
|
||||||
(shelf.trayHeight + shelf.trayDensity)
|
(shelf.trayHeight + shelf.trayDensity)
|
||||||
|
@ -115,6 +124,40 @@ Vn.ShelvesReport = new Class
|
||||||
// Opens the report
|
// Opens the report
|
||||||
|
|
||||||
this.createWindow ('shelves');
|
this.createWindow ('shelves');
|
||||||
|
|
||||||
|
// Remaining amount
|
||||||
|
|
||||||
|
if (remainings.length > 0)
|
||||||
|
{
|
||||||
|
var sheet = this.doc.createElement ('div');
|
||||||
|
sheet.className = 'sheet';
|
||||||
|
this.doc.body.appendChild (sheet);
|
||||||
|
|
||||||
|
var title = this.doc.createElement ('h1');
|
||||||
|
title.appendChild (this.doc.createTextNode (_('Palets')));
|
||||||
|
sheet.appendChild (title);
|
||||||
|
|
||||||
|
var ul = this.doc.createElement ('ul');
|
||||||
|
sheet.appendChild (ul);
|
||||||
|
|
||||||
|
for (var i = 0; i < remainings.length; i++)
|
||||||
|
{
|
||||||
|
var li = this.doc.createElement ('li');
|
||||||
|
ul.appendChild (li);
|
||||||
|
|
||||||
|
var span = this.doc.createElement ('span');
|
||||||
|
span.className = 'amount';
|
||||||
|
span.appendChild (this.doc.createTextNode (remainings[i].amount));
|
||||||
|
li.appendChild (span);
|
||||||
|
|
||||||
|
var span = this.doc.createElement ('span');
|
||||||
|
span.appendChild (this.doc.createTextNode (' '+ remainings[i].name));
|
||||||
|
li.appendChild (span);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Draws the shelves
|
||||||
|
|
||||||
alloc.run ();
|
alloc.run ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,8 +167,7 @@ Vn.ShelvesReport = new Class
|
||||||
|
|
||||||
var sheet = this.doc.createElement ('div');
|
var sheet = this.doc.createElement ('div');
|
||||||
sheet.className = 'sheet';
|
sheet.className = 'sheet';
|
||||||
/* sheet.style.top = (allocator.currentShelf * 297) +'mm';
|
this.doc.body.appendChild (sheet);
|
||||||
*/ this.doc.body.appendChild (sheet);
|
|
||||||
|
|
||||||
// Draws the title
|
// Draws the title
|
||||||
|
|
||||||
|
@ -283,6 +325,7 @@ Vn.Allocator = new Class
|
||||||
this.lastBoxWidth = 0;
|
this.lastBoxWidth = 0;
|
||||||
this.trayX = 0;
|
this.trayX = 0;
|
||||||
this.trayY = 0;
|
this.trayY = 0;
|
||||||
|
this.remaining = false;
|
||||||
|
|
||||||
for (var i = 0; i < this.items.length; i++)
|
for (var i = 0; i < this.items.length; i++)
|
||||||
{
|
{
|
||||||
|
@ -290,11 +333,6 @@ Vn.Allocator = new Class
|
||||||
|
|
||||||
for (var amount = 0; amount < item.amount; amount++)
|
for (var amount = 0; amount < item.amount; amount++)
|
||||||
{
|
{
|
||||||
if (amount == 0
|
|
||||||
&& this.maxAmount > 0
|
|
||||||
&& item.amount > this.maxAmount)
|
|
||||||
break;
|
|
||||||
|
|
||||||
this.addBox (item, amount);
|
this.addBox (item, amount);
|
||||||
this.firstShelfBox = false;
|
this.firstShelfBox = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
|
|
||||||
|
/* Shelves */
|
||||||
|
|
||||||
h1
|
h1
|
||||||
{
|
{
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
@ -58,3 +60,22 @@ h1.page-number
|
||||||
{
|
{
|
||||||
background-color: #ECE !important;
|
background-color: #ECE !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Remaining amounts*/
|
||||||
|
|
||||||
|
ul
|
||||||
|
{
|
||||||
|
list-style-type: none;
|
||||||
|
}
|
||||||
|
li *
|
||||||
|
{
|
||||||
|
font-size: 6mm;
|
||||||
|
}
|
||||||
|
.amount
|
||||||
|
{
|
||||||
|
width: 10mm;
|
||||||
|
text-align: right;
|
||||||
|
display: inline-block;
|
||||||
|
padding-right: 1mm;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue