0
1
Fork 0
This commit is contained in:
Juan Ferrer Toribio 2017-03-30 13:44:53 +02:00
parent a5854290e9
commit efdde01e19
47 changed files with 619 additions and 475 deletions

View File

@ -41,19 +41,19 @@
<div class="card form">
<div>
<label><t>Name</t></label>
<htk-entry column="consignee" form="iter"/>
<htk-entry form="iter" column="consignee"/>
</div>
<div>
<label><t>Address</t></label>
<htk-entry column="name" form="iter"/>
<htk-entry form="iter" column="name"/>
</div>
<div>
<label><t>City</t></label>
<htk-entry column="city" form="iter"/>
<htk-entry form="iter" column="city"/>
</div>
<div>
<label><t>ZipCode</t></label>
<htk-entry column="zip_code" form="iter"/>
<htk-entry form="iter" column="zip_code"/>
</div>
<div>
<label><t>Country</t></label>
@ -74,7 +74,7 @@
</div>
<div>
<label><t>Province</t></label>
<htk-combo column="province_id" form="iter">
<htk-combo form="iter" column="province_id">
<db-model property="model">
<custom>
SELECT province_id, name FROM vn2008.province

View File

@ -5,19 +5,16 @@ Hedera.Items = new Class
,activate: function ()
{
this.$('warehouse').value = 7;
this.$('realm').value = null;
var set = this.$('set');
set.set ('warehouse', 7);
set.set ('realm', null);
}
,onPreviewClick: function ()
,onShowClick: function ()
{
var batch = new Sql.Batch ();
batch.addValues ({
'warehouse': this.$('warehouse').value
,'realm': this.$('realm').value
,'rate': this.$('rate').value
});
this.gui.openReport ('items-report', batch);
var set = this.$('set');
set.set ('rate', this.$('rate').value);
this.gui.openReport ('items-report', set.params);
}
});

View File

@ -5,5 +5,5 @@
,"Realm": "Realm"
,"Rate": "Rate"
,"Preview": "Preview"
,"Show": "Show"
}

View File

@ -5,5 +5,5 @@
,"Realm": "Reino"
,"Rate": "Tarifa"
,"Preview": "Mostrar"
,"Show": "Mostrar"
}

View File

@ -5,5 +5,5 @@
,"Realm": "Realm"
,"Rate": "Rate"
,"Preview": "Preview"
,"Show": "Show"
}

View File

@ -5,5 +5,5 @@
,"Realm": "Reino"
,"Rate": "Tarifa"
,"Preview": "Mostrar"
,"Show": "Mostrar"
}

View File

@ -1,19 +1,19 @@
<vn>
<vn-basic-set id="set"/>
<h1 id="title">
<t>Item list</t>
</h1>
<div id="actions" class="action-bar">
<htk-bar-button
icon="print"
tip="_Preview"
on-click="onPreviewClick"/>
icon="show"
tip="_Show"
on-click="onShowClick"/>
</div>
<div id="main" class="items">
<div class="card form">
<div>
<label><t>Store</t></label>
<htk-combo>
<vn-param property="param" id="warehouse"/>
<htk-combo form="set" column="warehouse">
<db-model property="model">
<custom>
SELECT id, name FROM vn2008.warehouse
@ -24,8 +24,7 @@
</div>
<div>
<label><t>Realm</t></label>
<htk-combo not-null="false">
<vn-param property="param" id="realm"/>
<htk-combo form="set" column="realm" not-null="false">
<db-model property="model">
<custom>
SELECT id, reino FROM vn2008.reinos

View File

@ -12,7 +12,7 @@
,"Show packing": "Show packing"
,"Stack different items": "Stack different items"
,"Preview": "Preview"
,"Show": "Show"
,"Pallets": "Pallets"

View File

@ -12,7 +12,7 @@
,"Show packing": "Mostrar unidades por caja"
,"Stack different items": "Apilar artículos distintos"
,"Preview": "Mostrar"
,"Show": "Mostrar"
,"Pallets": "Palets"

View File

@ -12,7 +12,7 @@
,"Show packing": "Show packing"
,"Stack different items": "Stack different items"
,"Preview": "Preview"
,"Show": "Show"
,"Pallets": "Pallets"

View File

@ -12,7 +12,7 @@
,"Show packing": "Mostrar unidades por caixa"
,"Stack different items": "Empilhar ítens diferentes"
,"Preview": "Mostrar"
,"Show": "Mostrar"
,"Pallets": "Palets"

View File

@ -5,49 +5,19 @@ Hedera.Shelves = new Class
,activate: function ()
{
this.$('date').value = new Date ();
this.$('useIds').value = false;
var set = this.$('set');
set.set ('date', new Date ());
set.set ('useIds', false);
}
,onConfigChange: function ()
{
var fields = [
'realm'
,'family'
,'warehouse'
,'shelf'
,'namePrefix'
,'maxAmount'
,'reportTitle'
,'showPacking'
,'stack'
];
for (var i = 0; i < fields.length; i++)
this.$(fields[i]).value = this.$('config').get (fields[i]);
this.$('set').assign (this.$('config'));
}
,onPreviewClick: function ()
{
var fields = [
'family'
,'warehouse'
,'shelf'
,'namePrefix'
,'maxAmount'
,'reportTitle'
,'showPacking'
,'stack'
,'useIds'
,'date'
];
var batch = new Sql.Batch ();
for (var i = 0; i < fields.length; i++)
batch.addValue (fields[i], this.$(fields[i]).value);
this.gui.openReport ('shelves-report', batch);
,onShowClick: function ()
{
this.gui.openReport ('shelves-report', this.$('set').params);
}
});

View File

@ -1,23 +1,13 @@
<vn>
<vn-group>
<db-model property="model" id="configs-model">
<custom>
SELECT c.id, c.name reportTitle, c.namePrefix, c.warehouse, c.family,
c.shelf, c.maxAmount, c.showPacking, c.stack, t.reino_id realm
FROM shelfConfig c
JOIN vn2008.Tipos t ON t.tipo_id = c.family
</custom>
</db-model>
<vn-basic-set id="set"/>
</vn-group>
<vn-basic-set id="set"/>
<h1 id="title">
<t>Shelves</t>
</h1>
<div id="actions">
<htk-bar-button
icon="print"
tip="_Preview"
on-click="onPreviewClick"/>
icon="show"
tip="_Show"
on-click="onShowClick"/>
</div>
<div id="main" class="shelves">
<div class="card form">
@ -28,16 +18,25 @@
placeholder="_Select config"
model="configs-model"
on-changed="onConfigChange"
on-ready="onConfigChange"/>
on-ready="onConfigChange">
<db-model property="model" id="configs-model">
<custom>
SELECT c.id, c.name reportTitle, c.namePrefix, c.warehouse, c.family,
c.shelf, c.maxAmount, c.showPacking, c.stack, t.reino_id realm
FROM shelfConfig c
JOIN vn2008.Tipos t ON t.tipo_id = c.family
</custom>
</db-model>
</htk-combo>
</div>
<div>
<label><t>Date</t></label>
<htk-date-chooser id="date"/>
<htk-date-chooser form="set" column="date"/>
</div>
<div>
<label><t>Reign</t></label>
<htk-combo id="realm">
<db-model property="model" id="realms">
<htk-combo form="set" column="realm" id="realm">
<db-model property="model">
<custom>
SELECT id, reino FROM vn2008.reinos
WHERE display != FALSE ORDER BY reino
@ -47,7 +46,7 @@
</div>
<div>
<label><t>Family</t></label>
<htk-combo id="family">
<htk-combo form="set" column="family">
<db-model property="model">
<custom>
SELECT tipo_id, Tipo FROM vn2008.Tipos
@ -63,7 +62,7 @@
</div>
<div>
<label><t>Store</t></label>
<htk-combo id="warehouse">
<htk-combo form="set" column="warehouse">
<db-model property="model">
<custom>
SELECT id, name FROM vn2008.warehouse
@ -74,7 +73,7 @@
</div>
<div>
<label><t>Shelf</t></label>
<htk-combo id="shelf">
<htk-combo form="set" column="shelf">
<db-model property="model">
<custom>
SELECT id, name FROM shelf
@ -84,27 +83,27 @@
</div>
<div>
<label><t>Name prefix</t></label>
<htk-entry id="namePrefix"/>
<htk-entry form="set" column="namePrefix"/>
</div>
<div>
<label><t>Limit amount per item</t></label>
<htk-entry id="maxAmount"/>
<htk-entry form="set" column="maxAmount"/>
</div>
<div>
<label><t>Title</t></label>
<htk-entry id="reportTitle"/>
<htk-entry form="set" column="reportTitle"/>
</div>
<div>
<label><t>Show packing</t></label>
<htk-check id="showPacking"/>
<htk-check form="set" column="showPacking"/>
</div>
<div>
<label><t>Stack different items</t></label>
<htk-check id="stack"/>
<htk-check form="set" column="stack"/>
</div>
<div>
<label><t>Use ids instead of names</t></label>
<htk-check id="useIds"/>
<htk-check form="set" column="useIds"/>
</div>
</div>
</div>

View File

@ -90,10 +90,6 @@
display: block;
float: left;
width: 33.33%;
}
.right-panel .realms a:hover
{
background-color: rgba(1, 1, 1, .05);
border-radius: .1em;
}
.right-panel .realms a > img

View File

@ -225,7 +225,7 @@
</custom>
</db-model>
<custom>
<a id="link">
<a id="link" class="clickable">
<img id="image"/>
</a>
</custom>

View File

@ -7,7 +7,7 @@
SELECT o.id, o.date_send, o.note, o.company_id,
ag.description agency, v.code method,
ad.consignee, ad.zip_code, ad.city, ad.name address,
t.*, c.credit, customer_get_debt() debt
t.*, c.credit, clientGetDebt() debt
FROM basket o
JOIN vn2008.Agencias ag ON ag.Id_Agencia = o.agency_id
LEFT JOIN address_view ad ON ad.id = o.address_id

View File

@ -8,9 +8,13 @@ Hedera.Orders = new Class
this.tpv = new Hedera.Tpv ({conn: this.conn});
this.tpv.check (this._onTpvCheck.bind (this));
var from = new Date ();
from.setDate (from.getDate () - 25);
this.$('from').value = from;
if (!this.$('from').value)
{
var from = new Date ();
from.setDate (from.getDate () - 25);
from.setHours (0, 0, 0, 0);
this.$('from').value = from;
}
}
,_onTpvCheck: function (tpv, tpvOrder, tpvStatus)

View File

@ -16,8 +16,14 @@ Hedera.Preview = new Class
this.gui.loaderPush ();
var module = new Hedera.Module ('reports', reportName);
this.reportModule = module;
module.load (this._onReportLoad.bind (this));
}
,deactivate: function ()
{
this.reportModule.unload ();
}
,_onReportLoad: function (module)
{
@ -32,12 +38,15 @@ Hedera.Preview = new Class
var batch = new Sql.Batch ();
batch.addValues (Vn.Hash._hashMap);
var report = new module.klass (module, this.gui);
report.open (batch, this.node);
this.report = new module.klass ({
info: module,
conn: this.conn
});
this.report.open (batch, this.node);
}
,onPrintClick: function ()
{
this.doc.defaultView.print ();
this.report.print ();
}
});

View File

@ -8,5 +8,5 @@
tip="_Print"
on-click="onPrintClick"/>
</div>
<div id="main" class="report"/>
<div id="main" class="preview report"/>
</vn>

130
image/icon/dark/show.svg Normal file
View File

@ -0,0 +1,130 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
id="svg7384"
sodipodi:docname="search.svg"
version="1.1"
inkscape:version="0.48.5 r10040"
height="16"
width="16">
<metadata
id="metadata90">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>Gnome Symbolic Icon Theme</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
inkscape:cy="8.9536526"
pagecolor="#555753"
borderopacity="1"
showborder="false"
inkscape:bbox-paths="false"
guidetolerance="10"
inkscape:object-paths="true"
inkscape:window-width="1296"
showguides="true"
inkscape:object-nodes="true"
inkscape:snap-bbox="true"
inkscape:pageshadow="2"
inkscape:guide-bbox="true"
inkscape:snap-nodes="false"
bordercolor="#666666"
objecttolerance="10"
id="namedview88"
showgrid="true"
inkscape:window-maximized="0"
inkscape:window-x="2192"
inkscape:snap-global="true"
inkscape:window-y="243"
gridtolerance="10"
inkscape:window-height="701"
inkscape:snap-to-guides="true"
inkscape:current-layer="layer12"
inkscape:snap-bbox-midpoints="false"
inkscape:zoom="16.3125"
inkscape:cx="7.1233965"
inkscape:snap-grids="true"
inkscape:pageopacity="1">
<inkscape:grid
spacingx="1px"
spacingy="1px"
id="grid4866"
empspacing="2"
enabled="true"
type="xygrid"
snapvisiblegridlinesonly="true"
visible="true" />
</sodipodi:namedview>
<title
id="title9167">Gnome Symbolic Icon Theme</title>
<defs
id="defs7386" />
<g
inkscape:label="status"
transform="translate(-140.0002,-645.96875)"
inkscape:groupmode="layer"
id="layer9"
style="display:inline" />
<g
inkscape:label="devices"
transform="translate(-140.0002,-645.96875)"
inkscape:groupmode="layer"
id="layer10" />
<g
inkscape:label="apps"
transform="translate(-140.0002,-645.96875)"
inkscape:groupmode="layer"
id="layer11" />
<g
inkscape:label="actions"
transform="translate(-140.0002,-645.96875)"
inkscape:groupmode="layer"
id="layer12">
<path
inkscape:connector-curvature="0"
d="m 146.50761,646.99554 c -3.02886,0 -5.51073,2.47905 -5.51073,5.50447 0,3.02541 2.48187,5.50446 5.51073,5.50446 3.02885,0 5.51072,-2.47905 5.51072,-5.50446 0,-3.02542 -2.48187,-5.50447 -5.51072,-5.50447 z m 0,2.00893 c 1.94735,0 3.49951,1.55039 3.49951,3.49554 0,1.94514 -1.55216,3.49553 -3.49951,3.49553 -1.94736,0 -3.49952,-1.55039 -3.49952,-3.49553 0,-1.94515 1.55216,-3.49554 3.49952,-3.49554 z"
id="path27918"
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1.55467153000000002;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new;font-family:Sans;-inkscape-font-specification:Sans" />
<path
inkscape:connector-curvature="0"
d="m 149.8125,655 a 1.0001,1.0001 0 0 0 -0.5,1.71875 l 4,4 a 1.0054782,1.0054782 0 1 0 1.40625,-1.4375 l -4,-4 A 1.0001,1.0001 0 0 0 149.8125,655 z"
id="path27941"
style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:new;font-family:Sans;-inkscape-font-specification:Sans" />
</g>
<g
inkscape:label="places"
transform="translate(-140.0002,-645.96875)"
inkscape:groupmode="layer"
id="layer13" />
<g
inkscape:label="mimetypes"
transform="translate(-140.0002,-645.96875)"
inkscape:groupmode="layer"
id="layer14" />
<g
inkscape:label="emblems"
transform="translate(-140.0002,-645.96875)"
inkscape:groupmode="layer"
id="layer15"
style="display:inline" />
<g
inkscape:label="categories"
transform="translate(-140.0002,-645.96875)"
inkscape:groupmode="layer"
id="g4953"
style="display:inline" />
</svg>

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@ -42,7 +42,7 @@ module.exports = new Class
return;
this._row = x;
this.iterChanged ();
this.changed ();
}
,get: function ()
{
@ -99,14 +99,14 @@ module.exports = new Class
if (ready)
this.signalEmit ('ready');
this.iterChanged ();
this.changed ();
}
}
,onRowUpdate: function (model, row, column)
,onRowUpdate: function (model, row)
{
if (row == this._row)
this.iterChanged ();
this.changed ();
}
});

View File

@ -45,11 +45,11 @@ module.exports = new Class
}
/**
* Emits the 'iter-changed' signal on the form.
* Emits the 'change' signal on the form.
*/
,iterChanged: function ()
,changed: function ()
{
this.signalEmit ('iter-changed');
this.signalEmit ('change');
}
/**
@ -130,5 +130,13 @@ module.exports = new Class
{
return this._model.setByIndex (this._row, column, value);
}
,keys: function ()
{
if (this._model)
return Object.keys (this._model.columnMap);
return [];
}
});

View File

@ -438,7 +438,7 @@ Model.implement
*
* @param {String} field The destination field name
* @param {String} table The destination table name
* @param {Object} value The default value
* @param {*} value The default value
*/
,setDefaultFromValue: function (field, table, value)
{
@ -527,8 +527,8 @@ Model.implement
* Gets a value from the model.
*
* @param {number} rowIndex The row index
* @param {string} columnName The column name
* @return {mixed} The value
* @param {String} columnName The column name
* @return {*} The value
*/
,get: function (rowIndex, columnName)
{
@ -544,8 +544,8 @@ Model.implement
* Updates a value on the model.
*
* @param {number} rowIndex The row index
* @param {string} columnName The column name
* @param {mixed} value The new value
* @param {String} columnName The column name
* @param {*} value The new value
*/
,set: function (rowIndex, columnName, value)
{
@ -562,7 +562,7 @@ Model.implement
*
* @param {number} rowIndex The row index
* @param {number} column The column index
* @return {mixed} The value
* @return {*} The value
*/
,getByIndex: function (rowIndex, column)
{
@ -577,7 +577,7 @@ Model.implement
*
* @param {number} rowIndex The row index
* @param {number} col The column index
* @param {mixed} value The new value
* @param {*} value The new value
*/
,setByIndex: function (rowIndex, col, value)
{

View File

@ -32,17 +32,16 @@ module.exports = new Class
type: Form
,set: function (x)
{
this.link ({_form: x},
this.link ({_set: x},
{
'status-changed': this.onFormChange
,'iter-changed': this.onIterChange
'change': this.onSetChange
});
this.refresh ();
}
,get: function ()
{
return this._form;
return this._set;
}
},
/**
@ -64,11 +63,10 @@ module.exports = new Class
}
,_columnName: null
,_form: null
,_formLock: false
,_columnIndex: -1
,_set: null
,_setLock: false
,_oneWay: false
,_formValue: null
,_setValue: null
,initialize: function (props)
{
@ -78,38 +76,22 @@ module.exports = new Class
,refresh: function ()
{
if (this._form)
{
this.onFormChange ();
this.onIterChange ();
}
if (this._set)
this.onSetChange ();
}
,onFormChange: function ()
,onSetChange: function ()
{
if (this._columnName != null)
this._columnIndex = this._form.getColumnIndex (this._columnName);
}
,onIterChange: function ()
{
this._formLock = true;
var formValue;
if (this._columnIndex !== -1)
formValue = this._form.getByIndex (this._columnIndex);
else
formValue = undefined;
this.value = formValue;
this._formLock = false;
this._setLock = true;
var formValue = this._set.get (this._columnName);
this.value = formValue;
this._setLock = false;
}
,onChange: function ()
{
if (!this._formLock && this._columnIndex != -1 && !this.oneWay)
this._form.setByIndex (this._columnIndex, this._value);
if (!this._setLock && this._columnName && !this.oneWay)
this._set.set (this._columnName, this._value);
}
});

View File

@ -12,6 +12,7 @@ module.exports = new Class
this.conn = gui.conn;
this.hash = gui.hash;
this.formInfo = formInfo;
this.parent ();
}
,loadUi: function ()

View File

@ -1,4 +1,6 @@
@media screen {
.vn-gui
{
height: inherit;
@ -32,7 +34,7 @@
transition-duration: 200ms;
transition-timing-function: ease-in-out;
}
.vn-gui .menu-button
.vn-gui .navbar .menu-button
{
position: absolute;
left: 0;
@ -43,20 +45,16 @@
margin: 0;
height: 100%;
}
.vn-gui .menu-button:hover
{
background-color: rgba(0, 0, 0, .2);
}
.vn-gui .menu-button img
.vn-gui .navbar .menu-button img
{
vertical-align: middle;
height: 1.8em;
}
.vn-gui .title
.vn-gui .navbar .title
{
float: left;
}
.vn-gui .title > h1
.vn-gui .navbar .title > h1
{
font-weight: normal;
font-size: 1.4em;
@ -72,33 +70,29 @@
/* Action bar */
.vn-gui .action-bar
.action-bar
{
float: right;
padding: 0;
margin: 0;
height: 100%;
}
.vn-gui .action-bar > div
.action-bar > div
{
padding: 0;
margin: 0;
height: 100%;
}
.vn-gui .action-bar > div > *
.action-bar > div > *
{
float: right;
}
.vn-gui .action-bar button
.action-bar button
{
margin: 0;
padding: 1.25em .5em;
}
.vn-gui .action-bar button:hover
{
background-color: rgba(1, 1, 1, .2);
}
.vn-gui .action-bar button > img
.action-bar button > img
{
vertical-align: middle;
height: 1.4em;
@ -233,7 +227,6 @@
display: block;
line-height: 2.8em;
}
.vn-gui .main-menu a:hover,
.vn-gui .main-menu a.selected
{
background-color: rgba(1, 1, 1, .1);
@ -267,17 +260,18 @@
/* Body */
.vn-gui > .body
{
margin-left: 15em;
padding-top: 3.9em;
height: inherit;
box-sizing: border-box;
height: inherit;
.vn-gui > .body
{
margin-left: 15em;
padding-top: 3.9em;
height: inherit;
box-sizing: border-box;
height: inherit;
transition-property: margin-left, margin-right;
transition-duration: 200ms;
}
transition-property: margin-left, margin-right;
transition-duration: 200ms;
}
.vn-gui .form-holder
{
height: inherit;
@ -304,9 +298,11 @@
-webkit-transform: translateZ(0) translateX(0em);
}
} /*+++++++++ Screen end */
/* Mobile */
@media (max-width: 960px)
@media screen and (max-width: 960px)
{
.vn-gui .action-bar span.label,
.vn-gui .htk-button > span
@ -362,3 +358,13 @@
}
}
/* Print */
@media print
{
.vn-gui .navbar,
.vn-gui .left-panel
{
display: none;
}
}

View File

@ -216,6 +216,7 @@ module.exports = new Class
var text = this.createTextNode (_(res.get ('description')));
var a = this.createElement ('a');
a.className = 'clickable';
if (res.get ('path'))
{

View File

@ -1,6 +1,7 @@
require ('htk/htk');
require ('./style.css');
require ('./report.css');
Hedera = module.exports = {
Login : require ('./login')

View File

@ -1,82 +1,54 @@
@font-face
{
font-family: 'Roboto';
src: url('roboto.ttf') format('truetype');
}
@media print
{
body
.report
{
font-size: 12pt;
-webkit-print-color-adjust: exact;
}
.sheet
.report .sheet
{
width: 100%;
page-break-after: always;
}
#topbar
}
@media screen
{
.report
{
display: none;
background-color: #EEE;
}
.report .sheet
{
/* A4 -> 210x297mm */
width: 51em;
height: 72.1em;
background-color: white;
margin: 2em auto;
box-shadow: 0 .1em .1em #CCC;
padding: 5em;
}
}
@media screen
{
body
{
background-color: #EEE;
padding-top: 3.9em;
}
.sheet
{
width: 210mm;
height: 297mm;
background-color: white;
margin: 10mm auto;
box-shadow: 0 1mm 1mm #CCC;
padding: 20mm;
}
#topbar
{
position: fixed;
top: 0;
left: 0;
right: 0;
height: 4em;
background-color: #009688;
z-index: 100;
box-shadow: 0 .1em .1em #AAA;
}
#topbar > button
{
float: right;
background-color: transparent;
color: white;
padding: .4em;
z-index: 100;
border: none;
cursor: pointer;
font-size: 1.15em;
height: 100%;
padding: 0 1em;
}
#topbar > button:hover
{
background-color: rgba(1, 1, 1, 0.2);
}
.report { font-size: .8em; }
}
*
@media
screen and (min-resolution: 120dpi),
screen and (-webkit-min-device-pixel-ratio: 1.5)
{
font-family: 'Roboto';
.report { font-size: .4em; }
}
body
.report
{
position: relative;
margin: 0;
width: 100%;
z-index: -2;
}
.sheet
.report .sheet
{
position: relative;
overflow: hidden;
@ -86,35 +58,36 @@ body
/* Widgets */
.htk-grid
.report .htk-grid
{
border-collapse: collapse;
width: 100%;
margin: 0 auto;
padding: 0;
}
.htk-grid > thead > tr
.report .htk-grid > thead > tr
{
border-bottom: 1px solid #333;
height: 10mm;
border-bottom: .01em solid #333;
height: 2em;
background-color: initial;
}
.htk-grid > thead th
.report .htk-grid > thead th
{
text-align: left;
font-weight: normal;
color: initial;
}
.htk-grid tr
.report .htk-grid tr
{
height: 2em;
border: initial;
}
.htk-grid > thead th,
.htk-grid td
.report .htk-grid > thead th,
.report .htk-grid td
{
padding-left: 3mm;
padding-left: .3em;
}
.htk-grid .cell-spin
.report .htk-grid .cell-spin
{
text-align: right;
}

View File

@ -3,49 +3,47 @@ module.exports = new Class
({
Extends: Htk.Component
,initialize: function (moduleInfo, gui)
{
this.info = moduleInfo;
this.gui = gui;
this.conn = gui.conn;
this.parent (null);
}
,open: function (batch, body)
{
this.batch = batch;
this.body = body;
this.createWindow ();
}
,print: function ()
{
this.window.print ();
this.reportWindow = body.ownerDocument.defaultView;
this.activate (batch, body);
}
,createWindow: function ()
,activate: function (batch, body)
{
this.renderReport ();
}
,openIframe: function (batch)
{
this.batch = batch;
var iframe = this.iframe = this.createElement ('iframe');
iframe.src = 'js/hedera/report.html';
iframe.style.display = 'none';
document.body.appendChild (iframe);
this.doc.body.appendChild (iframe);
var reportWindow = iframe.contentWindow;
reportWindow.addEventListener ('load',
this._onWindowLoad.bind (this));
this.window = reportWindow;
this.reportWindow = iframe.contentWindow;
this.reportWindow.addEventListener ('load',
this._onWindowLoad.bind (this));
return true;
}
,_onWindowLoad: function ()
{
this.doc = this.window.document
this.onWindowCreate ();
this.body = this.reportWindow.document.body;
this.renderReport ();
}
,onWindowCreate: function ()
,print: function ()
{
this.reportWindow.print ();
}
,renderReport: function ()
{
var builder = new Vn.Builder ();
builder.signalData = this;

View File

@ -64,6 +64,7 @@ module.exports = new Class
var a = this.createElement ('a');
a.href = res.get ('link');
a.target = '_blank';
a.className = 'clickable-img';
this._node.appendChild (a);
var img = this.createElement ('img');

View File

@ -14,53 +14,55 @@
}
/* Desktop - Laptop 1360x768 */
@media (max-resolution: 119dpi) and (min-device-width: 1340px) and (max-device-width: 1899px)
@media
screen and (max-resolution: 119dpi) and (min-device-width: 1340px) and (max-device-width: 1899px)
{
body { font-size: 10pt; }
}
/* Desktop - FHD 1920x1080 */
@media (max-resolution: 119dpi) and (min-device-width: 1900px)
@media
screen and (max-resolution: 119dpi) and (min-device-width: 1900px)
{
body { font-size: 13pt; }
}
/* Mobile - Low DPI */
@media
(min-resolution: 120dpi),
(-webkit-min-device-pixel-ratio: 1.5)
screen and (min-resolution: 120dpi),
screen and (-webkit-min-device-pixel-ratio: 1.5)
{
body { font-size: 9pt; }
}
@media
(min-resolution: 144dpi),
(-webkit-min-device-pixel-ratio: 1.5)
screen and (min-resolution: 144dpi),
screen and (-webkit-min-device-pixel-ratio: 1.5)
{
body { font-size: 11pt; }
}
/* Mobile - Normal DPI */
@media
(max-device-width: 383px) and (min-resolution: 192dpi),
(max-device-width: 383px) and (-webkit-min-device-pixel-ratio: 2)
screen and (max-device-width: 383px) and (min-resolution: 192dpi),
screen and (max-device-width: 383px) and (-webkit-min-device-pixel-ratio: 2)
{
body { font-size: 10pt; }
}
@media
(min-device-width: 384px) and (min-resolution: 192dpi),
(min-device-width: 384px) and (-webkit-min-device-pixel-ratio: 2)
screen and (min-device-width: 384px) and (min-resolution: 192dpi),
screen and (min-device-width: 384px) and (-webkit-min-device-pixel-ratio: 2)
{
body { font-size: 11pt; }
}
/* Mobile - High DPI */
@media
@media screen and
(max-device-width: 411px) and (min-resolution: 249dpi),
(max-device-width: 411px) and (-webkit-min-device-pixel-ratio: 3)
{
body { font-size: 10pt; }
}
@media
@media screen and
(min-device-width: 412px) and (min-resolution: 249dpi),
(min-device-width: 412px) and (-webkit-min-device-pixel-ratio: 3)
{
@ -72,14 +74,20 @@
body
{
font-family: 'Roboto', 'Verdana', 'Sans';
background-color: #EEE;
margin: 0;
z-index: -2;
}
@media screen {
body
{
color: #333;
position: absolute;
height: 100%;
width: 100%;
margin: 0;
background-color: #EEE;
overflow: auto;
z-index: -2;
position: absolute;
}
label,
button,
@ -116,19 +124,10 @@ a:active
color: inherit;
text-decoration: none;
}
a:hover
{
text-decoration: none;
cursor: pointer;
}
a img
{
padding: 1px;
}
a img:hover
{
opacity: 0.9;
}
h1, h2, h3, h4, h5, h6
{
margin: 0;
@ -147,6 +146,37 @@ p
margin: 0.8em 0;
}
/* Efects */
button,
.list-row,
.clickable,
.clickable-img
{
cursor: pointer;
}
button,
.list-row,
.clickable
{
transition: background-color 200ms ease-out;
}
button:hover,
.list-row:hover,
.clickable:hover
{
background-color: rgba(1, 1, 1, 0.05);
}
.clickable-img
{
transition: opacity 200ms ease-out;
}
.clickable-img:hover
{
opacity: 0.85;
}
/* Focus outline */
a:focus,
@ -418,7 +448,6 @@ img.editable
display: block;
padding: 1em;
border-bottom: 1px solid #DDD;
transition: background-color 200ms ease-out;
}
a.list-row:hover
{
@ -503,6 +532,26 @@ img.icon
display: inline-block;
vertical-align: top;
}
/* Social bar */
.htk-social-bar
{
text-align: center;
}
.htk-social-bar a
{
display: inline-block;
margin: 0 .1em;
}
.htk-social-bar img
{
height: 1.8em;
width: 1.8em;
}
} /*+++++++++ Screen end */
@media screen and (min-width: 1000px) and (max-width: 1399px)
{
.masonry-box
@ -526,21 +575,3 @@ img.icon
{
.masonry-box { width: 25%; }
}
/* Social bar */
.htk-social-bar
{
text-align: center;
}
.htk-social-bar a
{
display: inline-block;
margin: 0 .1em;
}
.htk-social-bar img
{
height: 1.8em;
width: 1.8em;
}

View File

@ -44,7 +44,7 @@ module.exports = new Class
return;
this._row = x;
this.iterChanged ();
this.changed ();
}
,get: function ()
{
@ -139,7 +139,7 @@ module.exports = new Class
{
this._row = row;
this._refreshShowText ();
this.iterChanged ();
this.changed ();
}
,_onButtonMouseDown: function (e)

View File

@ -91,7 +91,7 @@ module.exports = new Class
if (this.clickHandler)
{
Vn.Node.removeClass (this.node, 'clickable');
Vn.Node.removeClass (this.node, 'clickable-img');
this.node.removeEventListener ('click', this.clickHandler);
this.clickHander = null;
}
@ -100,7 +100,7 @@ module.exports = new Class
{
this.clickHandler = this._onClick.bind (this);
this.node.addEventListener ('click', this.clickHandler);
Vn.Node.addClass (this.node, 'clickable');
Vn.Node.addClass (this.node, 'clickable-img');
}
}

View File

@ -215,7 +215,7 @@ module.exports = new Class
,_onRowUpdate: function (model, row, columns)
{
this._childsData[row].set.iterChanged ();
this._childsData[row].set.changed ();
}
,_onRowInsert: function (model, row)

View File

@ -1,4 +1,6 @@
@media screen {
/* Grid */
.htk-grid
@ -24,10 +26,6 @@
{
background-color: rgba(1, 1, 1, 0.2);
}
.htk-grid tr
{
height: 3.5em;
}
.htk-grid > tfoot a,
.htk-grid > thead a
{
@ -37,11 +35,12 @@
{
background-color: transparent;
}
.htk-grid > tbody tr
.htk-grid > tbody > tr
{
height: 3.5em;
border-top: 1px solid #DDD;
}
.htk-grid > tbody tr:first-child
.htk-grid > tbody > tr:first-child
{
border-top: none;
}
@ -287,11 +286,6 @@ td.cell-image .htk-image
position: relative;
overflow: hidden;
}
.htk-image.clickable:hover
{
cursor: pointer;
opacity: 0.85;
}
.htk-image > img
{
display: block;
@ -637,6 +631,9 @@ td.cell-image .htk-image
border-top-color: white;
border-left-color: white;
}
} /*+++++++++ Screen end */
@keyframes spinner
{
to {transform: rotate(360deg);}

View File

@ -7,6 +7,22 @@ module.exports = new Class
Extends: Object
,Implements: Set
,Tag: 'vn-basic-set'
,Properties:
{
params:
{
type: Object
,set: function (x)
{
this._params = x;
this.changed ();
}
,get: function ()
{
return this._params;
}
}
}
,initialize: function (props)
{
@ -14,23 +30,11 @@ module.exports = new Class
this.parent (props);
}
/**
* Gets a value from the set.
*
* @param {String} paramName The parameter name
* @return {any} The value
*/
,get: function (paramName)
{
return this._params[paramName];
}
/**
* Sets a value on the set.
*
* @param {String} paramName The parameter name
* @param {any} value The new value
*/
,set: function (paramName, value)
{
this._params[paramName] = value;
@ -45,5 +49,10 @@ module.exports = new Class
this._params = {};
this.changed ();
}
,keys: function ()
{
return Object.keys (this._params);
}
});

View File

@ -79,47 +79,12 @@ module.exports = new Class
this._onHashChange ();
}
,parseHashValue: function (v, type)
{
if (v === '')
return null;
if (type && v !== undefined && v !== null)
switch (type)
{
case Boolean:
return (/^(true|1)$/i).test (v);
case Number:
return 0 + new Number (v);
case Date:
return new Date(v);
}
return v;
}
,renderHashValue: function (v)
{
switch (typeof v)
{
case 'number':
return v;
case 'boolean':
return (v) ? 'true' : 'false';
case 'object':
if (v instanceof Date)
return VnDate.strftime (v, '%Y-%m-%d');
}
return v;
}
,_onHashChange: function ()
{
if (this._hashLock || !this._key || !this._listener)
return;
var newValue = this.parseHashValue (Hash.get (this._key), this._type);
var newValue = Hash.get (this._key, this._type);
this._hashLock = true;
this._setValue (newValue, true);
@ -138,7 +103,7 @@ module.exports = new Class
this._hashLock = true;
var map = {};
map[this._key] = this.renderHashValue(newValue);
map[this._key] = newValue;
Hash.add (map);
this._hashLock = false;

View File

@ -1,5 +1,6 @@
var HashListener = require ('./hash-listener');
var VnDate = require ('./date');
/**
* Class to handle the URL.
@ -34,9 +35,9 @@ module.exports =
*
* @param {string} key The variable name
*/
,get: function (key)
,get: function (key, type)
{
return this._hashMap[key];
return this.parseValue (this._hashMap[key], type);
}
/**
@ -105,7 +106,7 @@ module.exports =
if (hash.length > 2)
hash += '&';
hash += key +'='+ map[key];
hash += key +'='+ this.renderValue (map[key]);
}
return hash;
@ -126,11 +127,48 @@ module.exports =
var kvPair = kvPairs[i].split ('=', 2);
if (kvPair[0])
newMap[kvPair[0]] = decodeURIComponent(kvPair[1]);
newMap[kvPair[0]] = decodeURIComponent (kvPair[1]);
}
this._hashMap = newMap;
this._hash = newHash;
this._listener.changed ();
}
,renderValue: function (v)
{
switch (typeof v)
{
case 'number':
return v;
case 'boolean':
return (v) ? 'true' : 'false';
case 'object':
if (v instanceof Date)
return VnDate.strftime (v, '%Y-%m-%d');
}
return v;
}
,parseValue: function (v, type)
{
if (v === '')
return null;
if (type && v !== undefined && v !== null)
switch (type)
{
case Boolean:
return (/^(true|1)$/i).test (v);
case Number:
return 0 + new Number (v);
case Date:
var date = new Date (v);
date.setHours (0, 0, 0, 0);
return date;
}
return v;
}
};

View File

@ -1,21 +1,39 @@
module.exports = new Class
({
Properties:
{
/**
* The internal object with the params.
*/
params:
{
type: Object
}
}
/**
* Gets a value from the set.
*
* @param {String} field The field name
* @return {any} The field value
* @return {*} The field value
*/
get: function (field) {}
,get: function () {}
/**
* Sets a value on the set.
*
* @param {String} field The field name
* @param {any} value The new field value
* @param {*} value The new field value
*/
,set: function (field, value) {}
,set: function () {}
/**
* Returns an array with the set keys.
*
* @return {Array} The set keys
*/
,keys: function () {}
/**
* Emits the 'change' signal on the set.
@ -24,5 +42,22 @@ module.exports = new Class
{
this.signalEmit ('change');
}
/**
* Copies all values from another set.
*
* @param {Set} source The source set
*/
,assign: function (source, keys)
{
if (!keys)
keys = source.keys ();
for (var i = 0; i < keys.length; i++)
{
var key = keys[i];
this.set (key, source.get (key));
}
}
});

View File

@ -1,5 +1,4 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

View File

@ -1,5 +1,4 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

View File

@ -1,33 +1,26 @@
*
{
font-size: 4mm;
}
.sheet
.report .sheet
{
height: auto;
}
h2
.report h2
{
font-size: 1.2em;
margin-bottom: 8mm;
margin-bottom: .8em;
font-weight: bold;
}
.header
.report .header
{
margin-bottom: 2em;
}
.header > p
.report .header > p
{
text-align: right;
margin: .1em 0;
}
.footer
.report .footer
{
font-size: 1.2em;
font-weight: bold;
margin-top: .2em;
border-top: 1px solid #333;
padding-top: .3em;
text-align: right;
}

View File

@ -42,6 +42,7 @@
<htk-column-text title="_Item" column="concept"/>
<htk-column-text title="_S1" column="Medida"/>
<htk-column-text title="_Cat" column="Categoria"/>
<htk-column-text title="_Color" column="Color"/>
<htk-column-spin title="_Price" column="price" unit="€" digits="2"/>
<htk-column-spin title="_Import" unit="€" digits="2" renderer="subtotalRenderer"/>
</htk-grid>

View File

@ -1,45 +1,42 @@
*
{
font-size: 4mm;
}
.sheet
.report .sheet
{
height: auto;
}
h1
.report h1
{
font-weight: normal;
font-size: 200%;
font-size: 4em;
text-align: center;
margin: 0 auto;
margin-bottom: 8mm;
margin-bottom: .8em;
}
.htk-grid
.report .htk-grid
{
border-collapse: collapse;
width: 100%;
margin: 0 auto;
padding: 0;
}
thead > tr
.report thead > tr
{
border-bottom: 1px solid #333;
height: 10mm;
height: .1em;
}
th
.report th
{
font-weight: normal;
}
td
.report td
{
padding-left: 2mm;
padding-left: .02em;
}
tbody > tr
.report tbody > tr
{
height: 18mm;
height: .18em;
}
.cell-image > img
.report .cell-image > img
{
width: 15mm;
width: .15em;
}

View File

@ -8,9 +8,8 @@ Hedera.ShelvesReport = new Class
,trayThickness: 2
,trayMargin: 5
,open: function (batch)
,activate: function (batch)
{
this.batch = batch;
this.title = batch.getValue ('reportTitle');
this.maxAmount = batch.getValue ('maxAmount');
this.showPacking = batch.getValue ('showPacking');
@ -108,11 +107,11 @@ Hedera.ShelvesReport = new Class
// Opens the report
this.createWindow ();
this.renderReport ();
}
,onWindowCreate: function ()
{
,renderReport: function ()
{
// Remaining amount
var remainings = this.remainings;
@ -120,8 +119,8 @@ Hedera.ShelvesReport = new Class
if (remainings.length > 0)
{
var sheet = this.doc.createElement ('div');
sheet.className = 'sheet';
this.doc.body.appendChild (sheet);
sheet.className = 'sheet remaining';
this.body.appendChild (sheet);
var title = this.doc.createElement ('h1');
title.className = 'title';
@ -133,20 +132,20 @@ Hedera.ShelvesReport = new Class
subtitle.appendChild (this.doc.createTextNode (_('Pallets')));
sheet.appendChild (subtitle);
var ul = this.doc.createElement ('ul');
var ul = this.doc.createElement ('table');
sheet.appendChild (ul);
for (var i = 0; i < remainings.length; i++)
{
var li = this.doc.createElement ('li');
var li = this.doc.createElement ('tr');
ul.appendChild (li);
var span = this.doc.createElement ('span');
var span = this.doc.createElement ('td');
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 ('td');
span.className = 'item';
span.appendChild (this.doc.createTextNode (remainings[i].name));
li.appendChild (span);
@ -154,7 +153,7 @@ Hedera.ShelvesReport = new Class
if (this.showPacking)
span.appendChild (this.doc.createTextNode (' '+ remainings[i].packing));
var span = this.doc.createElement ('span');
var span = this.doc.createElement ('td');
span.className = 'amount';
span.appendChild (this.doc.createTextNode (remainings[i].amount));
li.appendChild (span);
@ -173,7 +172,7 @@ Hedera.ShelvesReport = new Class
var sheet = this.doc.createElement ('div');
sheet.className = 'sheet';
this.doc.body.appendChild (sheet);
this.body.appendChild (sheet);
// Draws the title
@ -249,7 +248,8 @@ Hedera.ShelvesReport = new Class
,mm: function (size)
{
return size.toFixed (2) +'mm';
size *= 0.24;
return size.toFixed (2) +'em';
}
,drawBox: function (allocator, item, amount)

View File

@ -1,7 +1,12 @@
.report .sheet.remaining
{
height: auto;
}
/* Shelves */
h1
.report h1
{
font-weight: normal;
font-size: 500%;
@ -9,110 +14,110 @@ h1
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
margin-bottom: 4mm;
margin-bottom: .4em;
}
label.range-label
.report label.range-label
{
color: #777;
}
h2.subtitle
.report h2.subtitle
{
margin: 0;
font-size: 200%;
margin-bottom: 2mm;
margin-bottom: .2em;
font-weight: normal;
color: #333;
}
h1.page-number
.report h1.page-number
{
padding-left: 4mm;
padding-left: .4em;
float: right;
text-align: right;
}
.shelf
.report .shelf
{
position: relative;
margin: 0 auto;
padding-top: 10mm;
padding-top: 1em;
}
.edge,
.tray
.report .edge,
.report .tray
{
position: absolute;
border-top: 2px solid black;
box-sizing: border-box;
}
.edge
.report .edge
{
width: 0;
}
.box
.report .box
{
position: absolute;
border: 1px solid black;
border-bottom: 0;
box-sizing: border-box;
}
.box-label
.report .box-label
{
font-size: 2.55mm;
font-size: .25em;
word-wrap: break-word;
box-sizing: border-box;
padding: 1% 2%;
}
.box-label.id
.report .box-label.id
{
text-align: right;
}
.color0
.report .color0
{
background-color: #FDD !important;
}
.color1
.report .color1
{
background-color: #DFD !important;
}
.color2
.report .color2
{
background-color: #DDF !important;
}
.color3
.report .color3
{
background-color: #DFF !important;
}
.color4
.report .color4
{
background-color: #FFD !important;
}
/* Remaining amounts*/
ul
.report table
{
list-style-type: none;
padding-left: .5em;
}
li *
.report table td
{
font-size: 200%;
line-height: 200%;
font-size: 2em;
padding: .2em .5em;
}
.item-id
.report .item-id
{
display: inline-block;
text-align: right;
margin: 0 5mm;
width: 30mm;
width: 1em;
}
.item
.report .item
{
display: inline-block;
width: 80mm;
max-width: 10em;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.amount
.report .amount
{
text-align: right;
width: 1em;
color: #666;
width: 10mm;
text-align: right;
padding-right: 1mm;
}