salix/modules/claim/front/action/index.html

179 lines
7.2 KiB
HTML
Raw Normal View History

2020-02-07 06:47:11 +00:00
<vn-crud-model vn-id="model"
2022-04-12 08:09:00 +00:00
url="ClaimEnds/filter"
2020-05-15 12:47:19 +00:00
link="{claimFk: $ctrl.$params.id}"
2020-02-07 06:47:11 +00:00
data="$ctrl.salesClaimed"
auto-load="true"
on-save="$ctrl.onSave()">
2018-09-05 09:34:23 +00:00
</vn-crud-model>
2020-09-17 18:12:52 +00:00
<vn-crud-model
auto-load="true"
url="ClaimDestinations"
2019-10-21 11:43:17 +00:00
data="claimDestinations">
</vn-crud-model>
2019-10-17 11:27:50 +00:00
<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 claimed"
value="{{$ctrl.claimedTotal | currency: 'EUR':2}}">
</vn-label-value>
</vn-card>
<vn-card class="vn-pa-lg vn-w-lg">
<smart-table
model="model"
options="$ctrl.smartTableOptions"
expr-builder="$ctrl.exprBuilder(param, value)">
<slot-actions>
<section class="header">
<vn-tool-bar class="vn-mb-md">
<vn-button
label="Import claim"
disabled="$ctrl.claim.claimStateFk == $ctrl.resolvedStateId"
vn-http-click="$ctrl.importToNewRefundTicket()"
translate-attr="{title: 'Imports claim details'}">
</vn-button>
<vn-button
label="Change destination"
ng-show="$ctrl.checked.length > 0"
ng-click="changeDestination.show()">
</vn-button>
<vn-range
label="Responsability"
min-label="Company"
max-label="Sales/Client"
ng-model="$ctrl.claim.responsibility"
max="$ctrl.maxResponsibility"
min="1"
step="1"
on-change="$ctrl.save({responsibility: value})">
</vn-range>
</vn-tool-bar>
2022-04-12 08:09:00 +00:00
<vn-check class="right"
vn-one
label="Is paid with mana"
ng-model="$ctrl.claim.isChargedToMana"
on-change="$ctrl.save({isChargedToMana: value})">
</vn-check>
</section>
</slot-actions>
<slot-table>
<table model="model">
<thead>
<tr>
<th shrink>
<vn-multi-check
model="model"
check-field="$checked">
</vn-multi-check>
</th>
<th number field="itemFk">Id</th>
<th number field="ticketFk">Ticket</th>
<th field="claimDestinationFk">Destination</th>
<th expand field="landed">Landed</th>
<th number field="quantity">Quantity</th>
2022-04-12 08:09:00 +00:00
<th field="concept">Description</th>
<th number field="price">Price</th>
<th number field="discount">Disc.</th>
<th number field="total">Total</th>
</tr>
</thead>
<tbody>
<tr
2019-10-17 11:27:50 +00:00
ng-repeat="saleClaimed in $ctrl.salesClaimed"
vn-repeat-last on-last="$ctrl.focusLastInput()">
<td>
<vn-check
ng-model="saleClaimed.$checked"
vn-click-stop>
</vn-check>
</td>
<td number>
<vn-span
2022-04-12 09:57:56 +00:00
ng-click="itemDescriptor.show($event, saleClaimed.itemFk)"
2019-10-17 11:27:50 +00:00
class="link">
2022-04-12 08:09:00 +00:00
{{::saleClaimed.itemFk | zeroFill:6}}
</vn-span>
</td>
<td number>
<vn-span
2019-10-17 11:27:50 +00:00
class="link"
2022-04-12 09:57:56 +00:00
ng-click="ticketDescriptor.show($event, saleClaimed.ticketFk)">
2022-04-12 08:09:00 +00:00
{{::saleClaimed.ticketFk}}
</vn-span>
</td>
<td expand>
2019-10-21 11:43:17 +00:00
<vn-autocomplete vn-one id="claimDestinationFk"
2019-10-17 11:27:50 +00:00
ng-model="saleClaimed.claimDestinationFk"
2019-10-21 11:43:17 +00:00
data="claimDestinations"
2022-04-12 08:09:00 +00:00
on-change="$ctrl.updateDestination(saleClaimed, value)"
2019-10-17 11:27:50 +00:00
fields="['id','description']"
value-field="id"
2019-10-21 11:43:17 +00:00
show-field="description">
2019-10-17 11:27:50 +00:00
</vn-autocomplete>
</td>
2022-04-12 08:09:00 +00:00
<td expand>{{::saleClaimed.landed | date: 'dd/MM/yyyy'}}</td>
<td number>{{::saleClaimed.quantity}}</td>
<td expand>{{::saleClaimed.concept}}</td>
<td number>{{::saleClaimed.price | currency: 'EUR':2}}</td>
<td number>{{::saleClaimed.discount}} %</td>
<td number>
2022-04-12 08:09:00 +00:00
{{saleClaimed.quantity * saleClaimed.price *
((100 - saleClaimed.discount) / 100) | currency: 'EUR':2}}
</td>
<td shrink>
2019-10-17 11:27:50 +00:00
<vn-icon-button
vn-tooltip="Remove line"
icon="delete"
2022-04-12 08:09:00 +00:00
ng-click="$ctrl.removeSales(saleClaimed)"
2019-10-17 11:27:50 +00:00
tabindex="-1">
</vn-icon-button>
</td>
</tr>
</tbody>
</table>
2022-04-12 08:09:00 +00:00
</slot-table>
</smart-table>
2022-04-12 08:09:00 +00:00
<button-bar class="vn-pa-md">
<vn-button
label="Regularize"
disabled="$ctrl.claim.claimStateFk == $ctrl.resolvedStateId"
vn-http-click="$ctrl.regularize()">
</vn-button>
</button-bar>
2019-10-17 11:27:50 +00:00
</vn-card>
2019-02-10 21:52:35 +00:00
<vn-item-descriptor-popover
vn-id="item-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
2019-02-21 12:48:34 +00:00
</vn-item-descriptor-popover>
<vn-ticket-descriptor-popover
vn-id="ticket-descriptor">
2019-04-16 06:09:16 +00:00
</vn-ticket-descriptor-popover>
<vn-confirm
vn-id="update-greuge"
question="Insert greuges on client card"
message="Do you want to insert greuges?"
2020-05-19 08:51:50 +00:00
on-accept="$ctrl.onUpdateGreugeAccept()">
</vn-confirm>
<!-- Dialog of change destionation -->
<vn-dialog
vn-id="changeDestination"
on-accept="$ctrl.onResponse()">
<tpl-body>
<section class="SMSDialog">
<h5 class="vn-py-sm">{{$ctrl.$t('Change destination to all selected rows', {total: $ctrl.checked.length})}}</h5>
<vn-horizontal>
<vn-autocomplete vn-one id="claimDestinationFk"
ng-model="$ctrl.newDestination"
data="claimDestinations"
fields="['id','description']"
value-field="id"
show-field="description"
vn-focus>
</vn-autocomplete>
</vn-horizontal>
</section>
</tpl-body>
<tpl-buttons>
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
<button response="accept" translate>Save</button>
</tpl-buttons>
</vn-dialog>