From a88afdfe71a5d6815ae5cb66fcc9b88714b7ba06 Mon Sep 17 00:00:00 2001 From: rocketdebris Date: Tue, 10 Feb 2026 18:18:24 -0500 Subject: [PATCH] Added Payment Term and Payment Terms Templates to fixtures. --- custom_ui/fixtures/payment_term.json | 223 +++++++++++ .../fixtures/payment_terms_template.json | 348 ++++++++++++++++++ custom_ui/hooks.py | 2 + 3 files changed, 573 insertions(+) create mode 100644 custom_ui/fixtures/payment_term.json create mode 100644 custom_ui/fixtures/payment_terms_template.json diff --git a/custom_ui/fixtures/payment_term.json b/custom_ui/fixtures/payment_term.json new file mode 100644 index 0000000..61676d8 --- /dev/null +++ b/custom_ui/fixtures/payment_term.json @@ -0,0 +1,223 @@ +[ + { + "credit_days": 0, + "credit_months": 0, + "description": null, + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "docstatus": 0, + "doctype": "Payment Term", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 20.0, + "mode_of_payment": "Bank Draft", + "modified": "2025-01-03 09:11:38.199028", + "name": "Deposit for Spring", + "payment_term_name": "Deposit for Spring" + }, + { + "credit_days": 0, + "credit_months": 0, + "description": "Milestone #1: 30% is due upon project initiation", + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "docstatus": 0, + "doctype": "Payment Term", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 30.0, + "mode_of_payment": null, + "modified": "2024-12-13 13:55:57.588606", + "name": "Milestone Payment", + "payment_term_name": "Milestone Payment" + }, + { + "credit_days": 0, + "credit_months": 0, + "description": "Milestone Payment 2 is due upon completion of design phase.", + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "docstatus": 0, + "doctype": "Payment Term", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 30.0, + "mode_of_payment": null, + "modified": "2024-12-13 14:01:09.387776", + "name": "Milestone Payment #2", + "payment_term_name": "Milestone Payment #2" + }, + { + "credit_days": 0, + "credit_months": 0, + "description": "Milestone payment #3 is due upon completion of installation", + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "docstatus": 0, + "doctype": "Payment Term", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 30.0, + "mode_of_payment": null, + "modified": "2024-12-13 14:02:12.045732", + "name": "milestone Payment #3", + "payment_term_name": "milestone Payment #3" + }, + { + "credit_days": 30, + "credit_months": 0, + "description": "Payment Terms: Installments\nDue Date: Monthly payments on the [X]th of each month\nInstallment Amount: [Amount Per Installment]\nTotal Amount: [Total Invoice Amount]\n\nDescription: Payment is split into multiple installments over a period of time.", + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "docstatus": 0, + "doctype": "Payment Term", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 0.0, + "mode_of_payment": null, + "modified": "2024-12-13 14:05:47.451623", + "name": "Installments", + "payment_term_name": "Installments" + }, + { + "credit_days": 30, + "credit_months": 0, + "description": null, + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "docstatus": 0, + "doctype": "Payment Term", + "due_date_based_on": "Day(s) after the end of the invoice month", + "invoice_portion": 95.0, + "mode_of_payment": null, + "modified": "2024-12-13 13:44:21.019236", + "name": "Payment in full, less retention", + "payment_term_name": "Payment in full, less retention" + }, + { + "credit_days": 90, + "credit_months": 0, + "description": null, + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "docstatus": 0, + "doctype": "Payment Term", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 5.0, + "mode_of_payment": null, + "modified": "2024-12-13 13:44:54.391772", + "name": "Retention Payment", + "payment_term_name": "Retention Payment" + }, + { + "credit_days": 0, + "credit_months": 0, + "description": "Prepaid services require payment in full prior to the service date.", + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "docstatus": 0, + "doctype": "Payment Term", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 100.0, + "mode_of_payment": null, + "modified": "2024-12-27 12:45:32.841916", + "name": "Prepaid", + "payment_term_name": "Prepaid" + }, + { + "credit_days": 30, + "credit_months": 0, + "description": null, + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "docstatus": 0, + "doctype": "Payment Term", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 100.0, + "mode_of_payment": null, + "modified": "2024-12-27 14:47:23.733775", + "name": "Net 30", + "payment_term_name": "Net 30" + }, + { + "credit_days": -50, + "credit_months": 0, + "description": null, + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "docstatus": 0, + "doctype": "Payment Term", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 50.0, + "mode_of_payment": null, + "modified": "2024-11-01 13:15:13.698534", + "name": "50% Commitment Payment", + "payment_term_name": "50% Commitment Payment" + }, + { + "credit_days": 0, + "credit_months": 0, + "description": "Remaining Balance Due upon completion of project", + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "docstatus": 0, + "doctype": "Payment Term", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 50.0, + "mode_of_payment": "", + "modified": "2024-11-01 13:18:23.029229", + "name": "Final Payment", + "payment_term_name": "Final Payment" + }, + { + "credit_days": 10, + "credit_months": 0, + "description": "Payment due in full on the 10th of next month\n", + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "docstatus": 0, + "doctype": "Payment Term", + "due_date_based_on": "Day(s) after the end of the invoice month", + "invoice_portion": 100.0, + "mode_of_payment": "", + "modified": "2024-10-30 12:14:45.411032", + "name": "Net 10th", + "payment_term_name": "Net 10th" + }, + { + "credit_days": 1, + "credit_months": 0, + "description": null, + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "docstatus": 0, + "doctype": "Payment Term", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 100.0, + "mode_of_payment": null, + "modified": "2024-12-16 17:33:50.732656", + "name": "Payment due", + "payment_term_name": "Payment due" + } +] \ No newline at end of file diff --git a/custom_ui/fixtures/payment_terms_template.json b/custom_ui/fixtures/payment_terms_template.json new file mode 100644 index 0000000..ee846f7 --- /dev/null +++ b/custom_ui/fixtures/payment_terms_template.json @@ -0,0 +1,348 @@ +[ + { + "allocate_payment_based_on_payment_terms": 1, + "docstatus": 0, + "doctype": "Payment Terms Template", + "modified": "2024-12-13 13:49:50.909253", + "name": "Retainage withheld", + "template_name": "Retainage withheld", + "terms": [ + { + "credit_days": 30, + "credit_months": 0, + "description": null, + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "due_date_based_on": "Day(s) after the end of the invoice month", + "invoice_portion": 95.0, + "mode_of_payment": null, + "parent": "Retainage withheld", + "parentfield": "terms", + "parenttype": "Payment Terms Template", + "payment_term": "Payment in full, less retention" + }, + { + "credit_days": 90, + "credit_months": 0, + "description": null, + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 5.0, + "mode_of_payment": null, + "parent": "Retainage withheld", + "parentfield": "terms", + "parenttype": "Payment Terms Template", + "payment_term": "Retention Payment" + } + ] + }, + { + "allocate_payment_based_on_payment_terms": 0, + "docstatus": 0, + "doctype": "Payment Terms Template", + "modified": "2024-12-13 14:02:40.410369", + "name": "Progress Payments", + "template_name": "Progress Payments", + "terms": [ + { + "credit_days": 0, + "credit_months": 0, + "description": "Milestone #1: 30% is due upon project initiation", + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 30.0, + "mode_of_payment": null, + "parent": "Progress Payments", + "parentfield": "terms", + "parenttype": "Payment Terms Template", + "payment_term": "Milestone Payment" + }, + { + "credit_days": 0, + "credit_months": 0, + "description": "Milestone Payment 2 is due upon completion of design phase.", + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 30.0, + "mode_of_payment": null, + "parent": "Progress Payments", + "parentfield": "terms", + "parenttype": "Payment Terms Template", + "payment_term": "Milestone Payment #2" + }, + { + "credit_days": 0, + "credit_months": 0, + "description": "Milestone payment #3 is due upon completion of installation", + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 30.0, + "mode_of_payment": null, + "parent": "Progress Payments", + "parentfield": "terms", + "parenttype": "Payment Terms Template", + "payment_term": "milestone Payment #3" + }, + { + "credit_days": 0, + "credit_months": 0, + "description": "Remaining Balance Due upon completion of project", + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 10.0, + "mode_of_payment": "", + "parent": "Progress Payments", + "parentfield": "terms", + "parenttype": "Payment Terms Template", + "payment_term": "Final Payment" + } + ] + }, + { + "allocate_payment_based_on_payment_terms": 0, + "docstatus": 0, + "doctype": "Payment Terms Template", + "modified": "2024-12-13 14:07:00.773030", + "name": "Installment Payments", + "template_name": "Installment Payments", + "terms": [ + { + "credit_days": 30, + "credit_months": 0, + "description": "Payment Terms: Installments\nDue Date: Monthly payments on the [X]th of each month\nInstallment Amount: [Amount Per Installment]\nTotal Amount: [Total Invoice Amount]\n\nDescription: Payment is split into multiple installments over a period of time.", + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 100.0, + "mode_of_payment": null, + "parent": "Installment Payments", + "parentfield": "terms", + "parenttype": "Payment Terms Template", + "payment_term": "Installments" + } + ] + }, + { + "allocate_payment_based_on_payment_terms": 0, + "docstatus": 0, + "doctype": "Payment Terms Template", + "modified": "2025-01-03 09:12:35.254621", + "name": "20 - 30 - 50", + "template_name": "20 - 30 - 50", + "terms": [ + { + "credit_days": 0, + "credit_months": 0, + "description": null, + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 20.0, + "mode_of_payment": "Bank Draft", + "parent": "20 - 30 - 50", + "parentfield": "terms", + "parenttype": "Payment Terms Template", + "payment_term": "Deposit for Spring" + }, + { + "credit_days": 180, + "credit_months": 0, + "description": null, + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 30.0, + "mode_of_payment": null, + "parent": "20 - 30 - 50", + "parentfield": "terms", + "parenttype": "Payment Terms Template", + "payment_term": "50% Commitment Payment" + }, + { + "credit_days": 200, + "credit_months": 0, + "description": "Remaining Balance Due upon completion of project", + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 50.0, + "mode_of_payment": "", + "parent": "20 - 30 - 50", + "parentfield": "terms", + "parenttype": "Payment Terms Template", + "payment_term": "Final Payment" + } + ] + }, + { + "allocate_payment_based_on_payment_terms": 0, + "docstatus": 0, + "doctype": "Payment Terms Template", + "modified": "2024-12-27 14:46:06.969722", + "name": "Prepaid", + "template_name": "Prepaid", + "terms": [ + { + "credit_days": 0, + "credit_months": 0, + "description": "Prepaid services require payment in full prior to the service date.", + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 100.0, + "mode_of_payment": null, + "parent": "Prepaid", + "parentfield": "terms", + "parenttype": "Payment Terms Template", + "payment_term": "Prepaid" + } + ] + }, + { + "allocate_payment_based_on_payment_terms": 0, + "docstatus": 0, + "doctype": "Payment Terms Template", + "modified": "2024-11-01 13:20:36.757196", + "name": "Half Down", + "template_name": "Half Down", + "terms": [ + { + "credit_days": 1, + "credit_months": 0, + "description": null, + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 50.0, + "mode_of_payment": null, + "parent": "Half Down", + "parentfield": "terms", + "parenttype": "Payment Terms Template", + "payment_term": "50% Commitment Payment" + }, + { + "credit_days": 1, + "credit_months": 0, + "description": "Remaining Balance Due upon completion of project", + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 50.0, + "mode_of_payment": "", + "parent": "Half Down", + "parentfield": "terms", + "parenttype": "Payment Terms Template", + "payment_term": "Final Payment" + } + ] + }, + { + "allocate_payment_based_on_payment_terms": 0, + "docstatus": 0, + "doctype": "Payment Terms Template", + "modified": "2024-12-27 14:47:41.338972", + "name": "Net 30", + "template_name": "Net 30", + "terms": [ + { + "credit_days": 30, + "credit_months": 0, + "description": null, + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 100.0, + "mode_of_payment": null, + "parent": "Net 30", + "parentfield": "terms", + "parenttype": "Payment Terms Template", + "payment_term": "Net 30" + } + ] + }, + { + "allocate_payment_based_on_payment_terms": 0, + "docstatus": 0, + "doctype": "Payment Terms Template", + "modified": "2024-12-16 17:35:10.724856", + "name": "Net 10th", + "template_name": "Net 10th", + "terms": [ + { + "credit_days": 15, + "credit_months": 0, + "description": "Payment due in full on the 10th of next month\n", + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "due_date_based_on": "Day(s) after the end of the invoice month", + "invoice_portion": 100.0, + "mode_of_payment": "", + "parent": "Net 10th", + "parentfield": "terms", + "parenttype": "Payment Terms Template", + "payment_term": "Net 10th" + } + ] + }, + { + "allocate_payment_based_on_payment_terms": 0, + "docstatus": 0, + "doctype": "Payment Terms Template", + "modified": "2024-12-27 14:45:32.560693", + "name": "Due on receipt", + "template_name": "Due on receipt", + "terms": [ + { + "credit_days": 1, + "credit_months": 0, + "description": null, + "discount": 0.0, + "discount_type": "Percentage", + "discount_validity": 0, + "discount_validity_based_on": "Day(s) after invoice date", + "due_date_based_on": "Day(s) after invoice date", + "invoice_portion": 100.0, + "mode_of_payment": null, + "parent": "Due on receipt", + "parentfield": "terms", + "parenttype": "Payment Terms Template", + "payment_term": "Payment due" + } + ] + } +] \ No newline at end of file diff --git a/custom_ui/hooks.py b/custom_ui/hooks.py index a9f2818..1994b71 100644 --- a/custom_ui/hooks.py +++ b/custom_ui/hooks.py @@ -236,6 +236,8 @@ fixtures = [ {"dt": "Client Script"}, {"dt": "Server Script"}, {"dt": "Letter Head"}, + {"dt": "Payment Term"}, + {"dt": "Payment Terms Template"} ]