159 lines
6.2 KiB
HTML
159 lines
6.2 KiB
HTML
<vn-crud-model
|
|
vn-id="model"
|
|
auto-load="true"
|
|
url="ClaimBeginnings"
|
|
filter="$ctrl.filter"
|
|
data="$ctrl.salesClaimed"
|
|
on-data-change="$ctrl.calculateTotals()">
|
|
</vn-crud-model>
|
|
<vn-card
|
|
class="vn-mb-md vn-pa-lg vn-w-lg"
|
|
style="text-align: right"
|
|
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>
|
|
<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>
|
|
<vn-td center>{{::saleClaimed.sale.ticket.landed | date:'dd/MM/yyyy'}}</vn-td>
|
|
<vn-td number>{{::saleClaimed.sale.quantity}}</vn-td>
|
|
<vn-td>
|
|
<vn-input-number
|
|
min="0"
|
|
step="1"
|
|
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}}">
|
|
<span
|
|
class="link"
|
|
ng-click="$ctrl.showItemDescriptor($event, saleClaimed.sale.itemFk)">
|
|
{{::saleClaimed.sale.concept}}
|
|
</span>
|
|
</vn-td>
|
|
<vn-td number>{{::saleClaimed.sale.price | currency: 'EUR':2}}</vn-td>
|
|
<vn-td number>
|
|
<span ng-class="{'link': $ctrl.isEditable}"
|
|
title="{{$ctrl.isEditable ? 'Edit discount' : ''}}"
|
|
ng-click="$ctrl.showEditPopover($event, saleClaimed)">
|
|
{{saleClaimed.sale.discount}} %
|
|
</span>
|
|
</vn-td>
|
|
<vn-td number>
|
|
{{$ctrl.getSaleTotal(saleClaimed.sale) | currency: 'EUR':2}}
|
|
</vn-td>
|
|
<vn-td shrink>
|
|
<vn-icon-button
|
|
vn-tooltip="Remove sale"
|
|
icon="delete"
|
|
ng-click="$ctrl.deleteClaimedSale($index)"
|
|
tabindex="-1">
|
|
</vn-icon-button>
|
|
</vn-td>
|
|
</vn-tr>
|
|
</vn-tbody>
|
|
</vn-table>
|
|
</vn-card>
|
|
</vn-data-viewer>
|
|
<a ng-click="$ctrl.openAddSalesDialog()" vn-tooltip="Add sale item" vn-bind="+" fixed-bottom-right>
|
|
<vn-float-button icon="add"></vn-float-button>
|
|
</a>
|
|
<!-- Add Lines Dialog -->
|
|
<vn-dialog vn-id="add-sales" class="modal-form">
|
|
<tpl-body>
|
|
<vn-horizontal class="header vn-pa-md">
|
|
<h5><span translate>Claimable sales from ticket</span> {{$ctrl.claim.ticketFk}}</h5>
|
|
</vn-horizontal>
|
|
<vn-horizontal class="vn-pa-md">
|
|
<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>
|
|
<vn-tr ng-repeat="sale in $ctrl.salesToClaim" class="clickable" ng-click="$ctrl.addClaimedSale($index)">
|
|
<vn-td number>{{sale.landed | date: 'dd/MM/yyyy'}}</vn-td>
|
|
<vn-td number>{{sale.quantity}}</vn-td>
|
|
<vn-td expand title="{{::sale.concept}}">
|
|
<span
|
|
class="link"
|
|
ng-click="$ctrl.showItemDescriptor($event, sale.itemFk)">
|
|
{{sale.concept}}
|
|
</span>
|
|
</vn-td>
|
|
<vn-td number>{{sale.price | currency: 'EUR':2}}</vn-td>
|
|
<vn-td number>{{sale.discount}} %</vn-td>
|
|
<vn-td number>
|
|
{{(sale.quantity * sale.price) - ((sale.discount * (sale.quantity * sale.price))/100) | currency: 'EUR':2}}
|
|
</vn-td>
|
|
</vn-tr>
|
|
</vn-tbody>
|
|
</vn-table>
|
|
</vn-horizontal>
|
|
</tpl-body>
|
|
</vn-dialog>
|
|
<vn-item-descriptor-popover
|
|
vn-id="descriptor">
|
|
</vn-item-descriptor-popover>
|
|
<vn-popover
|
|
class="edit"
|
|
vn-id="edit-popover"
|
|
on-open="$ctrl.getSalespersonMana()"
|
|
on-close="$ctrl.mana = null">
|
|
<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>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</vn-popover>
|