salix/client/ticket/src/sale/index.html

285 lines
12 KiB
HTML
Raw Normal View History

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>
<vn-vertical>
<vn-title>Sale</vn-title>
<vn-tool-bar margin-medium-bottom>
<vn-button
disabled="!$ctrl.isEditable"
label="Ok"
2018-09-06 10:22:12 +00:00
ng-click="$ctrl.onStateOkClick()"
vn-tooltip="Change ticket state to 'Ok'">
</vn-button>
2018-11-08 14:20:42 +00:00
<vn-button-menu
disabled="!$ctrl.isEditable"
label="State"
url="/ticket/api/States/alertLevelIs0"
on-change="$ctrl.onStateChange(value)">
2018-11-08 14:20:42 +00:00
</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']"
2018-06-19 07:09:49 +00:00
on-change="$ctrl.onMoreChange(value)"
on-open="$ctrl.onMoreOpen()">
2018-11-08 14:20:42 +00:00
</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>
2018-07-17 06:44:31 +00:00
<vn-table model="model">
<vn-thead>
<vn-tr>
2018-09-11 10:49:31 +00:00
<vn-th number>
<vn-multi-check
data="$ctrl.sales">
</vn-multi-check>
2018-07-17 06:44:31 +00:00
</vn-th>
<vn-th></vn-th>
<vn-th style="text-align: center">Item</vn-th>
2018-07-17 06:44:31 +00:00
<vn-th number>Id</vn-th>
<vn-th>Description</vn-th>
<vn-th number>Quantity</vn-th>
<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">
2018-09-11 10:49:31 +00:00
<vn-td number >
<vn-check
field="sale.checked">
</vn-check>
2018-07-17 06:44:31 +00:00
</vn-td>
<vn-td>
<a ui-sref="claim.card.basicData({id: sale.claim.claimFk})">
<vn-icon
ng-show="sale.claim.claimFk"
orange
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
2018-07-30 12:46:04 +00:00
ng-show="sale.visible || sale.available"
2018-07-17 11:04:47 +00:00
orange
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>
2018-11-22 07:48:40 +00:00
<vn-icon ng-show="sale.reserved" icon="icon-reserva"></vn-icon>
2018-07-17 06:44:31 +00:00
</vn-td>
<vn-td style="text-align: center">
<img
2018-10-22 06:23:10 +00:00
ng-src="{{::$ctrl.imagesPath}}/50x50/{{::sale.image}}"
zoom-image="{{::$ctrl.imagesPath}}/1600x900/{{::sale.image}}"
on-error-src/>
2018-07-17 06:44:31 +00:00
</vn-td>
<vn-td number>
<span
ng-click="$ctrl.showDescriptor($event, sale.itemFk)"
pointer class="link">
{{("000000"+sale.itemFk).slice(-6)}}
</span>
2018-07-17 06:44:31 +00:00
</vn-td>
2018-11-06 08:21:53 +00:00
<vn-td><vn-fetched-tags max-length="6" item="sale.tags"/></vn-td>
2018-07-17 06:44:31 +00:00
<vn-td ng-if="!$ctrl.isEditable" number>{{sale.quantity}}</vn-td>
<vn-td ng-if="$ctrl.isEditable" number>
<vn-textfield
model="sale.quantity"
on-change="$ctrl.updateQuantity(sale.id, sale.quantity)"
2018-07-13 13:21:37 +00:00
type="text">
</vn-textfield>
2018-07-17 06:44:31 +00:00
</vn-td>
<vn-td number
ng-if="$ctrl.isEditable"
2018-07-26 11:49:01 +00:00
class="link"
ng-click="$ctrl.showEditPricePopover($event, sale)"
pointer
vn-tooltip="Edit price">
{{sale.price | currency:'€':2}}
2018-07-17 06:44:31 +00:00
</vn-td>
<vn-td number ng-if="!$ctrl.isEditable">
{{sale.price | currency:'€':2}}
2018-07-17 06:44:31 +00:00
</vn-td>
<vn-td number
ng-if="$ctrl.isEditable"
2018-07-26 11:49:01 +00:00
class="link"
ng-click="$ctrl.showEditPopover($event, sale)"
pointer
vn-tooltip="Edit discount">
{{sale.discount}} %
2018-07-17 06:44:31 +00:00
</vn-td>
<vn-td number
ng-if="!$ctrl.isEditable">
{{sale.discount}} %
</vn-td>
<vn-td number>
2018-10-22 06:23:10 +00:00
{{$ctrl.getSaleTotal(sale) | currency:'€':2}}
2018-07-17 06:44:31 +00:00
</vn-td>
</vn-tr>
</vn-tbody>
2018-10-22 06:23:10 +00:00
<vn-empty-rows ng-if="$ctrl.sales.length === 0" translate>
2018-07-17 06:44:31 +00:00
No results
</vn-empty-rows>
</vn-table>
2018-10-22 06:23:10 +00:00
<div class="totals"
ng-if="$ctrl.sales.length > 0">
<p>
<vn-label translate>Subtotal</vn-label>
<span>{{$ctrl.subTotal | currency:'€':2}}</span>
</p>
<p>
<vn-label translate>VAT</vn-label>
<span>{{$ctrl.VAT | currency:'€':2}}</span>
</p>
<p>
<vn-label><strong>Total</strong></vn-label>
<strong>{{$ctrl.total | currency:'€':2}}</strong>
</p>
</div>
</vn-vertical>
2018-03-22 17:02:48 +00:00
</vn-card>
<vn-item-descriptor-popover vn-id="descriptor"
quicklinks="$ctrl.quicklinks">
</vn-item-descriptor-popover>
<!-- Edit Price Popover -->
<vn-popover
class="edit dialog-summary"
vn-id="editPricePopover"
on-open="$ctrl.getManaSalespersonMana()">
<vn-horizontal pad-medium class="header">
<h5>MANÁ: {{$ctrl.mana | currency:'€':0}}</h5>
</vn-horizontal>
<div pad-medium>
<vn-textfield
label="Price"
model="$ctrl.editedPrice"
2018-07-13 13:21:37 +00:00
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>
2018-07-09 07:09:08 +00:00
<p>{{($ctrl.sale.quantity * $ctrl.editedPrice)
- (($ctrl.sale.discount * ($ctrl.sale.quantity * $ctrl.editedPrice))/100)
| currency:'€':2}}</p>
</div>
</div>
</vn-popover>
<!-- Edit Popover -->
<vn-popover
class="edit dialog-summary"
vn-id="editPopover"
on-open="$ctrl.getManaSalespersonMana()">
<vn-ticket-sale-edit-discount
mana="$ctrl.mana"
bulk="false"
edit="$ctrl.edit"
hide="$ctrl.hideEditPopover()">
</vn-ticket-sale-edit-discount>
</vn-popover>
<!-- Edit Dialog -->
<vn-dialog
vn-id="editDialog"
class="edit"
on-open="$ctrl.getManaSalespersonMana()">
<tpl-body>
<vn-ticket-sale-edit-discount
mana="$ctrl.mana"
bulk="true"
edit="$ctrl.edit"
hide="$ctrl.hideEditDialog()">
</vn-ticket-sale-edit-discount>
</tpl-body>
</vn-dialog>
<!-- 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>
<td number>{{::ticket.shipped | date: 'dd/MM/yyyy HH:mm'}}</td>
<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
pointer
icon="arrow_forward_ios"
ng-click="$ctrl.moveLines($ctrl.moveToTicketFk)">
</vn-icon-button>
</vn-horizontal>
<vn-horizontal>
<vn-button
pointer
label="New ticket"
ng-click="$ctrl.linesToNewTicket()">
</vn-button>
<vn-icon
medium-grey
vn-tooltip="You have to allow pop-ups in your web browser to use this functionality"
icon="info">
</vn-icon>
</vn-horizontal>
</div>
</vn-popover>
2018-03-22 17:02:48 +00:00
</vn-vertical>
<vn-confirm
vn-id="delete-lines"
question="You are going to delete lines of the ticket"
message="Continue anyway?"
on-response="$ctrl.onRemoveLinesClick(response)">
</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>