How to addition of two fields with different doctype


how to addition this two field
This Table doctype in different and security deposit field doctype is different now i want to addition of this two fields in to one new another field
how i can do this

@Rahul7218 frappe.ui.form.on(‘Lease Invoice Schedule’,{rate: function(frm, cdt, cdn) {
var row = locals[cdt][cdn];
if(row.rate){
frappe.model.set_value(cdt,cdn,“total_invoice_amount”,frm.doc.security_deposit+row.rate)
}
})