Honor the "product price may be questionable" flag for new custorder
i.e. don't expose the per-item flag unless *that* flag is set
This commit is contained in:
parent
4d33e3dcbe
commit
1bdb845032
2 changed files with 44 additions and 5 deletions
|
@ -545,12 +545,14 @@
|
|||
<!-- </b-field> -->
|
||||
</b-field>
|
||||
|
||||
% if product_price_may_be_questionable:
|
||||
<b-checkbox v-model="productPriceNeedsConfirmation"
|
||||
type="is-warning"
|
||||
size="is-small">
|
||||
This price is questionable and should be confirmed
|
||||
by someone before order proceeds.
|
||||
</b-checkbox>
|
||||
% endif
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@ -629,7 +631,11 @@
|
|||
</b-table-column>
|
||||
|
||||
<b-table-column field="total_price_display" label="Total">
|
||||
<span :class="props.row.price_needs_confirmation ? 'has-background-warning' : ''">
|
||||
<span
|
||||
% if product_price_may_be_questionable:
|
||||
:class="props.row.price_needs_confirmation ? 'has-background-warning' : ''"
|
||||
% endif
|
||||
>
|
||||
{{ props.row.total_price_display }}
|
||||
</span>
|
||||
</b-table-column>
|
||||
|
@ -758,7 +764,10 @@
|
|||
defaultUOM: defaultUOM,
|
||||
productUOM: defaultUOM,
|
||||
productCaseSize: null,
|
||||
|
||||
% if product_price_may_be_questionable:
|
||||
productPriceNeedsConfirmation: false,
|
||||
% endif
|
||||
|
||||
## TODO: should find a better way to handle CSRF token
|
||||
csrftoken: ${json.dumps(request.session.get_csrf_token() or request.session.new_csrf_token())|n},
|
||||
|
@ -1290,7 +1299,11 @@
|
|||
this.productQuantity = 1
|
||||
this.productUnitChoices = this.defaultUnitChoices
|
||||
this.productUOM = this.defaultUOM
|
||||
|
||||
% if product_price_may_be_questionable:
|
||||
this.productPriceNeedsConfirmation = false
|
||||
% endif
|
||||
|
||||
this.showingItemDialog = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.productAutocomplete.focus()
|
||||
|
@ -1311,7 +1324,10 @@
|
|||
this.productQuantity = row.order_quantity
|
||||
this.productUnitChoices = row.order_uom_choices
|
||||
this.productUOM = row.order_uom
|
||||
|
||||
% if product_price_may_be_questionable:
|
||||
this.productPriceNeedsConfirmation = row.price_needs_confirmation
|
||||
% endif
|
||||
|
||||
this.showingItemDialog = true
|
||||
},
|
||||
|
@ -1348,7 +1364,10 @@
|
|||
this.productURL = null
|
||||
this.productImageURL = null
|
||||
this.productUnitChoices = this.defaultUnitChoices
|
||||
|
||||
% if product_price_may_be_questionable:
|
||||
this.productPriceNeedsConfirmation = false
|
||||
% endif
|
||||
},
|
||||
|
||||
setProductUnitChoices(choices) {
|
||||
|
@ -1387,7 +1406,10 @@
|
|||
this.productURL = response.data.url
|
||||
this.productImageURL = response.data.image_url
|
||||
this.setProductUnitChoices(response.data.uom_choices)
|
||||
|
||||
% if product_price_may_be_questionable:
|
||||
this.productPriceNeedsConfirmation = false
|
||||
% endif
|
||||
})
|
||||
} else {
|
||||
this.clearProduct()
|
||||
|
@ -1401,7 +1423,10 @@
|
|||
product_uuid: this.productUUID,
|
||||
order_quantity: this.productQuantity,
|
||||
order_uom: this.productUOM,
|
||||
|
||||
% if product_price_may_be_questionable:
|
||||
price_needs_confirmation: this.productPriceNeedsConfirmation,
|
||||
% endif
|
||||
}
|
||||
|
||||
if (this.editingItem) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue