* fix(stock): carry accounting dimensions from Landed Cost Voucher charges into GL entries
* feat(stock): add accounting dimension fields to Landed Cost Taxes and Charges
The charge row had no dimension fields, so a dimension marked mandatory for
Profit and Loss accounts could not be supplied anywhere on the voucher.
Add the accounting dimensions section, cost center and project, and register
the doctype in accounting_dimension_doctypes so custom dimension fields are
created on it. The section and column break are required for that hook to
place the generated fields correctly.
Cost center deliberately omits the ":Company" default used by Purchase Taxes
and Charges: this child table is also the additional costs table on Stock
Entry and Subcontracting Receipt, and auto-filling it there would change
existing postings.
* refactor(stock): group landed cost charges by expense account and dimensions
get_item_account_wise_lcv_entries keyed its inner map by expense account
alone, so two charge rows posting to the same account - whether in one voucher
or across vouchers - were merged. Amounts accumulated correctly but any
per-row context was lost to whichever row was seen first.
Key the grouping by (expense account, dimension values) and return a list of
charges per receipt item, each carrying its own dimensions, so rows that
differ only by dimension stay distinct.
Dimensions resolve from the charge row first, then the voucher item row.
Blanks are left blank so the GL composers can fall back to the receipt item
and receipt document as before.
* refactor(accounts): allow explicit accounting dimensions on add_gl_entry
get_gl_dict derives dimensions from the parent document and the item row, and
reads only custom dimensions off the item - never cost center or project.
Callers that need to set a dimension from some other source had no way to do
so except by building the args dict by hand.
Add a dimensions argument that is merged into the entry before get_gl_dict is
called, and thread it through the StockController and BaseGLComposer wrappers.
* fix(stock): carry landed cost charge dimensions onto the GL entries
Landed cost charges are posted into the receipt document's ledger, and their
expense account is a Profit and Loss account. Until now the entry took its
dimensions from the receipt item, which cannot know about a voucher created
after it was submitted, so a dimension mandatory for P&L accounts failed.
Take cost center, project and custom dimensions from the charge row, falling
back to the receipt item and receipt document when the row leaves them blank.
Only the leg posting to the charge account is affected; the reclass leg keeps
the item's dimensions so it still nets against the base item entry.
Also skip charges that prorate to zero, and hoist the landed cost lookup in
the Purchase Receipt composer out of the item loop - it was reloading every
voucher once per item.
* fix(stock): report missing mandatory dimensions on the Landed Cost Voucher row
Submitting a voucher re-makes the receipt document's GL entries, so a missing
mandatory dimension surfaced as a GL Entry error naming an account, raised
from the middle of update_landed_cost, with nothing pointing at the row that
caused it.
Check the charge rows during validate instead, against both the mandatory
for P&L / Balance Sheet flags and the per-account Accounting Dimension Filter,
and name the row, the dimension and the account in the message.
The check resolves values through the same fallback chain the GL composers
use, so it does not reject a voucher that would have posted successfully.
* test(stock): cover accounting dimensions on landed cost vouchers
Covers the charge row reaching the GL entry, cost center and project
overriding the receipt item, the blank row still falling back to it, and two
charge rows - and two vouchers - on the same expense account with different
dimensions staying separate entries.
Also covers the mandatory P&L dimension being satisfied from the charge row,
the missing one being reported on the voucher, dimensions surviving a repost,
and each dimension netting to zero on cancellation.
* refactor(lcv): apply custom dimension overrides via .update()
---------
Co-authored-by: nareshkannasln <nareshkannashanmugam@gmail.com>
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
(cherry picked from commit 918e5a28db)
# Conflicts:
# erpnext/accounts/doctype/purchase_invoice/services/gl_composer.py
# erpnext/accounts/services/base_gl_composer.py
# erpnext/controllers/stock_controller.py
# erpnext/patches.txt
# erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py
# erpnext/stock/doctype/purchase_receipt/services/gl_composer.py
# erpnext/stock/doctype/stock_entry/services/gl_composer.py
# erpnext/subcontracting/doctype/subcontracting_receipt/services/gl_composer.py
ERPNext
100% Open-Source ERP system to help you run your business.
Motivation
Running a business is a complex task - handling invoices, tracking stock, managing personnel and even more ad-hoc activities. In a market where software is sold separately to manage each of these tasks, ERPNext does all of the above and more, for free.
Key Features
- Accounting: All the tools you need to manage cash flow in one place, right from recording transactions to summarizing and analyzing financial reports.
- Order Management: Track inventory levels, replenish stock, and manage sales orders, customers, suppliers, shipments, deliverables, and order fulfillment.
- Manufacturing: Simplifies the production cycle, helps track material consumption, exhibits capacity planning, handles subcontracting, and more!
- Asset Management: From purchase to perishment, IT infrastructure to equipment. Cover every branch of your organization, all in one centralized system.
- Projects: Delivery both internal and external Projects on time, budget and Profitability. Track tasks, timesheets, and issues by project.
Under the Hood
-
Frappe Framework: A full-stack web application framework written in Python and Javascript. The framework provides a robust foundation for building web applications, including a database abstraction layer, user authentication, and a REST API.
-
Frappe UI: A Vue-based UI library, to provide a modern user interface. The Frappe UI library provides a variety of components that can be used to build single-page applications on top of the Frappe Framework.
Production Setup
Managed Hosting
You can try Frappe Cloud, a simple, user-friendly and sophisticated open-source platform to host Frappe applications with peace of mind.
It takes care of installation, setup, upgrades, monitoring, maintenance and support of your Frappe deployments. It is a fully featured developer platform with an ability to manage and control multiple Frappe deployments.
Self-Hosted
Docker
Prerequisites: docker, docker-compose, git. Refer Docker Documentation for more details on Docker setup.
Run following commands:
git clone https://github.com/frappe/frappe_docker
cd frappe_docker
docker compose -f pwd.yml up -d
After a couple of minutes, site should be accessible on your localhost port: 8080. Use below default login credentials to access the site.
- Username: Administrator
- Password: admin
See Frappe Docker for ARM based docker setup.
Development Setup
Manual Install
The Easy Way: our install script for bench will install all dependencies (e.g. MariaDB). See https://github.com/frappe/bench for more details.
New passwords will be created for the ERPNext "Administrator" user, the MariaDB root user, and the frappe user (the script displays the passwords and saves them to ~/frappe_passwords.txt).
Local
To setup the repository locally follow the steps mentioned below:
-
Setup bench by following the Installation Steps and start the server
bench start -
In a separate terminal window, run the following commands:
# Create a new site bench new-site erpnext.localhost -
Get the ERPNext app and install it
# Get the ERPNext app bench get-app https://github.com/frappe/erpnext # Install the app bench --site erpnext.localhost install-app erpnext -
Open the URL
http://erpnext.localhost:8000/appin your browser, you should see the app running
Learning and community
- Frappe School - Learn Frappe Framework and ERPNext from the various courses by the maintainers or from the community.
- Official documentation - Extensive documentation for ERPNext.
- Discussion Forum - Engage with community of ERPNext users and service providers.
- Telegram Group - Get instant help from huge community of users.
Contributing
Logo and Trademark Policy
Please read our Logo and Trademark Policy.




