forked from verdnatura/hedera-web
Merge
This commit is contained in:
commit
6666304332
|
@ -7,7 +7,7 @@
|
||||||
SELECT o.id, o.date_send, o.note, o.company_id,
|
SELECT o.id, o.date_send, o.note, o.company_id,
|
||||||
ag.description agency, v.code method,
|
ag.description agency, v.code method,
|
||||||
ad.consignee, ad.zip_code, ad.city, ad.name address,
|
ad.consignee, ad.zip_code, ad.city, ad.name address,
|
||||||
t.*, c.credit, clientGetDebt(NULL) debt
|
t.*, c.credit, myClientGetDebt(NULL) debt
|
||||||
FROM basket o
|
FROM basket o
|
||||||
JOIN vn2008.Agencias ag ON ag.Id_Agencia = o.agency_id
|
JOIN vn2008.Agencias ag ON ag.Id_Agencia = o.agency_id
|
||||||
LEFT JOIN address_view ad ON ad.id = o.address_id
|
LEFT JOIN address_view ad ON ad.id = o.address_id
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
conditional-func="balanceConditionalFunc">
|
conditional-func="balanceConditionalFunc">
|
||||||
<db-form id="debt">
|
<db-form id="debt">
|
||||||
<db-model property="model">
|
<db-model property="model">
|
||||||
SELECT clientGetDebt(NULL) debt
|
SELECT -myClientGetDebt(NULL) debt
|
||||||
</db-model>
|
</db-model>
|
||||||
</db-form>
|
</db-form>
|
||||||
</htk-text>
|
</htk-text>
|
||||||
|
|
|
@ -24,9 +24,24 @@
|
||||||
{
|
{
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
.ticket .packages
|
||||||
|
{
|
||||||
|
margin-top: 1em;
|
||||||
|
padding-top: 1em;
|
||||||
|
border-top: 1px solid #DDD;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
/* Lines */
|
/* Lines */
|
||||||
|
|
||||||
|
.ticket .line > .photo
|
||||||
|
{
|
||||||
|
margin-right: 1em;
|
||||||
|
float: left;
|
||||||
|
border-radius: 50%;
|
||||||
|
height: 3.2em;
|
||||||
|
width: 3.2em;
|
||||||
|
}
|
||||||
.ticket .line
|
.ticket .line
|
||||||
{
|
{
|
||||||
padding: .5em 0;
|
padding: .5em 0;
|
||||||
|
|
|
@ -34,5 +34,11 @@ Hedera.Ticket = new Class
|
||||||
var row = form.$;
|
var row = form.$;
|
||||||
return row.quantity * row.price * ((100 - row.discount) / 100);
|
return row.quantity * row.price * ((100 - row.discount) / 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
,onPackagesChanged: function (model)
|
||||||
|
{
|
||||||
|
this.$('packages').node.style.display =
|
||||||
|
model.numRows > 0 ? 'block' : 'none';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
<custom>
|
<custom>
|
||||||
<div class="line">
|
<div class="line">
|
||||||
<htk-image
|
<htk-image
|
||||||
value="{{Foto}}"
|
value="{{image}}"
|
||||||
class="photo"
|
class="photo"
|
||||||
directory="catalog"
|
directory="catalog"
|
||||||
subdir="200x200"
|
subdir="200x200"
|
||||||
|
@ -76,6 +76,37 @@
|
||||||
</div>
|
</div>
|
||||||
</custom>
|
</custom>
|
||||||
</htk-repeater>
|
</htk-repeater>
|
||||||
|
<htk-repeater form-id="iter" id="packages" class="packages">
|
||||||
|
<db-model
|
||||||
|
property="model"
|
||||||
|
on-status-changed="onPackagesChanged"
|
||||||
|
batch="batch">
|
||||||
|
<custom>
|
||||||
|
CALL myTicketGetPackages (#ticket)
|
||||||
|
</custom>
|
||||||
|
</db-model>
|
||||||
|
<custom>
|
||||||
|
<div class="line">
|
||||||
|
<htk-image
|
||||||
|
form="iter"
|
||||||
|
column="image"
|
||||||
|
class="photo"
|
||||||
|
directory="catalog"
|
||||||
|
subdir="200x200"
|
||||||
|
full-dir="900x900"/>
|
||||||
|
<p class="subtotal">
|
||||||
|
<htk-text form="iter" column="quantity"/>
|
||||||
|
</p>
|
||||||
|
<p class="concept">
|
||||||
|
<htk-text form="iter" column="name"/>
|
||||||
|
</p>
|
||||||
|
<p class="amount">
|
||||||
|
@<htk-text form="iter" column="id"/>
|
||||||
|
</p>
|
||||||
|
<div class="clear"/>
|
||||||
|
</div>
|
||||||
|
</custom>
|
||||||
|
</htk-repeater>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</vn>
|
</vn>
|
||||||
|
|
|
@ -73,6 +73,9 @@ module.exports = new Class
|
||||||
,_onLogin: function ()
|
,_onLogin: function ()
|
||||||
{
|
{
|
||||||
this._freeLogin ();
|
this._freeLogin ();
|
||||||
|
|
||||||
|
if (this._gui)
|
||||||
|
return;
|
||||||
|
|
||||||
var gui = this._gui = new Gui ({
|
var gui = this._gui = new Gui ({
|
||||||
conn: this._conn,
|
conn: this._conn,
|
||||||
|
|
|
@ -94,6 +94,8 @@ module.exports = new Class
|
||||||
localStorage.setItem ('hederaCookies', true);
|
localStorage.setItem ('hederaCookies', true);
|
||||||
Htk.Toast.showWarning (_('By using this site you accept cookies'));
|
Htk.Toast.showWarning (_('By using this site you accept cookies'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.supplantInit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
,hide: function ()
|
,hide: function ()
|
||||||
|
@ -482,18 +484,27 @@ module.exports = new Class
|
||||||
}
|
}
|
||||||
|
|
||||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++ Supplant
|
//++++++++++++++++++++++++++++++++++++++++++++++++++++++ Supplant
|
||||||
|
|
||||||
|
,supplantInit: function ()
|
||||||
|
{
|
||||||
|
var user = sessionStorage.getItem ('supplantUser');
|
||||||
|
|
||||||
|
if (user != null)
|
||||||
|
this.supplantUser (user);
|
||||||
|
}
|
||||||
|
|
||||||
,supplantUser: function (user, callback)
|
,supplantUser: function (user, callback)
|
||||||
{
|
{
|
||||||
this._conn.supplantUser (user,
|
this._conn.supplantUser (user,
|
||||||
this._onUserSupplant.bind (this, callback));
|
this._onUserSupplant.bind (this, callback, user));
|
||||||
}
|
}
|
||||||
|
|
||||||
,_onUserSupplant: function (callback, supplantOk)
|
,_onUserSupplant: function (callback, user, supplantOk)
|
||||||
{
|
{
|
||||||
if (!supplantOk)
|
if (!supplantOk)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
sessionStorage.setItem ('supplantUser', user);
|
||||||
this.loadMenu ();
|
this.loadMenu ();
|
||||||
|
|
||||||
var sql = 'SELECT nickname FROM account.userView';
|
var sql = 'SELECT nickname FROM account.userView';
|
||||||
|
@ -514,6 +525,8 @@ module.exports = new Class
|
||||||
{
|
{
|
||||||
Vn.Node.hide (this.$.supplant);
|
Vn.Node.hide (this.$.supplant);
|
||||||
this._conn.supplantEnd ();
|
this._conn.supplantEnd ();
|
||||||
|
sessionStorage.removeItem ('supplantUser',
|
||||||
|
sessionStorage.getItem ('supplantUser'));
|
||||||
this.loadMenu ();
|
this.loadMenu ();
|
||||||
this._onFormChange ();
|
this._onFormChange ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
"style-loader": "^0.19.0",
|
"style-loader": "^0.19.0",
|
||||||
"url-loader": "^0.5.7",
|
"url-loader": "^0.5.7",
|
||||||
"webpack": "^3.10.0",
|
"webpack": "^3.10.0",
|
||||||
"webpack-chunk-hash": "^0.5.0",
|
|
||||||
"webpack-dev-server": "^2.9.1",
|
"webpack-dev-server": "^2.9.1",
|
||||||
"webpack-merge": "^4.1.0"
|
"webpack-merge": "^4.1.0"
|
||||||
},
|
},
|
||||||
|
|
|
@ -14,4 +14,10 @@ Hedera.DeliveryNote = new Class
|
||||||
var discount = form.get ('discount');
|
var discount = form.get ('discount');
|
||||||
return form.get ('quantity') * price * ((100 - discount) / 100);
|
return form.get ('quantity') * price * ((100 - discount) / 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
,onPackagesChanged: function (model)
|
||||||
|
{
|
||||||
|
this.$('packages').node.style.display =
|
||||||
|
model.numRows > 0 ? 'block' : 'none';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -23,3 +23,10 @@
|
||||||
border-top: 1px solid #333;
|
border-top: 1px solid #333;
|
||||||
padding-top: .3em;
|
padding-top: .3em;
|
||||||
}
|
}
|
||||||
|
.packages
|
||||||
|
{
|
||||||
|
width: 50%;
|
||||||
|
padding-top: 1em;
|
||||||
|
margin-left: 0;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
|
@ -52,5 +52,17 @@
|
||||||
<htk-text lot="ticket" name="total" format="%.2d€"/>
|
<htk-text lot="ticket" name="total" format="%.2d€"/>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
<htk-grid id="packages" class="packages">
|
||||||
|
<db-model
|
||||||
|
property="model"
|
||||||
|
conn="conn"
|
||||||
|
lot="hash"
|
||||||
|
on-status-changed="onPackagesChanged">
|
||||||
|
CALL myTicketGetPackages (#ticket)
|
||||||
|
</db-model>
|
||||||
|
<htk-column-spin title="_Ref" column="id"/>
|
||||||
|
<htk-column-spin title="_Amount" column="quantity"/>
|
||||||
|
<htk-column-text title="_Item" column="name"/>
|
||||||
|
</htk-grid>
|
||||||
</div>
|
</div>
|
||||||
</vn>
|
</vn>
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var webpack = require('webpack');
|
var webpack = require('webpack');
|
||||||
var AssetsWebpackPlugin = require('assets-webpack-plugin');
|
var AssetsWebpackPlugin = require('assets-webpack-plugin');
|
||||||
var WebpackChunkHash = require('webpack-chunk-hash');
|
|
||||||
var merge = require('webpack-merge');
|
var merge = require('webpack-merge');
|
||||||
var wpConfig = require('./webpack.config.json');
|
var wpConfig = require('./webpack.config.json');
|
||||||
|
|
||||||
|
@ -61,8 +60,7 @@ var prodConfig = {
|
||||||
new AssetsWebpackPlugin({
|
new AssetsWebpackPlugin({
|
||||||
path: outputPath
|
path: outputPath
|
||||||
}),
|
}),
|
||||||
new webpack.HashedModuleIdsPlugin(),
|
new webpack.HashedModuleIdsPlugin()
|
||||||
new WebpackChunkHash()
|
|
||||||
],
|
],
|
||||||
devtool: 'source-map'
|
devtool: 'source-map'
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue