2018-11-27 14:02:54 +00:00
|
|
|
<vn-crud-model auto-load="false"
|
2018-07-17 06:44:31 +00:00
|
|
|
vn-id="model"
|
|
|
|
url="/api/Tickets/{{$ctrl.$stateParams.id}}/getSales"
|
2018-10-22 06:23:10 +00:00
|
|
|
data="$ctrl.sales">
|
2018-07-17 06:44:31 +00:00
|
|
|
</vn-crud-model>
|
2018-03-22 17:02:48 +00:00
|
|
|
<vn-vertical>
|
|
|
|
<vn-card pad-large>
|
2018-03-23 15:50:11 +00:00
|
|
|
<vn-vertical>
|
2019-02-06 10:42:22 +00:00
|
|
|
<vn-horizontal class="header">
|
|
|
|
<vn-tool-bar margin-medium-bottom>
|
|
|
|
<vn-button
|
|
|
|
disabled="!$ctrl.isEditable"
|
|
|
|
label="Ok"
|
|
|
|
ng-click="$ctrl.onStateOkClick()"
|
|
|
|
vn-tooltip="Change ticket state to 'Ok'">
|
|
|
|
</vn-button>
|
|
|
|
<vn-button-menu
|
|
|
|
disabled="!$ctrl.isEditable"
|
|
|
|
label="State"
|
|
|
|
url="/ticket/api/States/alertLevelIs0"
|
|
|
|
on-change="$ctrl.onStateChange(value)">
|
|
|
|
</vn-button-menu>
|
|
|
|
<vn-button-menu
|
|
|
|
ng-show="$ctrl.isChecked"
|
|
|
|
vn-id="more-button"
|
|
|
|
label="More"
|
|
|
|
show-filter="false"
|
|
|
|
value-field="callback"
|
|
|
|
translate-fields="['name']"
|
|
|
|
on-change="$ctrl.onMoreChange(value)"
|
|
|
|
on-open="$ctrl.onMoreOpen()">
|
|
|
|
</vn-button-menu>
|
|
|
|
<vn-button
|
|
|
|
disabled="!$ctrl.isChecked || !$ctrl.isEditable"
|
|
|
|
ng-click="$ctrl.showRemoveLinesDialog()"
|
|
|
|
vn-tooltip="Remove lines"
|
|
|
|
tooltip-position="up"
|
|
|
|
icon="delete">
|
|
|
|
</vn-button>
|
|
|
|
<vn-button
|
|
|
|
disabled="!$ctrl.isChecked || !$ctrl.isEditable"
|
|
|
|
ng-click="$ctrl.showTransferPopover($event);"
|
|
|
|
vn-tooltip="Transfer lines"
|
|
|
|
tooltip-position="right"
|
|
|
|
icon="call_split">
|
|
|
|
</vn-button>
|
|
|
|
</vn-tool-bar>
|
|
|
|
<vn-one class="taxes" ng-if="$ctrl.sales.length > 0">
|
2019-02-21 07:43:04 +00:00
|
|
|
<p><vn-label translate>Subtotal</vn-label> {{$ctrl.subtotal | currency: 'EUR':2}}</p>
|
2019-02-06 10:42:22 +00:00
|
|
|
<p><vn-label translate>VAT</vn-label> {{$ctrl.VAT | currency: 'EUR':2}}</p>
|
|
|
|
<p><vn-label><strong>Total</strong></vn-label> <strong>{{$ctrl.total | currency: 'EUR':2}}</strong></p>
|
|
|
|
</vn-one>
|
|
|
|
</vn-horizontal>
|
2018-07-17 06:44:31 +00:00
|
|
|
<vn-table model="model">
|
|
|
|
<vn-thead>
|
|
|
|
<vn-tr>
|
2019-02-20 13:34:16 +00:00
|
|
|
<vn-th shrink>
|
2018-06-06 14:54:40 +00:00
|
|
|
<vn-multi-check
|
2018-08-23 06:58:28 +00:00
|
|
|
data="$ctrl.sales">
|
2018-06-06 14:54:40 +00:00
|
|
|
</vn-multi-check>
|
2018-07-17 06:44:31 +00:00
|
|
|
</vn-th>
|
2019-02-20 13:34:16 +00:00
|
|
|
<vn-th shrink></vn-th>
|
|
|
|
<vn-th shrink></vn-th>
|
2018-07-17 06:44:31 +00:00
|
|
|
<vn-th number>Id</vn-th>
|
2019-02-20 16:52:36 +00:00
|
|
|
<vn-th>Quantity</vn-th>
|
2019-02-20 13:34:16 +00:00
|
|
|
<vn-th>Item</vn-th>
|
2018-07-17 06:44:31 +00:00
|
|
|
<vn-th number>Price</vn-th>
|
|
|
|
<vn-th number>Disc</vn-th>
|
|
|
|
<vn-th number>Amount</vn-th>
|
|
|
|
</vn-tr>
|
|
|
|
</vn-thead>
|
|
|
|
<vn-tbody>
|
2018-10-22 06:23:10 +00:00
|
|
|
<vn-tr ng-repeat="sale in $ctrl.sales">
|
2019-02-20 13:34:16 +00:00
|
|
|
<vn-td shrink>
|
2018-06-06 14:54:40 +00:00
|
|
|
<vn-check
|
2018-08-23 06:58:28 +00:00
|
|
|
field="sale.checked">
|
2018-06-06 14:54:40 +00:00
|
|
|
</vn-check>
|
2018-07-17 06:44:31 +00:00
|
|
|
</vn-td>
|
2019-02-20 13:34:16 +00:00
|
|
|
<vn-td shrink>
|
2018-11-06 12:58:13 +00:00
|
|
|
<a ui-sref="claim.card.basicData({id: sale.claim.claimFk})">
|
|
|
|
<vn-icon
|
|
|
|
ng-show="sale.claim.claimFk"
|
|
|
|
icon="icon-claims"
|
|
|
|
vn-tooltip="{{::$ctrl.$translate.instant('Claim')}}: {{::sale.claim.claimFk}}">
|
|
|
|
</vn-icon>
|
|
|
|
</a>
|
2018-07-17 06:44:31 +00:00
|
|
|
<vn-icon
|
2019-04-24 07:54:25 +00:00
|
|
|
ng-show="sale.visible < 0 || sale.available < 0"
|
2019-02-08 16:49:51 +00:00
|
|
|
color-main
|
2018-07-17 11:04:47 +00:00
|
|
|
icon="warning"
|
2018-09-06 10:33:37 +00:00
|
|
|
vn-tooltip="Visible: {{::sale.visible || 0}} <br> {{::$ctrl.$translate.instant('Available')}}: {{::sale.available || 0}}">
|
2018-07-17 06:44:31 +00:00
|
|
|
</vn-icon>
|
2019-01-15 12:22:31 +00:00
|
|
|
<vn-icon ng-show="sale.reserved"
|
|
|
|
icon="icon-reserve"
|
|
|
|
vn-tooltip="{{::$ctrl.$translate.instant('Reserved')}}"></vn-icon>
|
2018-07-17 06:44:31 +00:00
|
|
|
</vn-td>
|
2019-02-20 16:52:36 +00:00
|
|
|
<vn-td shrink>
|
2018-07-11 07:56:07 +00:00
|
|
|
<img
|
2018-10-22 06:23:10 +00:00
|
|
|
ng-src="{{::$ctrl.imagesPath}}/50x50/{{::sale.image}}"
|
|
|
|
zoom-image="{{::$ctrl.imagesPath}}/1600x900/{{::sale.image}}"
|
2018-07-11 07:56:07 +00:00
|
|
|
on-error-src/>
|
2018-07-17 06:44:31 +00:00
|
|
|
</vn-td>
|
2018-09-06 06:04:43 +00:00
|
|
|
<vn-td number>
|
|
|
|
<span
|
|
|
|
ng-click="$ctrl.showDescriptor($event, sale.itemFk)"
|
2019-02-10 21:52:35 +00:00
|
|
|
class="link">
|
2018-12-20 13:37:29 +00:00
|
|
|
{{::sale.itemFk | zeroFill:6}}
|
2018-09-06 06:04:43 +00:00
|
|
|
</span>
|
2018-07-17 06:44:31 +00:00
|
|
|
</vn-td>
|
2019-02-26 16:32:32 +00:00
|
|
|
<vn-td-editable editable="!$ctrl.isEditable">
|
|
|
|
<text>{{sale.quantity}}</text>
|
|
|
|
<field>
|
|
|
|
<vn-textfield
|
|
|
|
model="sale.quantity"
|
|
|
|
on-change="$ctrl.updateQuantity(sale.id, sale.quantity)"
|
|
|
|
type="text">
|
|
|
|
</vn-textfield>
|
|
|
|
</field>
|
|
|
|
</vn-td-editable>
|
2019-02-20 16:52:36 +00:00
|
|
|
<vn-td expand>
|
|
|
|
<vn-fetched-tags
|
|
|
|
max-length="6"
|
|
|
|
item="::sale.tags"
|
2019-03-22 14:05:15 +00:00
|
|
|
title="::sale.concept"
|
|
|
|
sub-name="::sale.subName">
|
2019-02-20 16:52:36 +00:00
|
|
|
</vn-fetched-tags>
|
|
|
|
</vn-td>
|
|
|
|
<vn-td number ng-if="$ctrl.isEditable">
|
|
|
|
<span class="link"
|
|
|
|
vn-tooltip="Edit price"
|
|
|
|
ng-click="$ctrl.showEditPricePopover($event, sale)">
|
|
|
|
{{sale.price | currency: 'EUR':2}}
|
|
|
|
</span>
|
2018-07-17 06:44:31 +00:00
|
|
|
</vn-td>
|
|
|
|
<vn-td number ng-if="!$ctrl.isEditable">
|
2019-01-31 10:44:03 +00:00
|
|
|
{{sale.price | currency: 'EUR':2}}
|
2018-07-17 06:44:31 +00:00
|
|
|
</vn-td>
|
2019-02-20 16:52:36 +00:00
|
|
|
<vn-td number ng-if="$ctrl.isEditable">
|
|
|
|
<span class="link"
|
|
|
|
vn-tooltip="Edit discount"
|
|
|
|
ng-click="$ctrl.showEditPopover($event, sale)">
|
|
|
|
{{sale.discount}} %
|
|
|
|
</span>
|
2018-07-17 06:44:31 +00:00
|
|
|
</vn-td>
|
|
|
|
<vn-td number
|
|
|
|
ng-if="!$ctrl.isEditable">
|
|
|
|
{{sale.discount}} %
|
|
|
|
</vn-td>
|
|
|
|
<vn-td number>
|
2019-01-31 10:44:03 +00:00
|
|
|
{{$ctrl.getSaleTotal(sale) | currency: 'EUR':2}}
|
2018-07-17 06:44:31 +00:00
|
|
|
</vn-td>
|
|
|
|
</vn-tr>
|
|
|
|
</vn-tbody>
|
|
|
|
</vn-table>
|
2018-03-23 15:50:11 +00:00
|
|
|
</vn-vertical>
|
2018-03-22 17:02:48 +00:00
|
|
|
</vn-card>
|
2018-08-01 10:15:09 +00:00
|
|
|
<vn-item-descriptor-popover vn-id="descriptor"
|
|
|
|
quicklinks="$ctrl.quicklinks">
|
2018-06-06 14:54:40 +00:00
|
|
|
</vn-item-descriptor-popover>
|
|
|
|
|
2018-06-28 13:17:50 +00:00
|
|
|
<!-- Edit Price Popover -->
|
|
|
|
<vn-popover
|
|
|
|
class="edit dialog-summary"
|
2019-02-20 16:52:36 +00:00
|
|
|
vn-id="edit-price-popover"
|
2019-02-26 16:32:32 +00:00
|
|
|
on-open="$ctrl.getManaSalespersonMana()"
|
|
|
|
on-close="$ctrl.mana = null">
|
|
|
|
<vn-spinner
|
|
|
|
ng-if="$ctrl.mana == null"
|
|
|
|
style="padding: 1em;"
|
|
|
|
enable="true">
|
|
|
|
</vn-spinner>
|
|
|
|
<div ng-if="$ctrl.mana != null">
|
|
|
|
<vn-horizontal pad-medium class="header">
|
|
|
|
<h5>MANÁ: {{$ctrl.mana | currency: 'EUR':0}}</h5>
|
|
|
|
</vn-horizontal>
|
|
|
|
<div pad-medium>
|
|
|
|
<vn-textfield
|
|
|
|
vn-focus
|
|
|
|
label="Price"
|
|
|
|
model="$ctrl.editedPrice"
|
|
|
|
type="text"
|
|
|
|
on-change="$ctrl.updatePrice()">
|
|
|
|
<t-right-icons>
|
|
|
|
<span class="filter">€</span>
|
|
|
|
</t-right-icons>
|
|
|
|
</vn-textfield>
|
|
|
|
<div class="simulator">
|
|
|
|
<p class="simulatorTitle" translate>New price</p>
|
|
|
|
<p>{{($ctrl.sale.quantity * $ctrl.editedPrice)
|
|
|
|
- (($ctrl.sale.discount * ($ctrl.sale.quantity * $ctrl.editedPrice))/100)
|
|
|
|
| currency: 'EUR':2}}</p>
|
|
|
|
</div>
|
2018-06-28 13:17:50 +00:00
|
|
|
</div>
|
2018-06-06 14:54:40 +00:00
|
|
|
</div>
|
|
|
|
</vn-popover>
|
|
|
|
|
2018-06-28 13:17:50 +00:00
|
|
|
<!-- Edit Popover -->
|
|
|
|
<vn-popover
|
|
|
|
class="edit dialog-summary"
|
2019-02-20 16:52:36 +00:00
|
|
|
vn-id="edit-popover"
|
2019-02-26 16:32:32 +00:00
|
|
|
on-open="$ctrl.getManaSalespersonMana()"
|
|
|
|
on-close="$ctrl.mana = null">
|
|
|
|
<vn-spinner
|
|
|
|
ng-if="$ctrl.mana == null"
|
|
|
|
style="padding: 1em;"
|
|
|
|
enable="true">
|
|
|
|
</vn-spinner>
|
|
|
|
<vn-ticket-sale-edit-discount
|
|
|
|
ng-if="$ctrl.mana != null"
|
|
|
|
mana="$ctrl.mana"
|
|
|
|
bulk="false"
|
|
|
|
edit="$ctrl.edit"
|
|
|
|
on-hide="$ctrl.hideEditPopover()">
|
|
|
|
</vn-ticket-sale-edit-discount>
|
2018-06-28 13:17:50 +00:00
|
|
|
</vn-popover>
|
|
|
|
|
|
|
|
<!-- Edit Dialog -->
|
|
|
|
<vn-dialog
|
|
|
|
vn-id="editDialog"
|
|
|
|
class="edit"
|
2019-02-26 16:32:32 +00:00
|
|
|
on-open="$ctrl.getManaSalespersonMana()"
|
|
|
|
on-close="$ctrl.mana = null">
|
2018-06-28 13:17:50 +00:00
|
|
|
<tpl-body>
|
2019-02-26 16:32:32 +00:00
|
|
|
<vn-spinner
|
|
|
|
ng-if="$ctrl.mana == null"
|
|
|
|
style="padding: 1em;"
|
|
|
|
enable="true">
|
|
|
|
</vn-spinner>
|
2018-06-28 13:17:50 +00:00
|
|
|
<vn-ticket-sale-edit-discount
|
2019-02-26 16:32:32 +00:00
|
|
|
ng-if="$ctrl.mana != null"
|
2018-06-28 13:17:50 +00:00
|
|
|
mana="$ctrl.mana"
|
|
|
|
bulk="true"
|
|
|
|
edit="$ctrl.edit"
|
2019-02-14 19:18:10 +00:00
|
|
|
on-hide="$ctrl.hideEditDialog()">
|
2018-06-28 13:17:50 +00:00
|
|
|
</vn-ticket-sale-edit-discount>
|
|
|
|
</tpl-body>
|
|
|
|
</vn-dialog>
|
|
|
|
|
2018-06-06 14:54:40 +00:00
|
|
|
<!-- Transfer Popover -->
|
|
|
|
<vn-popover class="transfer" vn-id="transfer">
|
|
|
|
<div pad-medium>
|
|
|
|
<table class="vn-grid">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th number translate>ID</th>
|
|
|
|
<th number translate>F. envio</th>
|
|
|
|
<th number translate>Agencia</th>
|
|
|
|
<th number translate>Almacen</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr ng-if="$ctrl.lastThreeTickets.length === 0" ><td colspan="4" style="text-align: center" translate>No results</td></tr>
|
|
|
|
<tr
|
|
|
|
class="clickable"
|
|
|
|
ng-repeat="ticket in $ctrl.lastThreeTickets track by ticket.id"
|
|
|
|
ng-click="$ctrl.moveLines(ticket.id)">
|
|
|
|
<td number>{{::ticket.id}}</td>
|
2019-02-27 16:04:00 +00:00
|
|
|
<td number>{{::ticket.shipped | dateTime: 'dd/MM/yyyy HH:mm'}}</td>
|
2018-06-06 14:54:40 +00:00
|
|
|
<td number>{{::ticket.agencyName}}</td>
|
|
|
|
<td number>{{::ticket.warehouseName}}</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<vn-horizontal>
|
|
|
|
<vn-textfield
|
|
|
|
label="Move to ticket"
|
|
|
|
model="$ctrl.moveToTicketFk"
|
|
|
|
type="number">
|
|
|
|
</vn-textfield>
|
|
|
|
<vn-icon-button
|
|
|
|
icon="arrow_forward_ios"
|
|
|
|
ng-click="$ctrl.moveLines($ctrl.moveToTicketFk)">
|
|
|
|
</vn-icon-button>
|
|
|
|
</vn-horizontal>
|
2018-07-09 07:48:00 +00:00
|
|
|
<vn-horizontal>
|
|
|
|
<vn-button
|
|
|
|
label="New ticket"
|
|
|
|
ng-click="$ctrl.linesToNewTicket()">
|
|
|
|
</vn-button>
|
|
|
|
<vn-icon
|
2019-02-08 16:49:51 +00:00
|
|
|
color-secondary
|
2018-07-09 07:48:00 +00:00
|
|
|
vn-tooltip="You have to allow pop-ups in your web browser to use this functionality"
|
|
|
|
icon="info">
|
|
|
|
</vn-icon>
|
|
|
|
</vn-horizontal>
|
2018-06-06 14:54:40 +00:00
|
|
|
</div>
|
|
|
|
</vn-popover>
|
2018-03-22 17:02:48 +00:00
|
|
|
</vn-vertical>
|
2018-07-02 12:14:16 +00:00
|
|
|
<vn-confirm
|
|
|
|
vn-id="delete-lines"
|
|
|
|
question="You are going to delete lines of the ticket"
|
|
|
|
message="Continue anyway?"
|
|
|
|
on-response="$ctrl.onRemoveLinesClick(response)">
|
2018-11-14 13:31:56 +00:00
|
|
|
</vn-confirm>
|
|
|
|
<vn-float-button
|
|
|
|
ng-show="$ctrl.isEditable"
|
|
|
|
ng-click="$ctrl.newOrderFromTicket()"
|
|
|
|
icon="add"
|
|
|
|
vn-tooltip="New item"
|
|
|
|
vn-bind="+"
|
|
|
|
fixed-bottom-right>
|
|
|
|
</vn-float-button>
|