2018-07-17 06:44:31 +00:00
|
|
|
<vn-crud-model
|
|
|
|
vn-id="model"
|
|
|
|
url="/api/Tickets/{{$ctrl.$stateParams.id}}/getSales"
|
|
|
|
filter="{}"
|
|
|
|
data="sales" on-data-change="$ctrl.onDataChange()">
|
|
|
|
</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>
|
|
|
|
<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"
|
2018-08-02 13:33:24 +00:00
|
|
|
ng-click="$ctrl.onStateOkClick()">
|
2018-05-08 07:25:15 +00:00
|
|
|
</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
|
2018-07-02 11:17:01 +00:00
|
|
|
vn-id="more-button"
|
2018-06-06 14:54:40 +00:00
|
|
|
label="More"
|
|
|
|
show-filter="false"
|
|
|
|
value-field="callback"
|
|
|
|
translate-fields="['name']"
|
2018-06-19 07:09:49 +00:00
|
|
|
on-change="$ctrl.onMoreChange(value)"
|
2018-07-02 11:17:01 +00:00
|
|
|
on-open="$ctrl.onMoreOpen()">
|
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-08-02 13:33:24 +00:00
|
|
|
ng-click="$ctrl.showRemoveLinesDialog()"
|
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"
|
2018-08-02 13:33:24 +00:00
|
|
|
ng-click="$ctrl.showTransferPopover($event);"
|
2018-06-06 14:54:40 +00:00
|
|
|
vn-tooltip="Transfer lines"
|
|
|
|
tooltip-position="right"
|
|
|
|
icon="call_split">
|
|
|
|
</vn-button>
|
2018-05-08 07:25:15 +00:00
|
|
|
</vn-tool-bar>
|
2018-07-17 06:44:31 +00:00
|
|
|
<vn-table model="model">
|
|
|
|
<vn-thead>
|
|
|
|
<vn-tr>
|
2018-08-23 06:58:28 +00:00
|
|
|
<vn-th number ng-show="$ctrl.isEditable">
|
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>
|
|
|
|
<vn-th></vn-th>
|
2018-07-19 08:44:57 +00:00
|
|
|
<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>
|
|
|
|
<vn-tr ng-repeat="sale in sales">
|
2018-08-23 06:58:28 +00:00
|
|
|
<vn-td number ng-show="$ctrl.isEditable">
|
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>
|
|
|
|
<vn-td>
|
|
|
|
<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-07-18 07:31:45 +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-07-30 12:46:04 +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">
|
2018-07-11 07:56:07 +00:00
|
|
|
<img
|
2018-07-19 12:09:50 +00:00
|
|
|
ng-src="//verdnatura.es/vn-image-data/catalog/50x50/{{::sale.image}}"
|
|
|
|
zoom-image="//verdnatura.es/vn-image-data/catalog/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)"
|
|
|
|
pointer class="link">
|
|
|
|
{{("000000"+sale.itemFk).slice(-6)}}
|
|
|
|
</span>
|
2018-07-17 06:44:31 +00:00
|
|
|
</vn-td>
|
2018-07-19 08:44:57 +00:00
|
|
|
<vn-td><vn-fetched-tags concept="sale.concept" tags="sale.item.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>
|
2018-06-06 14:54:40 +00:00
|
|
|
<vn-textfield
|
|
|
|
model="sale.quantity"
|
2018-08-02 13:33:24 +00:00
|
|
|
on-change="$ctrl.updateQuantity(sale.id, sale.quantity)"
|
2018-07-13 13:21:37 +00:00
|
|
|
type="text">
|
2018-06-06 14:54:40 +00:00
|
|
|
</vn-textfield>
|
2018-07-17 06:44:31 +00:00
|
|
|
</vn-td>
|
|
|
|
<vn-td number
|
2018-06-28 13:17:50 +00:00
|
|
|
ng-if="$ctrl.isEditable"
|
2018-07-26 11:49:01 +00:00
|
|
|
class="link"
|
2018-06-28 13:17:50 +00:00
|
|
|
ng-click="$ctrl.showEditPricePopover($event, sale)"
|
|
|
|
pointer
|
2018-07-02 11:17:01 +00:00
|
|
|
vn-tooltip="Edit price">
|
2018-06-28 13:17:50 +00:00
|
|
|
{{sale.price | currency:'€':2}}
|
2018-07-17 06:44:31 +00:00
|
|
|
</vn-td>
|
|
|
|
<vn-td number ng-if="!$ctrl.isEditable">
|
2018-06-28 13:17:50 +00:00
|
|
|
{{sale.price | currency:'€':2}}
|
2018-07-17 06:44:31 +00:00
|
|
|
</vn-td>
|
|
|
|
<vn-td number
|
2018-06-28 13:17:50 +00:00
|
|
|
ng-if="$ctrl.isEditable"
|
2018-07-26 11:49:01 +00:00
|
|
|
class="link"
|
2018-06-28 13:17:50 +00:00
|
|
|
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>
|
|
|
|
{{(sale.quantity * sale.price) -
|
2018-08-02 08:54:03 +00:00
|
|
|
((sale.discount * (sale.quantity * sale.price))/100) | currency:'€':2
|
2018-07-17 06:44:31 +00:00
|
|
|
}}
|
|
|
|
</vn-td>
|
|
|
|
</vn-tr>
|
|
|
|
</vn-tbody>
|
|
|
|
<vn-empty-rows ng-if="model.data.length === 0" translate>
|
|
|
|
No results
|
|
|
|
</vn-empty-rows>
|
|
|
|
<vn-tfoot>
|
|
|
|
<vn-tr ng-if="model.data.length > 0">
|
2018-08-23 06:58:28 +00:00
|
|
|
<vn-td ng-show="$ctrl.isEditable"></vn-td>
|
2018-07-17 06:44:31 +00:00
|
|
|
<vn-td></vn-td>
|
|
|
|
<vn-td></vn-td>
|
|
|
|
<vn-td></vn-td>
|
|
|
|
<vn-td></vn-td>
|
|
|
|
<vn-td></vn-td>
|
|
|
|
<vn-td></vn-td>
|
|
|
|
<vn-td></vn-td>
|
|
|
|
<vn-td number>
|
|
|
|
<section>
|
|
|
|
<p>
|
|
|
|
<vn-label translate>Subtotal</vn-label>
|
2018-08-02 08:54:03 +00:00
|
|
|
<span>{{$ctrl.subTotal | currency:'€':2}}</span>
|
2018-07-17 06:44:31 +00:00
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<vn-label translate>VAT</vn-label>
|
2018-08-02 08:54:03 +00:00
|
|
|
<span>{{$ctrl.VAT | currency:'€':2}}</span>
|
2018-07-17 06:44:31 +00:00
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
<vn-label><strong>Total</strong></vn-label>
|
2018-08-02 08:54:03 +00:00
|
|
|
<strong>{{$ctrl.total | currency:'€':2}}</strong>
|
2018-07-17 06:44:31 +00:00
|
|
|
</p>
|
|
|
|
</section>
|
|
|
|
</vn-td>
|
|
|
|
</vn-tr>
|
|
|
|
</vn-tfoot>
|
|
|
|
</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>
|
|
|
|
|
|
|
|
<!-- 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>
|
|
|
|
|
2018-06-28 13:17:50 +00:00
|
|
|
<!-- Edit Price Popover -->
|
|
|
|
<vn-popover
|
|
|
|
class="edit dialog-summary"
|
|
|
|
vn-id="editPricePopover"
|
|
|
|
on-open="$ctrl.getManaSalespersonMana()">
|
2018-06-06 14:54:40 +00:00
|
|
|
<vn-horizontal pad-medium class="header">
|
2018-08-02 08:54:03 +00:00
|
|
|
<h5>MANÁ: {{$ctrl.mana | currency:'€':0}}</h5>
|
2018-06-06 14:54:40 +00:00
|
|
|
</vn-horizontal>
|
|
|
|
<div pad-medium>
|
|
|
|
<vn-textfield
|
|
|
|
label="Price"
|
2018-06-28 13:17:50 +00:00
|
|
|
model="$ctrl.editedPrice"
|
2018-07-13 13:21:37 +00:00
|
|
|
type="text"
|
2018-08-07 14:06:44 +00:00
|
|
|
on-change="$ctrl.updatePrice()">
|
2018-06-28 13:17:50 +00:00
|
|
|
<t-right-icons>
|
|
|
|
<span class="filter">€</span>
|
|
|
|
</t-right-icons>
|
2018-06-06 14:54:40 +00:00
|
|
|
</vn-textfield>
|
2018-06-28 13:17:50 +00:00
|
|
|
<div class="simulator">
|
|
|
|
<p class="simulatorTitle" translate>New price</p>
|
2018-07-09 07:09:08 +00:00
|
|
|
<p>{{($ctrl.sale.quantity * $ctrl.editedPrice)
|
2018-06-28 13:17:50 +00:00
|
|
|
- (($ctrl.sale.discount * ($ctrl.sale.quantity * $ctrl.editedPrice))/100)
|
2018-08-02 08:54:03 +00:00
|
|
|
| currency:'€':2}}</p>
|
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"
|
|
|
|
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>
|
|
|
|
|
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>
|
|
|
|
<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>
|
2018-07-09 07:48:00 +00:00
|
|
|
<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>
|
2018-06-06 14:54:40 +00:00
|
|
|
</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"
|
2018-07-30 12:46:04 +00:00
|
|
|
on-response="$ctrl.deleteTicket(response)"
|
2018-06-06 14:54:40 +00:00
|
|
|
question="You are going to delete this ticket"
|
|
|
|
message="Continue anyway?">
|
|
|
|
</vn-confirm>
|
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)">
|
|
|
|
</vn-confirm>
|