2499 - Allow zero quantity #411

Merged
bernat merged 2 commits from 2499-sale_quantity_zero into dev 2020-10-13 08:43:06 +00:00
2 changed files with 4 additions and 6 deletions

View File

@ -1,11 +1,9 @@
<mg-ajax path="Entries/{{patch.params.id}}" options="vnPatch"></mg-ajax>
<vn-watcher <vn-watcher
vn-id="watcher" vn-id="watcher"
url="Entries"
id-field="id"
data="$ctrl.entry" data="$ctrl.entry"
params="$ctrl.entry" form="form"
save="patch" save="patch">
form="form">
</vn-watcher> </vn-watcher>
<form name="form" ng-submit="watcher.submit()" class="vn-w-md"> <form name="form" ng-submit="watcher.submit()" class="vn-w-md">
<vn-card class="vn-pa-lg"> <vn-card class="vn-pa-lg">

View File

@ -386,7 +386,7 @@ class Controller extends Section {
* Updates the sale quantity for existing instance * Updates the sale quantity for existing instance
*/ */
changeQuantity(sale) { changeQuantity(sale) {
if (!sale.itemFk || !sale.quantity) return; if (!sale.itemFk || sale.quantity == null) return;
if (!sale.id) if (!sale.id)
return this.addSale(sale); return this.addSale(sale);