mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 15:42:52 +00:00
feat: flexible budget allocation frequency
This commit is contained in:
@@ -19,6 +19,8 @@
|
|||||||
"account",
|
"account",
|
||||||
"distribution_type",
|
"distribution_type",
|
||||||
"allocation_frequency",
|
"allocation_frequency",
|
||||||
|
"budget_start_date",
|
||||||
|
"budget_end_date",
|
||||||
"section_break_6",
|
"section_break_6",
|
||||||
"applicable_on_material_request",
|
"applicable_on_material_request",
|
||||||
"action_if_annual_budget_exceeded_on_mr",
|
"action_if_annual_budget_exceeded_on_mr",
|
||||||
@@ -286,6 +288,18 @@
|
|||||||
"options": "Amount\nPercent",
|
"options": "Amount\nPercent",
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "budget_start_date",
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"label": "Budget Start Date",
|
||||||
|
"reqd": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "budget_end_date",
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"label": "Budget End Date",
|
||||||
|
"reqd": 1
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"default": "Monthly",
|
"default": "Monthly",
|
||||||
"fieldname": "allocation_frequency",
|
"fieldname": "allocation_frequency",
|
||||||
@@ -299,7 +313,7 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2025-10-13 16:15:53.046278",
|
"modified": "2025-10-15 01:20:30.551362",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Budget",
|
"name": "Budget",
|
||||||
|
|||||||
@@ -2,10 +2,12 @@
|
|||||||
# For license information, please see license.txt
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
|
||||||
|
from datetime import date
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
from frappe import _
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from frappe.utils import add_months, flt, fmt_money, get_last_day, getdate
|
from frappe.utils import add_months, flt, fmt_money, get_last_day, getdate, month_diff
|
||||||
|
|
||||||
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
|
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import (
|
||||||
get_accounting_dimensions,
|
get_accounting_dimensions,
|
||||||
@@ -33,6 +35,7 @@ class Budget(Document):
|
|||||||
from erpnext.accounts.doctype.budget_account.budget_account import BudgetAccount
|
from erpnext.accounts.doctype.budget_account.budget_account import BudgetAccount
|
||||||
from erpnext.accounts.doctype.budget_distribution.budget_distribution import BudgetDistribution
|
from erpnext.accounts.doctype.budget_distribution.budget_distribution import BudgetDistribution
|
||||||
|
|
||||||
|
account: DF.Link
|
||||||
accounts: DF.Table[BudgetAccount]
|
accounts: DF.Table[BudgetAccount]
|
||||||
action_if_accumulated_monthly_budget_exceeded: DF.Literal["", "Stop", "Warn", "Ignore"]
|
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_mr: DF.Literal["", "Stop", "Warn", "Ignore"]
|
||||||
@@ -42,6 +45,7 @@ class Budget(Document):
|
|||||||
action_if_annual_budget_exceeded_on_mr: 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"]
|
action_if_annual_budget_exceeded_on_po: DF.Literal["", "Stop", "Warn", "Ignore"]
|
||||||
action_if_annual_exceeded_on_cumulative_expense: DF.Literal["", "Stop", "Warn", "Ignore"]
|
action_if_annual_exceeded_on_cumulative_expense: DF.Literal["", "Stop", "Warn", "Ignore"]
|
||||||
|
allocation_frequency: DF.Literal["Monthly", "Quarterly", "Half-Yearly", "Yearly", "Date Range"]
|
||||||
amended_from: DF.Link | None
|
amended_from: DF.Link | None
|
||||||
applicable_on_booking_actual_expenses: DF.Check
|
applicable_on_booking_actual_expenses: DF.Check
|
||||||
applicable_on_cumulative_expense: DF.Check
|
applicable_on_cumulative_expense: DF.Check
|
||||||
@@ -49,8 +53,11 @@ class Budget(Document):
|
|||||||
applicable_on_purchase_order: DF.Check
|
applicable_on_purchase_order: DF.Check
|
||||||
budget_against: DF.Literal["", "Cost Center", "Project"]
|
budget_against: DF.Literal["", "Cost Center", "Project"]
|
||||||
budget_distribution: DF.Table[BudgetDistribution]
|
budget_distribution: DF.Table[BudgetDistribution]
|
||||||
|
budget_end_date: DF.Date
|
||||||
|
budget_start_date: DF.Date
|
||||||
company: DF.Link
|
company: DF.Link
|
||||||
cost_center: DF.Link | None
|
cost_center: DF.Link | None
|
||||||
|
distribution_type: DF.Literal["Amount", "Percent"]
|
||||||
fiscal_year: DF.Link
|
fiscal_year: DF.Link
|
||||||
monthly_distribution: DF.Link | None
|
monthly_distribution: DF.Link | None
|
||||||
naming_series: DF.Literal["BUDGET-.YYYY.-"]
|
naming_series: DF.Literal["BUDGET-.YYYY.-"]
|
||||||
|
|||||||
Reference in New Issue
Block a user