Ahora se ordenan las estanterias por codigo de articulo
This commit is contained in:
parent
b83be5f282
commit
5c9703df3a
|
@ -1,4 +1,4 @@
|
||||||
hedera-web (1.239-deb8) stable; urgency=low
|
hedera-web (1.240-deb8) stable; urgency=low
|
||||||
|
|
||||||
* Initial Release.
|
* Initial Release.
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ Vn.ShelvesReport = new Class
|
||||||
res.next ();
|
res.next ();
|
||||||
|
|
||||||
var maxWidth = 170;
|
var maxWidth = 170;
|
||||||
var maxHeight = 230;
|
var maxHeight = 200;
|
||||||
|
|
||||||
var scale = maxWidth / res.get ('width');
|
var scale = maxWidth / res.get ('width');
|
||||||
|
|
||||||
|
@ -112,7 +112,8 @@ Vn.ShelvesReport = new Class
|
||||||
if (!this.maxAmount || res.get ('etiquetas') <= this.maxAmount)
|
if (!this.maxAmount || res.get ('etiquetas') <= this.maxAmount)
|
||||||
{
|
{
|
||||||
items.push ({
|
items.push ({
|
||||||
name: res.get ('Article')
|
id: res.get ('Id_Article')
|
||||||
|
,name: res.get ('Article')
|
||||||
,packing: res.get ('packing')
|
,packing: res.get ('packing')
|
||||||
,boxHeight: res.get ('z') * 10 * scale
|
,boxHeight: res.get ('z') * 10 * scale
|
||||||
,boxWidth: res.get ('x') * 10 * scale
|
,boxWidth: res.get ('x') * 10 * scale
|
||||||
|
@ -123,7 +124,8 @@ Vn.ShelvesReport = new Class
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
remainings.push ({
|
remainings.push ({
|
||||||
name: res.get ('Article')
|
id: res.get ('Id_Article')
|
||||||
|
,name: res.get ('Article')
|
||||||
,packing: res.get ('packing')
|
,packing: res.get ('packing')
|
||||||
,amount: res.get ('etiquetas')
|
,amount: res.get ('etiquetas')
|
||||||
});
|
});
|
||||||
|
@ -160,10 +162,15 @@ Vn.ShelvesReport = new Class
|
||||||
this.doc.body.appendChild (sheet);
|
this.doc.body.appendChild (sheet);
|
||||||
|
|
||||||
var title = this.doc.createElement ('h1');
|
var title = this.doc.createElement ('h1');
|
||||||
title.appendChild (this.doc.createTextNode (this.title +' - '));
|
title.className = 'title';
|
||||||
title.appendChild (this.doc.createTextNode (_('Pallets')));
|
title.appendChild (this.doc.createTextNode (this.title));
|
||||||
sheet.appendChild (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');
|
var ul = this.doc.createElement ('ul');
|
||||||
sheet.appendChild (ul);
|
sheet.appendChild (ul);
|
||||||
|
|
||||||
|
@ -172,6 +179,11 @@ Vn.ShelvesReport = new Class
|
||||||
var li = this.doc.createElement ('li');
|
var li = this.doc.createElement ('li');
|
||||||
ul.appendChild (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');
|
var span = this.doc.createElement ('span');
|
||||||
span.className = 'item';
|
span.className = 'item';
|
||||||
span.appendChild (this.doc.createTextNode (remainings[i].name));
|
span.appendChild (this.doc.createTextNode (remainings[i].name));
|
||||||
|
@ -192,7 +204,7 @@ Vn.ShelvesReport = new Class
|
||||||
alloc.run ();
|
alloc.run ();
|
||||||
}
|
}
|
||||||
|
|
||||||
,drawShelf: function (allocator)
|
,drawShelf: function (allocator, item)
|
||||||
{
|
{
|
||||||
var shelf = this.shelf;
|
var shelf = this.shelf;
|
||||||
|
|
||||||
|
@ -202,15 +214,20 @@ Vn.ShelvesReport = new Class
|
||||||
|
|
||||||
// Draws the title
|
// 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');
|
var title = this.doc.createElement ('h1');
|
||||||
title.className = 'title';
|
title.className = 'title';
|
||||||
title.appendChild (this.doc.createTextNode (this.title));
|
title.appendChild (this.doc.createTextNode (this.title));
|
||||||
sheet.appendChild (title);
|
sheet.appendChild (title);
|
||||||
|
|
||||||
var pageNumber = this.doc.createElement ('h1');
|
var subtitle = this.doc.createElement ('h2');
|
||||||
pageNumber.className = 'page-number';
|
subtitle.className = 'subtitle';
|
||||||
pageNumber.appendChild (this.doc.createTextNode (allocator.currentShelf + 1));
|
subtitle.appendChild (this.doc.createTextNode (item.id.toLocaleString ()));
|
||||||
sheet.appendChild (pageNumber);
|
sheet.appendChild (subtitle);
|
||||||
|
|
||||||
// Draws the shelf
|
// Draws the shelf
|
||||||
|
|
||||||
|
@ -283,15 +300,15 @@ Vn.ShelvesReport = new Class
|
||||||
var boxLabel = this.doc.createElement ('div');
|
var boxLabel = this.doc.createElement ('div');
|
||||||
boxLabel.className = 'box-label';
|
boxLabel.className = 'box-label';
|
||||||
|
|
||||||
if (this.showPacking)
|
/* if (this.showPacking)
|
||||||
{
|
{
|
||||||
var packing = this.doc.createElement ('span');
|
var packing = this.doc.createElement ('span');
|
||||||
packing.className = 'packing';
|
packing.className = 'packing';
|
||||||
packing.appendChild (this.doc.createTextNode (item.packing));
|
packing.appendChild (this.doc.createTextNode (item.packing));
|
||||||
boxLabel.appendChild (packing);
|
boxLabel.appendChild (packing);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
boxLabel.appendChild (this.doc.createTextNode (item.name));
|
boxLabel.appendChild (this.doc.createTextNode (item.id.toLocaleString () /* item.name */));
|
||||||
box.appendChild (boxLabel);
|
box.appendChild (boxLabel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -299,20 +316,20 @@ Vn.ShelvesReport = new Class
|
||||||
|
|
||||||
Vn.Allocator = new Class
|
Vn.Allocator = new Class
|
||||||
({
|
({
|
||||||
addShelf: function ()
|
addShelf: function (item)
|
||||||
{
|
{
|
||||||
this.currentShelf++;
|
this.currentShelf++;
|
||||||
this.firstShelfBox = true;
|
this.firstShelfBox = true;
|
||||||
|
|
||||||
if (this.shelfFunc)
|
if (this.shelfFunc)
|
||||||
this.shelfFunc (this);
|
this.shelfFunc (this, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
,addTray: function ()
|
,addTray: function (item)
|
||||||
{
|
{
|
||||||
if (this.currentTray <= 0)
|
if (this.currentTray <= 0)
|
||||||
{
|
{
|
||||||
this.addShelf ();
|
this.addShelf (item);
|
||||||
this.currentTray = this.nTrays - 1;
|
this.currentTray = this.nTrays - 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -321,17 +338,17 @@ Vn.Allocator = new Class
|
||||||
this.trayX = 0;
|
this.trayX = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
,addColumn: function (width)
|
,addColumn: function (item)
|
||||||
{
|
{
|
||||||
if (this.trayX + this.columnWidth + width > this.width
|
if (this.trayX + this.columnWidth + item.boxWidth > this.width
|
||||||
|| this.currentTray == -1)
|
|| this.currentTray == -1)
|
||||||
this.addTray ();
|
this.addTray (item);
|
||||||
else
|
else
|
||||||
this.trayX += this.columnWidth;
|
this.trayX += this.columnWidth;
|
||||||
|
|
||||||
this.trayY = 0;
|
this.trayY = 0;
|
||||||
this.columnWidth = width;
|
this.columnWidth = item.boxWidth;
|
||||||
this.lastBoxWidth = width;
|
this.lastBoxWidth = item.boxWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
,addBox: function (item, amount)
|
,addBox: function (item, amount)
|
||||||
|
@ -344,7 +361,7 @@ Vn.Allocator = new Class
|
||||||
if (this.trayY + item.boxHeight > trayHeight
|
if (this.trayY + item.boxHeight > trayHeight
|
||||||
|| item.boxWidth > this.lastBoxWidth
|
|| item.boxWidth > this.lastBoxWidth
|
||||||
|| (!this.stack && amount == 0))
|
|| (!this.stack && amount == 0))
|
||||||
this.addColumn (item.boxWidth);
|
this.addColumn (item);
|
||||||
|
|
||||||
if (this.boxFunc)
|
if (this.boxFunc)
|
||||||
this.boxFunc (this, item, amount);
|
this.boxFunc (this, item, amount);
|
||||||
|
|
|
@ -4,12 +4,18 @@
|
||||||
h1
|
h1
|
||||||
{
|
{
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
font-size: 15mm;
|
font-size: 600%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
h1.title
|
h2.subtitle
|
||||||
{
|
{
|
||||||
float: left;
|
margin: 3mm 0;
|
||||||
|
font-size: 500%;
|
||||||
|
font-weight: normal;
|
||||||
|
color: #333;
|
||||||
}
|
}
|
||||||
h1.page-number
|
h1.page-number
|
||||||
{
|
{
|
||||||
|
@ -20,7 +26,8 @@ h1.page-number
|
||||||
{
|
{
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding-top: 40mm;
|
top: 50%;
|
||||||
|
margin-top: -120mm;
|
||||||
}
|
}
|
||||||
.edge,
|
.edge,
|
||||||
.tray
|
.tray
|
||||||
|
@ -42,19 +49,19 @@ h1.page-number
|
||||||
}
|
}
|
||||||
.box .box-label
|
.box .box-label
|
||||||
{
|
{
|
||||||
text-align: left;
|
text-align: right;
|
||||||
font-size: 55%;
|
font-size: 55%;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 4%;
|
padding: 3%;
|
||||||
}
|
}
|
||||||
.box .packing
|
/*.box .packing
|
||||||
{
|
{
|
||||||
margin-left: 4%;
|
margin-left: 3%;
|
||||||
display: block;
|
display: block;
|
||||||
float: right;
|
float: right;
|
||||||
font-size: 140%;
|
font-size: 140%;
|
||||||
}
|
}*/
|
||||||
.color0
|
.color0
|
||||||
{
|
{
|
||||||
background-color: #FDD !important;
|
background-color: #FDD !important;
|
||||||
|
@ -88,13 +95,20 @@ ul
|
||||||
}
|
}
|
||||||
li *
|
li *
|
||||||
{
|
{
|
||||||
font-size: 6mm;
|
font-size: 200%;
|
||||||
line-height: 12mm;
|
line-height: 200%;
|
||||||
|
}
|
||||||
|
.item-id
|
||||||
|
{
|
||||||
|
display: inline-block;
|
||||||
|
text-align: right;
|
||||||
|
margin: 0 5mm;
|
||||||
|
width: 30mm;
|
||||||
}
|
}
|
||||||
.item
|
.item
|
||||||
{
|
{
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 100mm;
|
width: 80mm;
|
||||||
}
|
}
|
||||||
.amount
|
.amount
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue