salix/modules/entry/front/basic-data/index.html

235 lines
8.0 KiB
HTML
Raw Normal View History

2020-10-13 06:42:13 +00:00
<mg-ajax path="Entries/{{patch.params.id}}" options="vnPatch"></mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.entry"
2020-10-13 06:42:13 +00:00
form="form"
save="patch">
</vn-watcher>
2023-05-25 09:41:14 +00:00
<vn-crud-model
auto-load="true"
url="Warehouses"
data="warehouses">
</vn-crud-model>
<form name="form" ng-submit="watcher.submit()" class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-horizontal>
2023-05-05 06:12:38 +00:00
<vn-autocomplete
vn-one
ng-model="$ctrl.entry.supplierFk"
url="Suppliers"
show-field="nickname"
search-function="{or: [{id: $search}, {nickname: {like: '%'+ $search +'%'}}]}"
value-field="id"
order="nickname"
label="Supplier"
required="true">
<tpl-item>
2023-05-05 06:12:38 +00:00
<div>#{{::nickname}}</div>
<div class="text-secondary text-caption">#{{::id}}</div>
</tpl-item>
</vn-autocomplete>
<vn-autocomplete
vn-one
ng-model="$ctrl.entry.travelFk"
url="Travels/filter"
search-function="$ctrl.searchFunction($search)"
value-field="id"
2023-05-05 06:12:38 +00:00
show-field="warehouseInName"
order="id"
label="Travel"
required="true">
<tpl-item>
2023-05-05 06:12:38 +00:00
<div>
{{::agencyModeName}} - {{::warehouseInName}} ({{::shipped | date: 'dd/MM/yyyy'}}) &#x2192;
{{::warehouseOutName}} ({{::landed | date: 'dd/MM/yyyy'}})
</div>
<div class="text-secondary text-caption">#{{::id}}</div>
</tpl-item>
<append>
<vn-icon-button
icon="filter_alt"
vn-click-stop="$ctrl.showFilterDialog($ctrl.entry.travelFk)"
vn-tooltip="Filter...">
</vn-icon-button>
</append>
</vn-autocomplete>
</vn-horizontal>
2020-10-05 07:24:49 +00:00
<vn-horizontal>
<vn-textfield
vn-one
label="Reference"
2022-10-26 10:48:48 +00:00
ng-model="$ctrl.entry.reference"
2020-10-05 07:24:49 +00:00
rule
vn-focus>
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
2022-10-26 10:48:48 +00:00
<vn-textfield
2020-10-05 07:24:49 +00:00
vn-one
2022-10-26 10:48:48 +00:00
label="Invoice number"
ng-model="$ctrl.entry.invoiceNumber"
rule
vn-focus>
</vn-textfield>
<vn-autocomplete
url="Companies"
label="Company"
show-field="code"
value-field="id"
ng-model="$ctrl.entry.companyFk">
</vn-autocomplete>
2020-10-05 07:24:49 +00:00
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete
2022-10-26 10:48:48 +00:00
vn-one
label="Currency"
ng-model="$ctrl.entry.currencyFk"
url="Currencies"
show-field="code"
value-field="id">
</vn-autocomplete>
<vn-input-number
vn-one
step="0.1"
label="Commission"
ng-model="$ctrl.entry.commission"
rule>
</vn-input-number>
2022-10-26 10:48:48 +00:00
</vn-horizontal>
<vn-horizontal>
<vn-textarea
vn-one
2023-05-05 06:12:38 +00:00
label="Observation"
2022-10-26 10:48:48 +00:00
ng-model="$ctrl.entry.observation"
rule>
</vn-textarea>
</vn-horizontal>
<vn-horizontal>
<vn-check
2023-05-05 06:12:38 +00:00
label="Ordered"
ng-model="$ctrl.entry.isOrdered">
</vn-check>
<vn-check
2023-05-05 06:12:38 +00:00
label="Confirmed"
ng-model="$ctrl.entry.isConfirmed">
</vn-check>
<vn-check
2023-05-05 06:12:38 +00:00
label="Inventory"
2022-07-01 07:53:44 +00:00
ng-model="$ctrl.entry.isExcludedFromAvailable">
</vn-check>
<vn-check
2023-05-05 06:12:38 +00:00
label="Raid"
ng-model="$ctrl.entry.isRaid">
</vn-check>
<vn-check
2023-05-05 06:12:38 +00:00
label="Booked"
ng-model="$ctrl.entry.isBooked"
vn-acl="administrative"
>
</vn-check>
</vn-horizontal>
</vn-card>
<vn-button-bar>
2020-12-14 16:35:32 +00:00
<vn-submit
2020-12-15 15:53:56 +00:00
disabled="!watcher.dataChanged()"
2020-12-14 16:35:32 +00:00
label="Save">
</vn-submit>
<vn-button
2020-12-15 15:53:56 +00:00
class="cancel"
2020-12-14 16:35:32 +00:00
label="Undo changes"
2020-12-15 15:53:56 +00:00
disabled="!watcher.dataChanged()"
2020-12-14 16:35:32 +00:00
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar>
</form>
<!-- Filter travel dialog -->
<vn-dialog
vn-id="filterDialog"
message="Filter travel">
<tpl-body class="travelFilter">
<vn-horizontal>
<vn-autocomplete
label="Agency"
2022-07-13 12:36:03 +00:00
ng-model="$ctrl.travelFilterParams.agencyModeFk"
url="AgencyModes"
show-field="name"
value-field="id">
</vn-autocomplete>
<vn-autocomplete
label="Warehouse Out"
ng-model="$ctrl.travelFilterParams.warehouseOutFk"
2023-05-30 13:48:09 +00:00
data="warehouses"
show-field="name"
value-field="id">
</vn-autocomplete>
<vn-autocomplete
label="Warehouse In"
ng-model="$ctrl.travelFilterParams.warehouseInFk"
2023-05-30 13:48:09 +00:00
data="warehouses"
show-field="name"
value-field="id">
</vn-autocomplete>
<vn-date-picker
2023-05-05 06:12:38 +00:00
label="Shipped"
ng-model="$ctrl.travelFilterParams.shipped">
</vn-date-picker>
<vn-date-picker
2023-05-05 06:12:38 +00:00
label="Landed"
ng-model="$ctrl.travelFilterParams.landed">
</vn-date-picker>
</vn-horizontal>
<vn-horizontal class="vn-mb-md">
<vn-button vn-none
label="Search"
ng-click="$ctrl.filter()">
</vn-button>
</vn-horizontal>
<vn-crud-model
2023-05-05 06:12:38 +00:00
vn-id="travelsModel"
url="Travels"
filter="$ctrl.travelFilter"
data="travels"
limit="10">
</vn-crud-model>
<vn-data-viewer
model="travelsModel"
class="vn-w-lg">
<vn-table class="scrollable">
<vn-thead>
<vn-tr>
<vn-th shrink>ID</vn-th>
<vn-th expand>Agency</vn-th>
<vn-th expand>Warehouse Out</vn-th>
<vn-th expand>Warehouse In</vn-th>
<vn-th expand>Shipped</vn-th>
<vn-th expand>Landed</vn-th>
</vn-tr>
</vn-thead>
<vn-tbody>
<a ng-repeat="travel in travels"
class="clickable vn-tr search-result"
ng-click="$ctrl.selectTravel(travel.id)">
<vn-td shrink>
<span
vn-click-stop="travelDescriptor.show($event, travel.id)"
class="link">
{{::travel.id}}
</span>
</vn-td>
<vn-td expand>{{::travel.agency.name}}</vn-td>
<vn-td expand>{{::travel.warehouseOut.name}}</vn-td>
<vn-td expand>{{::travel.warehouseIn.name}}</vn-td>
<vn-td expand>{{::travel.shipped | date: 'dd/MM/yyyy'}}</vn-td>
<vn-td expand>{{::travel.landed | date: 'dd/MM/yyyy'}}</vn-td>
</a>
</vn-tbody>
</vn-table>
</vn-data-viewer>
<vn-travel-descriptor-popover
vn-id="travel-descriptor"
warehouse-fk="$ctrl.vnConfig.warehouseFk">
</vn-travel-descriptor-popover>
</tpl-body>
2023-05-05 06:12:38 +00:00
</vn-dialog>