Merge branch 'documentation-website'

This commit is contained in:
Anand Doshi 2013-11-13 17:40:57 +05:30
commit 413c931436
25 changed files with 51 additions and 424 deletions

View File

@ -1,42 +0,0 @@
---
{
"_label": "Accounting of Inventory / Stock"
}
---
The value of available inventory is treated as an Asset in company's Chart of Accounts. Depending on the type of items, it can be treated as Fixed Asset or Current Asset. To prepare Balance Sheet, you should make the accounting entries for those assets.
There are generally two different methods of accounting for inventory:
### **Auto / Perpetual Inventory**
In this process, for each stock transactions, the system posts relevant accounting entries to sync stock balance and accounting balance. This is the default setting in ERPNext for new accounts.
When you buy and receive items, those items are booked as the companys assets (stock-in-hand / fixed-assets). When you sell and deliver those items, an expense (cost-of-goods-sold) equal to the buying cost of the items is booked. General Ledger entries are made after every stock transaction. As a result, the value as per Stock Ledger always remains same with the relevant account balance. This improves accuracy of Balance Sheet and Profit and Loss statement.
To check accounting entries for a particular stock transaction, please check [**examples**](docs.user.stock.perpetual_inventory.html)
#### **Advantages**
Perpetual Inventory system will make it easier for you to maintain accuracy of company's asset and expense values. Stock balances will always be synced with relevant account balances, so no more periodic manual entry has to be done to balance them.
In case of new back-dated stock transactions or cancellation/amendment of an existing transaction, all the future Stock Ledger entries and GL Entries will be recalculated for all items of that transaction.
The same is applicable if any cost is added to the submitted Purchase Receipt, later through the Landed Cost Wizard.
>Note: Perpetual Inventory totally depends upon the item valuation rate. Hence, you have to be more careful entering valuation rate while making any incoming stock transactions like Purchase Receipt, Material Receipt, or Manufacturing / Repack.
-
### **Periodic Inventory**
In this method, accounting entries are manually created periodically, to sync stock balance and relevant account balance. The system does not create accounting entries automatically for assets, at the time of material purchases or sales.
In an accounting period, when you buy and receive items, an expense is booked in your accounting system. You sell and deliver some of these items.
At the end of an accounting period, the total value of items to be sold, need to be booked as the companys assets, often known as stock-in-hand.
The difference between the value of the items remaining to be sold and the previous periods stock-in-hand value can be positive or negative. If positive, this value is removed from expenses (cost-of-goods-sold) and is added to assets (stock-in-hand / fixed-assets). If negative, a reverse entry is passed.
This complete process is called Periodic Inventory.
If you are an existing user using Periodic Inventory and want to use Perpetual Inventory, you have to follow some steps to migrate. For details, check [**Migration From Periodic Inventory**](docs.user.stock.perpetual_inventory.html)

View File

@ -1,313 +0,0 @@
---
{
"_label": "Perpetual Inventory"
}
---
In perpetual inventory, system creates accounting entries for each stock transactions, so that stock and account balance will always remain same. The account balance will be posted against their respective account heads for each Warehouse. On saving of a Warehouse, the system will automatically create an account head with the same name as warehouse. As account balance is maintained for each Warehouse, you should create Warehouses, based on the type of items (Current / Fixed Assets) it stores.
At the time of items received in a particular warehouse, the balance of asset account (linked to that warehouse) will be increased. Similarly when you deliver some items from that warehouse, an expense will be booked and the asset account will be reduced, based on the valuation amount of those items.
## **Activation**
1. Setup the following default accounts for each Company
- Stock Received But Not Billed
- Stock Adjustment Account
- Expenses Included In Valuation
- Cost Center
2. In perpetual inventory, the system will maintain seperate account balance for each warehouse under separate account head. To create that account head, enter "Create Account Under" in Warehouse master.
3. Activate Perpetual Inventory
> Setup > Accounts Settings > Make Accounting Entry For Every Stock Movement
-
## **Example**
Consider following Chart of Accounts and Warehouse setup for your company:
#### Chart of Accounts
- Assets (Dr)
- Current Assets
- Accounts Receivable
- Jane Doe
- Stock Assets
- Stores
- Finished Goods
- Work In Progress
- Tax Assets
- VAT
- Fixed Assets
- Fixed Asset Warehouse
- Liabilities (Cr)
- Current Liabilities
- Accounts Payable
- East Wind Inc.
- Stock Liabilities
- Stock Received But Not Billed
- Tax Liabilities
- Service Tax
- Income (Cr)
- Direct Income
- Sales Account
- Expenses (Dr)
- Direct Expenses
- Stock Expenses
- Cost of Goods Sold
- Expenses Included In Valuation
- Stock Adjustment
- Shipping Charges
- Customs Duty
#### Warehouse - Account Configuration
- Stores
- Work In Progress
- Finished Goods
- Fixed Asset Warehouse
### **Purchase Receipt**
Suppose you have purchased *10 nos* of item "RM0001" at *$200* and *5 nos* of item "Desktop" at **$100** from supplier "East Wind Inc". Following are the details of Purchase Receipt:
<b>Supplier:</b> East Wind Inc.
<b>Items:</b>
<table class="table table-bordered">
<thead>
<tr>
<th>Item</th><th>Warehouse</th><th>Qty</th>
<th>Rate</th><th>Amount</th><th>Valuation Amount</th>
</tr>
</thead>
<tbody>
<tr>
<td>RM0001</td><td>Stores</td><td>10</td><td>200</td><td>2000</td><td>2200</td>
</tr>
<tr>
<td>Desktop</td><td>Fixed Asset Warehouse</td>
<td>5</td><td>100</td><td>500</td><td>550</td>
</tr>
</tbody>
</table>
**Taxes:**
<table class="table table-bordered">
<thead>
<tr><th>Account</th><th>Amount</th><th>Category</th></tr>
</thead>
<tbody>
<tr><td>Shipping Charges</td><td>100</td><td>Total and Valuation</td></tr>
<tr><td>VAT</td><td>120</td><td>Total</td></tr>
<tr><td>Customs Duty</td><td>150</td><td>Valuation</td></tr>
</tbody>
</table>
**Stock Ledger**
![pr_stock_ledger](img/accounting-for-stock-2.png)
**General Ledger**
![pr_general_ledger](img/accounting-for-stock-3.png)
As stock balance increases through Purchase Receipt, "Store" and "Fixed Asset Warehouse" accounts are debited and a temporary account "Stock Receipt But Not Billed" account is credited, to maintain double entry accounting system.
--
### **Purchase Invoice**
On receiving Bill from supplier, for the above Purchase Receipt, you will make Purchase Invoice for the same. The general ledger entries are as follows:
**General Ledger**
![pi_general_ledger](img/accounting-for-stock-4.png)
Here "Stock Received But Not Billed" account is debited and nullified the effect of Purchase Receipt. "Expenses Included In Valuation" account has been credited which ensures the valuation expense accounts are not booked (debited) twice (in Purchase Invoice and Delivery Note).
--
### **Delivery Note**
Lets say, you have an order from "Jane Doe" to deliver 5 nos of item "RM0001" at $300. Following are the details of Delivery Note:
**Customer:** Jane Doe
**Items:**
<table class="table table-bordered">
<thead>
<tr><th>Item</th><th>Warehouse</th><th>Qty</th><th>Rate</th><th>Amount</th></tr>
</thead>
<tbody>
<tr><td>RM0001</td><td>Stores</td><td>5</td><td>300</td><td>1500</td></tr>
</tbody>
</table>
**Taxes:**
<table class="table table-bordered">
<thead>
<tr><th>Account</th><th>Amount</th></tr>
</thead>
<tbody>
<tr><td>Service Tax</td><td>150</td></tr>
<tr><td>VAT</td><td>100</td></tr>
</tbody>
</table>
**Stock Ledger**
![dn_stock_ledger](img/accounting-for-stock-5.png)
**General Ledger**
![dn_general_ledger](img/accounting-for-stock-6.png)
As item is delivered from "Stores" warehouse, "Stores" account is credited and equal amount is debited to the expense account "Cost of Goods Sold". The debit/credit amount is equal to the total valuation amount (buying cost) of the selling items. And valuation amount is calculated based on your prefferred valuation method (FIFO / Moving Average) or actual cost of serialized items.
<pre>
<code>
In this example, we have considered valuation method as FIFO.
Valuation Rate = Purchase Rate + Charges Included in Valuation
= 200 + (250 * (2000 / 2500) / 10)
= 220
Total Valuation Amount = 220 * 5
= 1100
</code>
</pre>
--
### **Sales Invoice with Update Stock**
Lets say, you did not make Delivery Note against the above order and instead you have made Sales Invoice directly, with "Update Stock" options. The details of the Sales Invoice are same as the above Delivery Note.
**Stock Ledger**
![si_stock_ledger](img/accounting-for-stock-7.png)
**General Ledger**
![si_general_ledger](img/accounting-for-stock-8.png)
Here, apart from normal account entries for invoice, "Stores" and "Cost of Goods Sold" accounts are also affected based on the valuation amount.
--
### **Stock Entry (Material Receipt)**
**Items:**
<table class="table table-bordered">
<thead>
<tr><th>Item</th><th>Target Warehouse</th><th>Qty</th><th>Rate</th><th>Amount</th></tr>
</thead>
<tbody>
<tr><td>RM0001</td><td>Stores</td><td>50</td><td>220</td><td>11000</td></tr>
</tbody>
</table>
**Stock Ledger**
![mr_stock_ledger](img/accounting-for-stock-9.png)
**General Ledger**
![mr_stock_ledger](img/accounting-for-stock-10.png)
--
### **Stock Entry (Material Issue)**
**Items:**
<table class="table table-bordered">
<thead>
<tr><th>Item</th><th>Source Warehouse</th><th>Qty</th><th>Rate</th><th>Amount</th></tr>
</thead>
<tbody>
<tr><td>RM0001</td><td>Stores</td><td>10</td><td>220</td><td>2200</td></tr>
</tbody>
</table>
**Stock Ledger**
![mi_stock_ledger](img/accounting-for-stock-11.png)
**General Ledger**
![mi_stock_ledger](img/accounting-for-stock-12.png)
--
### **Stock Entry (Material Transfer)**
**Items:**
<table class="table table-bordered">
<thead>
<tr><th>Item</th><th>Source Warehouse</th><th>Target Warehouse</th>
<th>Qty</th><th>Rate</th><th>Amount</th></tr>
</thead>
<tbody>
<tr><td>RM0001</td><td>Stores</td><td>Work In Progress</td>
<td>10</td><td>220</td><td>2200</td></tr>
</tbody>
</table>
**Stock Ledger**
![mtn_stock_ledger](img/accounting-for-stock-13.png)
**General Ledger**
![mtn_general_ledger](img/accounting-for-stock-14.png)
--
### **Stock Entry (Sales Return - Sales Invoice booked)**
**Items:**
<table class="table table-bordered">
<thead>
<tr><th>Item</th><th>Target Warehouse</th><th>Qty</th><th>Rate</th><th>Amount</th></tr>
</thead>
<tbody>
<tr><td>RM0001</td><td>Stores</td><td>2</td><td>200</td><td>400</td></tr>
</tbody>
</table>
**Stock Ledger**
![sret_stock_ledger](img/accounting-for-stock-15.png)
**General Ledger**
![sret_general_ledger](img/accounting-for-stock-16.png)
--
### **Stock Entry (Purchase Return)**
**Items:**
<table class="table table-bordered">
<thead>
<tr><th>Item</th><th>Source Warehouse</th><th>Qty</th><th>Rate</th><th>Amount</th></tr>
</thead>
<tbody>
<tr><td>RM0001</td><td>Stores</td><td>4</td><td>220</td><td>880</td></tr>
</tbody>
</table>
**Stock Ledger**
![pret_stock_ledger](img/accounting-for-stock-17.png)
**General Ledger**
![pret_general_ledger](img/accounting-for-stock-18.png)

View File

@ -1,6 +1,6 @@
---
{
"_label": "Reports"
"_label": "Accounting Reports"
}
---
Some of the major accounting reports are:

View File

@ -1,6 +1,6 @@
---
{
"_label": "Login"
"_label": "Portal Login"
}
---
To login into the customer account, the customer has to use his email id and the password sent by ERPNext; generated through the sign-up process.

View File

@ -4,7 +4,7 @@
"_toc": [
"docs.user.customer_portal.sign_up",
"docs.user.customer_portal.login",
"docs.user.customer_portal.orders",
"docs.user.customer_portal.order",
"docs.user.customer_portal.tickets"
]
}

View File

@ -1,22 +0,0 @@
---
{
"_label": "Hiding Modules and Features "
}
---
### Hiding Unused Features
As you have seen from this manual that ERPNext contains tons of features which you may not use. We have observed that most users start with using 20% of the features, though a different 20%. To hide fields belonging to features you dont require, go to:
> Setup > Customize ERPNext > Disable Features.
Check / uncheck the features you want to use and refresh your page for the changes to take effect.
---
### Hiding Module Icons
To hide modules (icons) from the home page, go to:
Setup > Customize ERPNext > Modules Setup
> Note: Modules are automatically hidden for users that have no permissions on the documents within that module. For example, if a user has no permissions on Purchase Order, Purchase Request, Supplier, the “Buying” module will automatically be hidden.

View File

@ -2,7 +2,7 @@
{
"_label": "Projects",
"_toc": [
"docs.user.projects.projects",
"docs.user.projects.project",
"docs.user.projects.task",
"docs.user.projects.timelog"
]

View File

@ -1,6 +1,6 @@
---
{
"_label": "Projects"
"_label": "Project"
}
---

View File

@ -1,6 +1,6 @@
---
{
"_label": "Blog"
"_label": "Blog Post"
}
---
Blogs are a great way to share your thoughts about your business and keep your customers and readers updated of what you are up to.

View File

@ -5,7 +5,7 @@
"docs.user.website.setup",
"docs.user.website.web_page",
"docs.user.website.style",
"docs.user.website.blog",
"docs.user.website.blog_post",
"docs.user.website.add_products_to_website"
]
}

View File

@ -8,7 +8,7 @@ from hr.doctype.leave_application.leave_application import LeaveDayBlockedError,
class TestLeaveApplication(unittest.TestCase):
def tearDown(self):
webnotes.session.user = "Administrator"
webnotes.set_user("Administrator")
def _clear_roles(self):
webnotes.conn.sql("""delete from `tabUserRole` where parent in
@ -19,7 +19,7 @@ class TestLeaveApplication(unittest.TestCase):
def _add_employee_leave_approver(self, employee, leave_approver):
temp_session_user = webnotes.session.user
webnotes.session.user = "Administrator"
webnotes.set_user("Administrator")
employee = webnotes.bean("Employee", employee)
employee.doclist.append({
"doctype": "Employee Leave Approver",
@ -27,7 +27,7 @@ class TestLeaveApplication(unittest.TestCase):
"leave_approver": leave_approver
})
employee.save()
webnotes.session.user = temp_session_user
webnotes.set_user(temp_session_user)
def get_application(self, doclist):
application = webnotes.bean(copy=doclist)
@ -49,7 +49,7 @@ class TestLeaveApplication(unittest.TestCase):
application.doc.status = "Approved"
self.assertRaises(LeaveDayBlockedError, application.submit)
webnotes.session.user = "test1@example.com"
webnotes.set_user("test1@example.com")
# clear other applications
webnotes.conn.sql("delete from `tabLeave Application`")
@ -65,7 +65,7 @@ class TestLeaveApplication(unittest.TestCase):
add_role("test@example.com", "Employee")
add_role("test2@example.com", "Leave Approver")
webnotes.session.user = "test@example.com"
webnotes.set_user("test@example.com")
application = self.get_application(test_records[1])
application.doc.leave_approver = "test2@example.com"
application.insert()
@ -89,10 +89,10 @@ class TestLeaveApplication(unittest.TestCase):
webnotes.conn.set_value("Employee", "_T-Employee-0002", "department",
"_Test Department")
webnotes.session.user = "test1@example.com"
webnotes.set_user("test1@example.com")
application.insert()
webnotes.session.user = "test@example.com"
webnotes.set_user("test@example.com")
application.doc.status = "Approved"
self.assertRaises(LeaveDayBlockedError, application.submit)
@ -116,13 +116,13 @@ class TestLeaveApplication(unittest.TestCase):
self._clear_applications()
# create leave application as Employee
webnotes.session.user = "test@example.com"
webnotes.set_user("test@example.com")
application = self.get_application(test_records[1])
application.doc.leave_approver = "test1@example.com"
application.insert()
# submit leave application by Leave Approver
webnotes.session.user = "test1@example.com"
webnotes.set_user("test1@example.com")
application.doc.status = "Approved"
application.submit()
self.assertEqual(webnotes.conn.get_value("Leave Application", application.doc.name,
@ -139,7 +139,7 @@ class TestLeaveApplication(unittest.TestCase):
# TODO - add test2@example.com leave approver in employee's leave approvers list
application = self.get_application(test_records[1])
webnotes.session.user = "test@example.com"
webnotes.set_user("test@example.com")
application.doc.leave_approver = "test1@example.com"
self.assertRaises(InvalidLeaveApproverError, application.insert)
@ -153,11 +153,11 @@ class TestLeaveApplication(unittest.TestCase):
# create leave application as employee
# but submit as invalid leave approver - should raise exception
webnotes.session.user = "test@example.com"
webnotes.set_user("test@example.com")
application = self.get_application(test_records[1])
application.doc.leave_approver = "test2@example.com"
application.insert()
webnotes.session.user = "test1@example.com"
webnotes.set_user("test1@example.com")
application.doc.status = "Approved"
from webnotes.model.bean import BeanPermissionError
@ -173,13 +173,13 @@ class TestLeaveApplication(unittest.TestCase):
original_department = webnotes.conn.get_value("Employee", "_T-Employee-0001", "department")
webnotes.conn.set_value("Employee", "_T-Employee-0001", "department", None)
webnotes.session.user = "test@example.com"
webnotes.set_user("test@example.com")
application = self.get_application(test_records[1])
application.doc.leave_approver = "test2@example.com"
application.insert()
# change to valid leave approver and try to submit leave application
webnotes.session.user = "test2@example.com"
webnotes.set_user("test2@example.com")
application.doc.status = "Approved"
application.submit()
self.assertEqual(webnotes.conn.get_value("Leave Application", application.doc.name,

View File

@ -4,7 +4,9 @@ def execute():
webnotes.reload_doc("stock", "doctype", "material_request")
webnotes.reload_doc("buying", "doctype", "purchase_order")
webnotes.reload_doc("selling", "doctype", "lead")
from core.doctype.custom_field.custom_field import create_custom_field_if_values_exist
create_custom_field_if_values_exist("Material Request",
{"fieldtype":"Text", "fieldname":"remark", "label":"Remarks","insert_after":"Fiscal Year"})
create_custom_field_if_values_exist("Purchase Order",

View File

@ -37,7 +37,7 @@ def update_file_list(doctype, singles):
except Exception, e:
print webnotes.getTraceback()
if (e.args and e.args[0]!=1054) or not e.args:
raise e
raise
def update_for_doc(doctype, doc):
for filedata in doc.file_list.split("\n"):

View File

@ -10,4 +10,4 @@ def execute():
webnotes.conn.sql("""update `tab%s` set file_list =
replace(file_list, "-", "")""" % dt[0])
except Exception, e:
if e.args[0]!=1146: raise e
if e.args[0]!=1146: raise

View File

@ -37,7 +37,7 @@ def execute():
except Exception, e:
# if duplicate entry, then dont update
if e[0]!=1062:
raise e
raise
changed_keys = change_map.keys()
@ -62,5 +62,5 @@ def execute():
except Exception, e:
if e[0]!=1146:
raise e
raise

View File

@ -25,4 +25,4 @@ def execute():
webnotes.conn.sql("""update `tabPrice List` set buying_or_selling='Selling'
where ifnull(buying_or_selling, '')='' """)
else:
raise e
raise

View File

@ -33,7 +33,7 @@ def execute():
pass
except Exception, e:
if e.args[0] != 1062:
raise e
raise
webnotes.delete_doc("DocType", "Question")
webnotes.delete_doc("DocType", "Answer")

View File

@ -212,7 +212,6 @@ patch_list = [
"execute:webnotes.delete_doc('DocType', 'Budget Control')",
"patches.september_2013.p03_update_stock_uom_in_sle",
"patches.september_2013.p03_move_website_to_framework",
"execute:webnotes.bean('Style Settings').save() #2013-09-19",
"execute:webnotes.conn.set_value('Accounts Settings', None, 'frozen_accounts_modifier', 'Accounts Manager') # 2013-09-24",
"patches.september_2013.p04_unsubmit_serial_nos",
"patches.september_2013.p05_fix_customer_in_pos",
@ -239,4 +238,7 @@ patch_list = [
"patches.october_2013.p08_cleanup_after_item_price_module_change",
"patches.october_2013.p10_plugins_refactor",
"patches.1311.p01_cleanup",
"execute:webnotes.reload_doc('website', 'doctype', 'table_of_contents') #2013-11-13",
"execute:webnotes.reload_doc('website', 'doctype', 'web_page') #2013-11-13",
"execute:webnotes.bean('Style Settings').save() #2013-11-13",
]

View File

@ -10,6 +10,6 @@ def execute():
webnotes.conn.sql("""alter table `tabStock Ledger Entry` add index posting_sort_index(posting_date, posting_time, name)""")
webnotes.conn.commit()
except Exception, e:
if e.args[0]!=1061: raise e
if e.args[0]!=1061: raise
webnotes.conn.begin()

View File

@ -19,4 +19,4 @@ def execute():
where ifnull(`%s`, '')!=''""" % ("%s", fieldname, fieldname), doctype)
except MySQLdb.OperationalError, e:
if e.args[0] != 1054:
raise e
raise

View File

@ -168,7 +168,7 @@ def _make_customer(source_name, ignore_permissions=False):
customer.insert()
return customer
else:
raise e
raise
except webnotes.MandatoryError:
from webnotes.utils import get_url_to_form
webnotes.throw(_("Before proceeding, please create Customer from Lead") + \

View File

@ -52,7 +52,7 @@ class DocType:
inc_email.password = self.doc.support_password
except AttributeError, e:
webnotes.msgprint(err_msg)
raise e
raise
pop_mb = POP3Mailbox(inc_email)
@ -61,7 +61,7 @@ class DocType:
except _socket.error, e:
# Invalid mail server -- due to refusing connection
webnotes.msgprint('Invalid POP3 Mail Server. Please rectify and try again.')
raise e
raise
except poplib.error_proto, e:
webnotes.msgprint('Invalid User Name or Support Password. Please rectify and try again.')
raise e
raise

View File

@ -41,10 +41,12 @@
<script>
$(function() {
if(window.logged_in && getCookie("system_user")==="yes") {
wn.require("lib/js/wn/website/editable.js");
wn.make_editable($('[itemprop="description"]'), "Item Group", "{{ name }}", "description");
wn.has_permission("Item Group", "{{ name }}", "write", function(r) {
wn.require("lib/js/wn/website/editable.js");
wn.make_editable($('[itemprop="description"]'), "Item Group", "{{ name }}", "description");
});
}
})
});
</script>
{% endblock %}

View File

@ -3,14 +3,15 @@
{% block javascript %}
<script>
{% include "app/stock/doctype/item/templates/includes/product_page.js" %}
$(function() {
if(window.logged_in && getCookie("system_user")==="yes") {
wn.require("lib/js/wn/website/editable.js");
wn.make_editable($('[itemprop="description"]'), "Item", "{{ name }}", "web_long_description");
wn.has_permission("Item", "{{ name }}", "write", function(r) {
wn.require("lib/js/wn/website/editable.js");
wn.make_editable($('[itemprop="description"]'), "Item", "{{ name }}", "web_long_description");
});
}
})
});
</script>
{% endblock %}

View File

@ -291,7 +291,7 @@ def reorder_item():
"reorder_qty": reorder_qty
})
)
create_material_request(material_requests)
def create_material_request(material_requests):
@ -311,10 +311,7 @@ def create_material_request(material_requests):
"company": company,
"fiscal_year": defaults.fiscal_year,
"transaction_date": nowdate(),
"material_request_type": request_type,
"remark": _("This is an auto generated Material Request.") + \
_("""It was raised because the (actual + ordered + indented - reserved)
quantity reaches re-order level when the following record was created""")
"material_request_type": request_type
}]
for d in items: