Sección estanterias acabada

This commit is contained in:
Juan Ferrer Toribio 2015-10-24 01:41:11 +02:00
parent 6886f436a9
commit b0e614894e
11 changed files with 101 additions and 77 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.234-deb8) stable; urgency=low hedera-web (1.235-deb8) stable; urgency=low
* Initial Release. * Initial Release.

View File

@ -5,14 +5,20 @@ Vn.Shelves = new Class
,activate: function () ,activate: function ()
{ {
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 = 4; 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 ';
this.$('max-amount').value = 50; 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 () ,onPreviewClick: function ()
@ -28,6 +34,8 @@ Vn.Shelves = new Class
report.setParams ( report.setParams (
this.$('report-title').value, this.$('report-title').value,
this.$('max-amount').value, this.$('max-amount').value,
this.$('show-packing').value,
this.$('stack').value,
batch batch
); );
report.open (); report.open ();
@ -41,11 +49,13 @@ Vn.ShelvesReport = new Class
,nItem: -1 ,nItem: -1
,nColors: 4 ,nColors: 4
,setParams: function (title, maxAmount, batch) ,setParams: function (title, maxAmount, showPacking, stack, batch)
{ {
this.title = title; this.title = title;
this.maxAmount = maxAmount; this.maxAmount = maxAmount;
this.batch = batch; this.batch = batch;
this.showPacking = showPacking;
this.stack = stack;
} }
,open: function () ,open: function ()
@ -88,7 +98,8 @@ Vn.ShelvesReport = new Class
if (res.get ('etiquetas') <= this.maxAmount) if (res.get ('etiquetas') <= this.maxAmount)
{ {
items.push ({ items.push ({
name: res.get ('Article') +' x'+ res.get ('Medida') name: res.get ('Article')
,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
,amount: res.get ('etiquetas') ,amount: res.get ('etiquetas')
@ -97,7 +108,8 @@ Vn.ShelvesReport = new Class
else else
{ {
remainings.push ({ remainings.push ({
name: res.get ('Article') +' x'+ res.get ('Medida') name: res.get ('Article')
,packing: res.get ('packing')
,amount: res.get ('etiquetas') ,amount: res.get ('etiquetas')
}); });
} }
@ -108,6 +120,7 @@ Vn.ShelvesReport = new Class
alloc.items = items; alloc.items = items;
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.stack = this.stack;
alloc.nTrays = Math.ceil ( alloc.nTrays = Math.ceil (
(shelf.height - shelf.firstTrayElevation) / (shelf.height - shelf.firstTrayElevation) /
(shelf.trayHeight + shelf.trayDensity) (shelf.trayHeight + shelf.trayDensity)
@ -130,7 +143,8 @@ 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 (_('Palets'))); title.appendChild (this.doc.createTextNode (this.title +' - '));
title.appendChild (this.doc.createTextNode (_('Pallets')));
sheet.appendChild (title); sheet.appendChild (title);
var ul = this.doc.createElement ('ul'); var ul = this.doc.createElement ('ul');
@ -146,6 +160,9 @@ Vn.ShelvesReport = new Class
span.appendChild (this.doc.createTextNode (remainings[i].name)); span.appendChild (this.doc.createTextNode (remainings[i].name));
li.appendChild (span); li.appendChild (span);
if (this.showPacking)
span.appendChild (this.doc.createTextNode (' '+ remainings[i].packing));
var span = this.doc.createElement ('span'); var span = this.doc.createElement ('span');
span.className = 'amount'; span.className = 'amount';
span.appendChild (this.doc.createTextNode (remainings[i].amount)); span.appendChild (this.doc.createTextNode (remainings[i].amount));
@ -247,11 +264,18 @@ Vn.ShelvesReport = new Class
if (amount == 0 || allocator.firstShelfBox) if (amount == 0 || allocator.firstShelfBox)
{ {
var boxLabel = this.doc.createElement ('span'); if (this.showPacking)
box.appendChild (boxLabel); {
var packing = this.doc.createElement ('span');
packing.className = 'packing';
packing.appendChild (this.doc.createTextNode (item.packing));
box.appendChild (packing);
}
var text = this.doc.createTextNode (item.name); var boxLabel = this.doc.createElement ('span');
boxLabel.appendChild (text); boxLabel.className = 'box-label';
boxLabel.appendChild (this.doc.createTextNode (item.name));
box.appendChild (boxLabel);
} }
} }
}); });
@ -301,7 +325,8 @@ Vn.Allocator = new Class
trayHeight = this.topTrayHeight; trayHeight = this.topTrayHeight;
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.addColumn (item.boxWidth); this.addColumn (item.boxWidth);
if (this.boxFunc) if (this.boxFunc)

View File

@ -23,7 +23,7 @@
display: block; display: block;
margin-bottom: 0.5em; margin-bottom: 0.5em;
} }
.shelves input, .shelves input[type=text],
.shelves select .shelves select
{ {
margin: 0; margin: 0;

View File

@ -6,8 +6,25 @@
<div class="box"> <div class="box">
<div class="body"> <div class="body">
<div class="form-group"> <div class="form-group">
<label><t>Title</t></label> <label><t>Reign</t></label>
<htk-entry id="report-title"/> <htk-combo id="reign">
<db-model property="model" id="reigns">
SELECT id, reino FROM vn2008.reinos
WHERE display != FALSE ORDER BY reino
</db-model>
</htk-combo>
</div>
<div class="form-group">
<label><t>Family</t></label>
<htk-combo id="family" on-changed="onFamilyChange" on-ready="onFamilyChange">
<db-model property="model">
SELECT tipo_id, Tipo FROM vn2008.Tipos
WHERE reino_id = #reign ORDER BY Tipo
<sql-batch property="batch">
<item name="reign" param="reign"/>
</sql-batch>
</db-model>
</htk-combo>
</div> </div>
<div class="form-group"> <div class="form-group">
<label><t>Store</t></label> <label><t>Store</t></label>
@ -31,34 +48,25 @@
</htk-combo> </htk-combo>
</div> </div>
<div class="form-group"> <div class="form-group">
<label><t>Reign</t></label> <label><t>Name prefix</t></label>
<htk-combo id="reign">
<db-model property="model" id="reigns">
SELECT id, reino FROM vn2008.reinos
WHERE display != FALSE ORDER BY reino
</db-model>
</htk-combo>
</div>
<div class="form-group">
<label><t>Family</t></label>
<htk-combo id="family">
<db-model property="model">
SELECT tipo_id, Tipo FROM vn2008.Tipos
WHERE reino_id = #reign ORDER BY Tipo
<sql-batch property="batch">
<item name="reign" param="reign"/>
</sql-batch>
</db-model>
</htk-combo>
</div>
<div class="form-group">
<label><t>Name filter</t></label>
<input type="text" id="filter"/> <input type="text" id="filter"/>
</div> </div>
<div class="form-group"> <div class="form-group">
<label><t>Max amount</t></label> <label><t>Limit amount per item</t></label>
<htk-entry id="max-amount"/> <htk-entry id="max-amount"/>
</div> </div>
<div class="form-group">
<label><t>Title</t></label>
<htk-entry id="report-title"/>
</div>
<div class="form-group">
<label><t>Show packing</t></label>
<htk-check id="show-packing"/>
</div>
<div class="form-group">
<label><t>Stack different items</t></label>
<htk-check id="stack"/>
</div>
</div> </div>
<div class="footer"> <div class="footer">
<button class="thin" on-click="onPreviewClick"> <button class="thin" on-click="onPreviewClick">

View File

@ -99,8 +99,8 @@ Htk.Select = new Class
else else
value = null; value = null;
this.valueChanged (value);
this.setRow (row); this.setRow (row);
this.valueChanged (value);
} }
,addOption: function (value, text) ,addOption: function (value, text)
@ -129,6 +129,7 @@ Htk.Select = new Class
this.addOption (data[i][this.showColumnIndex], data[i][1]); this.addOption (data[i][this.showColumnIndex], data[i][1]);
this.selectOption (); this.selectOption ();
this.signalEmit ('ready');
break; break;
} }
case Db.Model.Status.ERROR: case Db.Model.Status.ERROR:

View File

@ -1,11 +1 @@
{ {}
"Title": "Título"
,"Store": "Almacén"
,"Date": "Fecha"
,"Shelf": "Estantería"
,"Reign": "Reino"
,"Family": "Familia"
,"Name filter": "Filtro por nombre"
,"Max amount": "Cantidad máxima"
,"Preview": "Mostrar"
}

View File

@ -76,7 +76,7 @@ Vn.Locale.add
,"Visits": "Visites" ,"Visits": "Visites"
,"News": "Noticies" ,"News": "Noticies"
,"Photos": "Fotos" ,"Photos": "Fotos"
,"Shelves": "Estanterías" ,"Shelves": "Estanteríes"
,"Contact": "Vull ser client" ,"Contact": "Vull ser client"
,"Training": "Formació" ,"Training": "Formació"
,"Agencies": "Agències" ,"Agencies": "Agències"

View File

@ -1,11 +1,16 @@
{ {
"Title": "Título" "Reign": "Reino"
,"Family": "Familia"
,"Store": "Almacén" ,"Store": "Almacén"
,"Date": "Fecha" ,"Date": "Fecha"
,"Shelf": "Estantería" ,"Shelf": "Estantería"
,"Reign": "Reino" ,"Name prefix": "Prefijo del nombre"
,"Family": "Familia" ,"Limit amount per item": "Límite de cantidad por artículo"
,"Name filter": "Filtro por nombre" ,"Title": "Título"
,"Max amount": "Cantidad máxima" ,"Show packing": "Mostrar unidades por caja"
,"Stack different items": "Apilar artículos distintos"
,"Preview": "Mostrar" ,"Preview": "Mostrar"
,"Pallets": "Palets"
} }

View File

@ -1,11 +1 @@
{ {}
"Title": "Título"
,"Store": "Almacén"
,"Date": "Fecha"
,"Shelf": "Estantería"
,"Reign": "Reino"
,"Family": "Familia"
,"Name filter": "Filtro por nombre"
,"Max amount": "Cantidad máxima"
,"Preview": "Mostrar"
}

View File

@ -56,7 +56,7 @@ Vn.Locale.add
,"CookiesNotification": "En utilisant ce site, vous acceptez l'utilisation de cookies pour personnaliser le contenu et l'analyse." ,"CookiesNotification": "En utilisant ce site, vous acceptez l'utilisation de cookies pour personnaliser le contenu et l'analyse."
,"ReturnToOldWebsite": "Ancien site web" ,"ReturnToOldWebsite": "Ancien site web"
,"TestTheNewWebsite": "Testez le nouveau site!" ,"TestTheNewWebsite": "Testez le nouveau site!"
,"Print": "Imprimir" ,"Print": "Print"
,"Menu": "Menu" ,"Menu": "Menu"
@ -76,7 +76,7 @@ Vn.Locale.add
,"Visits": "Visites" ,"Visits": "Visites"
,"News": "Nouvelles" ,"News": "Nouvelles"
,"Photos": "Photos" ,"Photos": "Photos"
,"Shelves": "Estanterías" ,"Shelves": "Shelves"
,"Contact": "Je veux être client" ,"Contact": "Je veux être client"
,"Training": "Formation" ,"Training": "Formation"
,"Agencies": "Agences" ,"Agencies": "Agences"

View File

@ -33,16 +33,21 @@ h1.page-number
{ {
position: absolute; position: absolute;
border: 1px solid black; border: 1px solid black;
text-align: center; padding: .8mm;
box-sizing: padding-box;
} }
.box > span .box .box-label
{ {
font-size: 60%; text-align: left;
text-align: center; font-size: 55%;
margin: 5%; word-wrap: break-word;
display: inline-block; }
line-height: 100%; .box .packing
vertical-align: middle; {
margin: 3%;
display: block;
float: right;
font-size: 80%;
} }
.color0 .color0
{ {