Add price confirm prompt when adding unknown item to custorder
optional, per config
This commit is contained in:
parent
4247804707
commit
72dda3771e
3 changed files with 105 additions and 2 deletions
|
@ -757,6 +757,12 @@
|
|||
</b-input>
|
||||
</b-field>
|
||||
|
||||
<b-field label="Gross Margin">
|
||||
<span class="control">
|
||||
{{ pendingProductGrossMargin }}
|
||||
</span>
|
||||
</b-field>
|
||||
|
||||
</b-field>
|
||||
|
||||
<b-field label="Notes">
|
||||
|
@ -905,6 +911,52 @@
|
|||
</div>
|
||||
</b-modal>
|
||||
|
||||
% if unknown_product_confirm_price:
|
||||
<b-modal has-modal-card
|
||||
:active.sync="confirmPriceShowDialog">
|
||||
<div class="modal-card">
|
||||
|
||||
<header class="modal-card-head">
|
||||
<p class="modal-card-title">Confirm Price</p>
|
||||
</header>
|
||||
|
||||
<section class="modal-card-body">
|
||||
<p class="block">
|
||||
Please confirm the price info before proceeding.
|
||||
</p>
|
||||
|
||||
<div style="white-space: nowrap;">
|
||||
|
||||
<b-field label="Unit Cost" horizontal>
|
||||
<span>{{ pendingProduct.unit_cost }}</span>
|
||||
</b-field>
|
||||
|
||||
<b-field label="Unit Reg. Price" horizontal>
|
||||
<span>{{ pendingProduct.regular_price_amount }}</span>
|
||||
</b-field>
|
||||
|
||||
<b-field label="Gross Margin" horizontal>
|
||||
<span>{{ pendingProductGrossMargin }}</span>
|
||||
</b-field>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<footer class="modal-card-foot">
|
||||
<b-button type="is-primary"
|
||||
icon-pack="fas"
|
||||
icon-left="check"
|
||||
@click="confirmPriceSave()">
|
||||
Confirm
|
||||
</b-button>
|
||||
<b-button @click="confirmPriceCancel()">
|
||||
Cancel
|
||||
</b-button>
|
||||
</footer>
|
||||
</div>
|
||||
</b-modal>
|
||||
% endif
|
||||
|
||||
<tailbone-product-lookup ref="productLookup"
|
||||
@canceled="productLookupCanceled"
|
||||
@selected="productLookupSelected">
|
||||
|
@ -1242,6 +1294,9 @@
|
|||
pendingProduct: {},
|
||||
pendingProductRequiredFields: ${json.dumps(pending_product_required_fields)|n},
|
||||
departmentOptions: ${json.dumps(department_options)|n},
|
||||
% if unknown_product_confirm_price:
|
||||
confirmPriceShowDialog: false,
|
||||
% endif
|
||||
|
||||
submittingOrder: false,
|
||||
}
|
||||
|
@ -1428,6 +1483,15 @@
|
|||
|
||||
% endif
|
||||
|
||||
pendingProductGrossMargin() {
|
||||
let cost = this.pendingProduct.unit_cost
|
||||
let price = this.pendingProduct.regular_price_amount
|
||||
if (cost && price) {
|
||||
let margin = (price - cost) / price
|
||||
return (100 * margin).toFixed(2).toString() + " %"
|
||||
}
|
||||
},
|
||||
|
||||
itemDialogSaveDisabled() {
|
||||
|
||||
if (this.itemDialogSaving) {
|
||||
|
@ -2116,7 +2180,7 @@
|
|||
}
|
||||
},
|
||||
|
||||
itemDialogSave() {
|
||||
itemDialogAttemptSave() {
|
||||
this.itemDialogSaving = true
|
||||
|
||||
let params = {
|
||||
|
@ -2168,6 +2232,30 @@
|
|||
this.itemDialogSaving = false
|
||||
})
|
||||
},
|
||||
|
||||
itemDialogSave() {
|
||||
|
||||
% if unknown_product_confirm_price:
|
||||
if (!this.productIsKnown && !this.editingItem) {
|
||||
this.showingItemDialog = false
|
||||
this.confirmPriceShowDialog = true
|
||||
return
|
||||
}
|
||||
% endif
|
||||
|
||||
this.itemDialogAttemptSave()
|
||||
},
|
||||
|
||||
confirmPriceCancel() {
|
||||
this.confirmPriceShowDialog = false
|
||||
this.showingItemDialog = true
|
||||
},
|
||||
|
||||
confirmPriceSave() {
|
||||
this.confirmPriceShowDialog = false
|
||||
this.showingItemDialog = true
|
||||
this.itemDialogAttemptSave()
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue