-
Notifications
You must be signed in to change notification settings - Fork 263
feat: add scheduler based reverse GL creation for cancelled loan records #1236
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
Open
Nihantra-Patel
wants to merge
6
commits into
frappe:develop
Choose a base branch
from
Nihantra-Patel:cancel-gl-in-bg
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
defae11
fix: Reverse GL Entries update in the background job to avoid timeout…
Nihantra-Patel ab6c436
revert: changes
Nihantra-Patel 3968984
Merge branch 'develop' into cancel-gl-in-bg
Nihantra-Patel fc9ae1d
feat: add scheduler based reverse GL creation for cancelled loan records
Nihantra-Patel 3f8dd5c
feat: add scheduler based reverse GL creation for cancelled loan records
Nihantra-Patel 2826f33
fix: utils.py
Nihantra-Patel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
lending/patches/v16_0/add_cancel_gl_queue_settings_in_company.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| import frappe | ||
| from frappe.custom.doctype.custom_field.custom_field import create_custom_fields | ||
|
|
||
|
|
||
| def execute(): | ||
| company_fields = [] | ||
| created_demand_queue_field = False | ||
| created_interest_queue_field = False | ||
|
|
||
| if not frappe.db.exists( | ||
| "Custom Field", {"dt": "Company", "fieldname": "enable_demand_cancel_gl_queue"} | ||
| ): | ||
| company_fields.append( | ||
| { | ||
| "fieldname": "enable_demand_cancel_gl_queue", | ||
| "label": "Enable Demand Cancel GL Queue", | ||
| "fieldtype": "Check", | ||
| "default": "1", | ||
| "insert_after": "enable_loan_accounting", | ||
| } | ||
| ) | ||
| created_demand_queue_field = True | ||
|
|
||
| if not frappe.db.exists( | ||
| "Custom Field", {"dt": "Company", "fieldname": "enable_interest_cancel_gl_queue"} | ||
| ): | ||
| company_fields.append( | ||
| { | ||
| "fieldname": "enable_interest_cancel_gl_queue", | ||
| "label": "Enable Interest Cancel GL Queue", | ||
| "fieldtype": "Check", | ||
| "default": "1", | ||
| "insert_after": "enable_demand_cancel_gl_queue", | ||
| } | ||
| ) | ||
| created_interest_queue_field = True | ||
|
|
||
| if company_fields: | ||
| create_custom_fields({"Company": company_fields}, update=True) | ||
|
|
||
| if created_demand_queue_field: | ||
| frappe.db.sql( | ||
| """ | ||
| update `tabCompany` | ||
| set enable_demand_cancel_gl_queue = 1 | ||
| where ifnull(enable_demand_cancel_gl_queue, 0) = 0 | ||
| """ | ||
| ) | ||
|
|
||
| if created_interest_queue_field: | ||
| frappe.db.sql( | ||
| """ | ||
| update `tabCompany` | ||
| set enable_interest_cancel_gl_queue = 1 | ||
| where ifnull(enable_interest_cancel_gl_queue, 0) = 0 | ||
| """ | ||
| ) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.