Merge pull request #16853 from rohitwaghchaure/pos_profile_changes

fix: POS profile, account for change amount must be cash or bank account
This commit is contained in:
rohitwaghchaure 2019-03-07 11:28:25 +05:30 committed by GitHub
commit d06212e408
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 2 deletions

View File

@ -33,6 +33,14 @@ frappe.ui.form.on('POS Profile', {
};
});
frm.set_query("account_for_change_amount", function() {
return {
filters: {
account_type: ['in', ["Cash", "Bank"]]
}
};
});
frm.set_query("print_format", function() {
return { filters: { doc_type: "Sales Invoice", print_format_type: "Js"} };
});

View File

@ -556,6 +556,14 @@ frappe.ui.form.on('Sales Invoice', {
frm.add_fetch('payment_term', 'invoice_portion', 'invoice_portion');
frm.add_fetch('payment_term', 'description', 'description');
frm.set_query("account_for_change_amount", function() {
return {
filters: {
account_type: ['in', ["Cash", "Bank"]]
}
};
});
frm.custom_make_buttons = {
'Delivery Note': 'Delivery',
'Sales Invoice': 'Sales Return',

View File

@ -20,6 +20,7 @@
"collapsible": 0,
"columns": 0,
"depends_on": "eval:parent.doctype == 'POS Profile'",
"fetch_if_empty": 0,
"fieldname": "default",
"fieldtype": "Check",
"hidden": 0,
@ -52,6 +53,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "mode_of_payment",
"fieldtype": "Link",
"hidden": 0,
@ -85,8 +87,9 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "",
"default": "0",
"depends_on": "eval:parent.doctype == 'Sales Invoice'",
"fetch_if_empty": 0,
"fieldname": "amount",
"fieldtype": "Currency",
"hidden": 0,
@ -120,6 +123,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "column_break_3",
"fieldtype": "Column Break",
"hidden": 0,
@ -151,6 +155,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "account",
"fieldtype": "Link",
"hidden": 0,
@ -185,6 +190,7 @@
"collapsible": 0,
"columns": 0,
"fetch_from": "mode_of_payment.type",
"fetch_if_empty": 0,
"fieldname": "type",
"fieldtype": "Read Only",
"hidden": 0,
@ -218,6 +224,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "base_amount",
"fieldtype": "Currency",
"hidden": 0,
@ -251,6 +258,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"fetch_if_empty": 0,
"fieldname": "clearance_date",
"fieldtype": "Date",
"hidden": 0,
@ -287,7 +295,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2019-02-18 15:03:59.720469",
"modified": "2019-03-06 15:58:37.839241",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Payment",