mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 15:12:51 +00:00
Merge branch 'develop' into item-tax-update-items
This commit is contained in:
@@ -503,11 +503,11 @@ erpnext.buying.get_items_from_product_bundle = function(frm) {
|
||||
|
||||
if(!r.exc && r.message) {
|
||||
remove_empty_first_row(frm);
|
||||
for ( var i=0; i< r.message.length; i++ ) {
|
||||
for (var i=0; i< r.message.length; i++) {
|
||||
var d = frm.add_child("items");
|
||||
var item = r.message[i];
|
||||
for ( var key in item) {
|
||||
if ( !is_null(item[key]) ) {
|
||||
for (var key in item) {
|
||||
if (!is_null(item[key]) && key !== "doctype") {
|
||||
d[key] = item[key];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -673,23 +673,14 @@ erpnext.taxes_and_totals = erpnext.payments.extend({
|
||||
);
|
||||
}
|
||||
|
||||
frappe.db.get_value('Sales Invoice Payment', {'parent': this.frm.doc.pos_profile, 'default': 1},
|
||||
['mode_of_payment', 'account', 'type'], (value) => {
|
||||
if (this.frm.is_dirty()) {
|
||||
frappe.model.clear_table(this.frm.doc, 'payments');
|
||||
if (value) {
|
||||
let row = frappe.model.add_child(this.frm.doc, 'Sales Invoice Payment', 'payments');
|
||||
row.mode_of_payment = value.mode_of_payment;
|
||||
row.type = value.type;
|
||||
row.account = value.account;
|
||||
row.default = 1;
|
||||
row.amount = total_amount_to_pay;
|
||||
} else {
|
||||
this.frm.set_value('is_pos', 1);
|
||||
}
|
||||
this.frm.refresh_fields();
|
||||
}
|
||||
}, 'Sales Invoice');
|
||||
this.frm.doc.payments.find(pay => {
|
||||
if (pay.default) {
|
||||
pay.amount = total_amount_to_pay;
|
||||
} else {
|
||||
pay.amount = 0.0
|
||||
}
|
||||
});
|
||||
this.frm.refresh_fields();
|
||||
|
||||
this.calculate_paid_amount();
|
||||
},
|
||||
|
||||
@@ -781,10 +781,23 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
||||
else var date = this.frm.doc.transaction_date;
|
||||
|
||||
if (frappe.meta.get_docfield(this.frm.doctype, "shipping_address") &&
|
||||
in_list(['Purchase Order', 'Purchase Receipt', 'Purchase Invoice'], this.frm.doctype)){
|
||||
in_list(['Purchase Order', 'Purchase Receipt', 'Purchase Invoice'], this.frm.doctype)) {
|
||||
erpnext.utils.get_shipping_address(this.frm, function(){
|
||||
set_party_account(set_pricing);
|
||||
})
|
||||
|
||||
// Get default company billing address in Purchase Invoice, Order and Receipt
|
||||
frappe.call({
|
||||
'method': 'frappe.contacts.doctype.address.address.get_default_address',
|
||||
'args': {
|
||||
'doctype': 'Company',
|
||||
'name': this.frm.doc.company
|
||||
},
|
||||
'callback': function(r) {
|
||||
me.frm.set_value('billing_address', r.message);
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
set_party_account(set_pricing);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user