Merge branch 'develop' into breadcrumbs-module-map-2
This commit is contained in:
commit
ef1d0d1d14
@ -187,9 +187,13 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
method: "erpnext.selling.doctype.quotation.quotation.make_sales_invoice",
|
||||
source_doctype: "Quotation",
|
||||
target: me.frm,
|
||||
setters: {
|
||||
customer: me.frm.doc.customer || undefined,
|
||||
},
|
||||
setters: [{
|
||||
fieldtype: 'Link',
|
||||
label: __('Customer'),
|
||||
options: 'Customer',
|
||||
fieldname: 'party_name',
|
||||
default: me.frm.doc.customer,
|
||||
}],
|
||||
get_query_filters: {
|
||||
docstatus: 1,
|
||||
status: ["!=", "Lost"],
|
||||
|
@ -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
|
||||
// filter. It won't be used in cash flow for now so we pop it. Please take
|
||||
// of this if you are working here.
|
||||
frappe.query_reports["Cash Flow"]["filters"].pop();
|
||||
|
||||
frappe.query_reports["Cash Flow"]["filters"].push({
|
||||
"fieldname": "accumulated_values",
|
||||
"label": __("Accumulated Values"),
|
||||
"fieldtype": "Check"
|
||||
});
|
||||
frappe.query_reports["Cash Flow"]["filters"].splice(5, 1);
|
||||
|
||||
frappe.query_reports["Cash Flow"]["filters"].push({
|
||||
"fieldname": "include_default_book_entries",
|
||||
"label": __("Include Default Book Entries"),
|
||||
"fieldtype": "Check"
|
||||
});
|
||||
frappe.query_reports["Cash Flow"]["filters"].push(
|
||||
{
|
||||
"fieldname": "accumulated_values",
|
||||
"label": __("Accumulated Values"),
|
||||
"fieldtype": "Check"
|
||||
},
|
||||
{
|
||||
"fieldname": "include_default_book_entries",
|
||||
"label": __("Include Default Book Entries"),
|
||||
"fieldtype": "Check"
|
||||
}
|
||||
);
|
||||
});
|
@ -13,5 +13,5 @@ def execute():
|
||||
WHERE
|
||||
`tabGL Entry`.voucher_no = `tab{doctype}`.name and `tabGL Entry`.party is not null
|
||||
and `tabGL Entry`.voucher_type in ('Sales Invoice', 'Purchase Invoice', 'Journal Entry')
|
||||
and account in (select name from `tabAccount` where account_type in ('Receivable', 'Payable') )""" #nosec
|
||||
and `tabGL Entry`.account in (select name from `tabAccount` where account_type in ('Receivable', 'Payable'))""" #nosec
|
||||
.format(doctype=doctype))
|
||||
|
@ -141,6 +141,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
||||
|
||||
price_list_rate: function(doc, cdt, cdn) {
|
||||
var item = frappe.get_doc(cdt, cdn);
|
||||
|
||||
frappe.model.round_floats_in(item, ["price_list_rate", "discount_percentage"]);
|
||||
|
||||
let item_rate = item.price_list_rate;
|
||||
@ -154,6 +155,8 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
||||
|
||||
if (item.discount_amount) {
|
||||
item.rate = flt((item.price_list_rate) - (item.discount_amount), precision('rate', item));
|
||||
} else {
|
||||
item.rate = item_rate;
|
||||
}
|
||||
|
||||
this.calculate_taxes_and_totals();
|
||||
|
@ -573,7 +573,6 @@ erpnext.utils.map_current_doc = function(opts) {
|
||||
if(!r.exc) {
|
||||
var doc = frappe.model.sync(r.message);
|
||||
cur_frm.dirty();
|
||||
erpnext.utils.clear_duplicates();
|
||||
cur_frm.refresh();
|
||||
}
|
||||
}
|
||||
@ -604,28 +603,6 @@ erpnext.utils.map_current_doc = function(opts) {
|
||||
}
|
||||
}
|
||||
|
||||
erpnext.utils.clear_duplicates = function() {
|
||||
if(!cur_frm.doc.items) return;
|
||||
const unique_items = new Map();
|
||||
/*
|
||||
Create a Map of items with
|
||||
item_code => [qty, warehouse, batch_no]
|
||||
*/
|
||||
let items = [];
|
||||
|
||||
for (let item of cur_frm.doc.items) {
|
||||
if (!(unique_items.has(item.item_code) && unique_items.get(item.item_code)[0] === item.qty &&
|
||||
unique_items.get(item.item_code)[1] === item.warehouse && unique_items.get(item.item_code)[2] === item.batch_no &&
|
||||
unique_items.get(item.item_code)[3] === item.delivery_date && unique_items.get(item.item_code)[4] === item.required_date &&
|
||||
unique_items.get(item.item_code)[5] === item.rate)) {
|
||||
|
||||
unique_items.set(item.item_code, [item.qty, item.warehouse, item.batch_no, item.delivery_date, item.required_date, item.rate]);
|
||||
items.push(item);
|
||||
}
|
||||
}
|
||||
cur_frm.doc.items = items;
|
||||
}
|
||||
|
||||
frappe.form.link_formatters['Item'] = function(value, doc) {
|
||||
if(doc && doc.item_name && doc.item_name !== value) {
|
||||
return value? value + ': ' + doc.item_name: doc.item_name;
|
||||
|
@ -107,7 +107,7 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
|
||||
refresh: function(doc, dt, dn) {
|
||||
var me = this;
|
||||
this._super();
|
||||
var allow_delivery = false;
|
||||
let allow_delivery = false;
|
||||
|
||||
if(doc.docstatus==1) {
|
||||
if(this.frm.has_perm("submit")) {
|
||||
@ -132,6 +132,8 @@ erpnext.selling.SalesOrderController = erpnext.selling.SellingController.extend(
|
||||
if(doc.status !== 'Closed') {
|
||||
if(doc.status !== 'On Hold') {
|
||||
|
||||
allow_delivery = this.frm.doc.items.some(item => item.delivered_by_supplier === 0 && item.qty > flt(item.delivered_qty))
|
||||
|
||||
if (this.frm.has_perm("submit")) {
|
||||
if(flt(doc.per_delivered, 6) < 100 || flt(doc.per_billed) < 100) {
|
||||
// hold
|
||||
|
@ -136,7 +136,7 @@ function set_time_to_resolve_and_response(frm) {
|
||||
|
||||
var time_to_resolve = get_status(frm.doc.resolution_by_variance);
|
||||
if (!frm.doc.resolution_date && frm.doc.agreement_fulfilled === "Ongoing") {
|
||||
time_to_resolve = get_time_left(frm.doc.response_by, frm.doc.agreement_fulfilled);
|
||||
time_to_resolve = get_time_left(frm.doc.resolution_by, frm.doc.agreement_fulfilled);
|
||||
}
|
||||
|
||||
frm.dashboard.set_headline_alert(
|
||||
|
Loading…
Reference in New Issue
Block a user