what i want is
if account field = ‘45.02.04 - Beban Fee Ovo - HO’ , cost center field = ‘Main - HO’, and amount field = 0.2 * paid amount field (above : amount section)
i’m trying use this logic, but it doesn’t work //frappe.ui.form.on(‘Payment Entry Deduction’,‘account’,function(frm, cdt, cdn) {
//let item=locals[cdt][cdn]
//let amount=0
//if(!frm.doc.account) {
//amount = 2;
//} else if(frm.doc.account) {
// amount = 3;
// } //item.amount=amount
//frm.refresh_field(‘deductions’)
//});
can you help me, please?
but that’s didn’t work for me
in field account i use 45.02.04 - Beban Fee Ovo - HO, but the amount is 3
what ever i choose the account, the amount just 3
OMG, i’m not notice that capital letter
It’s worked, thanks a lot!
Let me ask a question again
if i click the ‘Mode of Payment = OVO’, can i add row on child table ‘Payment Entry Deduction’ automatically with previous coding?
‘Mode of Payment’ is custom doctype
What i want is
When i choose OVO in Mode of Payment
Automatically add row in child table Payment Entry Deduction, which is the formula is account = Beban Fee OVO, amount = 0.2*paid amount (previous coding)