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

fix: show purchase returns in list #130

Merged
merged 1 commit into from
Jul 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
2 changes: 1 addition & 1 deletion check_run/check_run/doctype/check_run/check_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ def get_entries(doc):
`tabPurchase Invoice`.posting_date,
COALESCE(`tabPurchase Invoice`.supplier_default_mode_of_payment, `tabSupplier`.supplier_default_mode_of_payment, '\n') AS mode_of_payment
FROM `tabPurchase Invoice`, `tabSupplier`
WHERE `tabPurchase Invoice`.outstanding_amount > 0
WHERE `tabPurchase Invoice`.outstanding_amount != 0
AND `tabPurchase Invoice`.supplier = `tabSupplier`.name
AND `tabPurchase Invoice`.company = %(company)s
AND `tabPurchase Invoice`.docstatus = 1
Expand Down
14 changes: 14 additions & 0 deletions check_run/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from frappe.desk.page.setup_wizard.setup_wizard import setup_complete
from erpnext.setup.utils import enable_all_roles_and_domains, set_defaults_for_tests
from erpnext.accounts.doctype.account.account import update_account_number
from erpnext.accounts.doctype.purchase_invoice.purchase_invoice import make_debit_note


def before_test():
Expand Down Expand Up @@ -594,6 +595,7 @@ def create_invoices(settings):
)
pi.save()
pi.submit()

# two electric meters / test invoice aggregation
pi = frappe.new_doc("Purchase Invoice")
pi.company = settings.company
Expand Down Expand Up @@ -652,6 +654,18 @@ def create_invoices(settings):
pi.save()
pi.submit()

# this example
spi = frappe.get_value(
"Purchase Invoice",
{"supplier": "Cooperative Ag Finance"},
order_by="posting_date DESC",
)
rpi = make_debit_note(spi)
rpi.return_against = None # this approach isn't best practice but it allows us to see a negative PI in the check run
rpi.items[0].rate = 500
rpi.save()
rpi.submit()


def validate_release_date(self):
pass
Expand Down