[enhance] Provision to set default mode of payment for the POS in POS profile

This commit is contained in:
Rohit Waghchaure
2017-07-24 17:53:10 +05:30
parent 8907f1d2c3
commit 5296e3c321
6 changed files with 96 additions and 4 deletions

View File

@@ -584,7 +584,7 @@ erpnext.taxes_and_totals = erpnext.payments.extend({
var payment_status = true;
if(this.frm.doc.is_pos && (update_paid_amount===undefined || update_paid_amount)){
$.each(this.frm.doc['payments'] || [], function(index, data){
if(data.type == "Cash" && payment_status && total_amount_to_pay > 0) {
if(data.default && payment_status && total_amount_to_pay > 0) {
data.base_amount = flt(total_amount_to_pay, precision("base_amount"));
data.amount = flt(total_amount_to_pay / me.frm.doc.conversion_rate, precision("amount"));
payment_status = false;

View File

@@ -17,6 +17,6 @@
</div>
<div class="pos-list-row">
<div class="cell">{{ __("Amount") }}:</div>
<input type="tel" class="form-control cell pos-amount" value="{%= amount %}"/>
<input type="tel" class="form-control cell pos-amount" disabled value="{%= amount %}"/>
</div>
</div>