Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 5334-editDepartment

This commit is contained in:
Carlos Satorres 2023-05-31 12:04:26 +02:00
commit 489012886b
13 changed files with 41 additions and 23 deletions

View File

@ -34,7 +34,7 @@
<vn-autocomplete vn-one required="true"
label="Warehouse"
ng-model="$ctrl.dms.warehouseId"
data="Warehouses"
data="warehouses"
show-field="name"
value-field="id">
</vn-autocomplete>

View File

@ -157,14 +157,14 @@
<vn-autocomplete
label="Warehouse Out"
ng-model="$ctrl.travelFilterParams.warehouseOutFk"
data="Warehouses"
data="warehouses"
show-field="name"
value-field="id">
</vn-autocomplete>
<vn-autocomplete
label="Warehouse In"
ng-model="$ctrl.travelFilterParams.warehouseInFk"
data="Warehouses"
data="warehouses"
show-field="name"
value-field="id">
</vn-autocomplete>

View File

@ -88,7 +88,7 @@
vn-one
label="Warehouse"
ng-model="filter.warehouseFk"
data="Warehouses">
data="warehouses">
</vn-autocomplete>
<vn-autocomplete
vn-one

View File

@ -84,7 +84,7 @@
vn-one
label="Warehouse"
ng-model="filter.warehouseFk"
data="Warehouses"
data="warehouses"
show-field="name"
value-field="id">
</vn-autocomplete>

View File

@ -101,6 +101,9 @@ module.exports = Self => {
}
}
const query = `CALL vn.ticket_recalc(?)`;
await Self.rawSql(query, [refundTicket.id], myOptions);
if (tx) await tx.commit();
return refundTicket;

View File

@ -30,7 +30,7 @@
</vn-autocomplete>
<vn-autocomplete vn-one
required="true"
data="Warehouses"
data="warehouses"
label="Warehouse"
show-field="name"
value-field="id"

View File

@ -34,7 +34,7 @@
<vn-autocomplete vn-one required="true"
label="Warehouse"
ng-model="$ctrl.dms.warehouseId"
data="Warehouses"
data="warehouses"
show-field="name"
value-field="id">
</vn-autocomplete>

View File

@ -61,20 +61,20 @@
</vn-th>
<vn-th shrink></vn-th>
<vn-th shrink></vn-th>
<vn-th shrink>Visible</vn-th>
<vn-th shrink>Available</vn-th>
<vn-th>Id</vn-th>
<vn-th shrink>Quantity</vn-th>
<vn-th expand>Item</vn-th>
<vn-th number>Price</vn-th>
<vn-th number>Disc</vn-th>
<vn-th number>Amount</vn-th>
<vn-th shrink>Packaging</vn-th>
<vn-th ng-click="$ctrl.sortBy('visible')" field="visible" shrink>Visible</vn-th>
<vn-th ng-click="$ctrl.sortBy('available')" field="available" shrink>Available</vn-th>
<vn-th ng-click="$ctrl.sortBy('itemFk')" field="itemFk">Id</vn-th>
<vn-th ng-click="$ctrl.sortBy('quantity')" field="quantity" shrink>Quantity</vn-th>
<vn-th ng-click="$ctrl.sortBy('concept')" field="concept" expand>Item</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('amount')" field="amount" number>Amount</vn-th>
<vn-th ng-click="$ctrl.sortBy('itemPackingTypeFk')" field="itemPackingTypeFk" shrink>Packaging</vn-th>
<vn-th shrink></vn-th>
</vn-tr>
</vn-thead>
<vn-tbody>
<vn-tr ng-repeat="sale in $ctrl.sales">
<vn-tr ng-repeat="sale in $ctrl.sales | orderBy: $ctrl.propertyName:$ctrl.reverse">
<vn-td shrink>
<vn-check tabindex="-1"
ng-model="sale.checked">
@ -481,7 +481,7 @@
on-accept="$ctrl.transferSales($ctrl.transfer.ticketId)">
</vn-confirm>
<vn-confirm
<vn-confirm
vn-id="claimConfirm"
question="Do you want to continue?"
message="Claim out of time"
@ -515,7 +515,7 @@
name="claim"
ng-click="$ctrl.createClaim()"
ng-if="$ctrl.isClaimable">
Add claim
Add claim
</vn-item>
<vn-item translate
name="reserve"

View File

@ -10,6 +10,11 @@ class Controller extends Section {
this.getConfig();
}
sortBy(propertyName) {
this.reverse = (this.propertyName === propertyName) ? !this.reverse : false;
this.propertyName = propertyName;
}
get manaCode() {
return this._manaCode;
}

View File

@ -758,5 +758,15 @@ describe('Ticket', () => {
expect(controller.$.editDiscount.hide).toHaveBeenCalledWith();
});
});
describe('sortBy()', () => {
it('should set reverse and propertyName properties', () => {
const propertyName = 'id';
controller.sortBy(propertyName);
expect(controller.propertyName).toEqual(propertyName);
expect(controller.reverse).toEqual(false);
});
});
});
});

View File

@ -107,7 +107,7 @@
vn-one
label="Warehouse"
ng-model="filter.warehouseFk"
data="Warehouses">
data="warehouses">
</vn-autocomplete>
<vn-autocomplete
vn-one

View File

@ -57,14 +57,14 @@
<vn-autocomplete vn-one
label="Warehouse Out"
ng-model="filter.warehouseOutFk"
data="Warehouses"
data="warehouses"
show-field="name"
value-field="id">
</vn-autocomplete>
<vn-autocomplete vn-one
label="Warehouse In"
ng-model="filter.warehouseInFk"
data="Warehouses"
data="warehouses"
show-field="name"
value-field="id">
</vn-autocomplete>

View File

@ -34,7 +34,7 @@
<vn-autocomplete vn-one required="true"
label="Warehouse"
ng-model="$ctrl.dms.warehouseId"
data="Warehouses"
data="warehouses"
show-field="name"
value-field="id">
</vn-autocomplete>