refs #5327 warnFix(ticket_sale): fix orderBy amount itemPackingType #1604
|
@ -69,7 +69,7 @@
|
|||
<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 ng-click="$ctrl.sortBy('item.itemPackingTypeFk')" field="itemPackingTypeFk" shrink>Packaging</vn-th>
|
||||
<vn-th shrink></vn-th>
|
||||
</vn-tr>
|
||||
</vn-thead>
|
||||
|
@ -202,7 +202,7 @@
|
|||
</span>
|
||||
</vn-td>
|
||||
<vn-td number>
|
||||
{{$ctrl.getSaleTotal(sale) | currency: 'EUR':2}}
|
||||
{{sale.amount | currency: 'EUR':2}}
|
||||
</vn-td>
|
||||
<vn-td shrink>
|
||||
{{::sale.item.itemPackingTypeFk | dashIfEmpty}}
|
||||
|
|
|
@ -34,6 +34,11 @@ class Controller extends Section {
|
|||
}
|
||||
|
||||
get sales() {
|
||||
if (this._sales) {
|
||||
|
||||
for (let sale of this._sales)
|
||||
sale.amount = this.getSaleTotal(sale);
|
||||
}
|
||||
|
||||
return this._sales;
|
||||
}
|
||||
|
||||
|
@ -49,6 +54,7 @@ class Controller extends Section {
|
|||
|
||||
return ticketState && ticketState.state.code;
|
||||
}
|
||||
|
||||
getConfig() {
|
||||
let filter = {
|
||||
fields: ['daysForWarningClaim'],
|
||||
|
|
Loading…
Reference in New Issue
Se te ocurrix alguna manera més eficient?
El problema ve de que AngularJS necesita tindre una propietat per a poder ordenar per ella, entonces he creat .amount
En problema de fer-ho en el Set es que quan es modifica el descompte o s'afegix no entra per el Set.