mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 16:34:46 +00:00
fix: project link not set in accounts other than profilt and loss accounts
This commit is contained in:
@@ -1,210 +1,210 @@
|
|||||||
{
|
{
|
||||||
"creation": "2013-06-24 15:49:57",
|
"creation": "2013-06-24 15:49:57",
|
||||||
"description": "Settings for Accounts",
|
"description": "Settings for Accounts",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"document_type": "Other",
|
"document_type": "Other",
|
||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
"field_order": [
|
"field_order": [
|
||||||
"auto_accounting_for_stock",
|
"auto_accounting_for_stock",
|
||||||
"acc_frozen_upto",
|
"acc_frozen_upto",
|
||||||
"frozen_accounts_modifier",
|
"frozen_accounts_modifier",
|
||||||
"determine_address_tax_category_from",
|
"determine_address_tax_category_from",
|
||||||
"over_billing_allowance",
|
"over_billing_allowance",
|
||||||
"column_break_4",
|
"column_break_4",
|
||||||
"credit_controller",
|
"credit_controller",
|
||||||
"check_supplier_invoice_uniqueness",
|
"check_supplier_invoice_uniqueness",
|
||||||
"make_payment_via_journal_entry",
|
"make_payment_via_journal_entry",
|
||||||
"unlink_payment_on_cancellation_of_invoice",
|
"unlink_payment_on_cancellation_of_invoice",
|
||||||
"unlink_advance_payment_on_cancelation_of_order",
|
"unlink_advance_payment_on_cancelation_of_order",
|
||||||
"book_asset_depreciation_entry_automatically",
|
"book_asset_depreciation_entry_automatically",
|
||||||
"allow_cost_center_in_entry_of_bs_account",
|
"add_taxes_from_item_tax_template",
|
||||||
"add_taxes_from_item_tax_template",
|
"automatically_fetch_payment_terms",
|
||||||
"automatically_fetch_payment_terms",
|
"print_settings",
|
||||||
"print_settings",
|
"show_inclusive_tax_in_print",
|
||||||
"show_inclusive_tax_in_print",
|
"column_break_12",
|
||||||
"column_break_12",
|
"show_payment_schedule_in_print",
|
||||||
"show_payment_schedule_in_print",
|
"currency_exchange_section",
|
||||||
"currency_exchange_section",
|
"allow_stale",
|
||||||
"allow_stale",
|
"stale_days",
|
||||||
"stale_days",
|
"report_settings_sb",
|
||||||
"report_settings_sb",
|
"use_custom_cash_flow"
|
||||||
"use_custom_cash_flow"
|
],
|
||||||
],
|
"fields": [
|
||||||
"fields": [
|
{
|
||||||
{
|
"default": "1",
|
||||||
"default": "1",
|
"description": "If enabled, the system will post accounting entries for inventory automatically.",
|
||||||
"description": "If enabled, the system will post accounting entries for inventory automatically.",
|
"fieldname": "auto_accounting_for_stock",
|
||||||
"fieldname": "auto_accounting_for_stock",
|
"fieldtype": "Check",
|
||||||
"fieldtype": "Check",
|
"hidden": 1,
|
||||||
"hidden": 1,
|
"in_list_view": 1,
|
||||||
"in_list_view": 1,
|
"label": "Make Accounting Entry For Every Stock Movement"
|
||||||
"label": "Make Accounting Entry For Every Stock Movement"
|
},
|
||||||
},
|
{
|
||||||
{
|
"description": "Accounting entry frozen up to this date, nobody can do / modify entry except role specified below.",
|
||||||
"description": "Accounting entry frozen up to this date, nobody can do / modify entry except role specified below.",
|
"fieldname": "acc_frozen_upto",
|
||||||
"fieldname": "acc_frozen_upto",
|
"fieldtype": "Date",
|
||||||
"fieldtype": "Date",
|
"in_list_view": 1,
|
||||||
"in_list_view": 1,
|
"label": "Accounts Frozen Upto"
|
||||||
"label": "Accounts Frozen Upto"
|
},
|
||||||
},
|
{
|
||||||
{
|
"description": "Users with this role are allowed to set frozen accounts and create / modify accounting entries against frozen accounts",
|
||||||
"description": "Users with this role are allowed to set frozen accounts and create / modify accounting entries against frozen accounts",
|
"fieldname": "frozen_accounts_modifier",
|
||||||
"fieldname": "frozen_accounts_modifier",
|
"fieldtype": "Link",
|
||||||
"fieldtype": "Link",
|
"in_list_view": 1,
|
||||||
"in_list_view": 1,
|
"label": "Role Allowed to Set Frozen Accounts & Edit Frozen Entries",
|
||||||
"label": "Role Allowed to Set Frozen Accounts & Edit Frozen Entries",
|
"options": "Role"
|
||||||
"options": "Role"
|
},
|
||||||
},
|
{
|
||||||
{
|
"default": "Billing Address",
|
||||||
"default": "Billing Address",
|
"description": "Address used to determine Tax Category in transactions.",
|
||||||
"description": "Address used to determine Tax Category in transactions.",
|
"fieldname": "determine_address_tax_category_from",
|
||||||
"fieldname": "determine_address_tax_category_from",
|
"fieldtype": "Select",
|
||||||
"fieldtype": "Select",
|
"label": "Determine Address Tax Category From",
|
||||||
"label": "Determine Address Tax Category From",
|
"options": "Billing Address\nShipping Address"
|
||||||
"options": "Billing Address\nShipping Address"
|
},
|
||||||
},
|
{
|
||||||
{
|
"fieldname": "column_break_4",
|
||||||
"fieldname": "column_break_4",
|
"fieldtype": "Column Break"
|
||||||
"fieldtype": "Column Break"
|
},
|
||||||
},
|
{
|
||||||
{
|
"description": "Role that is allowed to submit transactions that exceed credit limits set.",
|
||||||
"description": "Role that is allowed to submit transactions that exceed credit limits set.",
|
"fieldname": "credit_controller",
|
||||||
"fieldname": "credit_controller",
|
"fieldtype": "Link",
|
||||||
"fieldtype": "Link",
|
"in_list_view": 1,
|
||||||
"in_list_view": 1,
|
"label": "Credit Controller",
|
||||||
"label": "Credit Controller",
|
"options": "Role"
|
||||||
"options": "Role"
|
},
|
||||||
},
|
{
|
||||||
{
|
"default": "0",
|
||||||
"fieldname": "check_supplier_invoice_uniqueness",
|
"fieldname": "check_supplier_invoice_uniqueness",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Check Supplier Invoice Number Uniqueness"
|
"label": "Check Supplier Invoice Number Uniqueness"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "make_payment_via_journal_entry",
|
"default": "0",
|
||||||
"fieldtype": "Check",
|
"fieldname": "make_payment_via_journal_entry",
|
||||||
"label": "Make Payment via Journal Entry"
|
"fieldtype": "Check",
|
||||||
},
|
"label": "Make Payment via Journal Entry"
|
||||||
{
|
},
|
||||||
"default": "1",
|
{
|
||||||
"fieldname": "unlink_payment_on_cancellation_of_invoice",
|
"default": "1",
|
||||||
"fieldtype": "Check",
|
"fieldname": "unlink_payment_on_cancellation_of_invoice",
|
||||||
"label": "Unlink Payment on Cancellation of Invoice"
|
"fieldtype": "Check",
|
||||||
},
|
"label": "Unlink Payment on Cancellation of Invoice"
|
||||||
{
|
},
|
||||||
"default": "1",
|
{
|
||||||
"fieldname": "unlink_advance_payment_on_cancelation_of_order",
|
"default": "1",
|
||||||
"fieldtype": "Check",
|
"fieldname": "unlink_advance_payment_on_cancelation_of_order",
|
||||||
"label": "Unlink Advance Payment on Cancelation of Order"
|
"fieldtype": "Check",
|
||||||
},
|
"label": "Unlink Advance Payment on Cancelation of Order"
|
||||||
{
|
},
|
||||||
"default": "1",
|
{
|
||||||
"fieldname": "book_asset_depreciation_entry_automatically",
|
"default": "1",
|
||||||
"fieldtype": "Check",
|
"fieldname": "book_asset_depreciation_entry_automatically",
|
||||||
"label": "Book Asset Depreciation Entry Automatically"
|
"fieldtype": "Check",
|
||||||
},
|
"label": "Book Asset Depreciation Entry Automatically"
|
||||||
{
|
},
|
||||||
"fieldname": "allow_cost_center_in_entry_of_bs_account",
|
{
|
||||||
"fieldtype": "Check",
|
"default": "1",
|
||||||
"label": "Allow Cost Center In Entry of Balance Sheet Account"
|
"fieldname": "add_taxes_from_item_tax_template",
|
||||||
},
|
"fieldtype": "Check",
|
||||||
{
|
"label": "Automatically Add Taxes and Charges from Item Tax Template"
|
||||||
"default": "1",
|
},
|
||||||
"fieldname": "add_taxes_from_item_tax_template",
|
{
|
||||||
"fieldtype": "Check",
|
"fieldname": "print_settings",
|
||||||
"label": "Automatically Add Taxes and Charges from Item Tax Template"
|
"fieldtype": "Section Break",
|
||||||
},
|
"label": "Print Settings"
|
||||||
{
|
},
|
||||||
"fieldname": "print_settings",
|
{
|
||||||
"fieldtype": "Section Break",
|
"default": "0",
|
||||||
"label": "Print Settings"
|
"fieldname": "show_inclusive_tax_in_print",
|
||||||
},
|
"fieldtype": "Check",
|
||||||
{
|
"label": "Show Inclusive Tax In Print"
|
||||||
"fieldname": "show_inclusive_tax_in_print",
|
},
|
||||||
"fieldtype": "Check",
|
{
|
||||||
"label": "Show Inclusive Tax In Print"
|
"fieldname": "column_break_12",
|
||||||
},
|
"fieldtype": "Column Break"
|
||||||
{
|
},
|
||||||
"fieldname": "column_break_12",
|
{
|
||||||
"fieldtype": "Column Break"
|
"default": "0",
|
||||||
},
|
"fieldname": "show_payment_schedule_in_print",
|
||||||
{
|
"fieldtype": "Check",
|
||||||
"fieldname": "show_payment_schedule_in_print",
|
"label": "Show Payment Schedule in Print"
|
||||||
"fieldtype": "Check",
|
},
|
||||||
"label": "Show Payment Schedule in Print"
|
{
|
||||||
},
|
"fieldname": "currency_exchange_section",
|
||||||
{
|
"fieldtype": "Section Break",
|
||||||
"fieldname": "currency_exchange_section",
|
"label": "Currency Exchange Settings"
|
||||||
"fieldtype": "Section Break",
|
},
|
||||||
"label": "Currency Exchange Settings"
|
{
|
||||||
},
|
"default": "1",
|
||||||
{
|
"fieldname": "allow_stale",
|
||||||
"default": "1",
|
"fieldtype": "Check",
|
||||||
"fieldname": "allow_stale",
|
"in_list_view": 1,
|
||||||
"fieldtype": "Check",
|
"label": "Allow Stale Exchange Rates"
|
||||||
"in_list_view": 1,
|
},
|
||||||
"label": "Allow Stale Exchange Rates"
|
{
|
||||||
},
|
"default": "1",
|
||||||
{
|
"depends_on": "eval:doc.allow_stale==0",
|
||||||
"default": "1",
|
"fieldname": "stale_days",
|
||||||
"depends_on": "eval:doc.allow_stale==0",
|
"fieldtype": "Int",
|
||||||
"fieldname": "stale_days",
|
"label": "Stale Days"
|
||||||
"fieldtype": "Int",
|
},
|
||||||
"label": "Stale Days"
|
{
|
||||||
},
|
"fieldname": "report_settings_sb",
|
||||||
{
|
"fieldtype": "Section Break",
|
||||||
"fieldname": "report_settings_sb",
|
"label": "Report Settings"
|
||||||
"fieldtype": "Section Break",
|
},
|
||||||
"label": "Report Settings"
|
{
|
||||||
},
|
"default": "0",
|
||||||
{
|
"description": "Only select if you have setup Cash Flow Mapper documents",
|
||||||
"default": "0",
|
"fieldname": "use_custom_cash_flow",
|
||||||
"description": "Only select if you have setup Cash Flow Mapper documents",
|
"fieldtype": "Check",
|
||||||
"fieldname": "use_custom_cash_flow",
|
"label": "Use Custom Cash Flow Format"
|
||||||
"fieldtype": "Check",
|
},
|
||||||
"label": "Use Custom Cash Flow Format"
|
{
|
||||||
},
|
"default": "0",
|
||||||
{
|
"fieldname": "automatically_fetch_payment_terms",
|
||||||
"fieldname": "automatically_fetch_payment_terms",
|
"fieldtype": "Check",
|
||||||
"fieldtype": "Check",
|
"label": "Automatically Fetch Payment Terms"
|
||||||
"label": "Automatically Fetch Payment Terms"
|
},
|
||||||
},
|
{
|
||||||
{
|
"description": "Percentage you are allowed to bill more against the amount ordered. For example: If the order value is $100 for an item and tolerance is set as 10% then you are allowed to bill for $110.",
|
||||||
"description": "Percentage you are allowed to bill more against the amount ordered. For example: If the order value is $100 for an item and tolerance is set as 10% then you are allowed to bill for $110.",
|
"fieldname": "over_billing_allowance",
|
||||||
"fieldname": "over_billing_allowance",
|
"fieldtype": "Currency",
|
||||||
"fieldtype": "Currency",
|
"label": "Over Billing Allowance (%)"
|
||||||
"label": "Over Billing Allowance (%)"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"icon": "icon-cog",
|
|
||||||
"idx": 1,
|
|
||||||
"issingle": 1,
|
|
||||||
"modified": "2019-07-04 18:20:55.789946",
|
|
||||||
"modified_by": "Administrator",
|
|
||||||
"module": "Accounts",
|
|
||||||
"name": "Accounts Settings",
|
|
||||||
"owner": "Administrator",
|
|
||||||
"permissions": [
|
|
||||||
{
|
|
||||||
"create": 1,
|
|
||||||
"email": 1,
|
|
||||||
"print": 1,
|
|
||||||
"read": 1,
|
|
||||||
"role": "Accounts Manager",
|
|
||||||
"share": 1,
|
|
||||||
"write": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"read": 1,
|
|
||||||
"role": "Sales User"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"read": 1,
|
|
||||||
"role": "Purchase User"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"quick_entry": 1,
|
|
||||||
"sort_order": "ASC",
|
|
||||||
"track_changes": 1
|
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"icon": "icon-cog",
|
||||||
|
"idx": 1,
|
||||||
|
"issingle": 1,
|
||||||
|
"modified": "2020-03-11 13:09:26.235848",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "Accounts",
|
||||||
|
"name": "Accounts Settings",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"permissions": [
|
||||||
|
{
|
||||||
|
"create": 1,
|
||||||
|
"email": 1,
|
||||||
|
"print": 1,
|
||||||
|
"read": 1,
|
||||||
|
"role": "Accounts Manager",
|
||||||
|
"share": 1,
|
||||||
|
"write": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"read": 1,
|
||||||
|
"role": "Sales User"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"read": 1,
|
||||||
|
"role": "Purchase User"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"quick_entry": 1,
|
||||||
|
"sort_field": "modified",
|
||||||
|
"sort_order": "ASC",
|
||||||
|
"track_changes": 1
|
||||||
|
}
|
||||||
@@ -75,12 +75,6 @@ class GLEntry(Document):
|
|||||||
if not self.cost_center and self.voucher_type != 'Period Closing Voucher':
|
if not self.cost_center and self.voucher_type != 'Period Closing Voucher':
|
||||||
frappe.throw(_("{0} {1}: Cost Center is required for 'Profit and Loss' account {2}. Please set up a default Cost Center for the Company.")
|
frappe.throw(_("{0} {1}: Cost Center is required for 'Profit and Loss' account {2}. Please set up a default Cost Center for the Company.")
|
||||||
.format(self.voucher_type, self.voucher_no, self.account))
|
.format(self.voucher_type, self.voucher_no, self.account))
|
||||||
else:
|
|
||||||
from erpnext.accounts.utils import get_allow_cost_center_in_entry_of_bs_account
|
|
||||||
if not get_allow_cost_center_in_entry_of_bs_account() and self.cost_center:
|
|
||||||
self.cost_center = None
|
|
||||||
if self.project:
|
|
||||||
self.project = None
|
|
||||||
|
|
||||||
def validate_dimensions_for_pl_and_bs(self):
|
def validate_dimensions_for_pl_and_bs(self):
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
"accounting_dimensions_section",
|
"accounting_dimensions_section",
|
||||||
"cost_center",
|
"cost_center",
|
||||||
"dimension_col_break",
|
"dimension_col_break",
|
||||||
|
"project",
|
||||||
"sb_14",
|
"sb_14",
|
||||||
"on_hold",
|
"on_hold",
|
||||||
"release_date",
|
"release_date",
|
||||||
@@ -1292,13 +1293,19 @@
|
|||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Is Internal Supplier",
|
"label": "Is Internal Supplier",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "project",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Project",
|
||||||
|
"options": "Project"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-file-text",
|
"icon": "fa fa-file-text",
|
||||||
"idx": 204,
|
"idx": 204,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2019-12-30 19:13:49.610538",
|
"modified": "2020-03-11 12:28:45.711416",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Purchase Invoice",
|
"name": "Purchase Invoice",
|
||||||
|
|||||||
@@ -466,7 +466,8 @@ class PurchaseInvoice(BuyingController):
|
|||||||
if self.party_account_currency==self.company_currency else grand_total,
|
if self.party_account_currency==self.company_currency else grand_total,
|
||||||
"against_voucher": self.return_against if cint(self.is_return) and self.return_against else self.name,
|
"against_voucher": self.return_against if cint(self.is_return) and self.return_against else self.name,
|
||||||
"against_voucher_type": self.doctype,
|
"against_voucher_type": self.doctype,
|
||||||
"cost_center": self.cost_center
|
"cost_center": self.cost_center,
|
||||||
|
"project": self.project
|
||||||
}, self.party_account_currency)
|
}, self.party_account_currency)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -506,6 +507,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
"account": warehouse_account[item.warehouse]['account'],
|
"account": warehouse_account[item.warehouse]['account'],
|
||||||
"against": warehouse_account[item.from_warehouse]["account"],
|
"against": warehouse_account[item.from_warehouse]["account"],
|
||||||
"cost_center": item.cost_center,
|
"cost_center": item.cost_center,
|
||||||
|
"project": item_row.project or self.project,
|
||||||
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
||||||
"debit": warehouse_debit_amount,
|
"debit": warehouse_debit_amount,
|
||||||
}, warehouse_account[item.warehouse]["account_currency"], item=item))
|
}, warehouse_account[item.warehouse]["account_currency"], item=item))
|
||||||
@@ -515,6 +517,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
"account": warehouse_account[item.from_warehouse]['account'],
|
"account": warehouse_account[item.from_warehouse]['account'],
|
||||||
"against": warehouse_account[item.warehouse]["account"],
|
"against": warehouse_account[item.warehouse]["account"],
|
||||||
"cost_center": item.cost_center,
|
"cost_center": item.cost_center,
|
||||||
|
"project": item_row.project or self.project,
|
||||||
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
||||||
"debit": -1 * flt(item.base_net_amount, item.precision("base_net_amount")),
|
"debit": -1 * flt(item.base_net_amount, item.precision("base_net_amount")),
|
||||||
}, warehouse_account[item.from_warehouse]["account_currency"], item=item))
|
}, warehouse_account[item.from_warehouse]["account_currency"], item=item))
|
||||||
@@ -538,7 +541,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
"debit": warehouse_debit_amount,
|
"debit": warehouse_debit_amount,
|
||||||
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
||||||
"cost_center": item.cost_center,
|
"cost_center": item.cost_center,
|
||||||
"project": item.project
|
"project": item.project or self.project
|
||||||
}, account_currency, item=item)
|
}, account_currency, item=item)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -551,7 +554,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
"cost_center": item.cost_center,
|
"cost_center": item.cost_center,
|
||||||
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
||||||
"credit": flt(amount),
|
"credit": flt(amount),
|
||||||
"project": item.project
|
"project": item.project or self.project
|
||||||
}, item=item))
|
}, item=item))
|
||||||
|
|
||||||
# sub-contracting warehouse
|
# sub-contracting warehouse
|
||||||
@@ -564,6 +567,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
"account": supplier_warehouse_account,
|
"account": supplier_warehouse_account,
|
||||||
"against": item.expense_account,
|
"against": item.expense_account,
|
||||||
"cost_center": item.cost_center,
|
"cost_center": item.cost_center,
|
||||||
|
"project": item.project or self.project,
|
||||||
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
||||||
"credit": flt(item.rm_supp_cost)
|
"credit": flt(item.rm_supp_cost)
|
||||||
}, warehouse_account[self.supplier_warehouse]["account_currency"], item=item))
|
}, warehouse_account[self.supplier_warehouse]["account_currency"], item=item))
|
||||||
@@ -582,7 +586,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
"against": self.supplier,
|
"against": self.supplier,
|
||||||
"debit": amount,
|
"debit": amount,
|
||||||
"cost_center": item.cost_center,
|
"cost_center": item.cost_center,
|
||||||
"project": item.project
|
"project": item.project or self.project
|
||||||
}, account_currency, item=item))
|
}, account_currency, item=item))
|
||||||
|
|
||||||
# If asset is bought through this document and not linked to PR
|
# If asset is bought through this document and not linked to PR
|
||||||
@@ -595,7 +599,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
"cost_center": item.cost_center,
|
"cost_center": item.cost_center,
|
||||||
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
||||||
"credit": flt(item.landed_cost_voucher_amount),
|
"credit": flt(item.landed_cost_voucher_amount),
|
||||||
"project": item.project
|
"project": item.project or self.project
|
||||||
}, item=item))
|
}, item=item))
|
||||||
|
|
||||||
gl_entries.append(self.get_gl_dict({
|
gl_entries.append(self.get_gl_dict({
|
||||||
@@ -604,7 +608,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
"cost_center": item.cost_center,
|
"cost_center": item.cost_center,
|
||||||
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
||||||
"debit": flt(item.landed_cost_voucher_amount),
|
"debit": flt(item.landed_cost_voucher_amount),
|
||||||
"project": item.project
|
"project": item.project or self.project
|
||||||
}, item=item))
|
}, item=item))
|
||||||
|
|
||||||
# update gross amount of asset bought through this document
|
# update gross amount of asset bought through this document
|
||||||
@@ -630,7 +634,8 @@ class PurchaseInvoice(BuyingController):
|
|||||||
"against": self.supplier,
|
"against": self.supplier,
|
||||||
"debit": flt(item.item_tax_amount, item.precision("item_tax_amount")),
|
"debit": flt(item.item_tax_amount, item.precision("item_tax_amount")),
|
||||||
"remarks": self.remarks or "Accounting Entry for Stock",
|
"remarks": self.remarks or "Accounting Entry for Stock",
|
||||||
"cost_center": self.cost_center
|
"cost_center": self.cost_center,
|
||||||
|
"project": item.project or self.project
|
||||||
}, item=item)
|
}, item=item)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -659,7 +664,8 @@ class PurchaseInvoice(BuyingController):
|
|||||||
"debit": base_asset_amount,
|
"debit": base_asset_amount,
|
||||||
"debit_in_account_currency": (base_asset_amount
|
"debit_in_account_currency": (base_asset_amount
|
||||||
if arbnb_currency == self.company_currency else asset_amount),
|
if arbnb_currency == self.company_currency else asset_amount),
|
||||||
"cost_center": item.cost_center
|
"cost_center": item.cost_center,
|
||||||
|
"project": item.project or self.project
|
||||||
}, item=item))
|
}, item=item))
|
||||||
|
|
||||||
if item.item_tax_amount:
|
if item.item_tax_amount:
|
||||||
@@ -669,6 +675,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
"against": self.supplier,
|
"against": self.supplier,
|
||||||
"remarks": self.get("remarks") or _("Accounting Entry for Asset"),
|
"remarks": self.get("remarks") or _("Accounting Entry for Asset"),
|
||||||
"cost_center": item.cost_center,
|
"cost_center": item.cost_center,
|
||||||
|
"project": item.project or self.project,
|
||||||
"credit": item.item_tax_amount,
|
"credit": item.item_tax_amount,
|
||||||
"credit_in_account_currency": (item.item_tax_amount
|
"credit_in_account_currency": (item.item_tax_amount
|
||||||
if asset_eiiav_currency == self.company_currency else
|
if asset_eiiav_currency == self.company_currency else
|
||||||
@@ -685,7 +692,8 @@ class PurchaseInvoice(BuyingController):
|
|||||||
"debit": base_asset_amount,
|
"debit": base_asset_amount,
|
||||||
"debit_in_account_currency": (base_asset_amount
|
"debit_in_account_currency": (base_asset_amount
|
||||||
if cwip_account_currency == self.company_currency else asset_amount),
|
if cwip_account_currency == self.company_currency else asset_amount),
|
||||||
"cost_center": self.cost_center
|
"cost_center": self.cost_center,
|
||||||
|
"project": item.project or self.project
|
||||||
}, item=item))
|
}, item=item))
|
||||||
|
|
||||||
if item.item_tax_amount and not cint(erpnext.is_perpetual_inventory_enabled(self.company)):
|
if item.item_tax_amount and not cint(erpnext.is_perpetual_inventory_enabled(self.company)):
|
||||||
@@ -696,6 +704,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
"remarks": self.get("remarks") or _("Accounting Entry for Asset"),
|
"remarks": self.get("remarks") or _("Accounting Entry for Asset"),
|
||||||
"cost_center": item.cost_center,
|
"cost_center": item.cost_center,
|
||||||
"credit": item.item_tax_amount,
|
"credit": item.item_tax_amount,
|
||||||
|
"project": item.project or self.project,
|
||||||
"credit_in_account_currency": (item.item_tax_amount
|
"credit_in_account_currency": (item.item_tax_amount
|
||||||
if asset_eiiav_currency == self.company_currency else
|
if asset_eiiav_currency == self.company_currency else
|
||||||
item.item_tax_amount / self.conversion_rate)
|
item.item_tax_amount / self.conversion_rate)
|
||||||
@@ -711,7 +720,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
"cost_center": item.cost_center,
|
"cost_center": item.cost_center,
|
||||||
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
||||||
"credit": flt(item.landed_cost_voucher_amount),
|
"credit": flt(item.landed_cost_voucher_amount),
|
||||||
"project": item.project
|
"project": item.project or self.project
|
||||||
}, item=item))
|
}, item=item))
|
||||||
|
|
||||||
gl_entries.append(self.get_gl_dict({
|
gl_entries.append(self.get_gl_dict({
|
||||||
@@ -720,7 +729,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
"cost_center": item.cost_center,
|
"cost_center": item.cost_center,
|
||||||
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
||||||
"debit": flt(item.landed_cost_voucher_amount),
|
"debit": flt(item.landed_cost_voucher_amount),
|
||||||
"project": item.project
|
"project": item.project or self.project
|
||||||
}, item=item))
|
}, item=item))
|
||||||
|
|
||||||
# update gross amount of assets bought through this document
|
# update gross amount of assets bought through this document
|
||||||
@@ -755,7 +764,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
"debit": stock_adjustment_amt,
|
"debit": stock_adjustment_amt,
|
||||||
"remarks": self.get("remarks") or _("Stock Adjustment"),
|
"remarks": self.get("remarks") or _("Stock Adjustment"),
|
||||||
"cost_center": item.cost_center,
|
"cost_center": item.cost_center,
|
||||||
"project": item.project
|
"project": item.project or self.project
|
||||||
}, account_currency, item=item)
|
}, account_currency, item=item)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -847,7 +856,8 @@ class PurchaseInvoice(BuyingController):
|
|||||||
if self.party_account_currency==self.company_currency else self.paid_amount,
|
if self.party_account_currency==self.company_currency else self.paid_amount,
|
||||||
"against_voucher": self.return_against if cint(self.is_return) and self.return_against else self.name,
|
"against_voucher": self.return_against if cint(self.is_return) and self.return_against else self.name,
|
||||||
"against_voucher_type": self.doctype,
|
"against_voucher_type": self.doctype,
|
||||||
"cost_center": self.cost_center
|
"cost_center": self.cost_center,
|
||||||
|
"project": self.project
|
||||||
}, self.party_account_currency)
|
}, self.party_account_currency)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -879,7 +889,8 @@ class PurchaseInvoice(BuyingController):
|
|||||||
if self.party_account_currency==self.company_currency else self.write_off_amount,
|
if self.party_account_currency==self.company_currency else self.write_off_amount,
|
||||||
"against_voucher": self.return_against if cint(self.is_return) and self.return_against else self.name,
|
"against_voucher": self.return_against if cint(self.is_return) and self.return_against else self.name,
|
||||||
"against_voucher_type": self.doctype,
|
"against_voucher_type": self.doctype,
|
||||||
"cost_center": self.cost_center
|
"cost_center": self.cost_center,
|
||||||
|
"project": self.project
|
||||||
}, self.party_account_currency)
|
}, self.party_account_currency)
|
||||||
)
|
)
|
||||||
gl_entries.append(
|
gl_entries.append(
|
||||||
|
|||||||
@@ -777,7 +777,8 @@ class SalesInvoice(SellingController):
|
|||||||
if self.party_account_currency==self.company_currency else grand_total,
|
if self.party_account_currency==self.company_currency else grand_total,
|
||||||
"against_voucher": self.return_against if cint(self.is_return) and self.return_against else self.name,
|
"against_voucher": self.return_against if cint(self.is_return) and self.return_against else self.name,
|
||||||
"against_voucher_type": self.doctype,
|
"against_voucher_type": self.doctype,
|
||||||
"cost_center": self.cost_center
|
"cost_center": self.cost_center,
|
||||||
|
"project": self.project
|
||||||
}, self.party_account_currency)
|
}, self.party_account_currency)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -832,7 +833,8 @@ class SalesInvoice(SellingController):
|
|||||||
"credit_in_account_currency": (flt(item.base_net_amount, item.precision("base_net_amount"))
|
"credit_in_account_currency": (flt(item.base_net_amount, item.precision("base_net_amount"))
|
||||||
if account_currency==self.company_currency
|
if account_currency==self.company_currency
|
||||||
else flt(item.net_amount, item.precision("net_amount"))),
|
else flt(item.net_amount, item.precision("net_amount"))),
|
||||||
"cost_center": item.cost_center
|
"cost_center": item.cost_center,
|
||||||
|
"project": item.project or self.project
|
||||||
}, account_currency, item=item)
|
}, account_currency, item=item)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -913,7 +915,8 @@ class SalesInvoice(SellingController):
|
|||||||
if self.party_account_currency==self.company_currency else flt(self.change_amount),
|
if self.party_account_currency==self.company_currency else flt(self.change_amount),
|
||||||
"against_voucher": self.return_against if cint(self.is_return) and self.return_against else self.name,
|
"against_voucher": self.return_against if cint(self.is_return) and self.return_against else self.name,
|
||||||
"against_voucher_type": self.doctype,
|
"against_voucher_type": self.doctype,
|
||||||
"cost_center": self.cost_center
|
"cost_center": self.cost_center,
|
||||||
|
"project": self.project
|
||||||
}, self.party_account_currency)
|
}, self.party_account_currency)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -946,7 +949,8 @@ class SalesInvoice(SellingController):
|
|||||||
else flt(self.write_off_amount, self.precision("write_off_amount"))),
|
else flt(self.write_off_amount, self.precision("write_off_amount"))),
|
||||||
"against_voucher": self.return_against if cint(self.is_return) else self.name,
|
"against_voucher": self.return_against if cint(self.is_return) else self.name,
|
||||||
"against_voucher_type": self.doctype,
|
"against_voucher_type": self.doctype,
|
||||||
"cost_center": self.cost_center
|
"cost_center": self.cost_center,
|
||||||
|
"project": self.project
|
||||||
}, self.party_account_currency)
|
}, self.party_account_currency)
|
||||||
)
|
)
|
||||||
gl_entries.append(
|
gl_entries.append(
|
||||||
|
|||||||
@@ -94,6 +94,7 @@
|
|||||||
"accounting_dimensions_section",
|
"accounting_dimensions_section",
|
||||||
"cost_center",
|
"cost_center",
|
||||||
"dimension_col_break",
|
"dimension_col_break",
|
||||||
|
"project",
|
||||||
"section_break_54",
|
"section_break_54",
|
||||||
"page_break"
|
"page_break"
|
||||||
],
|
],
|
||||||
@@ -783,12 +784,18 @@
|
|||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"label": "Finance Book",
|
"label": "Finance Book",
|
||||||
"options": "Finance Book"
|
"options": "Finance Book"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "project",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Project",
|
||||||
|
"options": "Project"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2019-12-04 12:22:38.517710",
|
"modified": "2020-03-11 12:24:41.749986",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Sales Invoice Item",
|
"name": "Sales Invoice Item",
|
||||||
|
|||||||
@@ -124,14 +124,12 @@ def get_balance_on(account=None, date=None, party_type=None, party=None, company
|
|||||||
# hence, assuming balance as 0.0
|
# hence, assuming balance as 0.0
|
||||||
return 0.0
|
return 0.0
|
||||||
|
|
||||||
allow_cost_center_in_entry_of_bs_account = get_allow_cost_center_in_entry_of_bs_account()
|
|
||||||
|
|
||||||
if account:
|
if account:
|
||||||
report_type = acc.report_type
|
report_type = acc.report_type
|
||||||
else:
|
else:
|
||||||
report_type = ""
|
report_type = ""
|
||||||
|
|
||||||
if cost_center and (allow_cost_center_in_entry_of_bs_account or report_type =='Profit and Loss'):
|
if cost_center and report_type == 'Profit and Loss':
|
||||||
cc = frappe.get_doc("Cost Center", cost_center)
|
cc = frappe.get_doc("Cost Center", cost_center)
|
||||||
if cc.is_group:
|
if cc.is_group:
|
||||||
cond.append(""" exists (
|
cond.append(""" exists (
|
||||||
@@ -888,11 +886,6 @@ def get_coa(doctype, parent, is_root, chart=None):
|
|||||||
|
|
||||||
return accounts
|
return accounts
|
||||||
|
|
||||||
def get_allow_cost_center_in_entry_of_bs_account():
|
|
||||||
def generator():
|
|
||||||
return cint(frappe.db.get_value('Accounts Settings', None, 'allow_cost_center_in_entry_of_bs_account'))
|
|
||||||
return frappe.local_cache("get_allow_cost_center_in_entry_of_bs_account", (), generator, regenerate_if_none=True)
|
|
||||||
|
|
||||||
def get_stock_accounts(company):
|
def get_stock_accounts(company):
|
||||||
return frappe.get_all("Account", filters = {
|
return frappe.get_all("Account", filters = {
|
||||||
"account_type": "Stock",
|
"account_type": "Stock",
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ class StockController(AccountsController):
|
|||||||
"account": warehouse_account[sle.warehouse]["account"],
|
"account": warehouse_account[sle.warehouse]["account"],
|
||||||
"against": item_row.expense_account,
|
"against": item_row.expense_account,
|
||||||
"cost_center": item_row.cost_center,
|
"cost_center": item_row.cost_center,
|
||||||
|
"project": item_row.project or self.project if hasattr(self, 'project') else None,
|
||||||
"remarks": self.get("remarks") or "Accounting Entry for Stock",
|
"remarks": self.get("remarks") or "Accounting Entry for Stock",
|
||||||
"debit": flt(sle.stock_value_difference, precision),
|
"debit": flt(sle.stock_value_difference, precision),
|
||||||
"is_opening": item_row.get("is_opening") or self.get("is_opening") or "No",
|
"is_opening": item_row.get("is_opening") or self.get("is_opening") or "No",
|
||||||
@@ -101,6 +102,7 @@ class StockController(AccountsController):
|
|||||||
"account": item_row.expense_account,
|
"account": item_row.expense_account,
|
||||||
"against": warehouse_account[sle.warehouse]["account"],
|
"against": warehouse_account[sle.warehouse]["account"],
|
||||||
"cost_center": item_row.cost_center,
|
"cost_center": item_row.cost_center,
|
||||||
|
"project": item_row.project or self.project if hasattr(self, 'project') else None,
|
||||||
"remarks": self.get("remarks") or "Accounting Entry for Stock",
|
"remarks": self.get("remarks") or "Accounting Entry for Stock",
|
||||||
"credit": flt(sle.stock_value_difference, precision),
|
"credit": flt(sle.stock_value_difference, precision),
|
||||||
"project": item_row.get("project") or self.get("project"),
|
"project": item_row.get("project") or self.get("project"),
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"actions": [],
|
|
||||||
"autoname": "hash",
|
"autoname": "hash",
|
||||||
"creation": "2013-04-22 13:15:44",
|
"creation": "2013-04-22 13:15:44",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
@@ -81,6 +80,7 @@
|
|||||||
"accounting_dimensions_section",
|
"accounting_dimensions_section",
|
||||||
"cost_center",
|
"cost_center",
|
||||||
"dimension_col_break",
|
"dimension_col_break",
|
||||||
|
"project",
|
||||||
"section_break_72",
|
"section_break_72",
|
||||||
"page_break"
|
"page_break"
|
||||||
],
|
],
|
||||||
@@ -699,12 +699,18 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "dimension_col_break",
|
"fieldname": "dimension_col_break",
|
||||||
"fieldtype": "Column Break"
|
"fieldtype": "Column Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "project",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Project",
|
||||||
|
"options": "Project"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2020-03-05 14:18:33.131672",
|
"modified": "2020-03-11 12:25:06.177894",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Delivery Note Item",
|
"name": "Delivery Note Item",
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"actions": [],
|
|
||||||
"allow_import": 1,
|
"allow_import": 1,
|
||||||
"autoname": "naming_series:",
|
"autoname": "naming_series:",
|
||||||
"creation": "2013-05-21 16:16:39",
|
"creation": "2013-05-21 16:16:39",
|
||||||
@@ -105,6 +104,7 @@
|
|||||||
"amended_from",
|
"amended_from",
|
||||||
"range",
|
"range",
|
||||||
"column_break4",
|
"column_break4",
|
||||||
|
"project",
|
||||||
"per_billed",
|
"per_billed",
|
||||||
"is_internal_supplier",
|
"is_internal_supplier",
|
||||||
"inter_company_reference",
|
"inter_company_reference",
|
||||||
@@ -925,6 +925,12 @@
|
|||||||
"print_width": "50%",
|
"print_width": "50%",
|
||||||
"width": "50%"
|
"width": "50%"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "project",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Project",
|
||||||
|
"options": "Project"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "per_billed",
|
"fieldname": "per_billed",
|
||||||
"fieldtype": "Percent",
|
"fieldtype": "Percent",
|
||||||
@@ -1076,7 +1082,7 @@
|
|||||||
"idx": 261,
|
"idx": 261,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2019-12-30 19:12:49.709711",
|
"modified": "2020-03-11 12:58:46.515404",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Stock",
|
"module": "Stock",
|
||||||
"name": "Purchase Receipt",
|
"name": "Purchase Receipt",
|
||||||
|
|||||||
Reference in New Issue
Block a user