-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36672 from frappe/mergify/bp/version-14-hotfix/pr…
…-36469 feat: utility to repost accounting ledgers without cancellation (backport #36469)
- Loading branch information
Showing
18 changed files
with
660 additions
and
18 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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
Empty file.
44 changes: 44 additions & 0 deletions
44
erpnext/accounts/doctype/repost_accounting_ledger/repost_accounting_ledger.html
This file contains 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,44 @@ | ||
<style> | ||
.print-format { | ||
padding: 4mm; | ||
font-size: 8.0pt !important; | ||
} | ||
.print-format td { | ||
vertical-align:middle !important; | ||
} | ||
.old { | ||
background-color: #FFB3C0; | ||
} | ||
.new { | ||
background-color: #B3FFCC; | ||
} | ||
</style> | ||
|
||
|
||
<table class="table table-bordered table-condensed"> | ||
<colgroup> | ||
{% for col in gl_columns%} | ||
<col style="width: 18mm;"> | ||
{% endfor %} | ||
</colgroup> | ||
<thead> | ||
<tr> | ||
{% for col in gl_columns%} | ||
<td>{{ col.label }}</td> | ||
{% endfor %} | ||
</tr> | ||
</thead> | ||
{% for gl in gl_data%} | ||
{% if gl["old"]%} | ||
<tr class="old"> | ||
{% else %} | ||
<tr class="new"> | ||
{% endif %} | ||
{% for col in gl_columns %} | ||
<td class="text-right"> | ||
{{ gl[col.fieldname] }} | ||
</td> | ||
{% endfor %} | ||
</tr> | ||
{% endfor %} | ||
</table> |
50 changes: 50 additions & 0 deletions
50
erpnext/accounts/doctype/repost_accounting_ledger/repost_accounting_ledger.js
This file contains 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,50 @@ | ||
// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors | ||
// For license information, please see license.txt | ||
|
||
frappe.ui.form.on("Repost Accounting Ledger", { | ||
setup: function(frm) { | ||
frm.fields_dict['vouchers'].grid.get_field('voucher_type').get_query = function(doc) { | ||
return { | ||
filters: { | ||
name: ['in', ['Purchase Invoice', 'Sales Invoice', 'Payment Entry', 'Journal Entry']], | ||
} | ||
} | ||
} | ||
|
||
frm.fields_dict['vouchers'].grid.get_field('voucher_no').get_query = function(doc) { | ||
if (doc.company) { | ||
return { | ||
filters: { | ||
company: doc.company, | ||
docstatus: 1 | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
|
||
refresh: function(frm) { | ||
frm.add_custom_button(__('Show Preview'), () => { | ||
frm.call({ | ||
method: 'generate_preview', | ||
doc: frm.doc, | ||
freeze: true, | ||
freeze_message: __('Generating Preview'), | ||
callback: function(r) { | ||
if (r && r.message) { | ||
let content = r.message; | ||
let opts = { | ||
title: "Preview", | ||
subtitle: "preview", | ||
content: content, | ||
print_settings: {orientation: "landscape"}, | ||
columns: [], | ||
data: [], | ||
} | ||
frappe.render_grid(opts); | ||
} | ||
} | ||
}); | ||
}); | ||
} | ||
}); |
81 changes: 81 additions & 0 deletions
81
erpnext/accounts/doctype/repost_accounting_ledger/repost_accounting_ledger.json
This file contains 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,81 @@ | ||
{ | ||
"actions": [], | ||
"allow_rename": 1, | ||
"autoname": "format:ACC-REPOST-{#####}", | ||
"creation": "2023-07-04 13:07:32.923675", | ||
"default_view": "List", | ||
"doctype": "DocType", | ||
"editable_grid": 1, | ||
"engine": "InnoDB", | ||
"field_order": [ | ||
"company", | ||
"column_break_vpup", | ||
"delete_cancelled_entries", | ||
"section_break_metl", | ||
"vouchers", | ||
"amended_from" | ||
], | ||
"fields": [ | ||
{ | ||
"fieldname": "company", | ||
"fieldtype": "Link", | ||
"label": "Company", | ||
"options": "Company" | ||
}, | ||
{ | ||
"fieldname": "amended_from", | ||
"fieldtype": "Link", | ||
"label": "Amended From", | ||
"no_copy": 1, | ||
"options": "Repost Accounting Ledger", | ||
"print_hide": 1, | ||
"read_only": 1 | ||
}, | ||
{ | ||
"fieldname": "vouchers", | ||
"fieldtype": "Table", | ||
"label": "Vouchers", | ||
"options": "Repost Accounting Ledger Items" | ||
}, | ||
{ | ||
"fieldname": "column_break_vpup", | ||
"fieldtype": "Column Break" | ||
}, | ||
{ | ||
"fieldname": "section_break_metl", | ||
"fieldtype": "Section Break" | ||
}, | ||
{ | ||
"default": "0", | ||
"fieldname": "delete_cancelled_entries", | ||
"fieldtype": "Check", | ||
"label": "Delete Cancelled Ledger Entries" | ||
} | ||
], | ||
"index_web_pages_for_search": 1, | ||
"is_submittable": 1, | ||
"links": [], | ||
"modified": "2023-07-27 15:47:58.975034", | ||
"modified_by": "Administrator", | ||
"module": "Accounts", | ||
"name": "Repost Accounting Ledger", | ||
"naming_rule": "Expression", | ||
"owner": "Administrator", | ||
"permissions": [ | ||
{ | ||
"create": 1, | ||
"delete": 1, | ||
"email": 1, | ||
"export": 1, | ||
"print": 1, | ||
"read": 1, | ||
"report": 1, | ||
"role": "System Manager", | ||
"share": 1, | ||
"write": 1 | ||
} | ||
], | ||
"sort_field": "modified", | ||
"sort_order": "DESC", | ||
"states": [] | ||
} |
Oops, something went wrong.