Merge branch 'develop' into cash-flow-chart

This commit is contained in:
Shivam Mishra
2019-07-11 10:12:45 +05:30
committed by GitHub
3 changed files with 23 additions and 14 deletions

View File

@@ -187,9 +187,13 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
method: "erpnext.selling.doctype.quotation.quotation.make_sales_invoice", method: "erpnext.selling.doctype.quotation.quotation.make_sales_invoice",
source_doctype: "Quotation", source_doctype: "Quotation",
target: me.frm, target: me.frm,
setters: { setters: [{
customer: me.frm.doc.customer || undefined, fieldtype: 'Link',
}, label: __('Customer'),
options: 'Customer',
fieldname: 'party_name',
default: me.frm.doc.customer,
}],
get_query_filters: { get_query_filters: {
docstatus: 1, docstatus: 1,
status: ["!=", "Lost"], status: ["!=", "Lost"],

View File

@@ -8,17 +8,19 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() {
// The last item in the array is the definition for Presentation Currency // The last item in the array is the definition for Presentation Currency
// filter. It won't be used in cash flow for now so we pop it. Please take // filter. It won't be used in cash flow for now so we pop it. Please take
// of this if you are working here. // of this if you are working here.
frappe.query_reports["Cash Flow"]["filters"].pop();
frappe.query_reports["Cash Flow"]["filters"].push({ frappe.query_reports["Cash Flow"]["filters"].splice(5, 1);
"fieldname": "accumulated_values",
"label": __("Accumulated Values"),
"fieldtype": "Check"
});
frappe.query_reports["Cash Flow"]["filters"].push({ frappe.query_reports["Cash Flow"]["filters"].push(
"fieldname": "include_default_book_entries", {
"label": __("Include Default Book Entries"), "fieldname": "accumulated_values",
"fieldtype": "Check" "label": __("Accumulated Values"),
}); "fieldtype": "Check"
},
{
"fieldname": "include_default_book_entries",
"label": __("Include Default Book Entries"),
"fieldtype": "Check"
}
);
}); });

View File

@@ -141,6 +141,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
price_list_rate: function(doc, cdt, cdn) { price_list_rate: function(doc, cdt, cdn) {
var item = frappe.get_doc(cdt, cdn); var item = frappe.get_doc(cdt, cdn);
frappe.model.round_floats_in(item, ["price_list_rate", "discount_percentage"]); frappe.model.round_floats_in(item, ["price_list_rate", "discount_percentage"]);
let item_rate = item.price_list_rate; let item_rate = item.price_list_rate;
@@ -154,6 +155,8 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
if (item.discount_amount) { if (item.discount_amount) {
item.rate = flt((item.price_list_rate) - (item.discount_amount), precision('rate', item)); item.rate = flt((item.price_list_rate) - (item.discount_amount), precision('rate', item));
} else {
item.rate = item_rate;
} }
this.calculate_taxes_and_totals(); this.calculate_taxes_and_totals();