Advance Payment Entry adjustment against Invoice
This commit is contained in:
@@ -4,6 +4,16 @@
|
||||
erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
||||
setup: function() {
|
||||
this._super();
|
||||
|
||||
if(in_list(["Sales Invoice", "Purchase Invoice"], this.frm.doc.doctype)) {
|
||||
this.frm.get_field('advances').grid.editable_fields = [
|
||||
{fieldname: 'reference_name', columns: 2},
|
||||
{fieldname: 'remarks', columns: 3},
|
||||
{fieldname: 'advance_amount', columns: 3},
|
||||
{fieldname: 'allocated_amount', columns: 3}
|
||||
];
|
||||
}
|
||||
|
||||
frappe.ui.form.on(this.frm.doctype + " Item", "rate", function(frm, cdt, cdn) {
|
||||
var item = frappe.get_doc(cdt, cdn);
|
||||
frappe.model.round_floats_in(item, ["rate", "price_list_rate"]);
|
||||
@@ -978,5 +988,17 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
||||
if(!this.item_selector) {
|
||||
this.item_selector = new erpnext.ItemSelector({frm: this.frm});
|
||||
}
|
||||
},
|
||||
|
||||
get_advances: function() {
|
||||
if(!this.frm.is_return) {
|
||||
return this.frm.call({
|
||||
method: "set_advances",
|
||||
doc: this.frm.doc,
|
||||
callback: function(r, rt) {
|
||||
refresh_field("advances");
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user