2019-10-18 20:28:08 +00:00
|
|
|
<vn-crud-model
|
|
|
|
vn-id="model"
|
2019-10-18 07:53:30 +00:00
|
|
|
auto-load="true"
|
2019-10-24 22:53:53 +00:00
|
|
|
url="ClaimBeginnings"
|
2018-08-30 07:19:09 +00:00
|
|
|
filter="$ctrl.filter"
|
2018-12-20 13:37:29 +00:00
|
|
|
data="$ctrl.salesClaimed"
|
|
|
|
on-data-change="$ctrl.calculateTotals()">
|
2018-08-30 07:19:09 +00:00
|
|
|
</vn-crud-model>
|
2019-10-18 20:28:08 +00:00
|
|
|
<vn-card
|
|
|
|
class="vn-mb-md vn-pa-lg vn-w-lg"
|
|
|
|
style="text-align: right"
|
2019-10-18 07:53:30 +00:00
|
|
|
ng-if="$ctrl.salesClaimed.length > 0">
|
|
|
|
<vn-label-value label="Total"
|
|
|
|
value="{{$ctrl.paidTotal | currency: 'EUR':2}}">
|
|
|
|
</vn-label-value>
|
|
|
|
<vn-label-value label="Total claimed"
|
|
|
|
value="{{$ctrl.claimedTotal | currency: 'EUR':2}}">
|
|
|
|
</vn-label-value>
|
|
|
|
</vn-card>
|
2019-10-18 20:28:08 +00:00
|
|
|
<vn-data-viewer model="model">
|
|
|
|
<vn-card>
|
|
|
|
<vn-table model="model">
|
|
|
|
<vn-thead>
|
|
|
|
<vn-tr>
|
|
|
|
<vn-th center>Landed</vn-th>
|
|
|
|
<vn-th number>Quantity</vn-th>
|
|
|
|
<vn-th>Claimed</vn-th>
|
|
|
|
<vn-th>Description</vn-th>
|
|
|
|
<vn-th number>Price</vn-th>
|
|
|
|
<vn-th number>Disc.</vn-th>
|
|
|
|
<vn-th number>Total</vn-th>
|
|
|
|
<vn-th></vn-th>
|
|
|
|
</vn-tr>
|
|
|
|
</vn-thead>
|
|
|
|
<vn-tbody>
|
|
|
|
<vn-tr ng-repeat="saleClaimed in $ctrl.salesClaimed" vn-repeat-last>
|
2019-10-18 23:18:25 +00:00
|
|
|
<vn-td center>{{::saleClaimed.sale.ticket.landed | date:'dd/MM/yyyy'}}</vn-td>
|
2019-10-18 20:28:08 +00:00
|
|
|
<vn-td number>{{::saleClaimed.sale.quantity}}</vn-td>
|
|
|
|
<vn-td>
|
|
|
|
<vn-input-number
|
|
|
|
min="0"
|
|
|
|
step="1"
|
2020-06-16 05:47:46 +00:00
|
|
|
disabled="!$ctrl.isRewritable"
|
2019-10-18 20:28:08 +00:00
|
|
|
ng-model="saleClaimed.quantity"
|
|
|
|
on-change="$ctrl.setClaimedQuantity(saleClaimed.id, saleClaimed.quantity)"
|
|
|
|
class="dense">
|
|
|
|
</vn-input-number>
|
|
|
|
</vn-td>
|
|
|
|
<vn-td expand title="{{::saleClaimed.sale.concept}}">
|
2020-04-25 09:50:04 +00:00
|
|
|
<span
|
|
|
|
ng-click="itemDescriptor.show($event, saleClaimed.sale.itemFk)"
|
|
|
|
class="link">
|
2019-10-18 20:28:08 +00:00
|
|
|
{{::saleClaimed.sale.concept}}
|
|
|
|
</span>
|
|
|
|
</vn-td>
|
|
|
|
<vn-td number>{{::saleClaimed.sale.price | currency: 'EUR':2}}</vn-td>
|
|
|
|
<vn-td number>
|
2020-11-18 07:16:37 +00:00
|
|
|
<span ng-class="{'link': $ctrl.isRewritable && $ctrl.isClaimManager}"
|
|
|
|
translate-attr="{title: $ctrl.isRewritable && $ctrl.isClaimManager ? 'Edit discount' : ''}"
|
2019-10-18 20:28:08 +00:00
|
|
|
ng-click="$ctrl.showEditPopover($event, saleClaimed)">
|
2019-12-13 07:01:13 +00:00
|
|
|
{{saleClaimed.sale.discount}} %
|
2019-10-18 20:28:08 +00:00
|
|
|
</span>
|
|
|
|
</vn-td>
|
|
|
|
<vn-td number>
|
2019-12-13 07:01:13 +00:00
|
|
|
{{$ctrl.getSaleTotal(saleClaimed.sale) | currency: 'EUR':2}}
|
2019-10-18 20:28:08 +00:00
|
|
|
</vn-td>
|
|
|
|
<vn-td shrink>
|
|
|
|
<vn-icon-button
|
|
|
|
vn-tooltip="Remove sale"
|
2020-06-16 05:47:46 +00:00
|
|
|
ng-if ="$ctrl.isRewritable"
|
2019-10-18 20:28:08 +00:00
|
|
|
icon="delete"
|
2020-06-18 08:10:42 +00:00
|
|
|
ng-click="$ctrl.showDeleteConfirm($index)"
|
2019-10-18 20:28:08 +00:00
|
|
|
tabindex="-1">
|
|
|
|
</vn-icon-button>
|
|
|
|
</vn-td>
|
|
|
|
</vn-tr>
|
|
|
|
</vn-tbody>
|
|
|
|
</vn-table>
|
|
|
|
</vn-card>
|
|
|
|
</vn-data-viewer>
|
2020-06-16 05:47:46 +00:00
|
|
|
<vn-float-button
|
|
|
|
icon="add"
|
|
|
|
ng-if="$ctrl.isRewritable"
|
|
|
|
ng-click="$ctrl.openAddSalesDialog()"
|
|
|
|
vn-tooltip="Add sale item" vn-bind="+"
|
|
|
|
fixed-bottom-right>
|
|
|
|
</vn-float-button>
|
2018-08-30 07:19:09 +00:00
|
|
|
<!-- Add Lines Dialog -->
|
2019-01-23 11:46:45 +00:00
|
|
|
<vn-dialog vn-id="add-sales" class="modal-form">
|
2020-05-06 12:38:09 +00:00
|
|
|
<tpl-title>
|
|
|
|
<span translate>Claimable sales from ticket</span> {{$ctrl.claim.ticketFk}}
|
|
|
|
</tpl-title>
|
2018-08-30 07:19:09 +00:00
|
|
|
<tpl-body>
|
2019-10-04 22:16:57 +00:00
|
|
|
<vn-horizontal class="vn-pa-md">
|
2019-01-22 09:31:12 +00:00
|
|
|
<vn-table>
|
|
|
|
<vn-thead>
|
|
|
|
<vn-tr>
|
|
|
|
<vn-th number>Landed</vn-th>
|
|
|
|
<vn-th number>Quantity</vn-th>
|
|
|
|
<vn-th number>Description</vn-th>
|
|
|
|
<vn-th number>Price</vn-th>
|
|
|
|
<vn-th number>Disc.</vn-th>
|
|
|
|
<vn-th number>Total</vn-th>
|
|
|
|
</vn-tr>
|
|
|
|
</vn-thead>
|
|
|
|
<vn-tbody>
|
2020-04-25 09:50:04 +00:00
|
|
|
<vn-tr
|
|
|
|
ng-repeat="sale in $ctrl.salesToClaim"
|
|
|
|
ng-click="$ctrl.addClaimedSale($index)"
|
|
|
|
class="clickable">
|
2019-10-18 23:18:25 +00:00
|
|
|
<vn-td number>{{sale.landed | date: 'dd/MM/yyyy'}}</vn-td>
|
2019-01-22 09:31:12 +00:00
|
|
|
<vn-td number>{{sale.quantity}}</vn-td>
|
2019-09-30 12:49:04 +00:00
|
|
|
<vn-td expand title="{{::sale.concept}}">
|
2020-04-25 09:50:04 +00:00
|
|
|
<span
|
|
|
|
vn-click-stop="itemDescriptor.show($event, sale.itemFk)"
|
|
|
|
class="link">
|
|
|
|
{{sale.itemFk}} - {{sale.concept}}
|
2019-09-30 12:49:04 +00:00
|
|
|
</span>
|
|
|
|
</vn-td>
|
2019-01-31 10:44:03 +00:00
|
|
|
<vn-td number>{{sale.price | currency: 'EUR':2}}</vn-td>
|
2019-01-22 09:31:12 +00:00
|
|
|
<vn-td number>{{sale.discount}} %</vn-td>
|
|
|
|
<vn-td number>
|
2019-01-31 10:44:03 +00:00
|
|
|
{{(sale.quantity * sale.price) - ((sale.discount * (sale.quantity * sale.price))/100) | currency: 'EUR':2}}
|
2019-01-22 09:31:12 +00:00
|
|
|
</vn-td>
|
|
|
|
</vn-tr>
|
|
|
|
</vn-tbody>
|
|
|
|
</vn-table>
|
|
|
|
</vn-horizontal>
|
2018-08-30 07:19:09 +00:00
|
|
|
</tpl-body>
|
2018-11-21 12:29:46 +00:00
|
|
|
</vn-dialog>
|
2018-12-20 13:37:29 +00:00
|
|
|
<vn-item-descriptor-popover
|
2020-04-25 09:50:04 +00:00
|
|
|
vn-id="itemDescriptor">
|
2019-06-12 06:19:02 +00:00
|
|
|
</vn-item-descriptor-popover>
|
|
|
|
<vn-popover
|
2019-10-26 23:30:01 +00:00
|
|
|
class="edit"
|
2019-06-12 06:19:02 +00:00
|
|
|
vn-id="edit-popover"
|
2019-12-13 07:01:13 +00:00
|
|
|
on-open="$ctrl.getSalespersonMana()"
|
2019-06-12 06:19:02 +00:00
|
|
|
on-close="$ctrl.mana = null">
|
2019-12-13 07:01:13 +00:00
|
|
|
<div class="discount-popover">
|
|
|
|
<vn-spinner
|
|
|
|
ng-if="$ctrl.mana == null"
|
|
|
|
style="padding: 1em;"
|
|
|
|
enable="true">
|
|
|
|
</vn-spinner>
|
|
|
|
<div ng-if="$ctrl.mana != null">
|
|
|
|
<vn-horizontal class="header vn-pa-md">
|
|
|
|
<h5>MANÁ: {{$ctrl.mana | currency: 'EUR':0}}</h5>
|
|
|
|
</vn-horizontal>
|
|
|
|
<div class="vn-pa-md">
|
|
|
|
<vn-input-number
|
|
|
|
vn-focus
|
|
|
|
label="Discount"
|
|
|
|
ng-model="$ctrl.newDiscount"
|
|
|
|
type="text"
|
|
|
|
step="0.01"
|
|
|
|
on-change="$ctrl.updateDiscount()"
|
|
|
|
suffix="€">
|
|
|
|
</vn-input-number>
|
|
|
|
<div class="simulator">
|
|
|
|
<p class="simulatorTitle" translate>Total claimed price</p>
|
|
|
|
<p>{{$ctrl.newPrice | currency: 'EUR':2}}
|
|
|
|
</p>
|
|
|
|
</div>
|
2019-06-12 06:19:02 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-06-13 07:21:36 +00:00
|
|
|
</div>
|
2019-06-12 06:19:02 +00:00
|
|
|
</vn-popover>
|
2020-06-18 08:10:42 +00:00
|
|
|
<vn-confirm
|
|
|
|
vn-id="confirm"
|
|
|
|
question="Delete sale from claim?"
|
2020-06-23 10:46:24 +00:00
|
|
|
on-accept="$ctrl.deleteClaimedSale()">
|
2020-06-18 08:10:42 +00:00
|
|
|
</vn-confirm>
|