tüit Logo

Daten auf Mahnung automatisch berechnen

frappe.ui.form.on('Dunning', {
	validate(frm) {
		// your code here
	    frm.set_value('sub_sum',frm.doc.outstanding_amount+frm.doc.interest_amount)
	    
	},
	refresh(frm) {
	    if (frm.doc.docstatus===1 && !frm.doc.sub_sum) {
	        frm.set_value('sub_sum',frm.doc.outstanding_amount+frm.doc.interest_amount)
	    }
	    let due_date = new Date(frm.doc.posting_date)
        due_date.setDate(due_date.getDate()+14);
        frm.set_value('dunning_due_date',due_date)
	}
})

Revision #1
Created 9 November 2022 07:24:18 by Wolfram Schmidt
Updated 9 November 2022 07:24:35 by Wolfram Schmidt