Skip to content

Commit

Permalink
V14 ports (#98)
Browse files Browse the repository at this point in the history
* chore: port payement entry check number fetch/save to V14

* chore: port ach_post procesing hook and company disc data

* chore: port docstatus fix for ach-only crs

* chore: port Update effective entry date

* chore: port large process check run fixes

* chore: debug V14 large process check run fixes

* The hook jenv is deprecated New variable is jinja

* chore: port ach_post procesing hook and company disc data

* fix: fix savepoint wierdness

* fix: company discretionary data fix

---------

Co-authored-by: Mohammad Ali <[email protected]>
  • Loading branch information
agritheory and alibaig4u authored Apr 26, 2023
1 parent 7946bdf commit b7adf96
Show file tree
Hide file tree
Showing 13 changed files with 1,141 additions and 690 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Root editor config file
root = true

# Common settings
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

# python, js indentation settings
[{*.py,*.js,*.vue,*.css,*.scss,*.html}]
indent_style = tab
indent_size = 2
max_line_length = 99
71 changes: 71 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
[flake8]
ignore =
B001,
B007,
B009,
B010,
B950,
E101,
E111,
E114,
E116,
E117,
E121,
E122,
E123,
E124,
E125,
E126,
E127,
E128,
E131,
E201,
E202,
E203,
E211,
E221,
E222,
E223,
E224,
E225,
E226,
E228,
E231,
E241,
E242,
E251,
E261,
E262,
E265,
E266,
E271,
E272,
E273,
E274,
E301,
E302,
E303,
E305,
E306,
E402,
E501,
E502,
E701,
E702,
E703,
E741,
W191,
W291,
W292,
W293,
W391,
W503,
W504,
E711,
E129,
F841,
E713,
E712,

max-line-length = 200
exclude=,test_*.py
23 changes: 20 additions & 3 deletions check_run/check_run/doctype/check_run/check_run.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,20 @@ frappe.ui.form.on('Check Run', {
$(frm.wrapper).on('dirty', () => {
frm.trigger('update_primary_action')
})
if (frm.doc.__onload && frm.doc.__onload.check_run_submitting == frm.doc.name) {
frm.doc.status = 'Submitting'
frm.page.set_indicator(__('Submitting'), 'orange')
frm.disable_form()
cur_frm.$check_run.$children[0].state.status = 'Submitting'
} else if (frm.doc.__onload && frm.doc.__onload.check_run_submitting) {
frm.set_intro(
__(
`<span style="color: var(--orange)" id="check-run-error">Check Run ${frm.doc.__onload.check_run_submitting} is processing. This Check Run cannot be processed until it completes.</span>`
),
'red'
)
cur_frm.$check_run.$children[0].state.status = 'Submitting'
}
},
end_date: frm => {
get_entries(frm)
Expand Down Expand Up @@ -97,14 +111,17 @@ frappe.ui.form.on('Check Run', {
frm.doc.status = 'Submitting'
frm.page.set_indicator(__('Submitting'), 'orange')
frm.disable_form()
$(frm.$check_run).css({ 'pointer-events': 'none' })
frappe.xcall('check_run.check_run.doctype.check_run.check_run.process_check_run', { docname: frm.doc.name })
cur_frm.$check_run.$children[0].state.status = frm.doc.status
},
update_primary_action: frm => {
frm.disable_save()
if (frm.is_dirty()) {
frm.enable_save()
} else if (frm.doc.status === 'Draft') {
} else if ((frm.doc.__onload && frm.doc.__onload.check_run_submitting) || frm.doc.status == 'Submitting') {
frm.disable_save()
frm.disable_form()
} else if (frm.doc.status == 'Draft' && !(frm.doc.__onload && frm.doc.__onload.check_run_submitting)) {
frm.page.set_primary_action(__('Process Check Run'), () => frm.trigger('process_check_run'))
}
},
Expand Down Expand Up @@ -141,7 +158,7 @@ function get_entries(frm) {
check_run.mount_table(frm)
if (!frappe.user.has_role(['Accounts Manager'])) {
frm.disable_form()
frm.$check_run.css({ 'pointer-events': 'none' })
cur_frm.$check_run.$children[0].state.status = frm.doc.status
}
})
}
Expand Down
17 changes: 12 additions & 5 deletions check_run/check_run/doctype/check_run/check_run.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"end_date",
"posting_date",
"beg_balance",
"company_discretionary_data",
"column_break_3",
"initial_check_number",
"final_check_number",
Expand All @@ -19,10 +20,10 @@
"company",
"bank_account",
"pay_to_account",
"amended_from",
"section_break_9",
"check_run_table",
"transactions",
"amended_from",
"print_count",
"status"
],
Expand Down Expand Up @@ -95,6 +96,14 @@
"remember_last_selected_value": 1,
"reqd": 1
},
{
"allow_on_submit": 1,
"depends_on": "eval:doc.docstatus==1",
"fieldname": "company_discretionary_data",
"fieldtype": "Data",
"label": "Company Discretionary Data",
"length": 20
},
{
"fieldname": "section_break_9",
"fieldtype": "Section Break"
Expand Down Expand Up @@ -135,7 +144,7 @@
"fieldname": "status",
"fieldtype": "Select",
"hidden": 1,
"options": "Draft\nSubmitted\nSubmitting\nReady to Print\nConfirm Print\nPrinted"
"options": "Draft\nSubmitting\nSubmitted\nReady to Print\nConfirm Print\nPrinted"
},
{
"fieldname": "check_run_table",
Expand All @@ -151,11 +160,10 @@
],
"is_submittable": 1,
"links": [],
"modified": "2023-02-28 16:55:18.369852",
"modified": "2023-03-10 12:28:36.910004",
"modified_by": "Administrator",
"module": "Check Run",
"name": "Check Run",
"naming_rule": "Expression (old style)",
"owner": "Administrator",
"permissions": [
{
Expand All @@ -182,7 +190,6 @@
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"track_changes": 1,
"track_seen": 1,
"track_views": 1
Expand Down
Loading

0 comments on commit b7adf96

Please sign in to comment.