Cash drawer is now open when Cash payment is involved
This commit is contained in:
@@ -90,8 +90,15 @@ frappe.router.on("change", () => {
|
||||
</div>`);
|
||||
}
|
||||
|
||||
erpnext.PointOfSale.PastOrderSummary.prototype.get_used_payment_types = function(payments) {
|
||||
const filtered_payments = payments.filter(payment => payment.amount > 0);
|
||||
return filtered_payments.map(payment => payment.type);
|
||||
}
|
||||
|
||||
erpnext.PointOfSale.PastOrderSummary.prototype.open_cash_drawer = function(doc) {
|
||||
if (doc.change_amount == 0) {
|
||||
const used_type_payments = this.get_used_payment_types(doc.payments);
|
||||
|
||||
if (!used_type_payments.includes("Cash")) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user