mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 15:39:20 +00:00
Merge pull request #38590 from frappe/version-15-hotfix
chore: release v15
This commit is contained in:
@@ -23,6 +23,65 @@ class InvalidAccountMergeError(frappe.ValidationError):
|
|||||||
|
|
||||||
|
|
||||||
class Account(NestedSet):
|
class Account(NestedSet):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account_currency: DF.Link | None
|
||||||
|
account_name: DF.Data
|
||||||
|
account_number: DF.Data | None
|
||||||
|
account_type: DF.Literal[
|
||||||
|
"",
|
||||||
|
"Accumulated Depreciation",
|
||||||
|
"Asset Received But Not Billed",
|
||||||
|
"Bank",
|
||||||
|
"Cash",
|
||||||
|
"Chargeable",
|
||||||
|
"Capital Work in Progress",
|
||||||
|
"Cost of Goods Sold",
|
||||||
|
"Current Asset",
|
||||||
|
"Current Liability",
|
||||||
|
"Depreciation",
|
||||||
|
"Direct Expense",
|
||||||
|
"Direct Income",
|
||||||
|
"Equity",
|
||||||
|
"Expense Account",
|
||||||
|
"Expenses Included In Asset Valuation",
|
||||||
|
"Expenses Included In Valuation",
|
||||||
|
"Fixed Asset",
|
||||||
|
"Income Account",
|
||||||
|
"Indirect Expense",
|
||||||
|
"Indirect Income",
|
||||||
|
"Liability",
|
||||||
|
"Payable",
|
||||||
|
"Receivable",
|
||||||
|
"Round Off",
|
||||||
|
"Stock",
|
||||||
|
"Stock Adjustment",
|
||||||
|
"Stock Received But Not Billed",
|
||||||
|
"Service Received But Not Billed",
|
||||||
|
"Tax",
|
||||||
|
"Temporary",
|
||||||
|
]
|
||||||
|
balance_must_be: DF.Literal["", "Debit", "Credit"]
|
||||||
|
company: DF.Link
|
||||||
|
disabled: DF.Check
|
||||||
|
freeze_account: DF.Literal["No", "Yes"]
|
||||||
|
include_in_gross: DF.Check
|
||||||
|
is_group: DF.Check
|
||||||
|
lft: DF.Int
|
||||||
|
old_parent: DF.Data | None
|
||||||
|
parent_account: DF.Link
|
||||||
|
report_type: DF.Literal["", "Balance Sheet", "Profit and Loss"]
|
||||||
|
rgt: DF.Int
|
||||||
|
root_type: DF.Literal["", "Asset", "Liability", "Income", "Expense", "Equity"]
|
||||||
|
tax_rate: DF.Float
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
nsm_parent_field = "parent_account"
|
nsm_parent_field = "parent_account"
|
||||||
|
|
||||||
def on_update(self):
|
def on_update(self):
|
||||||
|
|||||||
@@ -11,6 +11,29 @@ from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
|
|||||||
|
|
||||||
|
|
||||||
class AccountClosingBalance(Document):
|
class AccountClosingBalance(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account: DF.Link | None
|
||||||
|
account_currency: DF.Link | None
|
||||||
|
closing_date: DF.Date | None
|
||||||
|
company: DF.Link | None
|
||||||
|
cost_center: DF.Link | None
|
||||||
|
credit: DF.Currency
|
||||||
|
credit_in_account_currency: DF.Currency
|
||||||
|
debit: DF.Currency
|
||||||
|
debit_in_account_currency: DF.Currency
|
||||||
|
finance_book: DF.Link | None
|
||||||
|
is_period_closing_voucher_entry: DF.Check
|
||||||
|
period_closing_voucher: DF.Link | None
|
||||||
|
project: DF.Link | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,25 @@ from frappe.utils import cstr
|
|||||||
|
|
||||||
|
|
||||||
class AccountingDimension(Document):
|
class AccountingDimension(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.accounting_dimension_detail.accounting_dimension_detail import (
|
||||||
|
AccountingDimensionDetail,
|
||||||
|
)
|
||||||
|
|
||||||
|
dimension_defaults: DF.Table[AccountingDimensionDetail]
|
||||||
|
disabled: DF.Check
|
||||||
|
document_type: DF.Link
|
||||||
|
fieldname: DF.Data | None
|
||||||
|
label: DF.Data | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def before_insert(self):
|
def before_insert(self):
|
||||||
self.set_fieldname_and_label()
|
self.set_fieldname_and_label()
|
||||||
|
|
||||||
|
|||||||
@@ -7,4 +7,24 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class AccountingDimensionDetail(Document):
|
class AccountingDimensionDetail(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
automatically_post_balancing_accounting_entry: DF.Check
|
||||||
|
company: DF.Link | None
|
||||||
|
default_dimension: DF.DynamicLink | None
|
||||||
|
mandatory_for_bs: DF.Check
|
||||||
|
mandatory_for_pl: DF.Check
|
||||||
|
offsetting_account: DF.Link | None
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
reference_document: DF.Link | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -8,6 +8,28 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class AccountingDimensionFilter(Document):
|
class AccountingDimensionFilter(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.allowed_dimension.allowed_dimension import AllowedDimension
|
||||||
|
from erpnext.accounts.doctype.applicable_on_account.applicable_on_account import (
|
||||||
|
ApplicableOnAccount,
|
||||||
|
)
|
||||||
|
|
||||||
|
accounting_dimension: DF.Literal
|
||||||
|
accounts: DF.Table[ApplicableOnAccount]
|
||||||
|
allow_or_restrict: DF.Literal["Allow", "Restrict"]
|
||||||
|
apply_restriction_on_values: DF.Check
|
||||||
|
company: DF.Link
|
||||||
|
dimensions: DF.Table[AllowedDimension]
|
||||||
|
disabled: DF.Check
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def before_save(self):
|
def before_save(self):
|
||||||
# If restriction is not applied on values, then remove all the dimensions and set allow_or_restrict to Restrict
|
# If restriction is not applied on values, then remove all the dimensions and set allow_or_restrict to Restrict
|
||||||
if not self.apply_restriction_on_values:
|
if not self.apply_restriction_on_values:
|
||||||
|
|||||||
@@ -16,6 +16,23 @@ class ClosedAccountingPeriod(frappe.ValidationError):
|
|||||||
|
|
||||||
|
|
||||||
class AccountingPeriod(Document):
|
class AccountingPeriod(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.closed_document.closed_document import ClosedDocument
|
||||||
|
|
||||||
|
closed_documents: DF.Table[ClosedDocument]
|
||||||
|
company: DF.Link
|
||||||
|
end_date: DF.Date
|
||||||
|
period_name: DF.Data
|
||||||
|
start_date: DF.Date
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_overlap()
|
self.validate_overlap()
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,52 @@ from erpnext.stock.utils import check_pending_reposting
|
|||||||
|
|
||||||
|
|
||||||
class AccountsSettings(Document):
|
class AccountsSettings(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
acc_frozen_upto: DF.Date | None
|
||||||
|
add_taxes_from_item_tax_template: DF.Check
|
||||||
|
allow_multi_currency_invoices_against_single_party_account: DF.Check
|
||||||
|
allow_stale: DF.Check
|
||||||
|
auto_reconcile_payments: DF.Check
|
||||||
|
automatically_fetch_payment_terms: DF.Check
|
||||||
|
automatically_process_deferred_accounting_entry: DF.Check
|
||||||
|
book_asset_depreciation_entry_automatically: DF.Check
|
||||||
|
book_deferred_entries_based_on: DF.Literal["Days", "Months"]
|
||||||
|
book_deferred_entries_via_journal_entry: DF.Check
|
||||||
|
book_tax_discount_loss: DF.Check
|
||||||
|
check_supplier_invoice_uniqueness: DF.Check
|
||||||
|
credit_controller: DF.Link | None
|
||||||
|
delete_linked_ledger_entries: DF.Check
|
||||||
|
determine_address_tax_category_from: DF.Literal["Billing Address", "Shipping Address"]
|
||||||
|
enable_common_party_accounting: DF.Check
|
||||||
|
enable_fuzzy_matching: DF.Check
|
||||||
|
enable_party_matching: DF.Check
|
||||||
|
frozen_accounts_modifier: DF.Link | None
|
||||||
|
general_ledger_remarks_length: DF.Int
|
||||||
|
ignore_account_closing_balance: DF.Check
|
||||||
|
make_payment_via_journal_entry: DF.Check
|
||||||
|
merge_similar_account_heads: DF.Check
|
||||||
|
over_billing_allowance: DF.Currency
|
||||||
|
post_change_gl_entries: DF.Check
|
||||||
|
receivable_payable_remarks_length: DF.Int
|
||||||
|
role_allowed_to_over_bill: DF.Link | None
|
||||||
|
round_row_wise_tax: DF.Check
|
||||||
|
show_balance_in_coa: DF.Check
|
||||||
|
show_inclusive_tax_in_print: DF.Check
|
||||||
|
show_payment_schedule_in_print: DF.Check
|
||||||
|
show_taxes_as_table_in_print: DF.Check
|
||||||
|
stale_days: DF.Int
|
||||||
|
submit_journal_entries: DF.Check
|
||||||
|
unlink_advance_payment_on_cancelation_of_order: DF.Check
|
||||||
|
unlink_payment_on_cancellation_of_invoice: DF.Check
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
old_doc = self.get_doc_before_save()
|
old_doc = self.get_doc_before_save()
|
||||||
clear_cache = False
|
clear_cache = False
|
||||||
|
|||||||
@@ -6,4 +6,22 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class AdvanceTax(Document):
|
class AdvanceTax(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account_head: DF.Link | None
|
||||||
|
allocated_amount: DF.Currency
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
reference_detail: DF.Data | None
|
||||||
|
reference_name: DF.DynamicLink | None
|
||||||
|
reference_type: DF.Link | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -7,4 +7,33 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class AdvanceTaxesandCharges(Document):
|
class AdvanceTaxesandCharges(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account_head: DF.Link
|
||||||
|
add_deduct_tax: DF.Literal["Add", "Deduct"]
|
||||||
|
allocated_amount: DF.Currency
|
||||||
|
base_tax_amount: DF.Currency
|
||||||
|
base_total: DF.Currency
|
||||||
|
charge_type: DF.Literal[
|
||||||
|
"", "Actual", "On Paid Amount", "On Previous Row Amount", "On Previous Row Total"
|
||||||
|
]
|
||||||
|
cost_center: DF.Link | None
|
||||||
|
currency: DF.Link | None
|
||||||
|
description: DF.SmallText
|
||||||
|
included_in_paid_amount: DF.Check
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
rate: DF.Float
|
||||||
|
row_id: DF.Data | None
|
||||||
|
tax_amount: DF.Currency
|
||||||
|
total: DF.Currency
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -7,4 +7,19 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class AllowedDimension(Document):
|
class AllowedDimension(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
accounting_dimension: DF.Link | None
|
||||||
|
dimension_value: DF.DynamicLink | None
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -6,4 +6,18 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class AllowedToTransactWith(Document):
|
class AllowedToTransactWith(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
company: DF.Link
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -7,4 +7,19 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class ApplicableOnAccount(Document):
|
class ApplicableOnAccount(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
applicable_on_account: DF.Link
|
||||||
|
is_mandatory: DF.Check
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -10,6 +10,25 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class Bank(Document):
|
class Bank(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.bank_transaction_mapping.bank_transaction_mapping import (
|
||||||
|
BankTransactionMapping,
|
||||||
|
)
|
||||||
|
|
||||||
|
bank_name: DF.Data
|
||||||
|
bank_transaction_mapping: DF.Table[BankTransactionMapping]
|
||||||
|
plaid_access_token: DF.Data | None
|
||||||
|
swift_number: DF.Data | None
|
||||||
|
website: DF.Data | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def onload(self):
|
def onload(self):
|
||||||
"""Load address and contacts in `__onload`"""
|
"""Load address and contacts in `__onload`"""
|
||||||
load_address_and_contact(self)
|
load_address_and_contact(self)
|
||||||
|
|||||||
@@ -12,6 +12,33 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class BankAccount(Document):
|
class BankAccount(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account: DF.Link | None
|
||||||
|
account_name: DF.Data
|
||||||
|
account_subtype: DF.Link | None
|
||||||
|
account_type: DF.Link | None
|
||||||
|
bank: DF.Link
|
||||||
|
bank_account_no: DF.Data | None
|
||||||
|
branch_code: DF.Data | None
|
||||||
|
company: DF.Link | None
|
||||||
|
disabled: DF.Check
|
||||||
|
iban: DF.Data | None
|
||||||
|
integration_id: DF.Data | None
|
||||||
|
is_company_account: DF.Check
|
||||||
|
is_default: DF.Check
|
||||||
|
last_integration_date: DF.Date | None
|
||||||
|
mask: DF.Data | None
|
||||||
|
party: DF.DynamicLink | None
|
||||||
|
party_type: DF.Link | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def onload(self):
|
def onload(self):
|
||||||
"""Load address and contacts in `__onload`"""
|
"""Load address and contacts in `__onload`"""
|
||||||
load_address_and_contact(self)
|
load_address_and_contact(self)
|
||||||
|
|||||||
@@ -6,4 +6,15 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class BankAccountSubtype(Document):
|
class BankAccountSubtype(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account_subtype: DF.Data | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -7,4 +7,15 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class BankAccountType(Document):
|
class BankAccountType(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account_type: DF.Data | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -13,6 +13,28 @@ form_grid_templates = {"journal_entries": "templates/form_grid/bank_reconciliati
|
|||||||
|
|
||||||
|
|
||||||
class BankClearance(Document):
|
class BankClearance(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.bank_clearance_detail.bank_clearance_detail import (
|
||||||
|
BankClearanceDetail,
|
||||||
|
)
|
||||||
|
|
||||||
|
account: DF.Link
|
||||||
|
account_currency: DF.Link | None
|
||||||
|
bank_account: DF.Link | None
|
||||||
|
from_date: DF.Date
|
||||||
|
include_pos_transactions: DF.Check
|
||||||
|
include_reconciled_entries: DF.Check
|
||||||
|
payment_entries: DF.Table[BankClearanceDetail]
|
||||||
|
to_date: DF.Date
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_payment_entries(self):
|
def get_payment_entries(self):
|
||||||
if not (self.from_date and self.to_date):
|
if not (self.from_date and self.to_date):
|
||||||
|
|||||||
@@ -6,4 +6,25 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class BankClearanceDetail(Document):
|
class BankClearanceDetail(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
against_account: DF.Data | None
|
||||||
|
amount: DF.Data | None
|
||||||
|
cheque_date: DF.Date | None
|
||||||
|
cheque_number: DF.Data | None
|
||||||
|
clearance_date: DF.Date | None
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
payment_document: DF.Link | None
|
||||||
|
payment_entry: DF.DynamicLink | None
|
||||||
|
posting_date: DF.Date | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -8,6 +8,40 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class BankGuarantee(Document):
|
class BankGuarantee(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account: DF.Link | None
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
amount: DF.Currency
|
||||||
|
bank: DF.Link | None
|
||||||
|
bank_account: DF.Link | None
|
||||||
|
bank_account_no: DF.Data | None
|
||||||
|
bank_guarantee_number: DF.Data | None
|
||||||
|
bg_type: DF.Literal["", "Receiving", "Providing"]
|
||||||
|
branch_code: DF.Data | None
|
||||||
|
charges: DF.Currency
|
||||||
|
customer: DF.Link | None
|
||||||
|
end_date: DF.Date | None
|
||||||
|
fixed_deposit_number: DF.Data | None
|
||||||
|
iban: DF.Data | None
|
||||||
|
margin_money: DF.Currency
|
||||||
|
more_information: DF.TextEditor | None
|
||||||
|
name_of_beneficiary: DF.Data | None
|
||||||
|
project: DF.Link | None
|
||||||
|
reference_docname: DF.DynamicLink | None
|
||||||
|
reference_doctype: DF.Link | None
|
||||||
|
start_date: DF.Date
|
||||||
|
supplier: DF.Link | None
|
||||||
|
swift_number: DF.Data | None
|
||||||
|
validity: DF.Int
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
if not (self.customer or self.supplier):
|
if not (self.customer or self.supplier):
|
||||||
frappe.throw(_("Select the customer or supplier."))
|
frappe.throw(_("Select the customer or supplier."))
|
||||||
|
|||||||
@@ -21,6 +21,26 @@ from erpnext.accounts.utils import get_account_currency, get_balance_on
|
|||||||
|
|
||||||
|
|
||||||
class BankReconciliationTool(Document):
|
class BankReconciliationTool(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account_currency: DF.Link | None
|
||||||
|
account_opening_balance: DF.Currency
|
||||||
|
bank_account: DF.Link | None
|
||||||
|
bank_statement_closing_balance: DF.Currency
|
||||||
|
bank_statement_from_date: DF.Date | None
|
||||||
|
bank_statement_to_date: DF.Date | None
|
||||||
|
company: DF.Link | None
|
||||||
|
filter_by_reference_date: DF.Check
|
||||||
|
from_reference_date: DF.Date | None
|
||||||
|
to_reference_date: DF.Date | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,30 @@ INVALID_VALUES = ("", None)
|
|||||||
|
|
||||||
|
|
||||||
class BankStatementImport(DataImport):
|
class BankStatementImport(DataImport):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
bank: DF.Link | None
|
||||||
|
bank_account: DF.Link
|
||||||
|
company: DF.Link
|
||||||
|
google_sheets_url: DF.Data | None
|
||||||
|
import_file: DF.Attach | None
|
||||||
|
import_type: DF.Literal["", "Insert New Records", "Update Existing Records"]
|
||||||
|
mute_emails: DF.Check
|
||||||
|
reference_doctype: DF.Link
|
||||||
|
show_failed_logs: DF.Check
|
||||||
|
statement_import_log: DF.Code | None
|
||||||
|
status: DF.Literal["Pending", "Success", "Partial Success", "Error"]
|
||||||
|
submit_after_import: DF.Check
|
||||||
|
template_options: DF.Code | None
|
||||||
|
template_warnings: DF.Code | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(BankStatementImport, self).__init__(*args, **kwargs)
|
super(BankStatementImport, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,41 @@ from erpnext.controllers.status_updater import StatusUpdater
|
|||||||
|
|
||||||
|
|
||||||
class BankTransaction(StatusUpdater):
|
class BankTransaction(StatusUpdater):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.bank_transaction_payments.bank_transaction_payments import (
|
||||||
|
BankTransactionPayments,
|
||||||
|
)
|
||||||
|
|
||||||
|
allocated_amount: DF.Currency
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
bank_account: DF.Link | None
|
||||||
|
bank_party_account_number: DF.Data | None
|
||||||
|
bank_party_iban: DF.Data | None
|
||||||
|
bank_party_name: DF.Data | None
|
||||||
|
company: DF.Link | None
|
||||||
|
currency: DF.Link | None
|
||||||
|
date: DF.Date | None
|
||||||
|
deposit: DF.Currency
|
||||||
|
description: DF.SmallText | None
|
||||||
|
naming_series: DF.Literal["ACC-BTN-.YYYY.-"]
|
||||||
|
party: DF.DynamicLink | None
|
||||||
|
party_type: DF.Link | None
|
||||||
|
payment_entries: DF.Table[BankTransactionPayments]
|
||||||
|
reference_number: DF.Data | None
|
||||||
|
status: DF.Literal["", "Pending", "Settled", "Unreconciled", "Reconciled", "Cancelled"]
|
||||||
|
transaction_id: DF.Data | None
|
||||||
|
transaction_type: DF.Data | None
|
||||||
|
unallocated_amount: DF.Currency
|
||||||
|
withdrawal: DF.Currency
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def before_validate(self):
|
def before_validate(self):
|
||||||
self.update_allocated_amount()
|
self.update_allocated_amount()
|
||||||
|
|
||||||
|
|||||||
@@ -6,4 +6,19 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class BankTransactionMapping(Document):
|
class BankTransactionMapping(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
bank_transaction_field: DF.Literal
|
||||||
|
file_field: DF.Data
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -6,4 +6,21 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class BankTransactionPayments(Document):
|
class BankTransactionPayments(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
allocated_amount: DF.Currency
|
||||||
|
clearance_date: DF.Date | None
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
payment_document: DF.Link
|
||||||
|
payment_entry: DF.DynamicLink
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -22,6 +22,36 @@ class DuplicateBudgetError(frappe.ValidationError):
|
|||||||
|
|
||||||
|
|
||||||
class Budget(Document):
|
class Budget(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.budget_account.budget_account import BudgetAccount
|
||||||
|
|
||||||
|
accounts: DF.Table[BudgetAccount]
|
||||||
|
action_if_accumulated_monthly_budget_exceeded: DF.Literal["", "Stop", "Warn", "Ignore"]
|
||||||
|
action_if_accumulated_monthly_budget_exceeded_on_mr: DF.Literal["", "Stop", "Warn", "Ignore"]
|
||||||
|
action_if_accumulated_monthly_budget_exceeded_on_po: DF.Literal["", "Stop", "Warn", "Ignore"]
|
||||||
|
action_if_annual_budget_exceeded: DF.Literal["", "Stop", "Warn", "Ignore"]
|
||||||
|
action_if_annual_budget_exceeded_on_mr: DF.Literal["", "Stop", "Warn", "Ignore"]
|
||||||
|
action_if_annual_budget_exceeded_on_po: DF.Literal["", "Stop", "Warn", "Ignore"]
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
applicable_on_booking_actual_expenses: DF.Check
|
||||||
|
applicable_on_material_request: DF.Check
|
||||||
|
applicable_on_purchase_order: DF.Check
|
||||||
|
budget_against: DF.Literal["", "Cost Center", "Project"]
|
||||||
|
company: DF.Link
|
||||||
|
cost_center: DF.Link | None
|
||||||
|
fiscal_year: DF.Link
|
||||||
|
monthly_distribution: DF.Link | None
|
||||||
|
naming_series: DF.Data | None
|
||||||
|
project: DF.Link | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
if not self.get(frappe.scrub(self.budget_against)):
|
if not self.get(frappe.scrub(self.budget_against)):
|
||||||
frappe.throw(_("{0} is mandatory").format(self.budget_against))
|
frappe.throw(_("{0} is mandatory").format(self.budget_against))
|
||||||
|
|||||||
@@ -6,4 +6,19 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class BudgetAccount(Document):
|
class BudgetAccount(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account: DF.Link
|
||||||
|
budget_amount: DF.Currency
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -6,4 +6,18 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class CampaignItem(Document):
|
class CampaignItem(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
campaign: DF.Link | None
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -9,6 +9,32 @@ from frappe.utils import flt
|
|||||||
|
|
||||||
|
|
||||||
class CashierClosing(Document):
|
class CashierClosing(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.cashier_closing_payments.cashier_closing_payments import (
|
||||||
|
CashierClosingPayments,
|
||||||
|
)
|
||||||
|
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
custody: DF.Float
|
||||||
|
date: DF.Date | None
|
||||||
|
expense: DF.Float
|
||||||
|
from_time: DF.Time
|
||||||
|
naming_series: DF.Literal["POS-CLO-"]
|
||||||
|
net_amount: DF.Float
|
||||||
|
outstanding_amount: DF.Float
|
||||||
|
payments: DF.Table[CashierClosingPayments]
|
||||||
|
returns: DF.Float
|
||||||
|
time: DF.Time
|
||||||
|
user: DF.Link
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_time()
|
self.validate_time()
|
||||||
|
|
||||||
|
|||||||
@@ -6,4 +6,19 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class CashierClosingPayments(Document):
|
class CashierClosingPayments(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
amount: DF.Float
|
||||||
|
mode_of_payment: DF.Link
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -24,6 +24,18 @@ from erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts import
|
|||||||
|
|
||||||
|
|
||||||
class ChartofAccountsImporter(Document):
|
class ChartofAccountsImporter(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
company: DF.Link | None
|
||||||
|
import_file: DF.Attach | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
if self.import_file:
|
if self.import_file:
|
||||||
get_coa(
|
get_coa(
|
||||||
|
|||||||
@@ -8,6 +8,41 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class ChequePrintTemplate(Document):
|
class ChequePrintTemplate(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
acc_no_dist_from_left_edge: DF.Float
|
||||||
|
acc_no_dist_from_top_edge: DF.Float
|
||||||
|
acc_pay_dist_from_left_edge: DF.Float
|
||||||
|
acc_pay_dist_from_top_edge: DF.Float
|
||||||
|
amt_in_figures_from_left_edge: DF.Float
|
||||||
|
amt_in_figures_from_top_edge: DF.Float
|
||||||
|
amt_in_word_width: DF.Float
|
||||||
|
amt_in_words_from_left_edge: DF.Float
|
||||||
|
amt_in_words_from_top_edge: DF.Float
|
||||||
|
amt_in_words_line_spacing: DF.Float
|
||||||
|
bank_name: DF.Data
|
||||||
|
cheque_height: DF.Float
|
||||||
|
cheque_size: DF.Literal["", "Regular", "A4"]
|
||||||
|
cheque_width: DF.Float
|
||||||
|
date_dist_from_left_edge: DF.Float
|
||||||
|
date_dist_from_top_edge: DF.Float
|
||||||
|
has_print_format: DF.Check
|
||||||
|
is_account_payable: DF.Check
|
||||||
|
message_to_show: DF.Data | None
|
||||||
|
payer_name_from_left_edge: DF.Float
|
||||||
|
payer_name_from_top_edge: DF.Float
|
||||||
|
scanned_cheque: DF.Attach | None
|
||||||
|
signatory_from_left_edge: DF.Float
|
||||||
|
signatory_from_top_edge: DF.Float
|
||||||
|
starting_position_from_top_edge: DF.Float
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,4 +6,19 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class ClosedDocument(Document):
|
class ClosedDocument(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
closed: DF.Check
|
||||||
|
document_type: DF.Link
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -10,6 +10,25 @@ from erpnext.accounts.utils import validate_field_number
|
|||||||
|
|
||||||
|
|
||||||
class CostCenter(NestedSet):
|
class CostCenter(NestedSet):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
company: DF.Link
|
||||||
|
cost_center_name: DF.Data
|
||||||
|
cost_center_number: DF.Data | None
|
||||||
|
disabled: DF.Check
|
||||||
|
is_group: DF.Check
|
||||||
|
lft: DF.Int
|
||||||
|
old_parent: DF.Link | None
|
||||||
|
parent_cost_center: DF.Link
|
||||||
|
rgt: DF.Int
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
nsm_parent_field = "parent_cost_center"
|
nsm_parent_field = "parent_cost_center"
|
||||||
|
|
||||||
def autoname(self):
|
def autoname(self):
|
||||||
|
|||||||
@@ -28,6 +28,25 @@ class InvalidDateError(frappe.ValidationError):
|
|||||||
|
|
||||||
|
|
||||||
class CostCenterAllocation(Document):
|
class CostCenterAllocation(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.cost_center_allocation_percentage.cost_center_allocation_percentage import (
|
||||||
|
CostCenterAllocationPercentage,
|
||||||
|
)
|
||||||
|
|
||||||
|
allocation_percentages: DF.Table[CostCenterAllocationPercentage]
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
company: DF.Link
|
||||||
|
main_cost_center: DF.Link
|
||||||
|
valid_from: DF.Date
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(CostCenterAllocation, self).__init__(*args, **kwargs)
|
super(CostCenterAllocation, self).__init__(*args, **kwargs)
|
||||||
self._skip_from_date_validation = False
|
self._skip_from_date_validation = False
|
||||||
|
|||||||
@@ -6,4 +6,19 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class CostCenterAllocationPercentage(Document):
|
class CostCenterAllocationPercentage(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
cost_center: DF.Link
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
percentage: DF.Percent
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -9,6 +9,27 @@ from frappe.utils import strip
|
|||||||
|
|
||||||
|
|
||||||
class CouponCode(Document):
|
class CouponCode(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
coupon_code: DF.Data | None
|
||||||
|
coupon_name: DF.Data
|
||||||
|
coupon_type: DF.Literal["Promotional", "Gift Card"]
|
||||||
|
customer: DF.Link | None
|
||||||
|
description: DF.TextEditor | None
|
||||||
|
maximum_use: DF.Int
|
||||||
|
pricing_rule: DF.Link
|
||||||
|
used: DF.Int
|
||||||
|
valid_from: DF.Date | None
|
||||||
|
valid_upto: DF.Date | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def autoname(self):
|
def autoname(self):
|
||||||
self.coupon_name = strip(self.coupon_name)
|
self.coupon_name = strip(self.coupon_name)
|
||||||
self.name = self.coupon_name
|
self.name = self.coupon_name
|
||||||
|
|||||||
@@ -9,6 +9,30 @@ from frappe.utils import nowdate
|
|||||||
|
|
||||||
|
|
||||||
class CurrencyExchangeSettings(Document):
|
class CurrencyExchangeSettings(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.currency_exchange_settings_details.currency_exchange_settings_details import (
|
||||||
|
CurrencyExchangeSettingsDetails,
|
||||||
|
)
|
||||||
|
from erpnext.accounts.doctype.currency_exchange_settings_result.currency_exchange_settings_result import (
|
||||||
|
CurrencyExchangeSettingsResult,
|
||||||
|
)
|
||||||
|
|
||||||
|
access_key: DF.Data | None
|
||||||
|
api_endpoint: DF.Data
|
||||||
|
disabled: DF.Check
|
||||||
|
req_params: DF.Table[CurrencyExchangeSettingsDetails]
|
||||||
|
result_key: DF.Table[CurrencyExchangeSettingsResult]
|
||||||
|
service_provider: DF.Literal["frankfurter.app", "exchangerate.host", "Custom"]
|
||||||
|
url: DF.Data | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.set_parameters_and_result()
|
self.set_parameters_and_result()
|
||||||
if frappe.flags.in_test or frappe.flags.in_install or frappe.flags.in_setup_wizard:
|
if frappe.flags.in_test or frappe.flags.in_install or frappe.flags.in_setup_wizard:
|
||||||
|
|||||||
@@ -6,4 +6,19 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class CurrencyExchangeSettingsDetails(Document):
|
class CurrencyExchangeSettingsDetails(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
key: DF.Data
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
value: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -6,4 +6,18 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class CurrencyExchangeSettingsResult(Document):
|
class CurrencyExchangeSettingsResult(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
key: DF.Data
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -6,4 +6,18 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class CustomerGroupItem(Document):
|
class CustomerGroupItem(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
customer_group: DF.Link | None
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -6,4 +6,18 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class CustomerItem(Document):
|
class CustomerItem(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
customer: DF.Link | None
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -7,4 +7,22 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class DiscountedInvoice(Document):
|
class DiscountedInvoice(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
customer: DF.Link | None
|
||||||
|
debit_to: DF.Link | None
|
||||||
|
outstanding_amount: DF.Currency
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
posting_date: DF.Date | None
|
||||||
|
sales_invoice: DF.Link
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -22,6 +22,52 @@ from erpnext.controllers.accounts_controller import AccountsController
|
|||||||
|
|
||||||
|
|
||||||
class Dunning(AccountsController):
|
class Dunning(AccountsController):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.overdue_payment.overdue_payment import OverduePayment
|
||||||
|
|
||||||
|
address_display: DF.SmallText | None
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
base_dunning_amount: DF.Currency
|
||||||
|
body_text: DF.TextEditor | None
|
||||||
|
closing_text: DF.TextEditor | None
|
||||||
|
company: DF.Link
|
||||||
|
company_address: DF.Link | None
|
||||||
|
company_address_display: DF.SmallText | None
|
||||||
|
contact_display: DF.SmallText | None
|
||||||
|
contact_email: DF.Data | None
|
||||||
|
contact_mobile: DF.SmallText | None
|
||||||
|
contact_person: DF.Link | None
|
||||||
|
conversion_rate: DF.Float
|
||||||
|
cost_center: DF.Link | None
|
||||||
|
currency: DF.Link | None
|
||||||
|
customer: DF.Link
|
||||||
|
customer_address: DF.Link | None
|
||||||
|
customer_name: DF.Data | None
|
||||||
|
dunning_amount: DF.Currency
|
||||||
|
dunning_fee: DF.Currency
|
||||||
|
dunning_type: DF.Link | None
|
||||||
|
grand_total: DF.Currency
|
||||||
|
income_account: DF.Link | None
|
||||||
|
language: DF.Link | None
|
||||||
|
letter_head: DF.Link | None
|
||||||
|
naming_series: DF.Literal["DUNN-.MM.-.YY.-"]
|
||||||
|
overdue_payments: DF.Table[OverduePayment]
|
||||||
|
posting_date: DF.Date
|
||||||
|
posting_time: DF.Time | None
|
||||||
|
rate_of_interest: DF.Float
|
||||||
|
spacer: DF.Data | None
|
||||||
|
status: DF.Literal["Draft", "Resolved", "Unresolved", "Cancelled"]
|
||||||
|
total_interest: DF.Currency
|
||||||
|
total_outstanding: DF.Currency
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_same_currency()
|
self.validate_same_currency()
|
||||||
self.validate_overdue_payments()
|
self.validate_overdue_payments()
|
||||||
|
|||||||
@@ -7,4 +7,21 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class DunningLetterText(Document):
|
class DunningLetterText(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
body_text: DF.TextEditor | None
|
||||||
|
closing_text: DF.TextEditor | None
|
||||||
|
is_default_language: DF.Check
|
||||||
|
language: DF.Link | None
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -7,6 +7,26 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class DunningType(Document):
|
class DunningType(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.dunning_letter_text.dunning_letter_text import DunningLetterText
|
||||||
|
|
||||||
|
company: DF.Link
|
||||||
|
cost_center: DF.Link | None
|
||||||
|
dunning_fee: DF.Currency
|
||||||
|
dunning_letter_text: DF.Table[DunningLetterText]
|
||||||
|
dunning_type: DF.Data
|
||||||
|
income_account: DF.Link | None
|
||||||
|
is_default: DF.Check
|
||||||
|
rate_of_interest: DF.Float
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def autoname(self):
|
def autoname(self):
|
||||||
company_abbr = frappe.get_value("Company", self.company, "abbr")
|
company_abbr = frappe.get_value("Company", self.company, "abbr")
|
||||||
self.name = f"{self.dunning_type} - {company_abbr}"
|
self.name = f"{self.dunning_type} - {company_abbr}"
|
||||||
|
|||||||
@@ -17,6 +17,28 @@ from erpnext.setup.utils import get_exchange_rate
|
|||||||
|
|
||||||
|
|
||||||
class ExchangeRateRevaluation(Document):
|
class ExchangeRateRevaluation(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.exchange_rate_revaluation_account.exchange_rate_revaluation_account import (
|
||||||
|
ExchangeRateRevaluationAccount,
|
||||||
|
)
|
||||||
|
|
||||||
|
accounts: DF.Table[ExchangeRateRevaluationAccount]
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
company: DF.Link
|
||||||
|
gain_loss_booked: DF.Currency
|
||||||
|
gain_loss_unbooked: DF.Currency
|
||||||
|
posting_date: DF.Date
|
||||||
|
rounding_loss_allowance: DF.Float
|
||||||
|
total_gain_loss: DF.Currency
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_rounding_loss_allowance()
|
self.validate_rounding_loss_allowance()
|
||||||
self.set_total_gain_loss()
|
self.set_total_gain_loss()
|
||||||
@@ -192,7 +214,7 @@ class ExchangeRateRevaluation(Document):
|
|||||||
# round off balance based on currency precision
|
# round off balance based on currency precision
|
||||||
# and consider debit-credit difference allowance
|
# and consider debit-credit difference allowance
|
||||||
currency_precision = get_currency_precision()
|
currency_precision = get_currency_precision()
|
||||||
rounding_loss_allowance = float(rounding_loss_allowance) or 0.05
|
rounding_loss_allowance = float(rounding_loss_allowance)
|
||||||
for acc in account_details:
|
for acc in account_details:
|
||||||
acc.balance_in_account_currency = flt(acc.balance_in_account_currency, currency_precision)
|
acc.balance_in_account_currency = flt(acc.balance_in_account_currency, currency_precision)
|
||||||
if abs(acc.balance_in_account_currency) <= rounding_loss_allowance:
|
if abs(acc.balance_in_account_currency) <= rounding_loss_allowance:
|
||||||
|
|||||||
@@ -6,4 +6,29 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class ExchangeRateRevaluationAccount(Document):
|
class ExchangeRateRevaluationAccount(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account: DF.Link
|
||||||
|
account_currency: DF.Link | None
|
||||||
|
balance_in_account_currency: DF.Currency
|
||||||
|
balance_in_base_currency: DF.Currency
|
||||||
|
current_exchange_rate: DF.Float
|
||||||
|
gain_loss: DF.Currency
|
||||||
|
new_balance_in_account_currency: DF.Currency
|
||||||
|
new_balance_in_base_currency: DF.Currency
|
||||||
|
new_exchange_rate: DF.Float
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
party: DF.DynamicLink | None
|
||||||
|
party_type: DF.Link | None
|
||||||
|
zero_balance: DF.Check
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -6,4 +6,15 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class FinanceBook(Document):
|
class FinanceBook(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
finance_book_name: DF.Data | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -10,6 +10,25 @@ from frappe.utils import add_days, add_years, cstr, getdate
|
|||||||
|
|
||||||
|
|
||||||
class FiscalYear(Document):
|
class FiscalYear(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.fiscal_year_company.fiscal_year_company import FiscalYearCompany
|
||||||
|
|
||||||
|
auto_created: DF.Check
|
||||||
|
companies: DF.Table[FiscalYearCompany]
|
||||||
|
disabled: DF.Check
|
||||||
|
is_short_year: DF.Check
|
||||||
|
year: DF.Data
|
||||||
|
year_end_date: DF.Date
|
||||||
|
year_start_date: DF.Date
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_dates()
|
self.validate_dates()
|
||||||
self.validate_overlap()
|
self.validate_overlap()
|
||||||
|
|||||||
@@ -6,4 +6,18 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class FiscalYearCompany(Document):
|
class FiscalYearCompany(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
company: DF.Link | None
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -28,6 +28,47 @@ exclude_from_linked_with = True
|
|||||||
|
|
||||||
|
|
||||||
class GLEntry(Document):
|
class GLEntry(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account: DF.Link | None
|
||||||
|
account_currency: DF.Link | None
|
||||||
|
against: DF.Text | None
|
||||||
|
against_voucher: DF.DynamicLink | None
|
||||||
|
against_voucher_type: DF.Link | None
|
||||||
|
company: DF.Link | None
|
||||||
|
cost_center: DF.Link | None
|
||||||
|
credit: DF.Currency
|
||||||
|
credit_in_account_currency: DF.Currency
|
||||||
|
credit_in_transaction_currency: DF.Currency
|
||||||
|
debit: DF.Currency
|
||||||
|
debit_in_account_currency: DF.Currency
|
||||||
|
debit_in_transaction_currency: DF.Currency
|
||||||
|
due_date: DF.Date | None
|
||||||
|
finance_book: DF.Link | None
|
||||||
|
fiscal_year: DF.Link | None
|
||||||
|
is_advance: DF.Literal["No", "Yes"]
|
||||||
|
is_cancelled: DF.Check
|
||||||
|
is_opening: DF.Literal["No", "Yes"]
|
||||||
|
party: DF.DynamicLink | None
|
||||||
|
party_type: DF.Link | None
|
||||||
|
posting_date: DF.Date | None
|
||||||
|
project: DF.Link | None
|
||||||
|
remarks: DF.Text | None
|
||||||
|
to_rename: DF.Check
|
||||||
|
transaction_currency: DF.Link | None
|
||||||
|
transaction_date: DF.Date | None
|
||||||
|
transaction_exchange_rate: DF.Float
|
||||||
|
voucher_detail_no: DF.Data | None
|
||||||
|
voucher_no: DF.DynamicLink | None
|
||||||
|
voucher_type: DF.Link | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def autoname(self):
|
def autoname(self):
|
||||||
"""
|
"""
|
||||||
Temporarily name doc for fast insertion
|
Temporarily name doc for fast insertion
|
||||||
|
|||||||
@@ -17,6 +17,34 @@ from erpnext.controllers.accounts_controller import AccountsController
|
|||||||
|
|
||||||
|
|
||||||
class InvoiceDiscounting(AccountsController):
|
class InvoiceDiscounting(AccountsController):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.discounted_invoice.discounted_invoice import DiscountedInvoice
|
||||||
|
|
||||||
|
accounts_receivable_credit: DF.Link
|
||||||
|
accounts_receivable_discounted: DF.Link
|
||||||
|
accounts_receivable_unpaid: DF.Link
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
bank_account: DF.Link
|
||||||
|
bank_charges: DF.Currency
|
||||||
|
bank_charges_account: DF.Link
|
||||||
|
company: DF.Link
|
||||||
|
invoices: DF.Table[DiscountedInvoice]
|
||||||
|
loan_end_date: DF.Date | None
|
||||||
|
loan_period: DF.Int
|
||||||
|
loan_start_date: DF.Date | None
|
||||||
|
posting_date: DF.Date
|
||||||
|
short_term_loan: DF.Link
|
||||||
|
status: DF.Literal["Draft", "Sanctioned", "Disbursed", "Settled", "Cancelled"]
|
||||||
|
total_amount: DF.Currency
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_mandatory()
|
self.validate_mandatory()
|
||||||
self.validate_invoices()
|
self.validate_invoices()
|
||||||
|
|||||||
@@ -8,6 +8,24 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class ItemTaxTemplate(Document):
|
class ItemTaxTemplate(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.item_tax_template_detail.item_tax_template_detail import (
|
||||||
|
ItemTaxTemplateDetail,
|
||||||
|
)
|
||||||
|
|
||||||
|
company: DF.Link
|
||||||
|
disabled: DF.Check
|
||||||
|
taxes: DF.Table[ItemTaxTemplateDetail]
|
||||||
|
title: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_tax_accounts()
|
self.validate_tax_accounts()
|
||||||
|
|
||||||
|
|||||||
@@ -6,4 +6,19 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class ItemTaxTemplateDetail(Document):
|
class ItemTaxTemplateDetail(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
tax_rate: DF.Float
|
||||||
|
tax_type: DF.Link
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ frappe.provide("erpnext.journal_entry");
|
|||||||
frappe.ui.form.on("Journal Entry", {
|
frappe.ui.form.on("Journal Entry", {
|
||||||
setup: function(frm) {
|
setup: function(frm) {
|
||||||
frm.add_fetch("bank_account", "account", "account");
|
frm.add_fetch("bank_account", "account", "account");
|
||||||
frm.ignore_doctypes_on_cancel_all = ['Sales Invoice', 'Purchase Invoice', 'Journal Entry', "Repost Payment Ledger", 'Asset', 'Asset Movement', 'Asset Depreciation Schedule', "Repost Accounting Ledger"];
|
frm.ignore_doctypes_on_cancel_all = ['Sales Invoice', 'Purchase Invoice', 'Journal Entry', "Repost Payment Ledger", 'Asset', 'Asset Movement', 'Asset Depreciation Schedule', "Repost Accounting Ledger", "Unreconcile Payment", "Unreconcile Payment Entries"];
|
||||||
},
|
},
|
||||||
|
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
|
|||||||
@@ -35,6 +35,78 @@ class StockAccountInvalidTransaction(frappe.ValidationError):
|
|||||||
|
|
||||||
|
|
||||||
class JournalEntry(AccountsController):
|
class JournalEntry(AccountsController):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.journal_entry_account.journal_entry_account import (
|
||||||
|
JournalEntryAccount,
|
||||||
|
)
|
||||||
|
|
||||||
|
accounts: DF.Table[JournalEntryAccount]
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
apply_tds: DF.Check
|
||||||
|
auto_repeat: DF.Link | None
|
||||||
|
bill_date: DF.Date | None
|
||||||
|
bill_no: DF.Data | None
|
||||||
|
cheque_date: DF.Date | None
|
||||||
|
cheque_no: DF.Data | None
|
||||||
|
clearance_date: DF.Date | None
|
||||||
|
company: DF.Link
|
||||||
|
difference: DF.Currency
|
||||||
|
due_date: DF.Date | None
|
||||||
|
finance_book: DF.Link | None
|
||||||
|
from_template: DF.Link | None
|
||||||
|
inter_company_journal_entry_reference: DF.Link | None
|
||||||
|
is_opening: DF.Literal["No", "Yes"]
|
||||||
|
is_system_generated: DF.Check
|
||||||
|
letter_head: DF.Link | None
|
||||||
|
mode_of_payment: DF.Link | None
|
||||||
|
multi_currency: DF.Check
|
||||||
|
naming_series: DF.Literal["ACC-JV-.YYYY.-"]
|
||||||
|
paid_loan: DF.Data | None
|
||||||
|
pay_to_recd_from: DF.Data | None
|
||||||
|
payment_order: DF.Link | None
|
||||||
|
posting_date: DF.Date
|
||||||
|
process_deferred_accounting: DF.Link | None
|
||||||
|
remark: DF.SmallText | None
|
||||||
|
reversal_of: DF.Link | None
|
||||||
|
select_print_heading: DF.Link | None
|
||||||
|
stock_entry: DF.Link | None
|
||||||
|
tax_withholding_category: DF.Link | None
|
||||||
|
title: DF.Data | None
|
||||||
|
total_amount: DF.Currency
|
||||||
|
total_amount_currency: DF.Link | None
|
||||||
|
total_amount_in_words: DF.Data | None
|
||||||
|
total_credit: DF.Currency
|
||||||
|
total_debit: DF.Currency
|
||||||
|
user_remark: DF.SmallText | None
|
||||||
|
voucher_type: DF.Literal[
|
||||||
|
"Journal Entry",
|
||||||
|
"Inter Company Journal Entry",
|
||||||
|
"Bank Entry",
|
||||||
|
"Cash Entry",
|
||||||
|
"Credit Card Entry",
|
||||||
|
"Debit Note",
|
||||||
|
"Credit Note",
|
||||||
|
"Contra Entry",
|
||||||
|
"Excise Entry",
|
||||||
|
"Write Off Entry",
|
||||||
|
"Opening Entry",
|
||||||
|
"Depreciation Entry",
|
||||||
|
"Exchange Rate Revaluation",
|
||||||
|
"Exchange Gain Or Loss",
|
||||||
|
"Deferred Revenue",
|
||||||
|
"Deferred Expense",
|
||||||
|
]
|
||||||
|
write_off_amount: DF.Currency
|
||||||
|
write_off_based_on: DF.Literal["Accounts Receivable", "Accounts Payable"]
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(JournalEntry, self).__init__(*args, **kwargs)
|
super(JournalEntry, self).__init__(*args, **kwargs)
|
||||||
|
|
||||||
@@ -98,6 +170,8 @@ class JournalEntry(AccountsController):
|
|||||||
"Repost Payment Ledger Items",
|
"Repost Payment Ledger Items",
|
||||||
"Repost Accounting Ledger",
|
"Repost Accounting Ledger",
|
||||||
"Repost Accounting Ledger Items",
|
"Repost Accounting Ledger Items",
|
||||||
|
"Unreconcile Payment",
|
||||||
|
"Unreconcile Payment Entries",
|
||||||
)
|
)
|
||||||
self.make_gl_entries(1)
|
self.make_gl_entries(1)
|
||||||
self.update_advance_paid()
|
self.update_advance_paid()
|
||||||
|
|||||||
@@ -6,4 +6,56 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class JournalEntryAccount(Document):
|
class JournalEntryAccount(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account: DF.Link
|
||||||
|
account_currency: DF.Link | None
|
||||||
|
account_type: DF.Data | None
|
||||||
|
against_account: DF.Text | None
|
||||||
|
balance: DF.Currency
|
||||||
|
bank_account: DF.Link | None
|
||||||
|
cost_center: DF.Link | None
|
||||||
|
credit: DF.Currency
|
||||||
|
credit_in_account_currency: DF.Currency
|
||||||
|
debit: DF.Currency
|
||||||
|
debit_in_account_currency: DF.Currency
|
||||||
|
exchange_rate: DF.Float
|
||||||
|
is_advance: DF.Literal["No", "Yes"]
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
party: DF.DynamicLink | None
|
||||||
|
party_balance: DF.Currency
|
||||||
|
party_type: DF.Link | None
|
||||||
|
project: DF.Link | None
|
||||||
|
reference_detail_no: DF.Data | None
|
||||||
|
reference_due_date: DF.Date | None
|
||||||
|
reference_name: DF.DynamicLink | None
|
||||||
|
reference_type: DF.Literal[
|
||||||
|
"",
|
||||||
|
"Sales Invoice",
|
||||||
|
"Purchase Invoice",
|
||||||
|
"Journal Entry",
|
||||||
|
"Sales Order",
|
||||||
|
"Purchase Order",
|
||||||
|
"Expense Claim",
|
||||||
|
"Asset",
|
||||||
|
"Loan",
|
||||||
|
"Payroll Entry",
|
||||||
|
"Employee Advance",
|
||||||
|
"Exchange Rate Revaluation",
|
||||||
|
"Invoice Discounting",
|
||||||
|
"Fees",
|
||||||
|
"Full and Final Statement",
|
||||||
|
"Payment Entry",
|
||||||
|
]
|
||||||
|
user_remark: DF.SmallText | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -7,6 +7,41 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class JournalEntryTemplate(Document):
|
class JournalEntryTemplate(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.journal_entry_template_account.journal_entry_template_account import (
|
||||||
|
JournalEntryTemplateAccount,
|
||||||
|
)
|
||||||
|
|
||||||
|
accounts: DF.Table[JournalEntryTemplateAccount]
|
||||||
|
company: DF.Link
|
||||||
|
is_opening: DF.Literal["No", "Yes"]
|
||||||
|
multi_currency: DF.Check
|
||||||
|
naming_series: DF.Literal
|
||||||
|
template_title: DF.Data
|
||||||
|
voucher_type: DF.Literal[
|
||||||
|
"Journal Entry",
|
||||||
|
"Inter Company Journal Entry",
|
||||||
|
"Bank Entry",
|
||||||
|
"Cash Entry",
|
||||||
|
"Credit Card Entry",
|
||||||
|
"Debit Note",
|
||||||
|
"Credit Note",
|
||||||
|
"Contra Entry",
|
||||||
|
"Excise Entry",
|
||||||
|
"Write Off Entry",
|
||||||
|
"Opening Entry",
|
||||||
|
"Depreciation Entry",
|
||||||
|
"Exchange Rate Revaluation",
|
||||||
|
]
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,4 +7,18 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class JournalEntryTemplateAccount(Document):
|
class JournalEntryTemplateAccount(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account: DF.Link
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -10,6 +10,27 @@ from erpnext.accounts.doctype.account.account import merge_account
|
|||||||
|
|
||||||
|
|
||||||
class LedgerMerge(Document):
|
class LedgerMerge(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.ledger_merge_accounts.ledger_merge_accounts import (
|
||||||
|
LedgerMergeAccounts,
|
||||||
|
)
|
||||||
|
|
||||||
|
account: DF.Link
|
||||||
|
account_name: DF.Data
|
||||||
|
company: DF.Link
|
||||||
|
is_group: DF.Check
|
||||||
|
merge_accounts: DF.Table[LedgerMergeAccounts]
|
||||||
|
root_type: DF.Literal["", "Asset", "Liability", "Income", "Expense", "Equity"]
|
||||||
|
status: DF.Literal["Pending", "Success", "Partial Success", "Error"]
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def start_merge(self):
|
def start_merge(self):
|
||||||
from frappe.utils.background_jobs import enqueue
|
from frappe.utils.background_jobs import enqueue
|
||||||
from frappe.utils.scheduler import is_scheduler_inactive
|
from frappe.utils.scheduler import is_scheduler_inactive
|
||||||
|
|||||||
@@ -6,4 +6,20 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class LedgerMergeAccounts(Document):
|
class LedgerMergeAccounts(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account: DF.Link
|
||||||
|
account_name: DF.Data
|
||||||
|
merged: DF.Check
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -10,6 +10,27 @@ exclude_from_linked_with = True
|
|||||||
|
|
||||||
|
|
||||||
class LoyaltyPointEntry(Document):
|
class LoyaltyPointEntry(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
company: DF.Link | None
|
||||||
|
customer: DF.Link | None
|
||||||
|
expiry_date: DF.Date | None
|
||||||
|
invoice: DF.DynamicLink | None
|
||||||
|
invoice_type: DF.Link | None
|
||||||
|
loyalty_points: DF.Int
|
||||||
|
loyalty_program: DF.Link | None
|
||||||
|
loyalty_program_tier: DF.Data | None
|
||||||
|
posting_date: DF.Date | None
|
||||||
|
purchase_amount: DF.Currency
|
||||||
|
redeem_against: DF.Link | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,4 +6,20 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class LoyaltyPointEntryRedemption(Document):
|
class LoyaltyPointEntryRedemption(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
redeemed_points: DF.Int
|
||||||
|
redemption_date: DF.Date | None
|
||||||
|
sales_invoice: DF.Data | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -9,6 +9,33 @@ from frappe.utils import flt, today
|
|||||||
|
|
||||||
|
|
||||||
class LoyaltyProgram(Document):
|
class LoyaltyProgram(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.loyalty_program_collection.loyalty_program_collection import (
|
||||||
|
LoyaltyProgramCollection,
|
||||||
|
)
|
||||||
|
|
||||||
|
auto_opt_in: DF.Check
|
||||||
|
collection_rules: DF.Table[LoyaltyProgramCollection]
|
||||||
|
company: DF.Link | None
|
||||||
|
conversion_factor: DF.Float
|
||||||
|
cost_center: DF.Link | None
|
||||||
|
customer_group: DF.Link | None
|
||||||
|
customer_territory: DF.Link | None
|
||||||
|
expense_account: DF.Link | None
|
||||||
|
expiry_duration: DF.Int
|
||||||
|
from_date: DF.Date
|
||||||
|
loyalty_program_name: DF.Data
|
||||||
|
loyalty_program_type: DF.Literal["Single Tier Program", "Multiple Tier Program"]
|
||||||
|
to_date: DF.Date | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,4 +6,20 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class LoyaltyProgramCollection(Document):
|
class LoyaltyProgramCollection(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
collection_factor: DF.Currency
|
||||||
|
min_spent: DF.Currency
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
tier_name: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -8,6 +8,24 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class ModeofPayment(Document):
|
class ModeofPayment(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.mode_of_payment_account.mode_of_payment_account import (
|
||||||
|
ModeofPaymentAccount,
|
||||||
|
)
|
||||||
|
|
||||||
|
accounts: DF.Table[ModeofPaymentAccount]
|
||||||
|
enabled: DF.Check
|
||||||
|
mode_of_payment: DF.Data
|
||||||
|
type: DF.Literal["Cash", "Bank", "General", "Phone"]
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_accounts()
|
self.validate_accounts()
|
||||||
self.validate_repeating_companies()
|
self.validate_repeating_companies()
|
||||||
|
|||||||
@@ -6,4 +6,19 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class ModeofPaymentAccount(Document):
|
class ModeofPaymentAccount(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
company: DF.Link | None
|
||||||
|
default_account: DF.Link | None
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -9,6 +9,23 @@ from frappe.utils import add_months, flt
|
|||||||
|
|
||||||
|
|
||||||
class MonthlyDistribution(Document):
|
class MonthlyDistribution(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.monthly_distribution_percentage.monthly_distribution_percentage import (
|
||||||
|
MonthlyDistributionPercentage,
|
||||||
|
)
|
||||||
|
|
||||||
|
distribution_id: DF.Data
|
||||||
|
fiscal_year: DF.Link | None
|
||||||
|
percentages: DF.Table[MonthlyDistributionPercentage]
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_months(self):
|
def get_months(self):
|
||||||
month_list = [
|
month_list = [
|
||||||
|
|||||||
@@ -6,4 +6,19 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class MonthlyDistributionPercentage(Document):
|
class MonthlyDistributionPercentage(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
month: DF.Data
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
percentage_allocation: DF.Float
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -14,6 +14,25 @@ from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
|
|||||||
|
|
||||||
|
|
||||||
class OpeningInvoiceCreationTool(Document):
|
class OpeningInvoiceCreationTool(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.opening_invoice_creation_tool_item.opening_invoice_creation_tool_item import (
|
||||||
|
OpeningInvoiceCreationToolItem,
|
||||||
|
)
|
||||||
|
|
||||||
|
company: DF.Link
|
||||||
|
cost_center: DF.Link | None
|
||||||
|
create_missing_party: DF.Check
|
||||||
|
invoice_type: DF.Literal["Sales", "Purchase"]
|
||||||
|
invoices: DF.Table[OpeningInvoiceCreationToolItem]
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def onload(self):
|
def onload(self):
|
||||||
"""Load the Opening Invoice summary"""
|
"""Load the Opening Invoice summary"""
|
||||||
summary, max_count = self.get_opening_invoice_summary()
|
summary, max_count = self.get_opening_invoice_summary()
|
||||||
|
|||||||
@@ -6,4 +6,27 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class OpeningInvoiceCreationToolItem(Document):
|
class OpeningInvoiceCreationToolItem(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
cost_center: DF.Link | None
|
||||||
|
due_date: DF.Date | None
|
||||||
|
invoice_number: DF.Data | None
|
||||||
|
item_name: DF.Data | None
|
||||||
|
outstanding_amount: DF.Currency
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
party: DF.DynamicLink
|
||||||
|
party_type: DF.Link | None
|
||||||
|
posting_date: DF.Date | None
|
||||||
|
qty: DF.Data | None
|
||||||
|
temporary_opening_account: DF.Link | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -6,4 +6,31 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class OverduePayment(Document):
|
class OverduePayment(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
description: DF.SmallText | None
|
||||||
|
discounted_amount: DF.Currency
|
||||||
|
due_date: DF.Date | None
|
||||||
|
dunning_level: DF.Int
|
||||||
|
interest: DF.Currency
|
||||||
|
invoice_portion: DF.Percent
|
||||||
|
mode_of_payment: DF.Link | None
|
||||||
|
outstanding: DF.Currency
|
||||||
|
overdue_days: DF.Data | None
|
||||||
|
paid_amount: DF.Currency
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
payment_amount: DF.Currency
|
||||||
|
payment_schedule: DF.Data | None
|
||||||
|
payment_term: DF.Link | None
|
||||||
|
sales_invoice: DF.Link
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -6,4 +6,20 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class PartyAccount(Document):
|
class PartyAccount(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account: DF.Link | None
|
||||||
|
advance_account: DF.Link | None
|
||||||
|
company: DF.Link
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -7,6 +7,20 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class PartyLink(Document):
|
class PartyLink(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
primary_party: DF.DynamicLink | None
|
||||||
|
primary_role: DF.Link
|
||||||
|
secondary_party: DF.DynamicLink | None
|
||||||
|
secondary_role: DF.Link | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
if self.primary_role not in ["Customer", "Supplier"]:
|
if self.primary_role not in ["Customer", "Supplier"]:
|
||||||
frappe.throw(
|
frappe.throw(
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import frappe
|
|||||||
from frappe import ValidationError, _, qb, scrub, throw
|
from frappe import ValidationError, _, qb, scrub, throw
|
||||||
from frappe.utils import cint, comma_or, flt, getdate, nowdate
|
from frappe.utils import cint, comma_or, flt, getdate, nowdate
|
||||||
from frappe.utils.data import comma_and, fmt_money
|
from frappe.utils.data import comma_and, fmt_money
|
||||||
|
from pypika import Case
|
||||||
|
from pypika.functions import Coalesce, Sum
|
||||||
|
|
||||||
import erpnext
|
import erpnext
|
||||||
from erpnext.accounts.doctype.bank_account.bank_account import (
|
from erpnext.accounts.doctype.bank_account.bank_account import (
|
||||||
@@ -104,9 +106,17 @@ class PaymentEntry(AccountsController):
|
|||||||
self.set_status()
|
self.set_status()
|
||||||
|
|
||||||
def set_liability_account(self):
|
def set_liability_account(self):
|
||||||
if not self.book_advance_payments_in_separate_party_account:
|
# Auto setting liability account should only be done during 'draft' status
|
||||||
|
if self.docstatus > 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if not frappe.db.get_value(
|
||||||
|
"Company", self.company, "book_advance_payments_in_separate_party_account"
|
||||||
|
):
|
||||||
|
return
|
||||||
|
|
||||||
|
# Important to set this flag for the gl building logic to work properly
|
||||||
|
self.book_advance_payments_in_separate_party_account = True
|
||||||
account_type = frappe.get_value(
|
account_type = frappe.get_value(
|
||||||
"Account", {"name": self.party_account, "company": self.company}, "account_type"
|
"Account", {"name": self.party_account, "company": self.company}, "account_type"
|
||||||
)
|
)
|
||||||
@@ -116,11 +126,13 @@ class PaymentEntry(AccountsController):
|
|||||||
):
|
):
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.unallocated_amount == 0:
|
if self.references:
|
||||||
for d in self.references:
|
allowed_types = frozenset(["Sales Order", "Purchase Order"])
|
||||||
if d.reference_doctype in ["Sales Order", "Purchase Order"]:
|
reference_types = set([x.reference_doctype for x in self.references])
|
||||||
break
|
|
||||||
else:
|
# If there are referencers other than `allowed_types`, treat this as a normal payment entry
|
||||||
|
if reference_types - allowed_types:
|
||||||
|
self.book_advance_payments_in_separate_party_account = False
|
||||||
return
|
return
|
||||||
|
|
||||||
liability_account = get_party_account(
|
liability_account = get_party_account(
|
||||||
@@ -1055,112 +1067,105 @@ class PaymentEntry(AccountsController):
|
|||||||
item=self,
|
item=self,
|
||||||
)
|
)
|
||||||
|
|
||||||
for d in self.get("references"):
|
|
||||||
# re-defining dr_or_cr for every reference in order to avoid the last value affecting calculation of reverse
|
|
||||||
dr_or_cr = "credit" if self.payment_type == "Receive" else "debit"
|
|
||||||
cost_center = self.cost_center
|
|
||||||
if d.reference_doctype == "Sales Invoice" and not cost_center:
|
|
||||||
cost_center = frappe.db.get_value(d.reference_doctype, d.reference_name, "cost_center")
|
|
||||||
|
|
||||||
gle = party_gl_dict.copy()
|
|
||||||
|
|
||||||
allocated_amount_in_company_currency = self.calculate_base_allocated_amount_for_reference(d)
|
|
||||||
|
|
||||||
if self.book_advance_payments_in_separate_party_account:
|
|
||||||
against_voucher_type = "Payment Entry"
|
|
||||||
against_voucher = self.name
|
|
||||||
else:
|
|
||||||
against_voucher_type = d.reference_doctype
|
|
||||||
against_voucher = d.reference_name
|
|
||||||
|
|
||||||
reverse_dr_or_cr = 0
|
|
||||||
if d.reference_doctype in ["Sales Invoice", "Purchase Invoice"]:
|
|
||||||
is_return = frappe.db.get_value(d.reference_doctype, d.reference_name, "is_return")
|
|
||||||
payable_party_types = get_party_types_from_account_type("Payable")
|
|
||||||
receivable_party_types = get_party_types_from_account_type("Receivable")
|
|
||||||
if is_return and self.party_type in receivable_party_types and (self.payment_type == "Pay"):
|
|
||||||
reverse_dr_or_cr = 1
|
|
||||||
elif (
|
|
||||||
is_return and self.party_type in payable_party_types and (self.payment_type == "Receive")
|
|
||||||
):
|
|
||||||
reverse_dr_or_cr = 1
|
|
||||||
|
|
||||||
if is_return and not reverse_dr_or_cr:
|
|
||||||
dr_or_cr = "debit" if dr_or_cr == "credit" else "credit"
|
|
||||||
|
|
||||||
gle.update(
|
|
||||||
{
|
|
||||||
dr_or_cr: abs(allocated_amount_in_company_currency),
|
|
||||||
dr_or_cr + "_in_account_currency": abs(d.allocated_amount),
|
|
||||||
"against_voucher_type": against_voucher_type,
|
|
||||||
"against_voucher": against_voucher,
|
|
||||||
"cost_center": cost_center,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
gl_entries.append(gle)
|
|
||||||
|
|
||||||
dr_or_cr = "credit" if self.payment_type == "Receive" else "debit"
|
dr_or_cr = "credit" if self.payment_type == "Receive" else "debit"
|
||||||
if self.unallocated_amount:
|
if self.book_advance_payments_in_separate_party_account:
|
||||||
exchange_rate = self.get_exchange_rate()
|
|
||||||
base_unallocated_amount = self.unallocated_amount * exchange_rate
|
|
||||||
|
|
||||||
gle = party_gl_dict.copy()
|
gle = party_gl_dict.copy()
|
||||||
|
|
||||||
|
if self.payment_type == "Receive":
|
||||||
|
amount = self.base_paid_amount
|
||||||
|
else:
|
||||||
|
amount = self.base_received_amount
|
||||||
|
|
||||||
|
exchange_rate = self.get_exchange_rate()
|
||||||
|
amount_in_account_currency = amount * exchange_rate
|
||||||
gle.update(
|
gle.update(
|
||||||
{
|
{
|
||||||
dr_or_cr + "_in_account_currency": self.unallocated_amount,
|
dr_or_cr: amount,
|
||||||
dr_or_cr: base_unallocated_amount,
|
dr_or_cr + "_in_account_currency": amount_in_account_currency,
|
||||||
|
"against_voucher_type": "Payment Entry",
|
||||||
|
"against_voucher": self.name,
|
||||||
|
"cost_center": self.cost_center,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
gl_entries.append(gle)
|
gl_entries.append(gle)
|
||||||
|
else:
|
||||||
|
for d in self.get("references"):
|
||||||
|
# re-defining dr_or_cr for every reference in order to avoid the last value affecting calculation of reverse
|
||||||
|
dr_or_cr = "credit" if self.payment_type == "Receive" else "debit"
|
||||||
|
cost_center = self.cost_center
|
||||||
|
if d.reference_doctype == "Sales Invoice" and not cost_center:
|
||||||
|
cost_center = frappe.db.get_value(d.reference_doctype, d.reference_name, "cost_center")
|
||||||
|
|
||||||
def make_advance_gl_entries(self, against_voucher_type=None, against_voucher=None, cancel=0):
|
gle = party_gl_dict.copy()
|
||||||
if self.book_advance_payments_in_separate_party_account:
|
|
||||||
gl_entries = []
|
|
||||||
for d in self.get("references"):
|
|
||||||
if d.reference_doctype in ("Sales Invoice", "Purchase Invoice", "Journal Entry"):
|
|
||||||
if not (against_voucher_type and against_voucher) or (
|
|
||||||
d.reference_doctype == against_voucher_type and d.reference_name == against_voucher
|
|
||||||
):
|
|
||||||
self.make_invoice_liability_entry(gl_entries, d)
|
|
||||||
|
|
||||||
if cancel:
|
allocated_amount_in_company_currency = self.calculate_base_allocated_amount_for_reference(d)
|
||||||
for entry in gl_entries:
|
reverse_dr_or_cr = 0
|
||||||
frappe.db.set_value(
|
|
||||||
"GL Entry",
|
if d.reference_doctype in ["Sales Invoice", "Purchase Invoice"]:
|
||||||
|
is_return = frappe.db.get_value(d.reference_doctype, d.reference_name, "is_return")
|
||||||
|
payable_party_types = get_party_types_from_account_type("Payable")
|
||||||
|
receivable_party_types = get_party_types_from_account_type("Receivable")
|
||||||
|
if is_return and self.party_type in receivable_party_types and (self.payment_type == "Pay"):
|
||||||
|
reverse_dr_or_cr = 1
|
||||||
|
elif (
|
||||||
|
is_return and self.party_type in payable_party_types and (self.payment_type == "Receive")
|
||||||
|
):
|
||||||
|
reverse_dr_or_cr = 1
|
||||||
|
|
||||||
|
if is_return and not reverse_dr_or_cr:
|
||||||
|
dr_or_cr = "debit" if dr_or_cr == "credit" else "credit"
|
||||||
|
|
||||||
|
gle.update(
|
||||||
{
|
{
|
||||||
"voucher_no": self.name,
|
dr_or_cr: abs(allocated_amount_in_company_currency),
|
||||||
"voucher_type": self.doctype,
|
dr_or_cr + "_in_account_currency": abs(d.allocated_amount),
|
||||||
"voucher_detail_no": entry.voucher_detail_no,
|
"against_voucher_type": d.reference_doctype,
|
||||||
"against_voucher_type": entry.against_voucher_type,
|
"against_voucher": d.reference_name,
|
||||||
"against_voucher": entry.against_voucher,
|
"cost_center": cost_center,
|
||||||
},
|
}
|
||||||
"is_cancelled",
|
)
|
||||||
1,
|
gl_entries.append(gle)
|
||||||
|
|
||||||
|
if self.unallocated_amount:
|
||||||
|
dr_or_cr = "credit" if self.payment_type == "Receive" else "debit"
|
||||||
|
exchange_rate = self.get_exchange_rate()
|
||||||
|
base_unallocated_amount = self.unallocated_amount * exchange_rate
|
||||||
|
|
||||||
|
gle = party_gl_dict.copy()
|
||||||
|
gle.update(
|
||||||
|
{
|
||||||
|
dr_or_cr + "_in_account_currency": self.unallocated_amount,
|
||||||
|
dr_or_cr: base_unallocated_amount,
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
make_reverse_gl_entries(gl_entries=gl_entries, partial_cancel=True)
|
gl_entries.append(gle)
|
||||||
return
|
|
||||||
|
|
||||||
# same reference added to payment entry
|
def make_advance_gl_entries(
|
||||||
for gl_entry in gl_entries.copy():
|
self, entry: object | dict = None, cancel: bool = 0, update_outstanding: str = "Yes"
|
||||||
if frappe.db.exists(
|
):
|
||||||
"GL Entry",
|
gl_entries = []
|
||||||
{
|
self.add_advance_gl_entries(gl_entries, entry)
|
||||||
"account": gl_entry.account,
|
|
||||||
"voucher_type": gl_entry.voucher_type,
|
|
||||||
"voucher_no": gl_entry.voucher_no,
|
|
||||||
"voucher_detail_no": gl_entry.voucher_detail_no,
|
|
||||||
"debit": gl_entry.debit,
|
|
||||||
"credit": gl_entry.credit,
|
|
||||||
"is_cancelled": 0,
|
|
||||||
},
|
|
||||||
):
|
|
||||||
gl_entries.remove(gl_entry)
|
|
||||||
|
|
||||||
make_gl_entries(gl_entries)
|
if cancel:
|
||||||
|
make_reverse_gl_entries(gl_entries, partial_cancel=True)
|
||||||
|
else:
|
||||||
|
make_gl_entries(gl_entries, update_outstanding=update_outstanding)
|
||||||
|
|
||||||
def make_invoice_liability_entry(self, gl_entries, invoice):
|
def add_advance_gl_entries(self, gl_entries: list, entry: object | dict | None):
|
||||||
|
"""
|
||||||
|
If 'entry' is passed, GL enties only for that reference is added.
|
||||||
|
"""
|
||||||
|
if self.book_advance_payments_in_separate_party_account:
|
||||||
|
references = [x for x in self.get("references")]
|
||||||
|
if entry:
|
||||||
|
references = [x for x in self.get("references") if x.name == entry.name]
|
||||||
|
|
||||||
|
for ref in references:
|
||||||
|
if ref.reference_doctype in ("Sales Invoice", "Purchase Invoice", "Journal Entry"):
|
||||||
|
self.add_advance_gl_for_reference(gl_entries, ref)
|
||||||
|
|
||||||
|
def add_advance_gl_for_reference(self, gl_entries, invoice):
|
||||||
args_dict = {
|
args_dict = {
|
||||||
"party_type": self.party_type,
|
"party_type": self.party_type,
|
||||||
"party": self.party,
|
"party": self.party,
|
||||||
@@ -1975,18 +1980,24 @@ def get_company_defaults(company):
|
|||||||
|
|
||||||
|
|
||||||
def get_outstanding_on_journal_entry(name):
|
def get_outstanding_on_journal_entry(name):
|
||||||
res = frappe.db.sql(
|
gl = frappe.qb.DocType("GL Entry")
|
||||||
"SELECT "
|
res = (
|
||||||
'CASE WHEN party_type IN ("Customer") '
|
frappe.qb.from_(gl)
|
||||||
"THEN ifnull(sum(debit_in_account_currency - credit_in_account_currency), 0) "
|
.select(
|
||||||
"ELSE ifnull(sum(credit_in_account_currency - debit_in_account_currency), 0) "
|
Case()
|
||||||
"END as outstanding_amount "
|
.when(
|
||||||
"FROM `tabGL Entry` WHERE (voucher_no=%s OR against_voucher=%s) "
|
gl.party_type == "Customer",
|
||||||
"AND party_type IS NOT NULL "
|
Coalesce(Sum(gl.debit_in_account_currency - gl.credit_in_account_currency), 0),
|
||||||
'AND party_type != ""',
|
)
|
||||||
(name, name),
|
.else_(Coalesce(Sum(gl.credit_in_account_currency - gl.debit_in_account_currency), 0))
|
||||||
as_dict=1,
|
.as_("outstanding_amount")
|
||||||
)
|
)
|
||||||
|
.where(
|
||||||
|
(Coalesce(gl.party_type, "") != "")
|
||||||
|
& (gl.is_cancelled == 0)
|
||||||
|
& ((gl.voucher_no == name) | (gl.against_voucher == name))
|
||||||
|
)
|
||||||
|
).run(as_dict=True)
|
||||||
|
|
||||||
outstanding_amount = res[0].get("outstanding_amount", 0) if res else 0
|
outstanding_amount = res[0].get("outstanding_amount", 0) if res else 0
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ from frappe import qb
|
|||||||
from frappe.tests.utils import FrappeTestCase, change_settings
|
from frappe.tests.utils import FrappeTestCase, change_settings
|
||||||
from frappe.utils import flt, nowdate
|
from frappe.utils import flt, nowdate
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.account.test_account import create_account
|
||||||
from erpnext.accounts.doctype.payment_entry.payment_entry import (
|
from erpnext.accounts.doctype.payment_entry.payment_entry import (
|
||||||
InvalidPaymentEntry,
|
InvalidPaymentEntry,
|
||||||
get_payment_entry,
|
get_payment_entry,
|
||||||
@@ -1318,6 +1319,142 @@ class TestPaymentEntry(FrappeTestCase):
|
|||||||
]
|
]
|
||||||
self.check_gl_entries()
|
self.check_gl_entries()
|
||||||
|
|
||||||
|
def test_ledger_entries_for_advance_as_liability(self):
|
||||||
|
from erpnext.accounts.doctype.account.test_account import create_account
|
||||||
|
|
||||||
|
company = "_Test Company"
|
||||||
|
|
||||||
|
advance_account = create_account(
|
||||||
|
parent_account="Current Assets - _TC",
|
||||||
|
account_name="Advances Received",
|
||||||
|
company=company,
|
||||||
|
account_type="Receivable",
|
||||||
|
)
|
||||||
|
|
||||||
|
frappe.db.set_value(
|
||||||
|
"Company",
|
||||||
|
company,
|
||||||
|
{
|
||||||
|
"book_advance_payments_in_separate_party_account": 1,
|
||||||
|
"default_advance_received_account": advance_account,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
# Advance Payment
|
||||||
|
pe = create_payment_entry(
|
||||||
|
party_type="Customer",
|
||||||
|
party="_Test Customer",
|
||||||
|
payment_type="Receive",
|
||||||
|
paid_from="Debtors - _TC",
|
||||||
|
paid_to="_Test Cash - _TC",
|
||||||
|
)
|
||||||
|
pe.save() # use save() to trigger set_liability_account()
|
||||||
|
pe.submit()
|
||||||
|
|
||||||
|
# Normal Invoice
|
||||||
|
si = create_sales_invoice(qty=10, rate=100, customer="_Test Customer")
|
||||||
|
|
||||||
|
pre_reconciliation_gle = [
|
||||||
|
{"account": advance_account, "debit": 0.0, "credit": 1000.0},
|
||||||
|
{"account": "_Test Cash - _TC", "debit": 1000.0, "credit": 0.0},
|
||||||
|
]
|
||||||
|
pre_reconciliation_ple = [
|
||||||
|
{
|
||||||
|
"account": advance_account,
|
||||||
|
"voucher_no": pe.name,
|
||||||
|
"against_voucher_no": pe.name,
|
||||||
|
"amount": -1000.0,
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
self.voucher_no = pe.name
|
||||||
|
self.expected_gle = pre_reconciliation_gle
|
||||||
|
self.expected_ple = pre_reconciliation_ple
|
||||||
|
self.check_gl_entries()
|
||||||
|
self.check_pl_entries()
|
||||||
|
|
||||||
|
# Partially reconcile advance against invoice
|
||||||
|
pr = frappe.get_doc("Payment Reconciliation")
|
||||||
|
pr.company = company
|
||||||
|
pr.party_type = "Customer"
|
||||||
|
pr.party = "_Test Customer"
|
||||||
|
pr.receivable_payable_account = si.debit_to
|
||||||
|
pr.default_advance_account = advance_account
|
||||||
|
pr.payment_name = pe.name
|
||||||
|
pr.invoice_name = si.name
|
||||||
|
pr.get_unreconciled_entries()
|
||||||
|
|
||||||
|
self.assertEqual(len(pr.invoices), 1)
|
||||||
|
self.assertEqual(len(pr.payments), 1)
|
||||||
|
|
||||||
|
invoices = [x.as_dict() for x in pr.get("invoices")]
|
||||||
|
payments = [x.as_dict() for x in pr.get("payments")]
|
||||||
|
pr.allocate_entries(frappe._dict({"invoices": invoices, "payments": payments}))
|
||||||
|
pr.allocation[0].allocated_amount = 400
|
||||||
|
pr.reconcile()
|
||||||
|
|
||||||
|
# assert General and Payment Ledger entries post partial reconciliation
|
||||||
|
self.expected_gle = [
|
||||||
|
{"account": si.debit_to, "debit": 0.0, "credit": 400.0},
|
||||||
|
{"account": advance_account, "debit": 400.0, "credit": 0.0},
|
||||||
|
{"account": advance_account, "debit": 0.0, "credit": 1000.0},
|
||||||
|
{"account": "_Test Cash - _TC", "debit": 1000.0, "credit": 0.0},
|
||||||
|
]
|
||||||
|
self.expected_ple = [
|
||||||
|
{
|
||||||
|
"account": advance_account,
|
||||||
|
"voucher_no": pe.name,
|
||||||
|
"against_voucher_no": pe.name,
|
||||||
|
"amount": -1000.0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"account": si.debit_to,
|
||||||
|
"voucher_no": pe.name,
|
||||||
|
"against_voucher_no": si.name,
|
||||||
|
"amount": -400.0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"account": advance_account,
|
||||||
|
"voucher_no": pe.name,
|
||||||
|
"against_voucher_no": pe.name,
|
||||||
|
"amount": 400.0,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
self.check_gl_entries()
|
||||||
|
self.check_pl_entries()
|
||||||
|
|
||||||
|
# Unreconcile
|
||||||
|
unrecon = (
|
||||||
|
frappe.get_doc(
|
||||||
|
{
|
||||||
|
"doctype": "Unreconcile Payment",
|
||||||
|
"company": company,
|
||||||
|
"voucher_type": pe.doctype,
|
||||||
|
"voucher_no": pe.name,
|
||||||
|
"allocations": [{"reference_doctype": si.doctype, "reference_name": si.name}],
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.save()
|
||||||
|
.submit()
|
||||||
|
)
|
||||||
|
|
||||||
|
self.voucher_no = pe.name
|
||||||
|
self.expected_gle = pre_reconciliation_gle
|
||||||
|
self.expected_ple = pre_reconciliation_ple
|
||||||
|
self.check_gl_entries()
|
||||||
|
self.check_pl_entries()
|
||||||
|
|
||||||
|
def check_pl_entries(self):
|
||||||
|
ple = frappe.qb.DocType("Payment Ledger Entry")
|
||||||
|
pl_entries = (
|
||||||
|
frappe.qb.from_(ple)
|
||||||
|
.select(ple.account, ple.voucher_no, ple.against_voucher_no, ple.amount)
|
||||||
|
.where((ple.voucher_no == self.voucher_no) & (ple.delinked == 0))
|
||||||
|
.orderby(ple.creation)
|
||||||
|
).run(as_dict=True)
|
||||||
|
for row in range(len(self.expected_ple)):
|
||||||
|
for field in ["account", "voucher_no", "against_voucher_no", "amount"]:
|
||||||
|
self.assertEqual(self.expected_ple[row][field], pl_entries[row][field])
|
||||||
|
|
||||||
def check_gl_entries(self):
|
def check_gl_entries(self):
|
||||||
gle = frappe.qb.DocType("GL Entry")
|
gle = frappe.qb.DocType("GL Entry")
|
||||||
gl_entries = (
|
gl_entries = (
|
||||||
|
|||||||
@@ -6,4 +6,21 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class PaymentEntryDeduction(Document):
|
class PaymentEntryDeduction(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account: DF.Link
|
||||||
|
amount: DF.Currency
|
||||||
|
cost_center: DF.Link
|
||||||
|
description: DF.SmallText | None
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -6,4 +6,28 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class PaymentEntryReference(Document):
|
class PaymentEntryReference(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account: DF.Link | None
|
||||||
|
allocated_amount: DF.Float
|
||||||
|
bill_no: DF.Data | None
|
||||||
|
due_date: DF.Date | None
|
||||||
|
exchange_gain_loss: DF.Currency
|
||||||
|
exchange_rate: DF.Float
|
||||||
|
outstanding_amount: DF.Float
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
payment_term: DF.Link | None
|
||||||
|
reference_doctype: DF.Link
|
||||||
|
reference_name: DF.DynamicLink
|
||||||
|
total_amount: DF.Float
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -7,6 +7,22 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class PaymentGatewayAccount(Document):
|
class PaymentGatewayAccount(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
currency: DF.ReadOnly | None
|
||||||
|
is_default: DF.Check
|
||||||
|
message: DF.SmallText | None
|
||||||
|
payment_account: DF.Link
|
||||||
|
payment_channel: DF.Literal["", "Email", "Phone"]
|
||||||
|
payment_gateway: DF.Link
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def autoname(self):
|
def autoname(self):
|
||||||
self.name = self.payment_gateway + " - " + self.currency
|
self.name = self.payment_gateway + " - " + self.currency
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,35 @@ from erpnext.exceptions import InvalidAccountDimensionError, MandatoryAccountDim
|
|||||||
|
|
||||||
|
|
||||||
class PaymentLedgerEntry(Document):
|
class PaymentLedgerEntry(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account: DF.Link | None
|
||||||
|
account_currency: DF.Link | None
|
||||||
|
account_type: DF.Literal["Receivable", "Payable"]
|
||||||
|
against_voucher_no: DF.DynamicLink | None
|
||||||
|
against_voucher_type: DF.Link | None
|
||||||
|
amount: DF.Currency
|
||||||
|
amount_in_account_currency: DF.Currency
|
||||||
|
company: DF.Link | None
|
||||||
|
cost_center: DF.Link | None
|
||||||
|
delinked: DF.Check
|
||||||
|
due_date: DF.Date | None
|
||||||
|
finance_book: DF.Link | None
|
||||||
|
party: DF.DynamicLink | None
|
||||||
|
party_type: DF.Link | None
|
||||||
|
posting_date: DF.Date | None
|
||||||
|
remarks: DF.Text | None
|
||||||
|
voucher_detail_no: DF.Data | None
|
||||||
|
voucher_no: DF.DynamicLink | None
|
||||||
|
voucher_type: DF.Link | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate_account(self):
|
def validate_account(self):
|
||||||
valid_account = frappe.db.get_list(
|
valid_account = frappe.db.get_list(
|
||||||
"Account",
|
"Account",
|
||||||
|
|||||||
@@ -11,6 +11,30 @@ from erpnext.accounts.party import get_party_account
|
|||||||
|
|
||||||
|
|
||||||
class PaymentOrder(Document):
|
class PaymentOrder(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.payment_order_reference.payment_order_reference import (
|
||||||
|
PaymentOrderReference,
|
||||||
|
)
|
||||||
|
|
||||||
|
account: DF.Data | None
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
company: DF.Link
|
||||||
|
company_bank: DF.Link | None
|
||||||
|
company_bank_account: DF.Link
|
||||||
|
naming_series: DF.Literal["PMO-"]
|
||||||
|
party: DF.Link | None
|
||||||
|
payment_order_type: DF.Literal["", "Payment Request", "Payment Entry"]
|
||||||
|
posting_date: DF.Date | None
|
||||||
|
references: DF.Table[PaymentOrderReference]
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def on_submit(self):
|
def on_submit(self):
|
||||||
self.update_payment_status()
|
self.update_payment_status()
|
||||||
|
|
||||||
|
|||||||
@@ -6,4 +6,26 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class PaymentOrderReference(Document):
|
class PaymentOrderReference(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account: DF.Link | None
|
||||||
|
amount: DF.Currency
|
||||||
|
bank_account: DF.Link
|
||||||
|
mode_of_payment: DF.Link | None
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
payment_reference: DF.Data | None
|
||||||
|
payment_request: DF.Link | None
|
||||||
|
reference_doctype: DF.Link
|
||||||
|
reference_name: DF.DynamicLink
|
||||||
|
supplier: DF.Link | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -212,9 +212,10 @@
|
|||||||
],
|
],
|
||||||
"hide_toolbar": 1,
|
"hide_toolbar": 1,
|
||||||
"icon": "icon-resize-horizontal",
|
"icon": "icon-resize-horizontal",
|
||||||
|
"is_virtual": 1,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2023-08-15 05:35:50.109290",
|
"modified": "2023-11-17 17:33:55.701726",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Payment Reconciliation",
|
"name": "Payment Reconciliation",
|
||||||
@@ -239,6 +240,5 @@
|
|||||||
],
|
],
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"states": [],
|
"states": []
|
||||||
"track_changes": 1
|
|
||||||
}
|
}
|
||||||
@@ -23,12 +23,106 @@ from erpnext.controllers.accounts_controller import get_advance_payment_entries_
|
|||||||
|
|
||||||
|
|
||||||
class PaymentReconciliation(Document):
|
class PaymentReconciliation(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.payment_reconciliation_allocation.payment_reconciliation_allocation import (
|
||||||
|
PaymentReconciliationAllocation,
|
||||||
|
)
|
||||||
|
from erpnext.accounts.doctype.payment_reconciliation_invoice.payment_reconciliation_invoice import (
|
||||||
|
PaymentReconciliationInvoice,
|
||||||
|
)
|
||||||
|
from erpnext.accounts.doctype.payment_reconciliation_payment.payment_reconciliation_payment import (
|
||||||
|
PaymentReconciliationPayment,
|
||||||
|
)
|
||||||
|
|
||||||
|
allocation: DF.Table[PaymentReconciliationAllocation]
|
||||||
|
bank_cash_account: DF.Link | None
|
||||||
|
company: DF.Link
|
||||||
|
cost_center: DF.Link | None
|
||||||
|
default_advance_account: DF.Link | None
|
||||||
|
from_invoice_date: DF.Date | None
|
||||||
|
from_payment_date: DF.Date | None
|
||||||
|
invoice_limit: DF.Int
|
||||||
|
invoice_name: DF.Data | None
|
||||||
|
invoices: DF.Table[PaymentReconciliationInvoice]
|
||||||
|
maximum_invoice_amount: DF.Currency
|
||||||
|
maximum_payment_amount: DF.Currency
|
||||||
|
minimum_invoice_amount: DF.Currency
|
||||||
|
minimum_payment_amount: DF.Currency
|
||||||
|
party: DF.DynamicLink
|
||||||
|
party_type: DF.Link
|
||||||
|
payment_limit: DF.Int
|
||||||
|
payment_name: DF.Data | None
|
||||||
|
payments: DF.Table[PaymentReconciliationPayment]
|
||||||
|
receivable_payable_account: DF.Link
|
||||||
|
to_invoice_date: DF.Date | None
|
||||||
|
to_payment_date: DF.Date | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(PaymentReconciliation, self).__init__(*args, **kwargs)
|
super(PaymentReconciliation, self).__init__(*args, **kwargs)
|
||||||
self.common_filter_conditions = []
|
self.common_filter_conditions = []
|
||||||
self.accounting_dimension_filter_conditions = []
|
self.accounting_dimension_filter_conditions = []
|
||||||
self.ple_posting_date_filter = []
|
self.ple_posting_date_filter = []
|
||||||
|
|
||||||
|
def load_from_db(self):
|
||||||
|
# 'modified' attribute is required for `run_doc_method` to work properly.
|
||||||
|
doc_dict = frappe._dict(
|
||||||
|
{
|
||||||
|
"modified": None,
|
||||||
|
"company": None,
|
||||||
|
"party": None,
|
||||||
|
"party_type": None,
|
||||||
|
"receivable_payable_account": None,
|
||||||
|
"default_advance_account": None,
|
||||||
|
"from_invoice_date": None,
|
||||||
|
"to_invoice_date": None,
|
||||||
|
"invoice_limit": 50,
|
||||||
|
"from_payment_date": None,
|
||||||
|
"to_payment_date": None,
|
||||||
|
"payment_limit": 50,
|
||||||
|
"minimum_invoice_amount": None,
|
||||||
|
"minimum_payment_amount": None,
|
||||||
|
"maximum_invoice_amount": None,
|
||||||
|
"maximum_payment_amount": None,
|
||||||
|
"bank_cash_account": None,
|
||||||
|
"cost_center": None,
|
||||||
|
"payment_name": None,
|
||||||
|
"invoice_name": None,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
super(Document, self).__init__(doc_dict)
|
||||||
|
|
||||||
|
def save(self):
|
||||||
|
return
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_list(args):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_count(args):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_stats(args):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def db_insert(self, *args, **kwargs):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def db_update(self, *args, **kwargs):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def delete(self):
|
||||||
|
pass
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_unreconciled_entries(self):
|
def get_unreconciled_entries(self):
|
||||||
self.get_nonreconciled_payment_entries()
|
self.get_nonreconciled_payment_entries()
|
||||||
|
|||||||
@@ -153,9 +153,10 @@
|
|||||||
"options": "Cost Center"
|
"options": "Cost Center"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"is_virtual": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2023-09-03 07:52:33.684217",
|
"modified": "2023-11-17 17:33:38.612615",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Payment Reconciliation Allocation",
|
"name": "Payment Reconciliation Allocation",
|
||||||
|
|||||||
@@ -6,4 +6,32 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class PaymentReconciliationAllocation(Document):
|
class PaymentReconciliationAllocation(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
allocated_amount: DF.Currency
|
||||||
|
amount: DF.Currency
|
||||||
|
cost_center: DF.Link | None
|
||||||
|
currency: DF.Link | None
|
||||||
|
difference_account: DF.Link | None
|
||||||
|
difference_amount: DF.Currency
|
||||||
|
exchange_rate: DF.Float
|
||||||
|
gain_loss_posting_date: DF.Date | None
|
||||||
|
invoice_number: DF.DynamicLink
|
||||||
|
invoice_type: DF.Link
|
||||||
|
is_advance: DF.Data | None
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
reference_name: DF.DynamicLink
|
||||||
|
reference_row: DF.Data | None
|
||||||
|
reference_type: DF.Link
|
||||||
|
unreconciled_amount: DF.Currency
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -71,9 +71,10 @@
|
|||||||
"label": "Exchange Rate"
|
"label": "Exchange Rate"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"is_virtual": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2022-11-08 18:18:02.502149",
|
"modified": "2023-11-17 17:33:45.455166",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Payment Reconciliation Invoice",
|
"name": "Payment Reconciliation Invoice",
|
||||||
|
|||||||
@@ -6,4 +6,24 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class PaymentReconciliationInvoice(Document):
|
class PaymentReconciliationInvoice(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
amount: DF.Currency
|
||||||
|
currency: DF.Link | None
|
||||||
|
exchange_rate: DF.Float
|
||||||
|
invoice_date: DF.Date | None
|
||||||
|
invoice_number: DF.DynamicLink | None
|
||||||
|
invoice_type: DF.Literal["Sales Invoice", "Purchase Invoice", "Journal Entry"]
|
||||||
|
outstanding_amount: DF.Currency
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -107,9 +107,10 @@
|
|||||||
"options": "Cost Center"
|
"options": "Cost Center"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"is_virtual": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2023-09-03 07:43:29.965353",
|
"modified": "2023-11-17 17:33:34.818530",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Payment Reconciliation Payment",
|
"name": "Payment Reconciliation Payment",
|
||||||
|
|||||||
@@ -6,4 +6,28 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class PaymentReconciliationPayment(Document):
|
class PaymentReconciliationPayment(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
amount: DF.Currency
|
||||||
|
cost_center: DF.Link | None
|
||||||
|
currency: DF.Link | None
|
||||||
|
difference_amount: DF.Currency
|
||||||
|
exchange_rate: DF.Float
|
||||||
|
is_advance: DF.Data | None
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
posting_date: DF.Date | None
|
||||||
|
reference_name: DF.DynamicLink | None
|
||||||
|
reference_row: DF.Data | None
|
||||||
|
reference_type: DF.Link | None
|
||||||
|
remark: DF.SmallText | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -27,6 +27,65 @@ def _get_payment_gateway_controller(*args, **kwargs):
|
|||||||
|
|
||||||
|
|
||||||
class PaymentRequest(Document):
|
class PaymentRequest(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.subscription_plan_detail.subscription_plan_detail import (
|
||||||
|
SubscriptionPlanDetail,
|
||||||
|
)
|
||||||
|
|
||||||
|
account: DF.ReadOnly | None
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
bank: DF.Link | None
|
||||||
|
bank_account: DF.Link | None
|
||||||
|
bank_account_no: DF.ReadOnly | None
|
||||||
|
branch_code: DF.ReadOnly | None
|
||||||
|
cost_center: DF.Link | None
|
||||||
|
currency: DF.Link | None
|
||||||
|
email_to: DF.Data | None
|
||||||
|
grand_total: DF.Currency
|
||||||
|
iban: DF.ReadOnly | None
|
||||||
|
is_a_subscription: DF.Check
|
||||||
|
make_sales_invoice: DF.Check
|
||||||
|
message: DF.Text | None
|
||||||
|
mode_of_payment: DF.Link | None
|
||||||
|
mute_email: DF.Check
|
||||||
|
naming_series: DF.Literal["ACC-PRQ-.YYYY.-"]
|
||||||
|
party: DF.DynamicLink | None
|
||||||
|
party_type: DF.Link | None
|
||||||
|
payment_account: DF.ReadOnly | None
|
||||||
|
payment_channel: DF.Literal["", "Email", "Phone"]
|
||||||
|
payment_gateway: DF.ReadOnly | None
|
||||||
|
payment_gateway_account: DF.Link | None
|
||||||
|
payment_order: DF.Link | None
|
||||||
|
payment_request_type: DF.Literal["Outward", "Inward"]
|
||||||
|
payment_url: DF.Data | None
|
||||||
|
print_format: DF.Literal
|
||||||
|
project: DF.Link | None
|
||||||
|
reference_doctype: DF.Link | None
|
||||||
|
reference_name: DF.DynamicLink | None
|
||||||
|
status: DF.Literal[
|
||||||
|
"",
|
||||||
|
"Draft",
|
||||||
|
"Requested",
|
||||||
|
"Initiated",
|
||||||
|
"Partially Paid",
|
||||||
|
"Payment Ordered",
|
||||||
|
"Paid",
|
||||||
|
"Failed",
|
||||||
|
"Cancelled",
|
||||||
|
]
|
||||||
|
subject: DF.Data | None
|
||||||
|
subscription_plans: DF.Table[SubscriptionPlanDetail]
|
||||||
|
swift_number: DF.ReadOnly | None
|
||||||
|
transaction_date: DF.Date | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
if self.get("__islocal"):
|
if self.get("__islocal"):
|
||||||
self.status = "Draft"
|
self.status = "Draft"
|
||||||
|
|||||||
@@ -6,4 +6,30 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class PaymentSchedule(Document):
|
class PaymentSchedule(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
base_payment_amount: DF.Currency
|
||||||
|
description: DF.SmallText | None
|
||||||
|
discount: DF.Float
|
||||||
|
discount_date: DF.Date | None
|
||||||
|
discount_type: DF.Literal["Percentage", "Amount"]
|
||||||
|
discounted_amount: DF.Currency
|
||||||
|
due_date: DF.Date
|
||||||
|
invoice_portion: DF.Percent
|
||||||
|
mode_of_payment: DF.Link | None
|
||||||
|
outstanding: DF.Currency
|
||||||
|
paid_amount: DF.Currency
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
payment_amount: DF.Currency
|
||||||
|
payment_term: DF.Link | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -6,4 +6,33 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class PaymentTerm(Document):
|
class PaymentTerm(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
credit_days: DF.Int
|
||||||
|
credit_months: DF.Int
|
||||||
|
description: DF.SmallText | None
|
||||||
|
discount: DF.Float
|
||||||
|
discount_type: DF.Literal["Percentage", "Amount"]
|
||||||
|
discount_validity: DF.Int
|
||||||
|
discount_validity_based_on: DF.Literal[
|
||||||
|
"Day(s) after invoice date",
|
||||||
|
"Day(s) after the end of the invoice month",
|
||||||
|
"Month(s) after the end of the invoice month",
|
||||||
|
]
|
||||||
|
due_date_based_on: DF.Literal[
|
||||||
|
"Day(s) after invoice date",
|
||||||
|
"Day(s) after the end of the invoice month",
|
||||||
|
"Month(s) after the end of the invoice month",
|
||||||
|
]
|
||||||
|
invoice_portion: DF.Float
|
||||||
|
mode_of_payment: DF.Link | None
|
||||||
|
payment_term_name: DF.Data | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -9,6 +9,23 @@ from frappe.utils import flt
|
|||||||
|
|
||||||
|
|
||||||
class PaymentTermsTemplate(Document):
|
class PaymentTermsTemplate(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.payment_terms_template_detail.payment_terms_template_detail import (
|
||||||
|
PaymentTermsTemplateDetail,
|
||||||
|
)
|
||||||
|
|
||||||
|
allocate_payment_based_on_payment_terms: DF.Check
|
||||||
|
template_name: DF.Data | None
|
||||||
|
terms: DF.Table[PaymentTermsTemplateDetail]
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_invoice_portion()
|
self.validate_invoice_portion()
|
||||||
self.validate_terms()
|
self.validate_terms()
|
||||||
|
|||||||
@@ -6,4 +6,36 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class PaymentTermsTemplateDetail(Document):
|
class PaymentTermsTemplateDetail(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
credit_days: DF.Int
|
||||||
|
credit_months: DF.Int
|
||||||
|
description: DF.SmallText | None
|
||||||
|
discount: DF.Float
|
||||||
|
discount_type: DF.Literal["Percentage", "Amount"]
|
||||||
|
discount_validity: DF.Int
|
||||||
|
discount_validity_based_on: DF.Literal[
|
||||||
|
"Day(s) after invoice date",
|
||||||
|
"Day(s) after the end of the invoice month",
|
||||||
|
"Month(s) after the end of the invoice month",
|
||||||
|
]
|
||||||
|
due_date_based_on: DF.Literal[
|
||||||
|
"Day(s) after invoice date",
|
||||||
|
"Day(s) after the end of the invoice month",
|
||||||
|
"Month(s) after the end of the invoice month",
|
||||||
|
]
|
||||||
|
invoice_portion: DF.Float
|
||||||
|
mode_of_payment: DF.Link | None
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
payment_term: DF.Link | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -15,6 +15,26 @@ from erpnext.controllers.accounts_controller import AccountsController
|
|||||||
|
|
||||||
|
|
||||||
class PeriodClosingVoucher(AccountsController):
|
class PeriodClosingVoucher(AccountsController):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
closing_account_head: DF.Link
|
||||||
|
company: DF.Link
|
||||||
|
error_message: DF.Text | None
|
||||||
|
fiscal_year: DF.Link
|
||||||
|
gle_processing_status: DF.Literal["In Progress", "Completed", "Failed"]
|
||||||
|
posting_date: DF.Date
|
||||||
|
remarks: DF.SmallText
|
||||||
|
transaction_date: DF.Date | None
|
||||||
|
year_start_date: DF.Date | None
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_account_head()
|
self.validate_account_head()
|
||||||
self.validate_posting_date()
|
self.validate_posting_date()
|
||||||
|
|||||||
@@ -14,6 +14,43 @@ from erpnext.controllers.status_updater import StatusUpdater
|
|||||||
|
|
||||||
|
|
||||||
class POSClosingEntry(StatusUpdater):
|
class POSClosingEntry(StatusUpdater):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
from erpnext.accounts.doctype.pos_closing_entry_detail.pos_closing_entry_detail import (
|
||||||
|
POSClosingEntryDetail,
|
||||||
|
)
|
||||||
|
from erpnext.accounts.doctype.pos_closing_entry_taxes.pos_closing_entry_taxes import (
|
||||||
|
POSClosingEntryTaxes,
|
||||||
|
)
|
||||||
|
from erpnext.accounts.doctype.pos_invoice_reference.pos_invoice_reference import (
|
||||||
|
POSInvoiceReference,
|
||||||
|
)
|
||||||
|
|
||||||
|
amended_from: DF.Link | None
|
||||||
|
company: DF.Link
|
||||||
|
error_message: DF.SmallText | None
|
||||||
|
grand_total: DF.Currency
|
||||||
|
net_total: DF.Currency
|
||||||
|
payment_reconciliation: DF.Table[POSClosingEntryDetail]
|
||||||
|
period_end_date: DF.Datetime
|
||||||
|
period_start_date: DF.Datetime
|
||||||
|
pos_opening_entry: DF.Link
|
||||||
|
pos_profile: DF.Link
|
||||||
|
pos_transactions: DF.Table[POSInvoiceReference]
|
||||||
|
posting_date: DF.Date
|
||||||
|
posting_time: DF.Time
|
||||||
|
status: DF.Literal["Draft", "Submitted", "Queued", "Failed", "Cancelled"]
|
||||||
|
taxes: DF.Table[POSClosingEntryTaxes]
|
||||||
|
total_quantity: DF.Float
|
||||||
|
user: DF.Link
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.posting_date = self.posting_date or frappe.utils.nowdate()
|
self.posting_date = self.posting_date or frappe.utils.nowdate()
|
||||||
self.posting_time = self.posting_time or frappe.utils.nowtime()
|
self.posting_time = self.posting_time or frappe.utils.nowtime()
|
||||||
|
|||||||
@@ -6,4 +6,22 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class POSClosingEntryDetail(Document):
|
class POSClosingEntryDetail(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
closing_amount: DF.Currency
|
||||||
|
difference: DF.Currency
|
||||||
|
expected_amount: DF.Currency
|
||||||
|
mode_of_payment: DF.Link
|
||||||
|
opening_amount: DF.Currency
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -6,4 +6,20 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class POSClosingEntryTaxes(Document):
|
class POSClosingEntryTaxes(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
account_head: DF.Link | None
|
||||||
|
amount: DF.Currency
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
rate: DF.Percent
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -6,4 +6,18 @@ from frappe.model.document import Document
|
|||||||
|
|
||||||
|
|
||||||
class POSCustomerGroup(Document):
|
class POSCustomerGroup(Document):
|
||||||
|
# begin: auto-generated types
|
||||||
|
# This code is auto-generated. Do not modify anything in this block.
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from frappe.types import DF
|
||||||
|
|
||||||
|
customer_group: DF.Link
|
||||||
|
parent: DF.Data
|
||||||
|
parentfield: DF.Data
|
||||||
|
parenttype: DF.Data
|
||||||
|
# end: auto-generated types
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user