Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEPA Payment Feature #234

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1d2a0b6
condition on button , only visible at docstatus = 1
viralpatel15 Apr 1, 2024
0097b12
change the title of payment info tag
viralkansodiya Apr 1, 2024
3d9f212
changes in sepa xml file
viralkansodiya Apr 10, 2024
5115955
changes in sepa xml file
viralkansodiya Apr 10, 2024
cae9be2
validation if iban code is not available
viralkansodiya Apr 10, 2024
779c32e
Iban No validation and added in xml file
viralkansodiya Apr 15, 2024
ab4d224
Iban No validation and added in xml file
viralkansodiya Apr 15, 2024
bbe79c0
set the Organisation id check run setting
viralkansodiya Apr 15, 2024
79978eb
org id variable chnages
viralkansodiya Apr 22, 2024
fc6d244
org id variable chnages
viralkansodiya Apr 22, 2024
7f6abb7
added atest cases to create mode of payment sepa
viralkansodiya Apr 22, 2024
a4dbeda
Test cases for supplier bank account with iban code
viralkansodiya Apr 22, 2024
76ef9ff
branch code added in xml
viralkansodiya Apr 22, 2024
c540be8
chanhes in debetrs address
viralkansodiya Apr 22, 2024
b537646
Merge branch 'agritheory:version-14' into sapa
viralkansodiya Apr 22, 2024
cfea2ea
new field and one time file generation access
viralkansodiya Apr 22, 2024
3c0946f
Merge branch 'sapa' of https://github.com/viralkansodiya/check_run in…
viralkansodiya Apr 22, 2024
c4be4cb
download sepa only on docstatus = 1
viralkansodiya Apr 25, 2024
b70614c
sepa file only able to download by authorized user
viralkansodiya Apr 25, 2024
b824b27
new purchase invoice test cases
viralkansodiya Apr 25, 2024
90369a0
added a item in fixtures
viralkansodiya Apr 25, 2024
f168a42
ach_file_generated will come in another PR
viralkansodiya Apr 25, 2024
633318c
Merge pull request #1 from viralkansodiya/patch-1
viralkansodiya Apr 25, 2024
134df73
if condition to optimisaion
viralkansodiya Apr 26, 2024
bba975f
changes role field label and bank bic tag format changes
viralkansodiya Apr 26, 2024
41a4c76
minore field label and error throw msges changes
viralkansodiya Apr 26, 2024
dc6c242
address filter added
viralkansodiya Apr 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions check_run/check_run/doctype/check_run/check_run.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ frappe.ui.form.on('Check Run', {
permit_first_user(frm)
get_defaults(frm)
set_queries(frm)
if (frm.doc.docstatus == 1 && frm.doc.sepa_file_generated == 0 && frm.pay_to_account_currency == 'EUR') {
downloadsepa(frm)
} else if (frm.doc.sepa_file_generated == 1 && frm.doc.docstatus == 1 && frm.pay_to_account_currency == 'EUR') {
gen_sepa_xml(frm)
}
frappe.realtime.off('reload')
frappe.realtime.on('reload', message => {
frm.reload_doc()
Expand Down Expand Up @@ -428,3 +433,33 @@ function check_settings(frm) {
})
}
}

function gen_sepa_xml(frm) {
frappe.xcall('check_run.check_run.doctype.check_run.check_run.get_authorized_role', { doc: frm.doc }).then(r => {
if (frappe.user.has_role(r)) {
downloadsepa(frm)
}
})
}

function downloadsepa(frm) {
frm.add_custom_button('Download SEPA', () => {
frappe.xcall('check_run.check_run.doctype.check_run.gen_sepa_xml.gen_sepa_xml_file', { doc: frm.doc }).then(r => {
console.log(r)
downloadXML('payments.xml', r)
if(frm.doc.sepa_file_generated == 0){
frappe.db.set_value('Check Run', frm.doc.name, 'sepa_file_generated', 1)
}
})
})
}

function downloadXML(filename, content) {
var element = document.createElement('a')
element.setAttribute('href', 'data:application/octet-stream;charset=utf-8,' + encodeURIComponent(content))
element.setAttribute('download', filename)
element.style.display = 'none'
document.body.appendChild(element)
element.click()
document.body.removeChild(element)
}
Loading
Loading