Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix into dev
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2023-06-20 09:20:54 +02:00
commit 5a6a18c76a
9 changed files with 28 additions and 26 deletions

View File

@ -4,4 +4,4 @@ apps:
instances: 1 instances: 1
max_restarts: 3 max_restarts: 3
restart_delay: 15000 restart_delay: 15000
node_args: --tls-min-v1.0 node_args: --tls-min-v1.0 --openssl-legacy-provider

View File

@ -200,22 +200,20 @@ module.exports = function(Self) {
const connector = this.dataSource.connector; const connector = this.dataSource.connector;
let conn; let conn;
let res; let res;
const opts = Object.assign({}, options);
try { try {
if (userId) { if (userId) {
conn = await new Promise((resolve, reject) => { if (!options.transaction) {
connector.client.getConnection(function(err, conn) { options = Object.assign({}, options);
if (err) conn = await new Promise((resolve, reject) => {
reject(err); connector.client.getConnection(function(err, conn) {
else if (err)
resolve(conn); reject(err);
else
resolve(conn);
});
}); });
}); options.transaction = {
const opts = Object.assign({}, options);
if (!opts.transaction) {
opts.transaction = {
connection: conn, connection: conn,
connector connector
}; };
@ -223,15 +221,14 @@ module.exports = function(Self) {
await connector.executeP( await connector.executeP(
'CALL account.myUser_loginWithName((SELECT name FROM account.user WHERE id = ?))', 'CALL account.myUser_loginWithName((SELECT name FROM account.user WHERE id = ?))',
[userId], opts [userId], options
); );
} }
res = await connector.executeP(query, params, opts); res = await connector.executeP(query, params, options);
if (userId) { if (userId)
await connector.executeP('CALL account.myUser_logout()', null, opts); await connector.executeP('CALL account.myUser_logout()', null, options);
}
} finally { } finally {
if (conn) conn.release(); if (conn) conn.release();
} }

View File

@ -21,7 +21,6 @@ module.exports = Self => {
Self.confirm = async(ctx, orderFk) => { Self.confirm = async(ctx, orderFk) => {
const userId = ctx.req.accessToken.userId; const userId = ctx.req.accessToken.userId;
const query = `CALL hedera.order_confirmWithUser(?, ?)`; const query = `CALL hedera.order_confirmWithUser(?, ?)`;
const response = await Self.rawSql(query, [orderFk, userId], {userId}); const response = await Self.rawSql(query, [orderFk, userId], {userId});

View File

@ -5,3 +5,4 @@ columns:
beneficiary: beneficiary beneficiary: beneficiary
supplierFk: supplier supplierFk: supplier
bankEntityFk: bank entity bankEntityFk: bank entity
accountingFk: ledger account

View File

@ -5,3 +5,4 @@ columns:
beneficiary: beneficiario beneficiary: beneficiario
supplierFk: proveedor supplierFk: proveedor
bankEntityFk: entidad bancaria bankEntityFk: entidad bancaria
accountingFk: cuenta contable

View File

@ -69,7 +69,7 @@
<vn-th ng-click="$ctrl.sortBy('price')" field="price" number>Price</vn-th> <vn-th ng-click="$ctrl.sortBy('price')" field="price" number>Price</vn-th>
<vn-th ng-click="$ctrl.sortBy('discount')" field="discount" number>Disc</vn-th> <vn-th ng-click="$ctrl.sortBy('discount')" field="discount" number>Disc</vn-th>
<vn-th ng-click="$ctrl.sortBy('amount')" field="amount" number>Amount</vn-th> <vn-th ng-click="$ctrl.sortBy('amount')" field="amount" number>Amount</vn-th>
<vn-th ng-click="$ctrl.sortBy('itemPackingTypeFk')" field="itemPackingTypeFk" shrink>Packaging</vn-th> <vn-th ng-click="$ctrl.sortBy('item.itemPackingTypeFk')" field="itemPackingTypeFk" shrink>Packaging</vn-th>
<vn-th shrink></vn-th> <vn-th shrink></vn-th>
</vn-tr> </vn-tr>
</vn-thead> </vn-thead>
@ -202,7 +202,7 @@
</span> </span>
</vn-td> </vn-td>
<vn-td number> <vn-td number>
{{$ctrl.getSaleTotal(sale) | currency: 'EUR':2}} {{sale.amount | currency: 'EUR':2}}
</vn-td> </vn-td>
<vn-td shrink> <vn-td shrink>
{{::sale.item.itemPackingTypeFk | dashIfEmpty}} {{::sale.item.itemPackingTypeFk | dashIfEmpty}}

View File

@ -34,6 +34,11 @@ class Controller extends Section {
} }
get sales() { get sales() {
if (this._sales) {
for (let sale of this._sales)
sale.amount = this.getSaleTotal(sale);
}
return this._sales; return this._sales;
} }
@ -49,6 +54,7 @@ class Controller extends Section {
return ticketState && ticketState.state.code; return ticketState && ticketState.state.code;
} }
getConfig() { getConfig() {
let filter = { let filter = {
fields: ['daysForWarningClaim'], fields: ['daysForWarningClaim'],

View File

@ -1,5 +1,5 @@
module.exports = Self => { module.exports = Self => {
Self.remoteMethodCtx, ('getLeaves', { Self.remoteMethodCtx('getLeaves', {
description: 'Returns the nodes for a department', description: 'Returns the nodes for a department',
accepts: [{ accepts: [{
arg: 'parentId', arg: 'parentId',

View File

@ -242,7 +242,7 @@
</tfoot> </tfoot>
</table> </table>
</div> </div>
<div class="columns vn-mt-xl" v-if="invoice.payMethodCode == 'wireTransfer' && invoice.iban"> <div class="columns vn-mt-lg" v-if="(invoice.payMethodCode == 'wireTransfer' && invoice.iban) || ticketObservations">
<div class="size50 pull-left no-page-break"> <div class="size50 pull-left no-page-break">
<div class="panel"> <div class="panel">
<div class="header">{{$t('observations')}}</div> <div class="header">{{$t('observations')}}</div>
@ -267,9 +267,7 @@
v-bind:left-text="$t('invoiceRef', [invoice.ref])" v-bind:left-text="$t('invoiceRef', [invoice.ref])"
v-bind:center-text="client.socialName" v-bind:center-text="client.socialName"
v-bind:recipient-id="client.id" v-bind:recipient-id="client.id"
v-bind="$props" v-bind="$props">
>
</report-footer> </report-footer>
</template> </template>
</report-body> </report-body>