Skip to content

Commit

Permalink
feat: add files for employee and suppleir bank account obfuscation
Browse files Browse the repository at this point in the history
  • Loading branch information
agritheory committed Jul 3, 2022
1 parent 679d3df commit f7ada06
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
9 changes: 9 additions & 0 deletions check_run/check_run/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import frappe


@frappe.whitelist()
def show_bank_account_number(doctype, docname):
doc = frappe.get_doc(doctype, docname)
routing_number = frappe.get_value('Bank', doc.bank, 'aba_number')
account_number = doc.get_password('bank_account')
return {'routing_number': routing_number, 'account_number': account_number}
15 changes: 15 additions & 0 deletions check_run/public/js/custom/employee_custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
frappe.ui.form.on('Employee', {
onload_post_render: frm => {
frm.fields_dict.bank_account.$wrapper.find('#bank-account').on('click', () => {
show_bank_account_number(frm)
})
},
})

function show_bank_account_number(frm) {
frappe.xcall('check_run.check_run.show_bank_account_number', { doctype: frm.doc.doctype, docname: frm.doc.name })
.then(r => {
let msg = `Routing Number ${r.routing_number}<br>Account Number: ${r.account_number}`
frappe.msgprint(msg, "Bank Information")
})
}
15 changes: 15 additions & 0 deletions check_run/public/js/custom/supplier_custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
frappe.ui.form.on('Supplier', {
onload_post_render: frm => {
frm.fields_dict.bank_account.$wrapper.find('#bank-account').on('click', () => {
show_bank_account_number(frm)
})
},
})

function show_bank_account_number(frm) {
frappe.xcall('check_run.check_run.show_bank_account_number', { doctype: frm.doc.doctype, docname: frm.doc.name })
.then(r => {
let msg = `Routing Number ${r.routing_number}<br>Account Number: ${r.account_number}`
frappe.msgprint(msg, "Bank Information")
})
}

0 comments on commit f7ada06

Please sign in to comment.