Merge pull request #988 from MaxMorais/patch-1
Fix UnicodeDecodeError
diff --git a/accounts/general_ledger.py b/accounts/general_ledger.py
index 995fdc0..b0c585a 100644
--- a/accounts/general_ledger.py
+++ b/accounts/general_ledger.py
@@ -30,8 +30,12 @@
entry.credit = flt(entry.credit, 2)
# toggle debit, credit if negative entry
- if flt(entry.debit) < 0 or flt(entry.credit) < 0:
- entry.debit, entry.credit = abs(flt(entry.credit)), abs(flt(entry.debit))
+ if flt(entry.debit) < 0:
+ entry.credit = flt(entry.credit) - flt(entry.debit)
+ entry.debit = 0.0
+ if flt(entry.credit) < 0:
+ entry.debit = flt(entry.debit) - flt(entry.credit)
+ entry.credit = 0.0
return gl_map
diff --git a/controllers/stock_controller.py b/controllers/stock_controller.py
index d4c92a9..359dc9e 100644
--- a/controllers/stock_controller.py
+++ b/controllers/stock_controller.py
@@ -12,18 +12,17 @@
class StockController(AccountsController):
def make_gl_entries(self):
- if not cint(webnotes.defaults.get_global_default("auto_accounting_for_stock")):
- return
-
- warehouse_account = self.get_warehouse_account()
-
- if self.doc.docstatus==1:
- gl_entries = self.get_gl_entries_for_stock(warehouse_account)
- make_gl_entries(gl_entries)
- else:
+ if self.doc.docstatus == 2:
delete_gl_entries(voucher_type=self.doc.doctype, voucher_no=self.doc.name)
+
+ if cint(webnotes.defaults.get_global_default("auto_accounting_for_stock")):
+ warehouse_account = self.get_warehouse_account()
- self.update_gl_entries_after(warehouse_account)
+ if self.doc.docstatus==1:
+ gl_entries = self.get_gl_entries_for_stock(warehouse_account)
+ make_gl_entries(gl_entries)
+
+ self.update_gl_entries_after(warehouse_account)
def get_gl_entries_for_stock(self, warehouse_account=None, default_expense_account=None,
default_cost_center=None):
@@ -91,15 +90,11 @@
return stock_ledger
def get_warehouse_account(self):
- for d in webnotes.conn.sql("select name from tabWarehouse"):
- webnotes.bean("Warehouse", d[0]).save()
-
warehouse_account = dict(webnotes.conn.sql("""select master_name, name from tabAccount
where account_type = 'Warehouse' and ifnull(master_name, '') != ''"""))
return warehouse_account
def update_gl_entries_after(self, warehouse_account=None):
- from accounts.utils import get_stock_and_account_difference
future_stock_vouchers = self.get_future_stock_vouchers()
gle = self.get_voucherwise_gl_entries(future_stock_vouchers)
if not warehouse_account:
diff --git a/docs/user/customer_portal/docs.user.customer_portal.login.md b/docs/user/customer_portal/docs.user.customer_portal.login.md
new file mode 100644
index 0000000..c0c5e78
--- /dev/null
+++ b/docs/user/customer_portal/docs.user.customer_portal.login.md
@@ -0,0 +1,8 @@
+---
+{
+ "_label": "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.
+
+
\ No newline at end of file
diff --git a/docs/user/customer_portal/docs.user.customer_portal.md b/docs/user/customer_portal/docs.user.customer_portal.md
new file mode 100644
index 0000000..fc886f1
--- /dev/null
+++ b/docs/user/customer_portal/docs.user.customer_portal.md
@@ -0,0 +1,16 @@
+---
+{
+ "_label": "Customer Portal",
+ "_toc": [
+ "docs.user.customer_portal.sign_up",
+ "docs.user.customer_portal.login",
+ "docs.user.customer_portal.orders",
+ "docs.user.customer_portal.tickets"
+ ]
+}
+---
+
+Customer Portal is designed to give easy accesibility to customers of a company.
+
+
+
diff --git a/docs/user/customer_portal/docs.user.customer_portal.orders.md b/docs/user/customer_portal/docs.user.customer_portal.orders.md
new file mode 100644
index 0000000..d24d038
--- /dev/null
+++ b/docs/user/customer_portal/docs.user.customer_portal.orders.md
@@ -0,0 +1,30 @@
+---
+{
+ "_label": "Customer Orders, Invoices, and Shipping Status"
+}
+---
+ERPNext Web Portal gives your customers quick access to their Orders, Invoices and Shipments
+Customers can check the status of their orders, invoices, and shipping status by logging on to the web.
+
+
+
+
+
+
+Once an order is raised, either using the Shopping Cart or from within ERPNext, your customer can view the order and keep an eye on the billing and shipment status. When the invoice and payment against these orders are submitted, the customer can see the updated status on the portal, at a glance.
+
+
+
+
+
+#### Invoice with paid status.
+
+
+
+
+
+#### Invoice with billed status.
+
+
+
+
diff --git a/docs/user/customer_portal/docs.user.customer_portal.sign_up.md b/docs/user/customer_portal/docs.user.customer_portal.sign_up.md
new file mode 100644
index 0000000..9574f65
--- /dev/null
+++ b/docs/user/customer_portal/docs.user.customer_portal.sign_up.md
@@ -0,0 +1,25 @@
+---
+{
+ "_label": "Sign-Up"
+}
+---
+Customers have to log-in to the Company Website, and sign-up as a customer.
+
+#### Step 1: Click on Login Icon
+
+
+
+<br>
+
+#### Step 2: Click on Sign Up Icon
+
+
+
+<br>
+
+#### Step 3: Enter Customer Name and ID
+
+
+
+After the sign up process, a mail will be sent to the customers email id with the password details.
+
diff --git a/docs/user/customer_portal/docs.user.customer_portal.tickets.md b/docs/user/customer_portal/docs.user.customer_portal.tickets.md
new file mode 100644
index 0000000..6ac8a37
--- /dev/null
+++ b/docs/user/customer_portal/docs.user.customer_portal.tickets.md
@@ -0,0 +1,28 @@
+---
+{
+ "_label": "Support Tickets"
+}
+---
+
+The customer portal makes it very easy for a customer to raise concerns. A simple and intuitive interface facilitates your customer to report their concerns as Support Tickets. They can view the complete thread of their conversation.
+
+#### Empty Ticket List
+
+
+
+
+
+#### New Support Ticket
+
+
+
+
+#### Open Support Ticket
+
+
+
+
+#### Reply on Support Ticket
+
+
+
diff --git a/docs/user/customize/docs.user.customize.custom_field.md b/docs/user/customize/docs.user.customize.custom_field.md
index a457f07..c5aac31 100644
--- a/docs/user/customize/docs.user.customize.custom_field.md
+++ b/docs/user/customize/docs.user.customize.custom_field.md
@@ -7,18 +7,20 @@
> Setup > Custom Field > New Custom Field
-
+
In the form:
- Select the Document on which you want to add the Custom Field.
-- Select the Type of field and the Options (see section on field types).
+- Select the Type of field and the Options .
- Select where you want the field to appear in the Form (“after field” section).
and save the Custom Field. When you open a new / existing form of the type you selected in step 1, you will see it with the Custom Fields.
+To understand Custom Fields in detail, visit [DocType-Fields](docs.user.knowledge.doctype_fields.html)
+
#### Naming
Many times you want your fields to be carried over from one form to another. For example, you may have added a Custom Field in Quotation that you want to include in Sales Order when a Sales Order is created from the Quotation. This is simple in ERPNext, just make sure the fields have the same “fieldname”
diff --git a/docs/user/customize/docs.user.customize.custom_form.md b/docs/user/customize/docs.user.customize.custom_form.md
index 6b37bd1..f418430 100644
--- a/docs/user/customize/docs.user.customize.custom_form.md
+++ b/docs/user/customize/docs.user.customize.custom_form.md
@@ -3,12 +3,13 @@
"_label": "Customize Form"
}
---
-Please read ERPNext Structure before you start customizing.
You can Customize Forms by changing its layout, making certain fields mandatory, hiding others and changing permission levels on fields by going to:
> Setup > Customize ERPNext > Customize Forms
+#### Step 1: Select the required Form Type for Customization.
+

@@ -24,12 +25,14 @@
You can also allow attachments, set max number of attachments and set the default Print Format.
+#### Step 2: Replace Fields with required changes.

<br>
+To understand field definitions, visit [Doctype-Fields](docs.user.knowledge.doctype_fields.html)
> Though we want you to do everything you can to customize your ERP based on your business needs, we recommend that you do not make “wild” changes to the forms. This is because, these changes may affect certain operations and may mess up your forms. Make small changes and see its effect before doing some more.
\ No newline at end of file
diff --git a/docs/user/docs.user.md b/docs/user/docs.user.md
index 5c65882..1b79ee7 100644
--- a/docs/user/docs.user.md
+++ b/docs/user/docs.user.md
@@ -17,8 +17,9 @@
"docs.user.website",
"docs.user.tools",
"docs.user.customize",
- "docs.user.knowledge"
- ],
+ "docs.user.knowledge",
+ "docs.user.customer_portal"
+ ],
"_no_toc": 1
}
---
@@ -70,6 +71,7 @@
1. [Terms and Conditions](docs.user.selling.terms.html)
1. [Price Lists](docs.user.setup.price_list.html)
1. [Discount](docs.user.selling.discount.html)
+ 1. [Shopping Cart](docs.user.selling.shopping_cart.html)
1. [Customers](docs.user.selling.customer.html)
1. [Lead](docs.user.selling.lead.html)
1. [Opportunity](docs.user.selling.opportunity.html)
@@ -88,6 +90,7 @@
1. [Warehouse](docs.user.stock.warehouse.html)
1. [Item Group](docs.user.stock.item_group.html)
1. [Item](docs.user.stock.item.html)
+ 1. [Product Listing on Website](docs.user.stock.product_listing_on_website.html)
1. [Serialized Inventory](docs.user.stock.serialized.html)
1. [Purchase Receipt](docs.user.stock.purchase_receipt.html)
1. [Delivery Note](docs.user.stock.delivery_note.html)
@@ -159,5 +162,11 @@
1. [Accounting Knowledge](docs.user.knowledge.accounting.html)
1. [Accounting Entries](docs.user.knowledge.accounting_entries.html)
1. [DocType Definitions](docs.user.knowledge.doctype.html)
+ 1. [DocType Fields](docs.user.knowledge.doctype_fields.html)
1. [Attachment and CSV Files](docs.user.knowledge.attachment_csv.html)
1. [Format using Markdown](docs.user.knowledge.markdown.html)
+1. [Customer Portal](docs.user.customer_portal.html)
+ 1. [Sign Up](docs.user.customer_portal.sign_up.html)
+ 2. [Login](docs.user.customer_portal.login.html)
+ 3. [Customer Orders](docs.user.customer_portal.orders.html)
+ 4. [Support Tickets](docs.user.customer_portal.tickets.html)
diff --git a/docs/user/knowledge/docs.user.knowledge.doctype.md b/docs/user/knowledge/docs.user.knowledge.doctype.md
index a2550d4..8614fdf 100644
--- a/docs/user/knowledge/docs.user.knowledge.doctype.md
+++ b/docs/user/knowledge/docs.user.knowledge.doctype.md
@@ -71,197 +71,3 @@
There are a certain type of DocTypes that are “Single”, i.e. they have no table associated and have only one record of its fields. DocTypes such as Global Defaults, Production Planning Tool are “Single” DocTypes.
-#### Field Columns
-
-In the fields table, there are many columns, here is an explanation of the columns of the field table.
-
-<table class="table table-bordered text-left">
- <thead>
- <tr class="active">
- <td width="30%">Column</td>
- <td>Description</td>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>Label</td>
- <td>Field Label (that appears in the form).</td>
- </tr>
- <tr>
- <td>Type</td>
- <td>Field Type</td>
- </tr>
- <tr>
- <td>Name</td>
- <td>Column name in the database, must be code friendly with no white spaces, special characters and capital letters.</td>
- </tr>
- <tr>
- <td>options</td>
- <td>Field settings:<br>
- For Select: List of options (each on a new line).<br>
- For Link: DocType that is “linked”.<br>
- For HTML: HTML Content
- </tr>
- <tr>
- <td>Perm Level</td>
- <td>Permission level (number) of the field. You can group fields by numbers, called levels, and apply rules on the levels.</td>
- </tr>
- <tr>
- <td>Width</td>
- <td>Width of the field (in pixels) - useful for “Table” types.</td>
- </tr>
- <tr>
- <td>Reqd</td>
- <td>Checked if field is mandatory (required).</td>
- </tr>
- <tr>
- <td>In Filter</td>
- <td>Checked if field appears as a standard filter in old style reports.</td>
- </tr>
- <tr>
- <td>Hidden</td>
- <td>Checked if field is hidden.</td>
- </tr>
- <tr>
- <td>Print Hide</td>
- <td>Checked if field is hidden in Print Formats.</td>
- </tr>
- <tr>
- <td>Report Hide</td>
- <td>Checked if field is hidden in old style reports.</td>
- </tr>
- <tr>
- <td>Allow on Submit</td>
- <td>Checked if this field can be edited after the document is “Submitted”.</td>
- </tr>
- <tr>
- <td>Depends On</td>
- <td>The fieldname of the field that will decide whether this field will be shown or hidden. It is useful to hide un-necessary fields.</td>
- </tr>
- <tr>
- <td>Description</td>
- <td>Description of the field</td>
- </tr>
- <tr>
- <td>Default</td>
- <td>Default value when a new record is created.<br>
- Note: “user” will set the current user as default and “today” will set today’s date (if the field is a Date field).</td>
- </tr>
- <tbody>
-<table>
-
-#### Field Types and Options
-
-Here is a list of the different types of fields used to make / customize forms in ERPNext.
-
-<table class="table table-bordered text-left">
- <thead>
- <tr class="active">
- <td width="30%">Type</td>
- <td>Description</td>
- <td>Options/Setting</td>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>Data</td>
- <td>Single line text field with 180 characters</td>
- <td> </td>
- </tr>
- <tr>
- <td>Select</td>
- <td>Select from a pre-determined items in a drop-down.</td>
- <td>The “Options” contains the drop-down items, each on a new row</td>
- </tr>
- <tr>
- <td>Link</td>
- <td>Link an existing document / record</td>
- <td>Options contains the name of the type of document (DocType)</td>
- </tr>
- <tr>
- <td>Currency</td>
- <td>Number with 2 decimal places, that will be shown separated by commas for thousands etc. in Print.</td>
- <td>e.g. 1,000,000.00</td>
- </tr>
- <tr>
- <td>Float</td>
- <td>Number with 6 decimal places.</td>
- <td>e.g. 3.141593</td>
- </tr>
- <tr>
- <td>Int</td>
- <td>Integer (no decimals)</td>
- <td>e.g. 100</td>
- </tr>
- <tr>
- <td>Date</td>
- <td>Date</td>
- <td>Format can be selected in Global Defaults</td>
- </tr>
- <tr>
- <td>Time</td>
- <td>Time</td>
- <td></td>
- </tr>
- <tr>
- <td colspan="3" class="active">Text</td>
- </tr>
- <tr>
- <td>Text</td>
- <td>Multi-line text box without formatting features</td>
- <td></td>
- </tr>
- <tr>
- <td>Text editor</td>
- <td>Multi-line text box with formatting toolbar etc</td>
- <td></td>
- </tr>
- <tr>
- <td>Code</td>
- <td>Code Editor</td>
- <td>Options can include the type of language for syntax formatting.
- Eg JS / Python / HTML</td>
- </tr>
- <tr>
- <td colspan="3" class="active">Table (Grid)</td>
- </tr>
- <tr>
- <td>Table</td>
- <td>Table of child items linked to the record.</td>
- <td>Options contains the name of the DocType of the child table. For example “Sales Invoice Item” for “Sales Invoice”</td>
- </tr>
- <tr>
- <td colspan="3" class="active">Layout</td>
- </tr>
- <tr>
- <td>Section Break</td>
- <td>Break into a new horizontal section.</td>
- <td>The layout in ERPNext is evaluated from top to bottom.</td>
- </tr>
- <tr>
- <td>Column Break</td>
- <td>Break into a new vertical column.</td>
- <td></td>
- </tr>
- <tr>
- <td>HTML</td>
- <td>Add a static text / help / link etc in HTML</td>
- <td>Options contains the HTML.</td>
- </tr>
- <tr>
- <td colspan="3" class="active">Action</td>
- </tr>
- <tr>
- <td>Button</td>
- <td>Button</td>
- <td>[for developers only]</td>
- </tr>
- <tbody>
- <table>
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/docs/user/knowledge/docs.user.knowledge.doctype_fields.md b/docs/user/knowledge/docs.user.knowledge.doctype_fields.md
new file mode 100644
index 0000000..dcc6d4e
--- /dev/null
+++ b/docs/user/knowledge/docs.user.knowledge.doctype_fields.md
@@ -0,0 +1,201 @@
+---
+{
+ "_label": "DocType-Fields"
+}
+---
+
+#### Field Columns
+
+In the fields table, there are many columns. The columns of the field table are explained below:
+
+<table class="table table-bordered text-left">
+ <thead>
+ <tr class="active">
+ <td width="30%">Column</td>
+ <td>Description</td>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>Label</td>
+ <td>Field Label (that appears in the form).</td>
+ </tr>
+ <tr>
+ <td>Type</td>
+ <td>Field Type</td>
+ </tr>
+ <tr>
+ <td>Name</td>
+ <td>Column name in the database, must be code friendly with no white spaces, special characters and capital letters.</td>
+ </tr>
+ <tr>
+ <td>options</td>
+ <td>Field settings:<br>
+ For Select: List of options (each on a new line).<br>
+ For Link: DocType that is “linked”.<br>
+ For HTML: HTML Content
+ </tr>
+ <tr>
+ <td>Perm Level</td>
+ <td>Permission level (number) of the field. You can group fields by numbers, called levels, and apply rules on the levels.</td>
+ </tr>
+ <tr>
+ <td>Width</td>
+ <td>Width of the field (in pixels) - useful for “Table” types.</td>
+ </tr>
+ <tr>
+ <td>Reqd</td>
+ <td>Checked if field is mandatory (required).</td>
+ </tr>
+ <tr>
+ <td>In Filter</td>
+ <td>Checked if field appears as a standard filter in old style reports.</td>
+ </tr>
+ <tr>
+ <td>Hidden</td>
+ <td>Checked if field is hidden.</td>
+ </tr>
+ <tr>
+ <td>Print Hide</td>
+ <td>Checked if field is hidden in Print Formats.</td>
+ </tr>
+ <tr>
+ <td>Report Hide</td>
+ <td>Checked if field is hidden in old style reports.</td>
+ </tr>
+ <tr>
+ <td>Allow on Submit</td>
+ <td>Checked if this field can be edited after the document is “Submitted”.</td>
+ </tr>
+ <tr>
+ <td>Depends On</td>
+ <td>The fieldname of the field that will decide whether this field will be shown or hidden. It is useful to hide un-necessary fields.</td>
+ </tr>
+ <tr>
+ <td>Description</td>
+ <td>Description of the field</td>
+ </tr>
+ <tr>
+ <td>Default</td>
+ <td>Default value when a new record is created.<br>
+ Note: “user” will set the current user as default and “today” will set today’s date (if the field is a Date field).</td>
+ </tr>
+ <tbody>
+<table>
+
+
+#### Field Types and Options
+
+Here is a list of the different types of fields used to make / customize forms in ERPNext.
+
+<table class="table table-bordered text-left">
+ <thead>
+ <tr class="active">
+ <td width="30%">Type</td>
+ <td>Description</td>
+ <td>Options/Setting</td>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>Data</td>
+ <td>Single line text field with 180 characters</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>Select</td>
+ <td>Select from a pre-determined items in a drop-down.</td>
+ <td>The “Options” contains the drop-down items, each on a new row</td>
+ </tr>
+ <tr>
+ <td>Link</td>
+ <td>Link an existing document / record</td>
+ <td>Options contains the name of the type of document (DocType)</td>
+ </tr>
+ <tr>
+ <td>Currency</td>
+ <td>Number with 2 decimal places, that will be shown separated by commas for thousands etc. in Print.</td>
+ <td>e.g. 1,000,000.00</td>
+ </tr>
+ <tr>
+ <td>Float</td>
+ <td>Number with 6 decimal places.</td>
+ <td>e.g. 3.141593</td>
+ </tr>
+ <tr>
+ <td>Int</td>
+ <td>Integer (no decimals)</td>
+ <td>e.g. 100</td>
+ </tr>
+ <tr>
+ <td>Date</td>
+ <td>Date</td>
+ <td>Format can be selected in Global Defaults</td>
+ </tr>
+ <tr>
+ <td>Time</td>
+ <td>Time</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td colspan="3" class="active">Text</td>
+ </tr>
+ <tr>
+ <td>Text</td>
+ <td>Multi-line text box without formatting features</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>Text editor</td>
+ <td>Multi-line text box with formatting toolbar etc</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>Code</td>
+ <td>Code Editor</td>
+ <td>Options can include the type of language for syntax formatting.
+ Eg JS / Python / HTML</td>
+ </tr>
+ <tr>
+ <td colspan="3" class="active">Table (Grid)</td>
+ </tr>
+ <tr>
+ <td>Table</td>
+ <td>Table of child items linked to the record.</td>
+ <td>Options contains the name of the DocType of the child table. For example “Sales Invoice Item” for “Sales Invoice”</td>
+ </tr>
+ <tr>
+ <td colspan="3" class="active">Layout</td>
+ </tr>
+ <tr>
+ <td>Section Break</td>
+ <td>Break into a new horizontal section.</td>
+ <td>The layout in ERPNext is evaluated from top to bottom.</td>
+ </tr>
+ <tr>
+ <td>Column Break</td>
+ <td>Break into a new vertical column.</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>HTML</td>
+ <td>Add a static text / help / link etc in HTML</td>
+ <td>Options contains the HTML.</td>
+ </tr>
+ <tr>
+ <td colspan="3" class="active">Action</td>
+ </tr>
+ <tr>
+ <td>Button</td>
+ <td>Button</td>
+ <td>[for developers only]</td>
+ </tr>
+ <tbody>
+ <table>
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docs/user/knowledge/docs.user.knowledge.md b/docs/user/knowledge/docs.user.knowledge.md
index 11dc995..1fa88d9 100644
--- a/docs/user/knowledge/docs.user.knowledge.md
+++ b/docs/user/knowledge/docs.user.knowledge.md
@@ -6,6 +6,7 @@
"docs.user.knowledge.accounting",
"docs.user.knowledge.accounting_entries",
"docs.user.knowledge.doctype",
+ "docs.user.knowledge.doctype_fields",
"docs.user.knowledge.attachment_csv",
"docs.user.knowledge.markdown"
]
diff --git a/docs/user/selling/docs.user.selling.md b/docs/user/selling/docs.user.selling.md
index 9794556..86a07a8 100644
--- a/docs/user/selling/docs.user.selling.md
+++ b/docs/user/selling/docs.user.selling.md
@@ -9,6 +9,9 @@
"docs.user.selling.sales_person",
"docs.user.selling.campaign",
"docs.user.selling.terms",
+ "docs.user.setup.price_list",
+ "docs.user.selling.discount",
+ "docs.user.selling.shopping_cart",
"docs.user.selling. customer",
"docs.user.selling.lead",
"docs.user.selling.opportunity",
diff --git a/docs/user/selling/docs.user.selling.shopping_cart.md b/docs/user/selling/docs.user.selling.shopping_cart.md
new file mode 100644
index 0000000..cf55f76
--- /dev/null
+++ b/docs/user/selling/docs.user.selling.shopping_cart.md
@@ -0,0 +1,41 @@
+---
+{
+ "_label": "Shopping Cart"
+}
+---
+On the Webpage, a shopping cart is an icon that allows you to store all the things that you have earmarked for purchasing. It is a graphical representation of a shopping basket or a shopping cart that allows you to save the items you intend to buy.
+
+This software displays the price of the product . It also displays shipping and handling charges, along with taxes, if applicable.
+
+To set up a shopping cart, go to the selling module.
+
+> Selling > Shopping Cart Settings
+
+
+#### Step 1: Enter Company Details and Default Territory.
+
+
+
+
+<br>
+
+#### Step 2: Enter Price List, Tax Master and Shipping Rule.
+
+
+
+
+<br>
+
+#### Shopping Cart Display
+
+On the Website, the shopping cart image will be seen below the Item price. Customers can click on the cart and enter the amount of quantity they wish to buy. The Item number will be stored on the right hand corner of the page, next to the flower sign.
+
+
+
+<br>
+
+Click on the flower sign on the right hand side to see the cart details. Click on the cart to get the final amount details.
+
+
+
+
diff --git a/docs/user/setup/docs.user.setup.taxes.md b/docs/user/setup/docs.user.setup.taxes.md
index 91ed591..7043429 100644
--- a/docs/user/setup/docs.user.setup.taxes.md
+++ b/docs/user/setup/docs.user.setup.taxes.md
@@ -7,14 +7,18 @@
### Tax Accounts
-For Tax Accounts that you want to use in the tax templates, you must mention them as type “Tax” in your Chart of Accounts. Some Item-tax features are given below :
+For Tax Accounts that you want to use in the tax templates, you must go to Chart of Accounts and mention them as type “Tax” in your Chart of Item.
-- **Discount**: The maximum Discount that can be applied on an Item can be fixed in the Item master. Read [Discount](docs.user.selling.discount.html)
+## Item Tax
+
+If some of your Items require different tax rates as compared to others, mention them in the Item tax table. Even if you have selected your sales and purchase taxes as default tax rates, the system will pull the Item tax rate for calculations. Item tax will get preference over other sales or purchase taxes. However, if you wish to apply default sales and purchase taxes, do not mention item tax rates in the Item master. The system will then select the sales or purchase tax rate specified by you as default rates.
+
+
+
+
- **Inclusive and Exclusive Tax**: ERPNext allows you to enter Item rates which are tax inclusive.
-- **Flat Discount**: This feature will be added soon.
- **Exception to the rule**: Item tax settings are required only if a particular Item has a different tax rate than the rate defined in the standard tax Account
-
-
+- **Item tax is overwrite-able**: You can overwrite or change the item tax rate by going to the Item master in the Item tax table.
## Sales Taxes and Charges Master
@@ -22,6 +26,8 @@
The way ERPNext sets up taxes is via templates. Other types of charges that may apply to your invoices (like shipping, insurance etc.) can also be configured as taxes.
+Select template and modify as per your need.
+
To create a new sales tax template called Sales Taxes and Charges Master, you have to go to:
> Setup > Accounts > Sales Taxes and Charge Master
@@ -38,9 +44,11 @@
In each row, you have to mention:
- Calculation Type:
- - This can be on net total (that is your basic amount).
- - On previous row total / amount (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.
- - Actual (as mentioned).
+ - On Net Total : This can be on net total (total amount without taxes).
+ - On Previous Row Total/Amount: You can apply taxes on previous row total / amount. If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total. Previous row amount means a particular tax amount.And, previous row total means net total plus taxes applied up to that row. In the Enter Row Field, mention row number on which you want to apply the current tax. If you want to apply the tax on the 3rd row, mention "3" in the Enter Row field.
+
+ - Actual : Enter as per actual amount in rate column.
+
- Account Head: The Account ledger under which this tax will be booked
- Cost Center: If the tax / charge is an income (like shipping) it needs to be booked against - a Cost Center.
- Description: Description of the tax (that will be printed in invoices / quotes).
diff --git a/docs/user/stock/docs.user.stock.item.md b/docs/user/stock/docs.user.stock.item.md
index fdf3045..14c1831 100644
--- a/docs/user/stock/docs.user.stock.item.md
+++ b/docs/user/stock/docs.user.stock.item.md
@@ -92,58 +92,4 @@
Visit [Manufacturing](docs.user.mfg.html) and [Website](docs.user.website.html) to understand these topics in detail.
-### Listing Item on Website
-
-To list your Item on the Website, fill the Item details and save the file. Once the file is saved, a plus (+) button will appear next to the Image icon. Click on the plus button and add your Item image. The html code will be generated automatically.
-
-##### Step 1: Save Image
-
-
-
-<br>
-
-##### Step 2: Check the 'Show in Website' box.
-
-Under the Website section, please check the box that says 'show in Website'. Once the box is checked, the page will display other fields for entering information.
-
-
-
-<br>
-
-
-##### Step 3: Enter Website Details
-
-
-
-
-The page name will be generated automatically. Mention the Item-Group under which the Item will be displayed.
-
-#### Item Groups
-
-Mention the Item Group under this column. If you wish to list your Item under the broad category products, name your Item Group as Products. In case you have various varieties of Item and want to classify them under different names, make Item Groups with those names and check the box that says 'show in Website'. For Example, if you wish to create a category called 'Bags', create a Item Group named Bags.
-
-
-
-
-Once the Item Group is created go to the Website Settings page under Website. Enter the Label, Url, and Parent Label.
-
-
-
-
-<br>
-
-#### Webpage labels
-
-
-
-Add more Items under a particular Item Group.
-
-To add more Items under a certain Label, mention the Item Group on the Item Page. The Items will be added automatically on the Webpage, under the Item Group Label. For Example, To add Item-Kiddies Bag and Butterfly Print Bag, check the 'Show in Website'box. The Items will be placed under the Label Bags on the Webpage.
-
-
-
-<br>
-
-Item Group Display
-
-
\ No newline at end of file
+To list your products on the website and understand this process in detail, visit [Product Listing On Website](docs.user.stock.product_listing_on_website.html)
diff --git a/docs/user/stock/docs.user.stock.md b/docs/user/stock/docs.user.stock.md
index a8c74c9..d0ab146 100644
--- a/docs/user/stock/docs.user.stock.md
+++ b/docs/user/stock/docs.user.stock.md
@@ -5,6 +5,7 @@
"docs.user.stock.warehouse",
"docs.user.stock.item_group",
"docs.user.stock.item",
+ "docs.user.stock.product_listing_on_website",
"docs.user.stock.serialized",
"docs.user.stock.purchase_receipt",
"docs.user.stock.delivery_note",
diff --git a/docs/user/stock/docs.user.stock.product_listing_on_website.md b/docs/user/stock/docs.user.stock.product_listing_on_website.md
new file mode 100644
index 0000000..6a544a1
--- /dev/null
+++ b/docs/user/stock/docs.user.stock.product_listing_on_website.md
@@ -0,0 +1,61 @@
+---
+{
+ "_label": "Product Listing on Website"
+}
+---
+
+### Listing Item on Website
+
+To list your Item on the Website, fill the Item details and save the file. Once the file is saved, a plus (+) button will appear next to the Image icon. Click on the plus button and add your Item image. The html code will be generated automatically.
+
+##### Step 1: Save Image
+
+
+
+<br>
+
+##### Step 2: Check the 'Show in Website' box.
+
+Under the Website section, please check the box that says 'show in Website'. Once the box is checked, the page will display other fields for entering information.
+
+
+
+<br>
+
+
+##### Step 3: Enter Website Details
+
+
+
+
+The page name will be generated automatically. Mention the Item-Group under which the Item will be displayed.
+
+#### Item Groups
+
+Mention the Item Group under this column. If you wish to list your Item under the broad category products, name your Item Group as Products. In case you have various varieties of Item and want to classify them under different names, make Item Groups with those names and check the box that says 'show in Website'. For Example, if you wish to create a category called 'Bags', create a Item Group named Bags.
+
+
+
+
+Once the Item Group is created go to the Website Settings page under Website. Enter the Label, Url, and Parent Label.
+
+
+
+
+<br>
+
+#### Webpage labels
+
+
+
+Add more Items under a particular Item Group.
+
+To add more Items under a certain Label, mention the Item Group on the Item Page. The Items will be added automatically on the Webpage, under the Item Group Label. For Example, To add Item-Kiddies Bag and Butterfly Print Bag, check the 'Show in Website'box. The Items will be placed under the Label Bags on the Webpage.
+
+
+
+<br>
+
+Item Group Display
+
+
\ No newline at end of file
diff --git a/patches/march_2013/p06_remove_sales_purchase_return_tool.py b/patches/march_2013/p06_remove_sales_purchase_return_tool.py
index ed8fbc8..ac11ecc 100644
--- a/patches/march_2013/p06_remove_sales_purchase_return_tool.py
+++ b/patches/march_2013/p06_remove_sales_purchase_return_tool.py
@@ -4,5 +4,7 @@
import webnotes
def execute():
- webnotes.delete_doc("DocType", "Sales and Purchase Return Item")
- webnotes.delete_doc("DocType", "Sales and Purchase Return Tool")
\ No newline at end of file
+ if webnotes.conn.exists("DocType", "Sales and Purchase Return Item"):
+ webnotes.delete_doc("DocType", "Sales and Purchase Return Item")
+ if webnotes.conn.exists("DocType", "Sales and Purchase Return Tool"):
+ webnotes.delete_doc("DocType", "Sales and Purchase Return Tool")
\ No newline at end of file
diff --git a/patches/october_2012/fix_cancelled_gl_entries.py b/patches/october_2012/fix_cancelled_gl_entries.py
index b610985..475ea1c 100644
--- a/patches/october_2012/fix_cancelled_gl_entries.py
+++ b/patches/october_2012/fix_cancelled_gl_entries.py
@@ -11,6 +11,7 @@
and docstatus=2""" % (entry['voucher_type'], "%s"), entry['voucher_no'])
is_cancelled = docstatus and 'Yes' or None
if is_cancelled:
+ print entry['voucher_type'], entry['voucher_no']
webnotes.conn.sql("""update `tabGL Entry` set is_cancelled = 'Yes'
where voucher_type = %s and voucher_no = %s""",
(entry['voucher_type'], entry['voucher_no']))
diff --git a/patches/october_2013/p03_remove_sales_and_purchase_return_tool.py b/patches/october_2013/p03_remove_sales_and_purchase_return_tool.py
new file mode 100644
index 0000000..e0965ab
--- /dev/null
+++ b/patches/october_2013/p03_remove_sales_and_purchase_return_tool.py
@@ -0,0 +1,8 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+
+def execute():
+ from patches.march_2013 import p06_remove_sales_purchase_return_tool
+ p06_remove_sales_purchase_return_tool.execute()
\ No newline at end of file
diff --git a/patches/october_2013/p04_update_report_permission.py b/patches/october_2013/p04_update_report_permission.py
new file mode 100644
index 0000000..1a9f99d
--- /dev/null
+++ b/patches/october_2013/p04_update_report_permission.py
@@ -0,0 +1,9 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# License: GNU General Public License v3. See license.txt
+
+import webnotes
+
+def execute():
+ webnotes.conn.sql("""update tabDocPerm set `create`=1 where
+ parent='Report'
+ and role in ('Administrator', 'Report Manager', 'System Manager')""")
\ No newline at end of file
diff --git a/patches/october_2013/p05_delete_gl_entries_for_cancelled_vouchers.py b/patches/october_2013/p05_delete_gl_entries_for_cancelled_vouchers.py
new file mode 100644
index 0000000..1d8657a
--- /dev/null
+++ b/patches/october_2013/p05_delete_gl_entries_for_cancelled_vouchers.py
@@ -0,0 +1,16 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# License: GNU General Public License v3. See license.txt
+
+def execute():
+ import webnotes
+ entries = webnotes.conn.sql("""select voucher_type, voucher_no
+ from `tabGL Entry` group by voucher_type, voucher_no""", as_dict=1)
+ for entry in entries:
+ try:
+ cancelled_voucher = webnotes.conn.sql("""select name from `tab%s` where name = %s
+ and docstatus=2""" % (entry['voucher_type'], "%s"), entry['voucher_no'])
+ if cancelled_voucher:
+ webnotes.conn.sql("""delete from `tabGL Entry` where voucher_type = %s and
+ voucher_no = %s""", (entry['voucher_type'], entry['voucher_no']))
+ except:
+ pass
\ No newline at end of file
diff --git a/patches/patch_list.py b/patches/patch_list.py
index 0b27a2e..565ff99 100644
--- a/patches/patch_list.py
+++ b/patches/patch_list.py
@@ -224,4 +224,7 @@
"patches.october_2013.repost_planned_qty",
"patches.october_2013.p02_update_price_list_and_item_details_in_item_price",
"execute:webnotes.delete_doc('Report', 'Item-wise Price List')",
+ "patches.october_2013.p03_remove_sales_and_purchase_return_tool",
+ "patches.october_2013.p04_update_report_permission",
+ "patches.october_2013.p05_delete_gl_entries_for_cancelled_vouchers",
]
\ No newline at end of file
diff --git a/selling/page/selling_home/selling_home.js b/selling/page/selling_home/selling_home.js
index a69e50b..4981ee7 100644
--- a/selling/page/selling_home/selling_home.js
+++ b/selling/page/selling_home/selling_home.js
@@ -168,6 +168,11 @@
icon: "icon-list",
items: [
{
+ "label":wn._("Lead Details"),
+ route: "query-report/Lead Details",
+ doctype: "Lead"
+ },
+ {
"label":wn._("Customer Addresses And Contacts"),
route: "query-report/Customer Addresses And Contacts",
doctype: "Contact"
diff --git a/selling/report/lead_details/__init__.py b/selling/report/lead_details/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/selling/report/lead_details/__init__.py
diff --git a/selling/report/lead_details/lead_details.txt b/selling/report/lead_details/lead_details.txt
new file mode 100644
index 0000000..6da9b79
--- /dev/null
+++ b/selling/report/lead_details/lead_details.txt
@@ -0,0 +1,22 @@
+[
+ {
+ "creation": "2013-10-22 11:58:16",
+ "docstatus": 0,
+ "modified": "2013-10-22 12:08:18",
+ "modified_by": "Administrator",
+ "owner": "Administrator"
+ },
+ {
+ "doctype": "Report",
+ "is_standard": "Yes",
+ "name": "__common__",
+ "query": "SELECT\n `tabLead`.name as \"Lead Id:Link/Lead:120\",\n `tabLead`.lead_name as \"Lead Name::120\",\n\t`tabLead`.company_name as \"Company Name::120\",\n\t`tabLead`.status as \"Status::120\",\n\tconcat_ws(', ', \n\t\ttrim(',' from `tabAddress`.address_line1), \n\t\ttrim(',' from tabAddress.address_line2), \n\t\ttabAddress.state, tabAddress.pincode, tabAddress.country\n\t) as 'Address::180',\n\t`tabLead`.phone as \"Phone::100\",\n\t`tabLead`.mobile_no as \"Mobile No::100\",\n\t`tabLead`.email_id as \"Email Id::120\",\n\t`tabLead`.lead_owner as \"Lead Owner::120\",\n\t`tabLead`.source as \"Source::120\",\n\t`tabLead`.territory as \"Territory::120\"\nFROM\n\t`tabLead`\n\tleft join `tabAddress` on (\n\t\t`tabAddress`.lead=`tabLead`.name\n\t)\nWHERE\n\t`tabLead`.docstatus<2\nORDER BY\n\t`tabLead`.name asc",
+ "ref_doctype": "Lead",
+ "report_name": "Lead Details",
+ "report_type": "Query Report"
+ },
+ {
+ "doctype": "Report",
+ "name": "Lead Details"
+ }
+]
\ No newline at end of file
diff --git a/setup/doctype/global_defaults/global_defaults.txt b/setup/doctype/global_defaults/global_defaults.txt
index fbfa8ca..a8a80b1 100644
--- a/setup/doctype/global_defaults/global_defaults.txt
+++ b/setup/doctype/global_defaults/global_defaults.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-02 17:53:24",
"docstatus": 0,
- "modified": "2013-08-06 11:22:22",
+ "modified": "2013-10-23 10:22:44",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -176,13 +176,6 @@
"read_only": 0
},
{
- "doctype": "DocField",
- "fieldname": "hr",
- "fieldtype": "Section Break",
- "label": "HR",
- "read_only": 0
- },
- {
"doctype": "DocPerm"
}
]
\ No newline at end of file
diff --git a/stock/doctype/stock_entry/stock_entry.js b/stock/doctype/stock_entry/stock_entry.js
index 7301bd5..b471256 100644
--- a/stock/doctype/stock_entry/stock_entry.js
+++ b/stock/doctype/stock_entry/stock_entry.js
@@ -144,11 +144,18 @@
},
production_order: function() {
+ var me = this;
this.toggle_enable_bom();
return this.frm.call({
method: "get_production_order_details",
- args: {production_order: this.frm.doc.production_order}
+ args: {production_order: this.frm.doc.production_order},
+ callback: function(r) {
+ if (!r.exc) {
+ if (me.frm.doc.purpose == "Material Transfer" && !me.frm.doc.to_warehouse)
+ me.frm.set_value("to_warehouse", r.message["wip_warehouse"]);
+ }
+ }
});
},
diff --git a/stock/doctype/stock_entry/stock_entry.py b/stock/doctype/stock_entry/stock_entry.py
index e4fa9d9..7ec2ba3 100644
--- a/stock/doctype/stock_entry/stock_entry.py
+++ b/stock/doctype/stock_entry/stock_entry.py
@@ -472,11 +472,12 @@
if self.doc.purpose=="Material Receipt":
self.doc.from_warehouse = ""
- item = webnotes.conn.sql("""select item, description, uom from `tabBOM`
- where name=%s""", (self.doc.bom_no,), as_dict=1)
+ item = webnotes.conn.sql("""select name, item_name, description, uom
+ from `tabItem` where name=%s""", (self.doc.bom_no), as_dict=1)
self.add_to_stock_entry_detail({
item[0]["item"] : {
"qty": self.doc.fg_completed_qty,
+ "item_name": item[0].item_name,
"description": item[0]["description"],
"stock_uom": item[0]["uom"],
"from_warehouse": ""
@@ -484,7 +485,6 @@
}, bom_no=self.doc.bom_no)
self.get_stock_and_rate()
-
def get_bom_raw_materials(self, qty):
"""
@@ -503,9 +503,12 @@
else:
item_dict[item.item_code] = {
"qty": flt(item.qty),
+ "item_name": item.item_name,
"description": item.description,
"stock_uom": item.stock_uom,
- "from_warehouse": item.default_warehouse
+ "from_warehouse": item.default_warehouse,
+ "expense_account": item.purchase_account,
+ "cost_center": item.cost_center
}
if self.doc.use_multi_level_bom:
@@ -515,7 +518,10 @@
ifnull(sum(fb.qty_consumed_per_unit),0)*%s as qty,
fb.description,
fb.stock_uom,
- it.default_warehouse
+ it.item_name,
+ it.default_warehouse,
+ it.purchase_account,
+ it.cost_center
from
`tabBOM Explosion Item` fb,`tabItem` it
where
@@ -532,10 +538,13 @@
# get only BOM items
fl_bom_sa_items = sql("""select
`tabItem`.item_code,
+ `tabItem`.item_name,
ifnull(sum(`tabBOM Item`.qty_consumed_per_unit), 0) *%s as qty,
`tabItem`.description,
`tabItem`.stock_uom,
- `tabItem`.default_warehouse
+ `tabItem`.default_warehouse,
+ `tabItem`.purchase_account,
+ `tabItem`.cost_center
from
`tabBOM Item`, `tabItem`
where
@@ -599,16 +608,24 @@
return issued_item_qty
def add_to_stock_entry_detail(self, item_dict, bom_no=None):
+ idx = 1
+ expense_account, cost_center = webnotes.conn.get_values("Company", self.doc.company, \
+ ["default_expense_account", "cost_center"])[0]
+
for d in item_dict:
se_child = addchild(self.doc, 'mtn_details', 'Stock Entry Detail',
self.doclist)
+ se_child.idx = idx
se_child.s_warehouse = item_dict[d].get("from_warehouse", self.doc.from_warehouse)
se_child.t_warehouse = item_dict[d].get("to_warehouse", self.doc.to_warehouse)
se_child.item_code = cstr(d)
+ se_child.item_name = item_dict[d]["item_name"]
se_child.description = item_dict[d]["description"]
se_child.uom = item_dict[d]["stock_uom"]
se_child.stock_uom = item_dict[d]["stock_uom"]
se_child.qty = flt(item_dict[d]["qty"])
+ se_child.expense_account = item_dict[d]["expense_account"] or expense_account
+ se_child.cost_center = item_dict[d]["cost_center"] or cost_center
# in stock uom
se_child.transfer_qty = flt(item_dict[d]["qty"])
@@ -617,6 +634,9 @@
# to be assigned for finished item
se_child.bom_no = bom_no
+ # increment idx by 1
+ idx += 1
+
def get_cust_values(self):
"""fetches customer details"""
if self.doc.delivery_note_no:
@@ -682,8 +702,8 @@
@webnotes.whitelist()
def get_production_order_details(production_order):
result = webnotes.conn.sql("""select bom_no,
- ifnull(qty, 0) - ifnull(produced_qty, 0) as fg_completed_qty, use_multi_level_bom
- from `tabProduction Order` where name = %s""", production_order, as_dict=1)
+ ifnull(qty, 0) - ifnull(produced_qty, 0) as fg_completed_qty, use_multi_level_bom,
+ wip_warehouse from `tabProduction Order` where name = %s""", production_order, as_dict=1)
return result and result[0] or {}
def query_sales_return_doc(doctype, txt, searchfield, start, page_len, filters):
diff --git a/stock/doctype/stock_entry_detail/stock_entry_detail.txt b/stock/doctype/stock_entry_detail/stock_entry_detail.txt
index b766250..5218c1a 100644
--- a/stock/doctype/stock_entry_detail/stock_entry_detail.txt
+++ b/stock/doctype/stock_entry_detail/stock_entry_detail.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-03-29 18:22:12",
"docstatus": 0,
- "modified": "2013-10-15 14:58:09",
+ "modified": "2013-10-23 14:35:46",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -67,6 +67,14 @@
},
{
"doctype": "DocField",
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "label": "Item Name",
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "doctype": "DocField",
"fieldname": "description",
"fieldtype": "Text",
"in_list_view": 1,
diff --git a/stock/page/stock_home/stock_home.js b/stock/page/stock_home/stock_home.js
index 713fe28..ecfc6fe 100644
--- a/stock/page/stock_home/stock_home.js
+++ b/stock/page/stock_home/stock_home.js
@@ -81,7 +81,7 @@
},
{
"doctype":"Item Price",
- "label": wn._("Price List"),
+ "label": wn._("Item Price"),
"description": wn._("Multiple Item prices.")
},
{
diff --git a/utilities/repost_stock.py b/utilities/repost_stock.py
index 7359304..536df81 100644
--- a/utilities/repost_stock.py
+++ b/utilities/repost_stock.py
@@ -13,8 +13,11 @@
"""
webnotes.conn.auto_commit_on_many_writes = 1
- for d in webnotes.conn.sql("select item_code, warehouse from tabBin"):
- repost_stock(d[0], d[1])
+ for d in webnotes.conn.sql("""select distinct item_code, warehouse from
+ (select item_code, warehouse from tabBin
+ union
+ select item_code, warehouse from `tabStock Ledger Entry`) a"""):
+ repost_stock(d[0], d[1])
webnotes.conn.auto_commit_on_many_writes = 0
@@ -31,7 +34,10 @@
def repost_actual_qty(item_code, warehouse):
from stock.stock_ledger import update_entries_after
- update_entries_after({ "item_code": item_code, "warehouse": warehouse })
+ try:
+ update_entries_after({ "item_code": item_code, "warehouse": warehouse })
+ except:
+ pass
def get_reserved_qty(item_code, warehouse):
reserved_qty = webnotes.conn.sql("""