Fixes
gitea/hedera-web/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2022-10-03 14:49:41 +02:00
parent 28ca363348
commit 5e87da735f
13 changed files with 79 additions and 58 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
hedera-web (1.408.11) stable; urgency=low hedera-web (1.408.12) stable; urgency=low
* Initial Release. * Initial Release.

View File

@ -40,28 +40,30 @@
<div class="form-group"> <div class="form-group">
<htk-entry <htk-entry
placeholder="_Name" placeholder="_Name"
column="nickname" form="iter"/> form="iter" column="nickname"/>
</div> </div>
<div class="form-group"> <div class="form-group">
<htk-entry <htk-entry
placeholder="_Address" placeholder="_Address"
column="street" form="iter"/> form="iter" column="street"/>
</div> </div>
<div class="form-group"> <div class="form-group">
<htk-entry <htk-entry
placeholder="_City" placeholder="_City"
column="city" form="iter"/> form="iter" column="city"/>
</div> </div>
<div class="form-group"> <div class="form-group">
<htk-entry <htk-entry
placeholder="_ZipCode" placeholder="_ZipCode"
column="postalCode" form="iter"/> form="iter" column="postalCode"/>
</div> </div>
<div class="form-group"> <div class="form-group">
<htk-combo <htk-combo
placeholder="_Country" placeholder="_Country"
form="iter" column="countryFk"
id="country" id="country"
one-way="true"> one-way="true"
one-time="true">
<db-model property="model"> <db-model property="model">
SELECT id, country FROM vn.country SELECT id, country FROM vn.country
ORDER BY country ORDER BY country

View File

@ -143,9 +143,9 @@ Hedera.Confirm = new Class({
conn: this.conn, conn: this.conn,
hash: this.hash hash: this.hash
}); });
tpv.pay(payAmount, this.$.orderForm.$.companyFk); tpv.pay(payAmount, this.$.order.companyFk);
} else } else
this.hash.setAll({'form': 'ecomerce/orders'}); this.hash.setAll({form: 'ecomerce/orders'});
} }
}); });

View File

@ -1,6 +1,6 @@
<vn> <vn>
<vn-group> <vn-group>
<db-form id="order-form" on-ready="onOrderReady"> <db-form v-model="order" on-ready="onOrderReady">
<db-model property="model" result-index="1"> <db-model property="model" result-index="1">
CALL myBasket_getTax; CALL myBasket_getTax;
SELECT o.id, o.sent, o.notes, o.companyFk, SELECT o.id, o.sent, o.notes, o.companyFk,
@ -36,26 +36,17 @@
<div class="delivery"> <div class="delivery">
<h6><t>ShippingInformation</t></h6> <h6><t>ShippingInformation</t></h6>
<p> <p>
<t>Delivery at</t> <t>Delivery at</t> {{Vn.Value.format(order.sent, _('%D'))}}
<htk-text format="%D" form="order-form" column="sent"/>
</p> </p>
<p> <p>
<span id="method"><t>Agency</t></span> <span id="method"><t>Agency</t></span> {{order.agency}}
<htk-text form="order-form" column="agency"/>
</p> </p>
</div> </div>
<div id="address" class="address vn-mt-md"> <div id="address" class="address vn-mt-md">
<h6><t>DeliveryAddress</t></h6> <h6><t>DeliveryAddress</t></h6>
<p> <p>{{order.nickname}}</p>
<htk-text form="order-form" column="nickname"/> <p>{{order.street}}</p>
</p> <p>{{order.postalCode}}, {{order.city}}</p>
<p>
<htk-text form="order-form" column="street"/>
</p>
<p>
<htk-text form="order-form" column="postalCode"/>,
<htk-text form="order-form" column="city"/>
</p>
</div> </div>
</div> </div>
</div> </div>
@ -64,9 +55,7 @@
<table class="debt-info"> <table class="debt-info">
<tbody> <tbody>
<tr> <tr>
<td> <td><t>Previous balance</t></td>
<t>Previous balance</t>
</td>
<td class="currency"> <td class="currency">
<htk-text format="%.2d€" id="debt"/> <htk-text format="%.2d€" id="debt"/>
</td> </td>
@ -76,7 +65,7 @@
<t>Order total</t> <t>Order total</t>
</td> </td>
<td class="currency"> <td class="currency">
<htk-text format="%.2d€" form="order-form" column="taxableBase"/> {{Vn.Value.format(order.taxableBase, _('%.2d€'))}}
</td> </td>
</tr> </tr>
<tr> <tr>
@ -84,7 +73,7 @@
<t>Order VAT</t> <t>Order VAT</t>
</td> </td>
<td class="currency"> <td class="currency">
<htk-text format="%.2d€" form="order-form" column="tax"/> {{Vn.Value.format(order.tax, _('%.2d€'))}}
</td> </td>
</tr> </tr>
<tr class="total-debt sum-total"> <tr class="total-debt sum-total">
@ -100,7 +89,7 @@
<t>Credit</t> <t>Credit</t>
</td> </td>
<td class="currency"> <td class="currency">
<htk-text format="%.2d€" form="order-form" column="credit"/> {{Vn.Value.format(order.credit, _('%.2d€'))}}
</td> </td>
</tr> </tr>
<tr id="exceeded-info" class="exceeded-info sum-total"> <tr id="exceeded-info" class="exceeded-info sum-total">
@ -183,8 +172,8 @@
</db-model> </db-model>
<custom> <custom>
<div class="transfer-account"> <div class="transfer-account">
<p><htk-text form="iter" column="name"/></p> <p>{{iter.name}}</p>
<p><htk-text form="iter" column="iban"/></p> <p>{{iter.iban}}</p>
</div> </div>
</custom> </custom>
</htk-repeater> </htk-repeater>

View File

@ -13,7 +13,7 @@ Hedera.Ticket = new Class({
onPrintClick: function() { onPrintClick: function() {
let params = Vn.Url.makeUri({ let params = Vn.Url.makeUri({
authorization: this.conn.token, authorization: this.conn.token,
ticketId: this.$.ticketId.value, ticketId: this.hash.$.ticket,
recipientId: this.gui.user.id, recipientId: this.gui.user.id,
type: 'deliveryNote' type: 'deliveryNote'
}); });

View File

@ -60,6 +60,15 @@ module.exports = new Class({
return this._oneWay; return this._oneWay;
} }
}, },
oneTime: {
type: Boolean
,set: function(x) {
this._oneTime = x;
}
,get: function() {
return this._oneTime;
}
},
editable: { editable: {
type: Boolean type: Boolean
,set: function(x) { ,set: function(x) {

View File

@ -64,6 +64,15 @@ module.exports = new Class({
,get: function() { ,get: function() {
return this._oneWay; return this._oneWay;
} }
},
oneTime: {
type: Boolean
,set: function(x) {
this._oneTime = x;
}
,get: function() {
return this._oneTime;
}
} }
} }

View File

@ -51,10 +51,9 @@ module.exports = new Class({
,_value: undefined ,_value: undefined
,_type: null ,_type: null
,_param: null ,_param: null
,_paramLock: false
,_lot: null ,_lot: null
,_sourceLock: false
,_name: null ,_name: null
,_lotLock: false
,_oneWay: false ,_oneWay: false
,_setValue: function(newValue) { ,_setValue: function(newValue) {
@ -80,53 +79,57 @@ module.exports = new Class({
this._type = type; this._type = type;
this._onLotChange(); this._onLotChange();
} }
,_onSourceChange(newValue) {
if (this._oneTime && this._value !== undefined)
return;
this._sourceLock = true;
this._setValue(newValue);
this._sourceLock = false;
}
,_setParam: function(param) { ,_setParam: function(param) {
this.link({_lot: null});
this.link({_param: param}, {changed: this._onParamChange}); this.link({_param: param}, {changed: this._onParamChange});
this._refreshParam(); this._refreshParam();
} }
,_onParamChange: function() { ,_onParamChange: function() {
if (this._paramLock || !this._param) if (this._sourceLock || !this._param) return;
return; this._onSourceChange(this._param.value);
this._paramLock = true;
this._setValue(this._param.value);
this._paramLock = false;
} }
,_refreshParam: function() { ,_refreshParam: function() {
if (this._paramLock || !this._param) if (this._sourceLock || !this._param || this._oneWay)
return; return;
this._paramLock = true; this._sourceLock = true;
this._param.value = this._value; this._param.value = this._value;
this._paramLock = false; this._sourceLock = false;
} }
,_setLot: function(lot) { ,_setLot: function(lot) {
this.link({_param: null});
this.link({_lot: lot}, {change: this._onLotChange}); this.link({_lot: lot}, {change: this._onLotChange});
this._onLotChange(); this._onLotChange();
} }
,_onLotChange: function() { ,_onLotChange: function() {
if (this._lotLock || !this._name || !this._lot) if (this._sourceLock || !this._lot || !this._name)
return; return;
var newValue = this._lot.get(this._name, this._type); var newValue = this._lot.get(this._name, this._type);
this._onSourceChange(newValue);
this._lotLock = true;
this._setValue(newValue);
this._lotLock = false;
} }
,_refreshLot: function() { ,_refreshLot: function() {
if (this._lotLock || !this._name || !this._lot || this._oneWay) if (this._sourceLock || !this._name || !this._lot || this._oneWay)
return; return;
this._lotLock = true; this._sourceLock = true;
this._lot.set(this._name, this._value); this._lot.set(this._name, this._value);
this._lotLock = false; this._sourceLock = false;
} }
,_setName: function(name) { ,_setName: function(name) {

View File

@ -74,6 +74,15 @@ module.exports = new Class({
,get: function() { ,get: function() {
return this._oneWay; return this._oneWay;
} }
},
oneTime: {
type: Boolean
,set: function(x) {
this._oneTime = x;
}
,get: function() {
return this._oneTime;
}
} }
} }
}); });

View File

@ -1,6 +1,6 @@
{ {
"name": "hedera-web", "name": "hedera-web",
"version": "1.408.11", "version": "1.408.12",
"description": "Verdnatura web page", "description": "Verdnatura web page",
"license": "GPL-3.0", "license": "GPL-3.0",
"repository": { "repository": {

View File

@ -50,7 +50,7 @@ class JsonService extends RestService {
if (_ENABLE_DEBUG || $errno & $eUser) if (_ENABLE_DEBUG || $errno & $eUser)
$json->message = $message; $json->message = $message;
else else
$json->message = s('Something went wrong'); $json->message = \s('Something went wrong');
if (_ENABLE_DEBUG) { if (_ENABLE_DEBUG) {
$json->code = $errno; $json->code = $errno;
@ -80,7 +80,7 @@ class JsonService extends RestService {
$json->message = $e->getMessage(); $json->message = $e->getMessage();
} else { } else {
$json->exception = 'Exception'; $json->exception = 'Exception';
$json->message = s('Something went wrong'); $json->message = \s('Something went wrong');
} }
if (_ENABLE_DEBUG) { if (_ENABLE_DEBUG) {

View File

@ -34,7 +34,7 @@ class RestService extends Service {
$isAuthorized = $db->getValue('SELECT myUser_checkRestPriv(#)', $isAuthorized = $db->getValue('SELECT myUser_checkRestPriv(#)',
[$_REQUEST['method']]); [$_REQUEST['method']]);
if (!$isAuthorized) if (!$isAuthorized)
throw new ForbiddenException(s('You don\'t have enough privileges')); throw new ForbiddenException(\s('You don\'t have enough privileges'));
if ($method::SECURITY == Security::DEFINER) { if ($method::SECURITY == Security::DEFINER) {
$methodDb = $db; $methodDb = $db;
@ -42,7 +42,7 @@ class RestService extends Service {
$methodDb = $this->getUserDb($_SESSION['user']); $methodDb = $this->getUserDb($_SESSION['user']);
if ($method::PARAMS !== NULL && !$method->checkParams($_REQUEST, $method::PARAMS)) if ($method::PARAMS !== NULL && !$method->checkParams($_REQUEST, $method::PARAMS))
throw new UserException (s('Missing parameters')); throw new UserException (\s('Missing parameters'));
Locale::addPath('rest/'. dirname($_REQUEST['method'])); Locale::addPath('rest/'. dirname($_REQUEST['method']));
@ -52,7 +52,7 @@ class RestService extends Service {
$res = $method->run($methodDb); $res = $method->run($methodDb);
} catch (Db\Exception $e) { } catch (Db\Exception $e) {
if ($e->getCode() == 1644) if ($e->getCode() == 1644)
throw new UserException(s($e->getMessage())); throw new UserException(\s($e->getMessage()));
} }
if ($method::SECURITY == Security::DEFINER) if ($method::SECURITY == Security::DEFINER)

View File

@ -1,5 +1,5 @@
{ {
"buildDir": "build", "buildDir": "build",
"devServerPort": 9000, "devServerPort": 9090,
"entry": "./app.js" "entry": "./app.js"
} }