2486 - Changed date filter
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2020-10-06 08:52:11 +02:00
parent 530a4026f8
commit 6ecf595a11
2 changed files with 22 additions and 13 deletions

View File

@ -7,25 +7,25 @@
order="landed DESC, buyFk DESC"
limit="20">
</vn-crud-model>
<vn-card class="vn-mb-md vn-w-xl vn-pa-lg">
<vn-date-picker
vn-none
label="Since"
ng-model="$ctrl.date">
</vn-date-picker>
</vn-card>
<vn-data-viewer
model="model"
class="vn-mb-xl vn-w-xl">
<vn-card class="vn-pa-lg">
<vn-vertical>
<vn-horizontal>
<vn-date-picker
vn-one
label="Since"
ng-model="$ctrl.date">
</vn-date-picker>
<!--datepicker-->
</vn-horizontal>
<vn-table model="model">
<vn-thead>
<vn-tr>
<vn-th vn-tooltip="Ignored" center>Ig</vn-th>
<vn-th field="warehouseFk">Warehouse</vn-th>
<vn-th field="landed">Landed</vn-th>
<vn-th field="landed" expand>Landed</vn-th>
<vn-th number>Entry</vn-th>
<vn-th number vn-tooltip="Price Per Unit">P.P.U</vn-th>
<vn-th number vn-tooltip="Price Per Package">P.P.P</vn-th>
@ -48,8 +48,8 @@
disabled="true">
</vn-check>
</vn-td>
<vn-td>{{::entry.warehouse| dashIfEmpty}}</vn-td>
<vn-td>{{::entry.landed | date:'dd/MM/yyyy HH:mm'}}</vn-td>
<vn-td title="{{::entry.warehouse| dashIfEmpty}}">{{::entry.warehouse| dashIfEmpty}}</vn-td>
<vn-td expand>{{::entry.landed | date:'dd/MM/yyyy HH:mm'}}</vn-td>
<vn-td number>{{::entry.entryFk | dashIfEmpty}}</vn-td>
<vn-td number>{{::entry.price2 | dashIfEmpty}}</vn-td>
<vn-td number>{{::entry.price3 | dashIfEmpty}}</vn-td>
@ -69,7 +69,7 @@
<vn-td number class="expendable">{{::entry.buyingValue | dashIfEmpty}}</vn-td>
<vn-td number>{{::entry.weight | dashIfEmpty}}</vn-td>
<vn-td number>{{::entry.packageFk | dashIfEmpty}}</vn-td>
<vn-td class="expendable">{{::entry.supplier | dashIfEmpty}}</vn-td>
<vn-td class="expendable" title="{{::entry.supplier | dashIfEmpty}}">{{::entry.supplier | dashIfEmpty}}</vn-td>
</vn-tr>
</vn-tbody>
</vn-table>

View File

@ -30,7 +30,16 @@ class Controller extends Section {
if (!value) return;
this.filter.where.date = value;
const from = new Date(value);
from.setHours(0, 0, 0, 0);
const to = new Date();
to.setDate(to.getDate() + 10);
to.setHours(23, 59, 59, 59);
this.filter.where.shipped = {
between: [from, to]
};
this.$.model.refresh();
}