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

V14 on hold invoice #55

Merged
merged 5 commits into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 5 additions & 1 deletion check_run/check_run/doctype/check_run/check_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# For license information, please see license.txt

from __future__ import unicode_literals
import datetime
import json
from itertools import groupby, zip_longest
from io import StringIO
Expand Down Expand Up @@ -213,6 +214,9 @@ def create_payment_entries(self, transactions):
for reference in group:
if not reference:
continue
if settings.automatically_release_on_hold_invoices and reference.doctype == 'Purchase Invoice':
if frappe.get_value(reference.doctype, reference.name, 'on_hold'):
frappe.db.set_value(reference.doctype, reference.name, 'on_hold', 0)
pe.append('references', {
"reference_doctype": reference.doctype,
"reference_name": reference.name or reference.ref_number,
Expand Down Expand Up @@ -363,8 +367,8 @@ def get_entries(doc):
.where(purchase_invoices.company == company)
.where(purchase_invoices.docstatus == 1)
.where(purchase_invoices.credit_to == pay_to_account)
.where(purchase_invoices.status != 'On Hold')
.where(purchase_invoices.due_date <= end_date)
.where(Coalesce(purchase_invoices.release_date, datetime.date(1900, 1, 1)) <= end_date)
)

# Build expense claims query
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"column_break_9",
"number_of_invoices_per_voucher",
"split_by_address",
"automatically_release_on_hold_invoices",
"ach_settings_section",
"ach_file_extension",
"ach_service_class_code",
Expand Down Expand Up @@ -138,29 +139,35 @@
"options": "Print Format"
},
{
"default": "0",
"fieldname": "split_by_address",
"fieldtype": "Check",
"label": "Split Invoices by Address"
},
{
"fieldname": "ach_settings_section",
"fieldtype": "Section Break",
"label": "ACH Settings"
},
{
"default": "0",
"fieldname": "omit_destination",
"fieldtype": "Check",
"label": "Omit Destination"
},
{
"fieldname": "column_break_21",
"fieldtype": "Column Break"
}
"default": "0",
"fieldname": "split_by_address",
"fieldtype": "Check",
"label": "Split Invoices by Address"
},
{
"fieldname": "ach_settings_section",
"fieldtype": "Section Break",
"label": "ACH Settings"
},
{
"default": "0",
"fieldname": "omit_destination",
"fieldtype": "Check",
"label": "Omit Destination"
},
{
"fieldname": "column_break_21",
"fieldtype": "Column Break"
},
{
"default": "0",
"fieldname": "automatically_release_on_hold_invoices",
"fieldtype": "Check",
"label": "Automatically Release On Hold Invoices"
}
],
"links": [],
"modified": "2022-02-13 15:33:15.269467",
"modified": "2023-02-22 14:14:52.852738",
"modified_by": "Administrator",
"module": "Check Run",
"name": "Check Run Settings",
Expand Down
Loading