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

GL Entry Creation Issue #229

Merged
merged 2 commits into from
Apr 4, 2024
Merged
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: 3 additions & 3 deletions check_run/overrides/sales_invoice.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import frappe
from erpnext.accounts.doctype.sales_invoice.sales_invoice import SalesInvoice
from erpnext.accounts.utils import get_account_currency
from erpnext.accounts.party import get_due_date
from erpnext.accounts.utils import get_account_currency
from frappe.utils.data import cint, flt


class CheckRunSalesInvoice(SalesInvoice):
# TODO: update due date in taxes with validate hook
def validate(self):
super().validate()
for row in self.taxes:
if not row.party:
continue
due_date = get_due_date(self.posting_date, row.party_type, row.party, self.company)
row.due_date = due_date or self.posting_date
row.outstanding_amount = row.tax_amount
super().validate()

def on_submit(self):
for row in self.taxes:
if row.party and row.party_type:
row.outstanding_amount = row.tax_amount
super().validate()
super().on_submit()

def make_tax_gl_entries(self, gl_entries):
enable_discount_accounting = cint(
Expand Down