2018-06-19 10:10:38 +00:00
|
|
|
<mg-ajax path="/ticket/api/sales/filter" options="vnIndexNonAuto" actions="$ctrl.getTaxes()"></mg-ajax>
|
2018-03-22 17:02:48 +00:00
|
|
|
<vn-vertical>
|
|
|
|
<vn-card pad-large>
|
2018-03-23 15:50:11 +00:00
|
|
|
<vn-vertical>
|
|
|
|
<vn-title>Sale</vn-title>
|
2018-05-08 07:25:15 +00:00
|
|
|
<vn-tool-bar margin-medium-bottom>
|
|
|
|
<vn-button
|
2018-06-06 14:54:40 +00:00
|
|
|
disabled="!$ctrl.isEditable"
|
2018-05-08 07:25:15 +00:00
|
|
|
label="Ok"
|
|
|
|
ng-click="$ctrl.onStateOkClick()">
|
|
|
|
</vn-button>
|
|
|
|
<vn-icon-menu
|
2018-06-06 14:54:40 +00:00
|
|
|
disabled="!$ctrl.isEditable"
|
2018-05-08 07:25:15 +00:00
|
|
|
label="State"
|
|
|
|
url="/ticket/api/States/alertLevelIs0"
|
|
|
|
on-change="$ctrl.onStateChange(value)">
|
|
|
|
</vn-icon-menu>
|
2018-06-06 14:54:40 +00:00
|
|
|
<vn-icon-menu
|
|
|
|
label="More"
|
|
|
|
show-filter="false"
|
|
|
|
value-field="callback"
|
2018-06-19 07:09:49 +00:00
|
|
|
data="$ctrl.moreOptions"
|
2018-06-06 14:54:40 +00:00
|
|
|
translate-fields="['name']"
|
2018-06-19 07:09:49 +00:00
|
|
|
on-change="$ctrl.onMoreChange(value)"
|
|
|
|
ng-click="$ctrl.onMoreClick()">
|
2018-06-06 14:54:40 +00:00
|
|
|
</vn-icon-menu>
|
2018-05-08 07:54:14 +00:00
|
|
|
<vn-button
|
2018-06-06 14:54:40 +00:00
|
|
|
disabled="!$ctrl.isChecked || !$ctrl.isEditable"
|
2018-05-08 07:54:14 +00:00
|
|
|
ng-click="$ctrl.onRemoveLinesClick()"
|
2018-06-06 14:54:40 +00:00
|
|
|
vn-tooltip="Remove lines"
|
|
|
|
tooltip-position="up"
|
2018-05-08 07:54:14 +00:00
|
|
|
icon="delete">
|
|
|
|
</vn-button>
|
2018-06-06 14:54:40 +00:00
|
|
|
<vn-button
|
|
|
|
disabled="!$ctrl.isChecked || !$ctrl.isEditable"
|
|
|
|
ng-click="$ctrl.showTransferPopover($event);"
|
|
|
|
vn-tooltip="Transfer lines"
|
|
|
|
tooltip-position="right"
|
|
|
|
icon="call_split">
|
|
|
|
</vn-button>
|
2018-05-08 07:25:15 +00:00
|
|
|
</vn-tool-bar>
|
2018-03-23 15:50:11 +00:00
|
|
|
<table class="vn-grid">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2018-06-19 07:09:49 +00:00
|
|
|
<th></th>
|
2018-05-08 07:25:15 +00:00
|
|
|
<th number>
|
2018-06-06 14:54:40 +00:00
|
|
|
<vn-multi-check
|
|
|
|
data="index.model.instances"
|
|
|
|
disabled="!$ctrl.isEditable">
|
|
|
|
</vn-multi-check>
|
2018-05-08 07:25:15 +00:00
|
|
|
</th>
|
2018-03-23 15:50:11 +00:00
|
|
|
<th number translate>Item</th>
|
2018-06-19 07:09:49 +00:00
|
|
|
<th translate>Description</th>
|
2018-03-23 15:50:11 +00:00
|
|
|
<th number translate>Quantity</th>
|
|
|
|
<th number translate>Price</th>
|
|
|
|
<th number translate>Discount</th>
|
|
|
|
<th number translate>Amount</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2018-05-08 07:25:15 +00:00
|
|
|
<tr ng-repeat="sale in index.model.instances track by sale.id">
|
2018-06-19 07:09:49 +00:00
|
|
|
<td><vn-icon ng-show="sale.reserved" icon="icon-reserved"></vn-icon></td>
|
2018-05-08 07:25:15 +00:00
|
|
|
<td number>
|
2018-06-06 14:54:40 +00:00
|
|
|
<vn-check
|
|
|
|
field="sale.checked"
|
|
|
|
disabled="!$ctrl.isEditable">
|
|
|
|
</vn-check>
|
2018-05-08 07:25:15 +00:00
|
|
|
</td>
|
2018-04-26 14:41:08 +00:00
|
|
|
<td
|
|
|
|
pointer
|
|
|
|
number
|
|
|
|
ng-click="$ctrl.showDescriptor($event, sale.itemFk)">
|
|
|
|
{{::sale.itemFk}}
|
|
|
|
</td>
|
2018-03-23 15:50:11 +00:00
|
|
|
<td><vn-fetched-tags sale="sale"/></td>
|
2018-06-06 14:54:40 +00:00
|
|
|
<td number>{{sale.quantity}}</td>
|
|
|
|
<!--<td ng-if="$ctrl.ticket.tracking.state.alertLevel == 0">
|
|
|
|
<vn-textfield
|
|
|
|
model="sale.quantity"
|
|
|
|
type="number"
|
|
|
|
ng-blur="updateLine()">
|
|
|
|
</vn-textfield>
|
|
|
|
</td>-->
|
|
|
|
<td number>{{sale.price | currency:'€':2}}</td>
|
|
|
|
<td number>{{sale.discount}} %</td>
|
|
|
|
<td number>{{sale.quantity * sale.price | currency:'€':2}}</td>
|
|
|
|
<!--<td number>
|
|
|
|
<vn-icon-button
|
|
|
|
ng-if="$ctrl.ticket.tracking.state.alertLevel == 0"
|
|
|
|
pointer
|
|
|
|
vn-tooltip="Add note"
|
|
|
|
tooltip-position="left"
|
|
|
|
icon="mode_edit"
|
|
|
|
ng-click="$ctrl.showEditPopover($event, sale)">
|
|
|
|
</vn-icon-button>
|
|
|
|
</td>-->
|
2018-03-23 15:50:11 +00:00
|
|
|
</tr>
|
2018-05-07 06:33:45 +00:00
|
|
|
<tr ng-if="index.model.count === 0" class="list list-element">
|
2018-06-19 07:09:49 +00:00
|
|
|
<td colspan="8" style="text-align: center" translate>No results</td>
|
2018-05-07 06:33:45 +00:00
|
|
|
</tr>
|
2018-06-19 10:10:38 +00:00
|
|
|
<tfoot>
|
|
|
|
<tr>
|
|
|
|
<td number colspan="8">
|
|
|
|
<section>
|
|
|
|
<p><vn-label translate>Subtotal</vn-label> {{$ctrl.subTotal | currency:' €':2}}</p>
|
|
|
|
<p><vn-label translate>VAT</vn-label> {{$ctrl.VAT | currency:' €':2}}</p>
|
|
|
|
<p><vn-label><strong>Total</strong></vn-label> <strong>{{$ctrl.total | currency:' €':2}}</strong></p>
|
|
|
|
</section>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tfoot>
|
2018-03-23 15:50:11 +00:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</vn-vertical>
|
2018-03-22 17:02:48 +00:00
|
|
|
</vn-card>
|
2018-05-11 06:35:28 +00:00
|
|
|
<vn-paging vn-one margin-large-top index="index" total="index.model.count"></vn-paging>
|
2018-06-06 14:54:40 +00:00
|
|
|
<vn-item-descriptor-popover vn-id="descriptor">
|
|
|
|
</vn-item-descriptor-popover>
|
|
|
|
|
|
|
|
<!-- Create Ticket Dialog -->
|
|
|
|
<!-- <vn-ticket-create-dialog
|
|
|
|
vn-id="newTicket"
|
|
|
|
callback="$ctrl.moveLines(res)"
|
|
|
|
ticket="$ctrl.ticket">
|
|
|
|
</vn-ticket-create-dialog>
|
|
|
|
-->
|
|
|
|
<!-- Add Turn Dialog -->
|
|
|
|
<vn-dialog class="dialog-summary"
|
|
|
|
vn-id="addTurn">
|
|
|
|
<tpl-body>
|
|
|
|
<div>
|
|
|
|
<h5 style="text-align: center">
|
|
|
|
<span translate>In which day you want to add the ticket?</span>
|
|
|
|
</h5>
|
|
|
|
<vn-tool-bar margin-medium-top>
|
|
|
|
<vn-button
|
|
|
|
label="Monday"
|
|
|
|
ng-click="$ctrl.addTurn(0)">
|
|
|
|
</vn-button>
|
|
|
|
<vn-button
|
|
|
|
label="Tuesday"
|
|
|
|
ng-click="$ctrl.addTurn(1)">
|
|
|
|
</vn-button>
|
|
|
|
<vn-button
|
|
|
|
label="Wednesday"
|
|
|
|
ng-click="$ctrl.addTurn(2)">
|
|
|
|
</vn-button>
|
|
|
|
<vn-button
|
|
|
|
label="Thursday"
|
|
|
|
ng-click="$ctrl.addTurn(3)">
|
|
|
|
</vn-button>
|
|
|
|
<vn-button
|
|
|
|
label="Friday"
|
|
|
|
ng-click="$ctrl.addTurn(4)">
|
|
|
|
</vn-button>
|
|
|
|
<vn-button
|
|
|
|
label="Saturday"
|
|
|
|
ng-click="$ctrl.addTurn(5)">
|
|
|
|
</vn-button>
|
|
|
|
<vn-button
|
|
|
|
label="Sunday"
|
|
|
|
ng-click="$ctrl.addTurn(6)">
|
|
|
|
</vn-button>
|
|
|
|
</vn-tool-bar>
|
|
|
|
</div>
|
|
|
|
</tpl-body>
|
|
|
|
</vn-dialog>
|
|
|
|
|
|
|
|
<!-- Edit Popover -->
|
|
|
|
<vn-popover class="edit" vn-id="edit">
|
|
|
|
<vn-horizontal pad-medium class="header">
|
|
|
|
<h5>MANÁ: {{$ctrl.workerMana}}</h5>
|
|
|
|
</vn-horizontal>
|
|
|
|
<div pad-medium>
|
|
|
|
<h5>{{$ctrl.client.name}}</h5>
|
|
|
|
<vn-textfield
|
|
|
|
label="Quantity"
|
|
|
|
model="$ctrl.edit.quantity"
|
|
|
|
type="number">
|
|
|
|
</vn-textfield>
|
|
|
|
<vn-textfield
|
|
|
|
label="Price"
|
|
|
|
model="$ctrl.edit.price"
|
|
|
|
type="number">
|
|
|
|
</vn-textfield>
|
|
|
|
<vn-textfield
|
|
|
|
label="Discount"
|
|
|
|
model="$ctrl.edit.discount"
|
|
|
|
type="number">
|
|
|
|
</vn-textfield>
|
|
|
|
<vn-button
|
|
|
|
label="Save"
|
|
|
|
ng-click="$ctrl.updateLine()">
|
|
|
|
</vn-button>
|
|
|
|
</div>
|
|
|
|
</vn-popover>
|
|
|
|
|
|
|
|
<!-- 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-button
|
|
|
|
pointer
|
|
|
|
label="New ticket"
|
|
|
|
ng-click="$ctrl.showticketCreate()">
|
|
|
|
</vn-button> -->
|
|
|
|
</div>
|
|
|
|
</vn-popover>
|
2018-03-22 17:02:48 +00:00
|
|
|
</vn-vertical>
|
2018-06-06 14:54:40 +00:00
|
|
|
<vn-confirm
|
|
|
|
vn-id="deleteConfirmation"
|
|
|
|
on-response="$ctrl.returnDeleteTicketDialog(response)"
|
|
|
|
question="You are going to delete this ticket"
|
|
|
|
message="Continue anyway?">
|
|
|
|
</vn-confirm>
|