chore: Clean up patches
This commit is contained in:
parent
2ee20d35d9
commit
f25251bb70
@ -183,9 +183,7 @@ class PaymentEntry(AccountsController):
|
||||
if not self.party:
|
||||
frappe.throw(_("Party is mandatory"))
|
||||
|
||||
_party_name = (
|
||||
"title" if self.party_type in ("Student", "Shareholder") else self.party_type.lower() + "_name"
|
||||
)
|
||||
_party_name = "title" if self.party_type == "Shareholder" else self.party_type.lower() + "_name"
|
||||
self.party_name = frappe.db.get_value(self.party_type, self.party, _party_name)
|
||||
|
||||
if self.party:
|
||||
@ -298,9 +296,7 @@ class PaymentEntry(AccountsController):
|
||||
frappe.throw(_("{0} is mandatory").format(self.meta.get_label(field)))
|
||||
|
||||
def validate_reference_documents(self):
|
||||
if self.party_type == "Student":
|
||||
valid_reference_doctypes = "Fees"
|
||||
elif self.party_type == "Customer":
|
||||
if self.party_type == "Customer":
|
||||
valid_reference_doctypes = ("Sales Order", "Sales Invoice", "Journal Entry", "Dunning")
|
||||
elif self.party_type == "Supplier":
|
||||
valid_reference_doctypes = ("Purchase Order", "Purchase Invoice", "Journal Entry")
|
||||
@ -338,8 +334,6 @@ class PaymentEntry(AccountsController):
|
||||
ref_party_account = (
|
||||
get_party_account_based_on_invoice_discounting(d.reference_name) or ref_doc.debit_to
|
||||
)
|
||||
elif self.party_type == "Student":
|
||||
ref_party_account = ref_doc.receivable_account
|
||||
elif self.party_type == "Supplier":
|
||||
ref_party_account = ref_doc.credit_to
|
||||
elif self.party_type == "Employee":
|
||||
@ -1259,20 +1253,19 @@ def get_outstanding_reference_documents(args):
|
||||
|
||||
# Get all SO / PO which are not fully billed or against which full advance not paid
|
||||
orders_to_be_billed = []
|
||||
if args.get("party_type") != "Student":
|
||||
orders_to_be_billed = get_orders_to_be_billed(
|
||||
args.get("posting_date"),
|
||||
args.get("party_type"),
|
||||
args.get("party"),
|
||||
args.get("company"),
|
||||
party_account_currency,
|
||||
company_currency,
|
||||
filters=args,
|
||||
)
|
||||
orders_to_be_billed = get_orders_to_be_billed(
|
||||
args.get("posting_date"),
|
||||
args.get("party_type"),
|
||||
args.get("party"),
|
||||
args.get("company"),
|
||||
party_account_currency,
|
||||
company_currency,
|
||||
filters=args,
|
||||
)
|
||||
|
||||
# Get negative outstanding sales /purchase invoices
|
||||
negative_outstanding_invoices = []
|
||||
if args.get("party_type") not in ["Student", "Employee"] and not args.get("voucher_no"):
|
||||
if args.get("party_type") != "Employee" and not args.get("voucher_no"):
|
||||
negative_outstanding_invoices = get_negative_outstanding_invoices(
|
||||
args.get("party_type"),
|
||||
args.get("party"),
|
||||
@ -1496,9 +1489,7 @@ def get_party_details(company, party_type, party, date, cost_center=None):
|
||||
|
||||
account_currency = get_account_currency(party_account)
|
||||
account_balance = get_balance_on(party_account, date, cost_center=cost_center)
|
||||
_party_name = (
|
||||
"title" if party_type in ("Student", "Shareholder") else party_type.lower() + "_name"
|
||||
)
|
||||
_party_name = "title" if party_type == "Shareholder" else party_type.lower() + "_name"
|
||||
party_name = frappe.db.get_value(party_type, party, _party_name)
|
||||
party_balance = get_balance_on(party_type=party_type, party=party, cost_center=cost_center)
|
||||
if party_type in ["Customer", "Supplier"]:
|
||||
@ -1560,7 +1551,7 @@ def get_company_defaults(company):
|
||||
def get_outstanding_on_journal_entry(name):
|
||||
res = frappe.db.sql(
|
||||
"SELECT "
|
||||
'CASE WHEN party_type IN ("Customer", "Student") '
|
||||
'CASE WHEN party_type IN ("Customer") '
|
||||
"THEN ifnull(sum(debit_in_account_currency - credit_in_account_currency), 0) "
|
||||
"ELSE ifnull(sum(credit_in_account_currency - debit_in_account_currency), 0) "
|
||||
"END as outstanding_amount "
|
||||
@ -1917,8 +1908,6 @@ def set_party_type(dt):
|
||||
party_type = "Supplier"
|
||||
elif dt in ("Expense Claim", "Employee Advance", "Gratuity"):
|
||||
party_type = "Employee"
|
||||
elif dt == "Fees":
|
||||
party_type = "Student"
|
||||
return party_type
|
||||
|
||||
|
||||
|
@ -69,8 +69,6 @@ doctype_series_map = {
|
||||
"Soil Analysis": "AG-ANA-.YY.-.MM.-.#####",
|
||||
"Soil Texture": "AG-TEX-.YYYY.-.#####",
|
||||
"Stock Ledger Entry": "MAT-SLE-.YYYY.-.#####",
|
||||
"Student Leave Application": "EDU-SLA-.YYYY.-.#####",
|
||||
"Student Log": "EDU-SLOG-.YYYY.-.#####",
|
||||
"Subscription": "ACC-SUB-.YYYY.-.#####",
|
||||
"Task": "TASK-.YYYY.-.#####",
|
||||
"Tax Rule": "ACC-TAX-RULE-.YYYY.-.#####",
|
||||
|
@ -55,8 +55,6 @@ doctype_series_map = {
|
||||
"Shareholder": "ACC-SH-.YYYY.-",
|
||||
"Stock Entry": "MAT-STE-.YYYY.-",
|
||||
"Stock Reconciliation": "MAT-RECO-.YYYY.-",
|
||||
"Student": "EDU-STU-.YYYY.-",
|
||||
"Student Applicant": "EDU-APP-.YYYY.-",
|
||||
"Supplier": "SUP-.YYYY.-",
|
||||
"Supplier Quotation": "PUR-SQTN-.YYYY.-",
|
||||
"Supplier Scorecard Period": "PU-SSP-.YYYY.-",
|
||||
|
@ -13,7 +13,6 @@ def execute():
|
||||
"Employee": "Payable",
|
||||
"Member": "Receivable",
|
||||
"Shareholder": "Payable",
|
||||
"Student": "Receivable",
|
||||
}
|
||||
|
||||
for party_type, account_type in party_types.items():
|
||||
|
@ -23,10 +23,6 @@ def set_default_role(doc, method):
|
||||
doc.add_roles("Customer")
|
||||
elif link.link_doctype == "Supplier" and "Supplier" not in roles:
|
||||
doc.add_roles("Supplier")
|
||||
elif frappe.get_value("Student", dict(student_email_id=doc.email)) and "Student" not in roles:
|
||||
doc.add_roles("Student")
|
||||
elif frappe.get_value("Guardian", dict(email_address=doc.email)) and "Guardian" not in roles:
|
||||
doc.add_roles("Guardian")
|
||||
|
||||
|
||||
def create_customer_or_supplier():
|
||||
|
Loading…
x
Reference in New Issue
Block a user