Advance Payment Entry adjustment against Invoice

This commit is contained in:
Nabin Hait
2016-06-27 17:41:39 +05:30
parent e3a10170f7
commit 28a0528ae4
21 changed files with 509 additions and 278 deletions

View File

@@ -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");
}
})
}
}
});