From 93d2c7aebb60008a0d3d240b2ff1a8f6c5c29554 Mon Sep 17 00:00:00 2001 From: Priya Date: Thu, 17 Oct 2013 11:44:31 +0530 Subject: [PATCH 01/26] [docs] Customize links added --- .../docs.user.customer_portal.login.md | 8 + .../docs.user.customer_portal.md | 14 ++ .../docs.user.customer_portal.orders.md | 13 ++ .../docs.user.customer_portal.sign_up.md | 25 +++ .../docs.user.customize.custom_field.md | 6 +- .../docs.user.customize.custom_form.md | 5 +- docs/user/docs.user.md | 12 +- .../knowledge/docs.user.knowledge.doctype.md | 194 ----------------- .../docs.user.knowledge.doctype_fields.md | 201 ++++++++++++++++++ docs/user/knowledge/docs.user.knowledge.md | 1 + docs/user/selling/docs.user.selling.md | 3 + .../docs.user.selling.shopping_cart.md | 41 ++++ docs/user/stock/docs.user.stock.item.md | 56 +---- docs/user/stock/docs.user.stock.md | 1 + ...s.user.stock.product_listing_on_website.md | 61 ++++++ 15 files changed, 387 insertions(+), 254 deletions(-) create mode 100644 docs/user/customer_portal/docs.user.customer_portal.login.md create mode 100644 docs/user/customer_portal/docs.user.customer_portal.md create mode 100644 docs/user/customer_portal/docs.user.customer_portal.orders.md create mode 100644 docs/user/customer_portal/docs.user.customer_portal.sign_up.md create mode 100644 docs/user/knowledge/docs.user.knowledge.doctype_fields.md create mode 100644 docs/user/selling/docs.user.selling.shopping_cart.md create mode 100644 docs/user/stock/docs.user.stock.product_listing_on_website.md 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 0000000000..982683a251 --- /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, use the customer email id and the password sent by ERPNext, generated by the sign-up process. + +![Login](img/customer-portal-login.png) \ 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 0000000000..2f080655b5 --- /dev/null +++ b/docs/user/customer_portal/docs.user.customer_portal.md @@ -0,0 +1,14 @@ +--- +{ + "_label": "Customer Portal", + "_toc": [ + "docs.user.customer_portal.sign_up", + "docs.user.customer_portal.login" + ] +} +--- + +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 0000000000..dd1fbff1ba --- /dev/null +++ b/docs/user/customer_portal/docs.user.customer_portal.orders.md @@ -0,0 +1,13 @@ +--- +{ + "_label": "Customer Orders" +} +--- + +ERPNext Web Portal gives your customers quick access to their Orders. Customers can check the status of their orders 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. + + +![Customer Portal](img/customer-portal-orders-1.png) + 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 0000000000..4a217c2659 --- /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 + +![Sign Up](img/customer-portal-sign-up-1.png) + +
+ +#### Step 2: Click on Sign Up Icon + +![Sign Up](img/customer-portal-sign-up-2.png) + +
+ +#### Step 3: Enter Customer Name and ID + +![Sign Up](img/customer-portal-sign-up-3.png) + +After the sign up process, a mail will be sent to the customers email id with the password details. + diff --git a/docs/user/customize/docs.user.customize.custom_field.md b/docs/user/customize/docs.user.customize.custom_field.md index a457f074cc..c5aac31a85 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 @@ A very common customization is adding of custom fields. You can add Custom Field > Setup > Custom Field > New Custom Field -![Custome Field](img/custom-field.png) +![Custom Field](img/custom-field.png) 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 6b37bd12ee..f4184303ef 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. + ![Customize Forms](img/customize-form-1.png) @@ -24,12 +25,14 @@ Select the Form you want to customize and the fields table will be updated with You can also allow attachments, set max number of attachments and set the default Print Format. +#### Step 2: Replace Fields with required changes. ![Customize Forms](img/customize-form-2.png)
+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 5c6588272e..cf0e273b97 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 @@ Contents 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 @@ Contents 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,10 @@ Contents 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) diff --git a/docs/user/knowledge/docs.user.knowledge.doctype.md b/docs/user/knowledge/docs.user.knowledge.doctype.md index a2550d4f95..8614fdf03d 100644 --- a/docs/user/knowledge/docs.user.knowledge.doctype.md +++ b/docs/user/knowledge/docs.user.knowledge.doctype.md @@ -71,197 +71,3 @@ Many DocTypes are single tables, but some work in groups. For example, Quotation 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. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ColumnDescription
LabelField Label (that appears in the form).
TypeField Type
NameColumn name in the database, must be code friendly with no white spaces, special characters and capital letters.
optionsField settings:
- For Select: List of options (each on a new line).
- For Link: DocType that is “linked”.
- For HTML: HTML Content -
Perm LevelPermission level (number) of the field. You can group fields by numbers, called levels, and apply rules on the levels.
WidthWidth of the field (in pixels) - useful for “Table” types.
ReqdChecked if field is mandatory (required).
In FilterChecked if field appears as a standard filter in old style reports.
HiddenChecked if field is hidden.
Print HideChecked if field is hidden in Print Formats.
Report HideChecked if field is hidden in old style reports.
Allow on SubmitChecked if this field can be edited after the document is “Submitted”.
Depends OnThe fieldname of the field that will decide whether this field will be shown or hidden. It is useful to hide un-necessary fields.
DescriptionDescription of the field
DefaultDefault value when a new record is created.
- Note: “user” will set the current user as default and “today” will set today’s date (if the field is a Date field).
- -#### Field Types and Options - -Here is a list of the different types of fields used to make / customize forms in ERPNext. - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TypeDescriptionOptions/Setting
DataSingle line text field with 180 characters
SelectSelect from a pre-determined items in a drop-down.The “Options” contains the drop-down items, each on a new row
LinkLink an existing document / recordOptions contains the name of the type of document (DocType)
CurrencyNumber with 2 decimal places, that will be shown separated by commas for thousands etc. in Print.e.g. 1,000,000.00
FloatNumber with 6 decimal places.e.g. 3.141593
IntInteger (no decimals)e.g. 100
DateDateFormat can be selected in Global Defaults
TimeTime
Text
TextMulti-line text box without formatting features
Text editorMulti-line text box with formatting toolbar etc
CodeCode EditorOptions can include the type of language for syntax formatting. - Eg JS / Python / HTML
Table (Grid)
TableTable of child items linked to the record.Options contains the name of the DocType of the child table. For example “Sales Invoice Item” for “Sales Invoice”
Layout
Section BreakBreak into a new horizontal section.The layout in ERPNext is evaluated from top to bottom.
Column BreakBreak into a new vertical column.
HTMLAdd a static text / help / link etc in HTMLOptions contains the HTML.
Action
ButtonButton[for developers only]
- - - - - - - \ 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 0000000000..dcc6d4ef3c --- /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: + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ColumnDescription
LabelField Label (that appears in the form).
TypeField Type
NameColumn name in the database, must be code friendly with no white spaces, special characters and capital letters.
optionsField settings:
+ For Select: List of options (each on a new line).
+ For Link: DocType that is “linked”.
+ For HTML: HTML Content +
Perm LevelPermission level (number) of the field. You can group fields by numbers, called levels, and apply rules on the levels.
WidthWidth of the field (in pixels) - useful for “Table” types.
ReqdChecked if field is mandatory (required).
In FilterChecked if field appears as a standard filter in old style reports.
HiddenChecked if field is hidden.
Print HideChecked if field is hidden in Print Formats.
Report HideChecked if field is hidden in old style reports.
Allow on SubmitChecked if this field can be edited after the document is “Submitted”.
Depends OnThe fieldname of the field that will decide whether this field will be shown or hidden. It is useful to hide un-necessary fields.
DescriptionDescription of the field
DefaultDefault value when a new record is created.
+ Note: “user” will set the current user as default and “today” will set today’s date (if the field is a Date field).
+ + +#### Field Types and Options + +Here is a list of the different types of fields used to make / customize forms in ERPNext. + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescriptionOptions/Setting
DataSingle line text field with 180 characters
SelectSelect from a pre-determined items in a drop-down.The “Options” contains the drop-down items, each on a new row
LinkLink an existing document / recordOptions contains the name of the type of document (DocType)
CurrencyNumber with 2 decimal places, that will be shown separated by commas for thousands etc. in Print.e.g. 1,000,000.00
FloatNumber with 6 decimal places.e.g. 3.141593
IntInteger (no decimals)e.g. 100
DateDateFormat can be selected in Global Defaults
TimeTime
Text
TextMulti-line text box without formatting features
Text editorMulti-line text box with formatting toolbar etc
CodeCode EditorOptions can include the type of language for syntax formatting. + Eg JS / Python / HTML
Table (Grid)
TableTable of child items linked to the record.Options contains the name of the DocType of the child table. For example “Sales Invoice Item” for “Sales Invoice”
Layout
Section BreakBreak into a new horizontal section.The layout in ERPNext is evaluated from top to bottom.
Column BreakBreak into a new vertical column.
HTMLAdd a static text / help / link etc in HTMLOptions contains the HTML.
Action
ButtonButton[for developers only]
+ + + + + + + \ 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 11dc9957ac..1fa88d99e1 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 9794556724..86a07a8b3f 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 0000000000..cf55f76c8a --- /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. + + +![Shopping Cart](img/shopping-cart-1.png) + +
+ +#### Step 2: Enter Price List, Tax Master and Shipping Rule. + + +![Shopping Cart](img/shopping-cart-2.png) + +
+ +#### 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. + +![Shopping Cart](img/shopping-cart-display-1.png) + +
+ +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. + + +![Shopping Cart](img/shopping-cart-display-amount.png) + diff --git a/docs/user/stock/docs.user.stock.item.md b/docs/user/stock/docs.user.stock.item.md index fdf304559b..14c18316f2 100644 --- a/docs/user/stock/docs.user.stock.item.md +++ b/docs/user/stock/docs.user.stock.item.md @@ -92,58 +92,4 @@ Inspection Criteria: If a Quality Inspection is prepared for this Item, then thi 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 - -![Webimage](img/item-webimage.png) - -
- -##### 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. - -![Webimage](img/item-webimage-1.png) - -
- - -##### Step 3: Enter Website Details - -![Webimage](img/item-webimage-2.png) - - -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. - - -![Item Group](img/itemgroup-webimage-bags.png) - -Once the Item Group is created go to the Website Settings page under Website. Enter the Label, Url, and Parent Label. - - -![Item Group](img/itemgroup-website-settings.png) - -
- -#### Webpage labels - -![Webpage](img/webpage-labels.png) - -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. - -![Item Group](img/itemgroup-websettings.png) - -
- -Item Group Display - -![Item Group Display](img/webpage-itemgroup-display.png) \ 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 a8c74c9175..d0ab146cad 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 0000000000..6a544a10c1 --- /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 + +![Webimage](img/item-webimage.png) + +
+ +##### 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. + +![Webimage](img/item-webimage-1.png) + +
+ + +##### Step 3: Enter Website Details + +![Webimage](img/item-webimage-2.png) + + +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. + + +![Item Group](img/itemgroup-webimage-bags.png) + +Once the Item Group is created go to the Website Settings page under Website. Enter the Label, Url, and Parent Label. + + +![Item Group](img/itemgroup-website-settings.png) + +
+ +#### Webpage labels + +![Webpage](img/webpage-labels.png) + +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. + +![Item Group](img/itemgroup-websettings.png) + +
+ +Item Group Display + +![Item Group Display](img/webpage-itemgroup-display.png) \ No newline at end of file From f913e0f29a31ba9c82ec85ac592fda9863ad6b00 Mon Sep 17 00:00:00 2001 From: Priya Date: Thu, 17 Oct 2013 12:46:41 +0530 Subject: [PATCH 02/26] [docs] customer portal added --- .../docs.user.customer_portal.md | 4 ++- .../docs.user.customer_portal.orders.md | 21 ++++++++++++-- .../docs.user.customer_portal.tickets.md | 28 +++++++++++++++++++ docs/user/docs.user.md | 1 + 4 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 docs/user/customer_portal/docs.user.customer_portal.tickets.md diff --git a/docs/user/customer_portal/docs.user.customer_portal.md b/docs/user/customer_portal/docs.user.customer_portal.md index 2f080655b5..fc886f1dfa 100644 --- a/docs/user/customer_portal/docs.user.customer_portal.md +++ b/docs/user/customer_portal/docs.user.customer_portal.md @@ -3,7 +3,9 @@ "_label": "Customer Portal", "_toc": [ "docs.user.customer_portal.sign_up", - "docs.user.customer_portal.login" + "docs.user.customer_portal.login", + "docs.user.customer_portal.orders", + "docs.user.customer_portal.tickets" ] } --- diff --git a/docs/user/customer_portal/docs.user.customer_portal.orders.md b/docs/user/customer_portal/docs.user.customer_portal.orders.md index dd1fbff1ba..d24d038ac5 100644 --- a/docs/user/customer_portal/docs.user.customer_portal.orders.md +++ b/docs/user/customer_portal/docs.user.customer_portal.orders.md @@ -1,13 +1,30 @@ --- { - "_label": "Customer Orders" + "_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. + + +![Portal Menu](img/portal-menu.png) + -ERPNext Web Portal gives your customers quick access to their Orders. Customers can check the status of their orders 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. ![Customer Portal](img/customer-portal-orders-1.png) + +#### Invoice with paid status. + + +![Invoice Paid](img/portal-invoice-paid.png) + + +#### Invoice with billed status. + + +![Billed Invoice](img/portal-order-billed.png) + 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 0000000000..238272ffcf --- /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 companys' 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 the conversation. + +#### Empty Ticket List + +![Ticket List](img/portal-ticket-list-empty.png) + + + +#### New Support Ticket + +![New Ticket](img/portal-new-ticket.png) + + +#### Open Support Ticket + +![Open Support Ticket](img/portal-ticket-1.png) + + +#### Reply on Support Ticket + +![Reply Support Ticket](img/portal-ticket-reply.png) + diff --git a/docs/user/docs.user.md b/docs/user/docs.user.md index cf0e273b97..1b79ee7606 100644 --- a/docs/user/docs.user.md +++ b/docs/user/docs.user.md @@ -169,3 +169,4 @@ Contents 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) From 006623a7fcff662dafa89e9097c0abb52086018a Mon Sep 17 00:00:00 2001 From: Priya Date: Thu, 17 Oct 2013 12:59:20 +0530 Subject: [PATCH 03/26] [docs] minor customer portal --- docs/user/customer_portal/docs.user.customer_portal.login.md | 2 +- docs/user/customer_portal/docs.user.customer_portal.sign_up.md | 2 +- docs/user/customer_portal/docs.user.customer_portal.tickets.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/user/customer_portal/docs.user.customer_portal.login.md b/docs/user/customer_portal/docs.user.customer_portal.login.md index 982683a251..c0c5e78d7c 100644 --- a/docs/user/customer_portal/docs.user.customer_portal.login.md +++ b/docs/user/customer_portal/docs.user.customer_portal.login.md @@ -3,6 +3,6 @@ "_label": "Login" } --- -To login into the customer account, use the customer email id and the password sent by ERPNext, generated by the sign-up process. +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. ![Login](img/customer-portal-login.png) \ No newline at end of file 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 index 4a217c2659..9574f6565a 100644 --- a/docs/user/customer_portal/docs.user.customer_portal.sign_up.md +++ b/docs/user/customer_portal/docs.user.customer_portal.sign_up.md @@ -3,7 +3,7 @@ "_label": "Sign-Up" } --- -Customers have to log-in to the Company Website,and sign-up as a customer. +Customers have to log-in to the Company Website, and sign-up as a customer. #### Step 1: Click on Login Icon diff --git a/docs/user/customer_portal/docs.user.customer_portal.tickets.md b/docs/user/customer_portal/docs.user.customer_portal.tickets.md index 238272ffcf..6ac8a37964 100644 --- a/docs/user/customer_portal/docs.user.customer_portal.tickets.md +++ b/docs/user/customer_portal/docs.user.customer_portal.tickets.md @@ -4,7 +4,7 @@ } --- -The customer portal makes it very easy for a companys' 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 the conversation. +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 From fcd70d04f3d4a00f5ea7d43064ef180179b6ace8 Mon Sep 17 00:00:00 2001 From: Akhilesh Darjee Date: Fri, 18 Oct 2013 14:24:21 +0530 Subject: [PATCH 04/26] [item price] item price made as an individual master and removed from price list --- accounts/doctype/sales_invoice/pos.js | 55 ++-- accounts/doctype/sales_invoice/pos.py | 29 +- buying/page/buying_home/buying_home.js | 7 +- buying/utils.py | 7 +- manufacturing/doctype/bom/bom.py | 2 +- ...ice_list_and_item_details_in_item_price.py | 20 ++ patches/patch_list.py | 1 + public/js/transaction.js | 34 +++ selling/doctype/sales_common/sales_common.js | 3 +- selling/page/selling_home/selling_home.js | 7 +- selling/utils/__init__.py | 25 +- selling/utils/product.py | 5 +- setup/doctype/item_price/item_price.js | 16 ++ setup/doctype/item_price/item_price.py | 31 ++- setup/doctype/item_price/item_price.txt | 84 +++++- setup/doctype/item_price/test_item_price.py | 23 ++ setup/doctype/price_list/price_list.js | 254 +----------------- setup/doctype/price_list/price_list.py | 18 +- setup/doctype/price_list/price_list.txt | 23 +- setup/doctype/price_list/test_price_list.py | 15 -- stock/doctype/item/item.js | 10 + stock/report/item_prices/item_prices.py | 7 +- 22 files changed, 312 insertions(+), 364 deletions(-) create mode 100644 patches/october_2013/p02_update_price_list_and_item_details_in_item_price.py create mode 100644 setup/doctype/item_price/item_price.js create mode 100644 setup/doctype/item_price/test_item_price.py diff --git a/accounts/doctype/sales_invoice/pos.js b/accounts/doctype/sales_invoice/pos.js index c68b9915c8..043fe90fc1 100644 --- a/accounts/doctype/sales_invoice/pos.js +++ b/accounts/doctype/sales_invoice/pos.js @@ -167,7 +167,7 @@ erpnext.POS = Class.extend({ "fieldtype": "Data", "label": "Barcode", "fieldname": "pos_barcode", - "placeholder": "Barcode" + "placeholder": "Barcode / Serial No" }, parent: this.wrapper.find(".barcode-area") }); @@ -228,7 +228,7 @@ erpnext.POS = Class.extend({ } }); }, - add_to_cart: function(item_code) { + add_to_cart: function(item_code, serial_no) { var me = this; var caught = false; @@ -239,39 +239,46 @@ erpnext.POS = Class.extend({ if (no_of_items != 0) { $.each(wn.model.get_children(this.frm.doctype + " Item", this.frm.doc.name, this.frm.cscript.fname, this.frm.doctype), function(i, d) { - if (d.item_code == item_code) + if (d.item_code == item_code) { caught = true; + if (serial_no) { + d.serial_no += '\n' + serial_no; + me.frm.script_manager.trigger("serial_no", d.doctype, d.name); + } + else { + d.qty += 1; + me.frm.script_manager.trigger("qty", d.doctype, d.name); + } + } }); } - // if duplicate row then append the qty - if (caught) { - me.update_qty(item_code, 1); - } - else { + // if item not found then add new item + if (!caught) { var child = wn.model.add_child(me.frm.doc, this.frm.doctype + " Item", this.frm.cscript.fname); child.item_code = item_code; - me.frm.cscript.item_code(me.frm.doc, child.doctype, child.name); + + if (serial_no) + child.serial_no = serial_no; + + me.frm.script_manager.trigger("item_code", child.doctype, child.name); } + me.refresh(); }, - update_qty: function(item_code, qty, textbox_qty) { + update_qty: function(item_code, qty) { var me = this; $.each(wn.model.get_children(this.frm.doctype + " Item", this.frm.doc.name, this.frm.cscript.fname, this.frm.doctype), function(i, d) { if (d.item_code == item_code) { - if (textbox_qty) { - if (qty == 0 && d.item_code == item_code) - wn.model.clear_doc(d.doctype, d.name); + if (qty == 0) + wn.model.clear_doc(d.doctype, d.name); + else { d.qty = qty; + me.frm.script_manager.trigger("qty", d.doctype, d.name); } - else - d.qty += 1; - - me.frm.cscript.qty(me.frm.doc, d.doctype, d.name); } }); - me.frm.dirty(); me.refresh(); }, refresh: function() { @@ -352,7 +359,7 @@ erpnext.POS = Class.extend({ // append quantity to the respective item after change from input box $(this.wrapper).find("input.qty").on("change", function() { var item_code = $(this).closest("tr")[0].id; - me.update_qty(item_code, $(this).val(), true); + me.update_qty(item_code, $(this).val()); }); // on td click toggle the highlighting of row @@ -407,11 +414,14 @@ erpnext.POS = Class.extend({ var me = this; me.barcode_timeout = null; wn.call({ - method: 'accounts.doctype.sales_invoice.pos.get_item_from_barcode', - args: {barcode: this.barcode.$input.val()}, + method: 'accounts.doctype.sales_invoice.pos.get_item_code', + args: {barcode_serial_no: this.barcode.$input.val()}, callback: function(r) { if (r.message) { - me.add_to_cart(r.message[0].name); + if (r.message[1] == "serial_no") + me.add_to_cart(r.message[0][0].item_code, r.message[0][0].name); + else + me.add_to_cart(r.message[0][0].name); } else msgprint(wn._("Invalid Barcode")); @@ -443,7 +453,6 @@ erpnext.POS = Class.extend({ }); this.frm.fields_dict[this.frm.cscript.fname].grid.refresh(); this.frm.script_manager.trigger("calculate_taxes_and_totals"); - me.frm.dirty(); me.refresh(); }, make_payment: function() { diff --git a/accounts/doctype/sales_invoice/pos.py b/accounts/doctype/sales_invoice/pos.py index 44fe40d8de..7bebbd2db8 100644 --- a/accounts/doctype/sales_invoice/pos.py +++ b/accounts/doctype/sales_invoice/pos.py @@ -20,25 +20,30 @@ def get_items(price_list, sales_or_purchase, item=None, item_group=None): condition += " and i.name='%s'" % item return webnotes.conn.sql("""select i.name, i.item_name, i.image, - pl_items.ref_rate, pl_items.currency + item_det.ref_rate, item_det.currency from `tabItem` i LEFT JOIN - (select ip.item_code, ip.ref_rate, pl.currency from - `tabItem Price` ip, `tabPrice List` pl - where ip.parent=%s and ip.parent = pl.name) pl_items + (select item_code, ref_rate, currency from + `tabItem Price` where price_list=%s) item_det ON - pl_items.item_code=i.name + item_det.item_code=i.name where %s""" % ('%s', condition), (price_list), as_dict=1) @webnotes.whitelist() -def get_item_from_barcode(barcode): - return webnotes.conn.sql("""select name from `tabItem` where barcode=%s""", - (barcode), as_dict=1) +def get_item_code(barcode_serial_no): + input_via = "serial_no" + item_code = webnotes.conn.sql("""select name, item_code from `tabSerial No` where + name=%s""", (barcode_serial_no), as_dict=1) -@webnotes.whitelist() -def get_item_from_serial_no(serial_no): - return webnotes.conn.sql("""select name, item_code from `tabSerial No` where - name=%s""", (serial_no), as_dict=1) + if not item_code: + input_via = "barcode" + item_code = webnotes.conn.sql("""select name from `tabItem` where barcode=%s""", + (barcode_serial_no), as_dict=1) + + if item_code: + return item_code, input_via + else: + webnotes.throw("Invalid Barcode / Serial No") @webnotes.whitelist() def get_mode_of_payment(): diff --git a/buying/page/buying_home/buying_home.js b/buying/page/buying_home/buying_home.js index eec0725de9..b6de994e96 100644 --- a/buying/page/buying_home/buying_home.js +++ b/buying/page/buying_home/buying_home.js @@ -67,9 +67,14 @@ wn.module_page["Buying"] = [ }, { label: wn._("Price List"), - description: wn._("Mupltiple Item prices."), + description: wn._("Multiple Price list."), doctype:"Price List" }, + { + label: wn._("Item Price"), + description: wn._("Multiple Item prices."), + doctype:"Item Price" + }, { "doctype":"Supplier Type", "label": wn._("Supplier Type"), diff --git a/buying/utils.py b/buying/utils.py index 115b023962..385a8c7b51 100644 --- a/buying/utils.py +++ b/buying/utils.py @@ -89,10 +89,9 @@ def _get_price_list_rate(args, item_bean, meta): # try fetching from price list if args.buying_price_list and args.price_list_currency: - price_list_rate = webnotes.conn.sql("""select ip.ref_rate from `tabItem Price` ip, - `tabPrice List` pl where ip.parent = pl.name and ip.parent=%s and - ip.item_code=%s and pl.buying_or_selling='Buying'""", - (args.buying_price_list, args.item_code), as_dict=1) + price_list_rate = webnotes.conn.sql("""select ref_rate from `tabItem Price` + where price_list=%s and item_code=%s and buying_or_selling='Buying'""", + (args.buying_price_list, args.item_code), as_dict=1) if price_list_rate: from utilities.transaction_base import validate_currency diff --git a/manufacturing/doctype/bom/bom.py b/manufacturing/doctype/bom/bom.py index 9a566123c7..c3dd7244fe 100644 --- a/manufacturing/doctype/bom/bom.py +++ b/manufacturing/doctype/bom/bom.py @@ -121,7 +121,7 @@ class DocType: elif self.doc.rm_cost_as_per == "Price List": if not self.doc.buying_price_list: webnotes.throw(_("Please select Price List")) - rate = webnotes.conn.get_value("Item Price", {"parent": self.doc.buying_price_list, + rate = webnotes.conn.get_value("Item Price", {"price_list": self.doc.buying_price_list, "item_code": arg["item_code"]}, "ref_rate") or 0 elif self.doc.rm_cost_as_per == 'Standard Rate': rate = arg['standard_rate'] diff --git a/patches/october_2013/p02_update_price_list_and_item_details_in_item_price.py b/patches/october_2013/p02_update_price_list_and_item_details_in_item_price.py new file mode 100644 index 0000000000..209ebf3574 --- /dev/null +++ b/patches/october_2013/p02_update_price_list_and_item_details_in_item_price.py @@ -0,0 +1,20 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import webnotes + +def execute(): + webnotes.reload_doc("setup", "doctype", "item_price") + + webnotes.conn.sql("""update `tabItem Price` ip, `tabItem` i + set ip.item_name=i.item_name, ip.item_description=i.description + where ip.item_code=i.name""") + + webnotes.conn.sql("""update `tabItem Price` ip, `tabPrice List` pl + set ip.price_list=pl.name, ip.currency=pl.currency, + ip.buying_or_selling=pl.buying_or_selling + where ip.parent=pl.name""") + + webnotes.conn.sql("""update `tabItem Price` + set parent=null, parenttype=null, parentfield=null, idx=null""") \ No newline at end of file diff --git a/patches/patch_list.py b/patches/patch_list.py index 59e0b0cf87..a4f0ec058d 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -222,4 +222,5 @@ patch_list = [ "patches.october_2013.fix_is_cancelled_in_sle", "patches.october_2013.repost_ordered_qty", "patches.october_2013.repost_planned_qty", + "patches.october_2013.p02_update_price_list_and_item_details_in_item_price", ] \ No newline at end of file diff --git a/public/js/transaction.js b/public/js/transaction.js index e948829af9..feae758d8f 100644 --- a/public/js/transaction.js +++ b/public/js/transaction.js @@ -114,6 +114,40 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ this.frm.refresh(); } }, + + serial_no: function(doc, cdt, cdn) { + var me = this; + var item = wn.model.get_doc(cdt, cdn); + + if (item.serial_no) { + if (!item.item_code) { + this.frm.script_manager.trigger("item_code", cdt, cdn); + } + else { + var sr_no = []; + + // Replacing all occurences of comma with carriage return + var serial_nos = item.serial_no.trim().replace(/,/g, '\n'); + + serial_nos = serial_nos.trim().split('\n'); + + // Trim each string and push unique string to new list + for (var x=0; x<=serial_nos.length - 1; x++) { + if (serial_nos[x].trim() != "" && sr_no.indexOf(serial_nos[x].trim()) == -1) { + sr_no.push(serial_nos[x].trim()); + } + } + + // Add the new list to the serial no. field in grid with each in new line + item.serial_no = ""; + for (var x=0; x<=sr_no.length - 1; x++) + item.serial_no += sr_no[x] + '\n'; + + refresh_field("serial_no", item.name, item.parentfield); + wn.model.set_value(item.doctype, item.name, "qty", sr_no.length); + } + } + }, validate: function() { this.calculate_taxes_and_totals(); diff --git a/selling/doctype/sales_common/sales_common.js b/selling/doctype/sales_common/sales_common.js index c87e823dba..8203af843f 100644 --- a/selling/doctype/sales_common/sales_common.js +++ b/selling/doctype/sales_common/sales_common.js @@ -160,7 +160,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ item_code: function(doc, cdt, cdn) { var me = this; var item = wn.model.get_doc(cdt, cdn); - if(item.item_code || item.barcode) { + if(item.item_code || item.barcode || item.serial_no) { if(!this.validate_company_and_party("customer")) { cur_frm.fields_dict[me.frm.cscript.fname].grid.grid_rows[item.idx - 1].remove(); } else { @@ -171,6 +171,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ args: { item_code: item.item_code, barcode: item.barcode, + serial_no: item.serial_no, warehouse: item.warehouse, doctype: me.frm.doc.doctype, parentfield: item.parentfield, diff --git a/selling/page/selling_home/selling_home.js b/selling/page/selling_home/selling_home.js index 9697ccf985..a69e50b06b 100644 --- a/selling/page/selling_home/selling_home.js +++ b/selling/page/selling_home/selling_home.js @@ -83,9 +83,14 @@ wn.module_page["Selling"] = [ }, { label: wn._("Price List"), - description: wn._("Mupltiple Item prices."), + description: wn._("Multiple Price list."), doctype:"Price List" }, + { + label: wn._("Item Price"), + description: wn._("Multiple Item prices."), + doctype:"Item Price" + }, { label: wn._("Sales BOM"), description: wn._("Bundle items at time of sale."), diff --git a/selling/utils/__init__.py b/selling/utils/__init__.py index 6e74ac4869..fd9c492b89 100644 --- a/selling/utils/__init__.py +++ b/selling/utils/__init__.py @@ -40,7 +40,9 @@ def get_item_details(args): args = webnotes._dict(args) if args.barcode: - args.item_code = _get_item_code(args.barcode) + args.item_code = _get_item_code(barcode=args.barcode) + elif not args.item_code and args.serial_no: + args.item_code = _get_item_code(serial_no=args.serial_no) item_bean = webnotes.bean("Item", args.item_code) @@ -88,15 +90,17 @@ def _get_serial_nos_by_fifo(args, item_bean): "qty": cint(args.qty) })) -def _get_item_code(barcode): - item_code = webnotes.conn.sql_list("""select name from `tabItem` where barcode=%s""", barcode) +def _get_item_code(barcode=None, serial_no=None): + if barcode: + input_type = "Barcode" + item_code = webnotes.conn.sql_list("""select name from `tabItem` where barcode=%s""", barcode) + elif serial_no: + input_type = "Serial No" + item_code = webnotes.conn.sql_list("""select item_code from `tabSerial No` + where name=%s""", serial_no) if not item_code: - msgprint(_("No Item found with Barcode") + ": %s" % barcode, raise_exception=True) - - elif len(item_code) > 1: - msgprint(_("Items") + " %s " % comma_and(item_code) + - _("have the same Barcode") + " %s" % barcode, raise_exception=True) + msgprint(_("No Item found with ") + input_type + ": %s" % (barcode or serial_no), raise_exception=True) return item_code[0] @@ -142,9 +146,8 @@ def _get_basic_details(args, item_bean, warehouse_fieldname): return out def _get_price_list_rate(args, item_bean, meta): - ref_rate = webnotes.conn.sql("""select ip.ref_rate from `tabItem Price` ip, - `tabPrice List` pl where ip.parent = pl.name and ip.parent=%s and - ip.item_code=%s and pl.buying_or_selling='Selling'""", + ref_rate = webnotes.conn.sql("""select ref_rate from `tabItem Price` + where price_list=%s and item_code=%s and buying_or_selling='Selling'""", (args.selling_price_list, args.item_code), as_dict=1) if not ref_rate: diff --git a/selling/utils/product.py b/selling/utils/product.py index 3432170a01..df5f16df5c 100644 --- a/selling/utils/product.py +++ b/selling/utils/product.py @@ -27,9 +27,8 @@ def get_product_info(item_code): else: in_stock = -1 - price = price_list and webnotes.conn.sql("""select ip.ref_rate, pl.currency from - `tabItem Price` ip, `tabPrice List` pl where ip.parent = pl.name and - ip.item_code=%s and ip.parent=%s""", + price = price_list and webnotes.conn.sql("""select ref_rate, currency from + `tabItem Price` where item_code=%s and price_list=%s""", (item_code, price_list), as_dict=1) or [] price = price and price[0] or None diff --git a/setup/doctype/item_price/item_price.js b/setup/doctype/item_price/item_price.js new file mode 100644 index 0000000000..0a08c984da --- /dev/null +++ b/setup/doctype/item_price/item_price.js @@ -0,0 +1,16 @@ +// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. +// License: GNU General Public License v3. See license.txt + +$.extend(cur_frm.cscript, { + + onload: function () { + + // Fetch price list details + cur_frm.add_fetch("price_list", "buying_or_selling", "buying_or_selling"); + cur_frm.add_fetch("price_list", "currency", "currency"); + + // Fetch item details + cur_frm.add_fetch("item_code", "item_name", "item_name"); + cur_frm.add_fetch("item_code", "description", "item_description"); + } +}); \ No newline at end of file diff --git a/setup/doctype/item_price/item_price.py b/setup/doctype/item_price/item_price.py index 3256c80d42..ddde87e98a 100644 --- a/setup/doctype/item_price/item_price.py +++ b/setup/doctype/item_price/item_price.py @@ -5,7 +5,36 @@ from __future__ import unicode_literals import webnotes +from webnotes import _ + +class ItemPriceDuplicateItem(Exception): pass class DocType: def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file + self.doc, self.doclist = d, dl + + def on_update(self): + self.update_price_list_details() + self.update_item_details() + self.check_duplicate_item() + + def update_price_list_details(self): + self.doc.buying_or_selling = webnotes.conn.get_value("Price List", self.doc.price_list, + "buying_or_selling") + + self.doc.currency = webnotes.conn.get_value("Price List", self.doc.price_list, + "currency") + + def update_item_details(self): + self.doc.item_name = webnotes.conn.get_value("Item", self.doc.item_code, "item_name") + + self.doc.item_description = webnotes.conn.get_value("Item", self.doc.item_code, + "description") + + def check_duplicate_item(self): + if webnotes.conn.sql("""select name from `tabItem Price` + where item_code=%s and price_list=%s and name!=%s""", + (self.doc.item_code, self.doc.price_list, self.doc.name)): + webnotes.throw(_("Duplicate Item: ") + self.doc.item_code + + _(" already available in Price List: ") + self.doc.price_list, + ItemPriceDuplicateItem) \ No newline at end of file diff --git a/setup/doctype/item_price/item_price.txt b/setup/doctype/item_price/item_price.txt index 4ff5124487..b101460f42 100644 --- a/setup/doctype/item_price/item_price.txt +++ b/setup/doctype/item_price/item_price.txt @@ -2,52 +2,126 @@ { "creation": "2013-05-02 16:29:48", "docstatus": 0, - "modified": "2013-09-13 11:50:02", + "modified": "2013-10-18 13:45:46", "modified_by": "Administrator", "owner": "Administrator" }, { "autoname": "RFD/.#####", + "description": "Multiple Item prices.", "doctype": "DocType", + "document_type": "Master", + "icon": "icon-flag", "in_create": 0, - "istable": 1, + "istable": 0, "module": "Setup", "name": "__common__", "read_only": 0 }, { "doctype": "DocField", - "in_filter": 1, - "in_list_view": 1, "name": "__common__", "parent": "Item Price", "parentfield": "fields", "parenttype": "DocType", + "permlevel": 0 + }, + { + "cancel": 1, + "create": 1, + "doctype": "DocPerm", + "name": "__common__", + "parent": "Item Price", + "parentfield": "permissions", + "parenttype": "DocType", "permlevel": 0, - "reqd": 1 + "read": 1, + "report": 1, + "write": 1 }, { "doctype": "DocType", "name": "Item Price" }, + { + "doctype": "DocField", + "fieldname": "price_list", + "fieldtype": "Link", + "in_filter": 1, + "label": "Price List", + "options": "Price List", + "reqd": 1 + }, { "doctype": "DocField", "fieldname": "item_code", "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, "label": "Item Code", "oldfieldname": "price_list_name", "oldfieldtype": "Select", "options": "Item", + "reqd": 1, "search_index": 1 }, { "doctype": "DocField", "fieldname": "ref_rate", "fieldtype": "Currency", + "in_filter": 1, + "in_list_view": 1, "label": "Rate", "oldfieldname": "ref_rate", "oldfieldtype": "Currency", "options": "currency", + "reqd": 1, "search_index": 0 + }, + { + "doctype": "DocField", + "fieldname": "col_br_1", + "fieldtype": "Column Break" + }, + { + "doctype": "DocField", + "fieldname": "buying_or_selling", + "fieldtype": "Select", + "in_filter": 1, + "in_list_view": 1, + "label": "Valid for Buying or Selling?", + "options": "Selling\nBuying", + "reqd": 0 + }, + { + "doctype": "DocField", + "fieldname": "item_name", + "fieldtype": "Data", + "label": "Item Name", + "read_only": 1 + }, + { + "doctype": "DocField", + "fieldname": "item_description", + "fieldtype": "Text", + "label": "Item Description", + "read_only": 1 + }, + { + "doctype": "DocField", + "fieldname": "currency", + "fieldtype": "Link", + "hidden": 1, + "label": "Currency", + "options": "Currency", + "read_only": 1 + }, + { + "doctype": "DocPerm", + "role": "Sales Master Manager" + }, + { + "doctype": "DocPerm", + "role": "Purchase Master Manager" } ] \ No newline at end of file diff --git a/setup/doctype/item_price/test_item_price.py b/setup/doctype/item_price/test_item_price.py new file mode 100644 index 0000000000..43694da8fa --- /dev/null +++ b/setup/doctype/item_price/test_item_price.py @@ -0,0 +1,23 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import unittest +import webnotes +from setup.doctype.item_price.item_price import ItemPriceDuplicateItem + +class TestItem(unittest.TestCase): + def test_duplicate_item(self): + item_price = webnotes.bean(copy=test_records[0]) + self.assertRaises(ItemPriceDuplicateItem, item_price.insert) + +test_records = [ + [ + { + "doctype": "Item Price", + "price_list": "_Test Price List", + "item_code": "_Test Item", + "ref_rate": 100 + } + ] +] \ No newline at end of file diff --git a/setup/doctype/price_list/price_list.js b/setup/doctype/price_list/price_list.js index 67090bcbc1..1f0693497d 100644 --- a/setup/doctype/price_list/price_list.js +++ b/setup/doctype/price_list/price_list.js @@ -5,253 +5,13 @@ $.extend(cur_frm.cscript, { onload: function() { erpnext.add_for_territory(); }, -}); -cur_frm.cscript.refresh = function(doc, cdt, cdn) { - cur_frm.cscript.show_item_prices(); -} - -cur_frm.cscript.show_item_prices = function() { - var item_price = wn.model.get("Item Price", {parent: cur_frm.doc.name}); - - $(cur_frm.fields_dict.item_prices_html.wrapper).empty(); - - new wn.ui.form.TableGrid({ - parent: cur_frm.fields_dict.item_prices_html.wrapper, - frm: cur_frm, - table_field: wn.meta.get_docfield("Price List", "item_prices", cur_frm.doc.name) - }); -} - -wn.ui.form.TableGrid = Class.extend({ - init: function(opts) { - $.extend(this, opts); - this.fields = wn.meta.get_docfields("Item Price", cur_frm.doc.name); - this.make_table(); - }, - make_table: function() { - var me = this; - // Creating table & assigning attributes - var grid_table = document.createElement("table"); - grid_table.className = "table table-hover table-bordered table-grid"; - - // Appending header & rows to table - grid_table.appendChild(this.make_table_headers()); - grid_table.appendChild(this.make_table_rows()); - - // Creating button to add new row - var btn_div = document.createElement("div"); - var new_row_btn = document.createElement("button"); - new_row_btn.className = "btn btn-success table-new-row"; - new_row_btn.title = "Add new row"; - - var btn_icon = document.createElement("i"); - btn_icon.className = "icon-plus"; - new_row_btn.appendChild(btn_icon); - new_row_btn.innerHTML += " Add new row"; - btn_div.appendChild(new_row_btn); - - // Appending table & button to parent - var $grid_table = $(grid_table).appendTo($(this.parent)); - var $btn_div = $(btn_div).appendTo($(this.parent)); - - $btn_div.on("click", ".table-new-row", function() { - me.make_dialog(); - return false; - }); - - $grid_table.on("click", ".table-row", function() { - me.make_dialog(this); - return false; - }); - }, - make_table_headers: function() { - var me = this; - var header = document.createElement("thead"); - - // Creating header row - var row = document.createElement("tr"); - row.className = "active"; - - // Creating head first cell - var th = document.createElement("th"); - th.width = "8%"; - th.className = "text-center"; - th.innerHTML = "#"; - row.appendChild(th); - - // Make other headers with label as heading - for(var i=0, l=this.fields.length; i Date: Fri, 18 Oct 2013 15:24:53 +0530 Subject: [PATCH 05/26] [report] created new item-wise price list rate report --- patches/patch_list.py | 1 + setup/report/item_wise_price_list/__init__.py | 0 .../item_wise_price_list.txt | 22 ------------------- .../item_wise_price_list_rate.txt | 4 ++-- stock/page/stock_home/stock_home.js | 4 ++-- 5 files changed, 5 insertions(+), 26 deletions(-) delete mode 100644 setup/report/item_wise_price_list/__init__.py delete mode 100644 setup/report/item_wise_price_list/item_wise_price_list.txt diff --git a/patches/patch_list.py b/patches/patch_list.py index a4f0ec058d..0b27a2e0d8 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -223,4 +223,5 @@ patch_list = [ "patches.october_2013.repost_ordered_qty", "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')", ] \ No newline at end of file diff --git a/setup/report/item_wise_price_list/__init__.py b/setup/report/item_wise_price_list/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/setup/report/item_wise_price_list/item_wise_price_list.txt b/setup/report/item_wise_price_list/item_wise_price_list.txt deleted file mode 100644 index 44118c8b13..0000000000 --- a/setup/report/item_wise_price_list/item_wise_price_list.txt +++ /dev/null @@ -1,22 +0,0 @@ -[ - { - "creation": "2013-09-25 10:29:04", - "docstatus": 0, - "modified": "2013-09-25 10:29:04", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "json": "{\"filters\":[[\"Item Price\",\"item_code\",\"like\",\"%\"],[\"Price List\",\"price_list_name\",\"like\",\"%\"]],\"columns\":[[\"item_code\",\"Item Price\"],[\"price_list_name\",\"Price List\"],[\"currency\",\"Price List\"],[\"ref_rate\",\"Item Price\"],[\"buying_or_selling\",\"Price List\"],[\"name\",\"Price List\"]],\"sort_by\":\"Price List.modified\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}", - "name": "__common__", - "ref_doctype": "Price List", - "report_name": "Item-Wise Price List", - "report_type": "Report Builder" - }, - { - "doctype": "Report", - "name": "Item-Wise Price List" - } -] \ No newline at end of file diff --git a/setup/report/item_wise_price_list_rate/item_wise_price_list_rate.txt b/setup/report/item_wise_price_list_rate/item_wise_price_list_rate.txt index 08b1bef01d..a28ebfd241 100644 --- a/setup/report/item_wise_price_list_rate/item_wise_price_list_rate.txt +++ b/setup/report/item_wise_price_list_rate/item_wise_price_list_rate.txt @@ -2,14 +2,14 @@ { "creation": "2013-09-25 10:21:15", "docstatus": 0, - "modified": "2013-09-25 10:24:57", + "modified": "2013-10-18 15:08:36", "modified_by": "Administrator", "owner": "Administrator" }, { "doctype": "Report", "is_standard": "Yes", - "json": "{\"filters\":[[\"Item Price\",\"item_code\",\"like\",\"%\"],[\"Price List\",\"price_list_name\",\"like\",\"%\"]],\"columns\":[[\"item_code\",\"Item Price\"],[\"price_list_name\",\"Price List\"],[\"currency\",\"Price List\"],[\"ref_rate\",\"Item Price\"],[\"buying_or_selling\",\"Price List\"],[\"name\",\"Price List\"]],\"sort_by\":\"Price List.modified\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}", + "json": "{\"filters\":[[\"Item Price\",\"price_list\",\"like\",\"%\"],[\"Item Price\",\"item_code\",\"like\",\"%\"]],\"columns\":[[\"price_list\",\"Item Price\"],[\"item_code\",\"Item Price\"],[\"item_name\",\"Item Price\"],[\"item_description\",\"Item Price\"],[\"ref_rate\",\"Item Price\"],[\"buying_or_selling\",\"Item Price\"]],\"sort_by\":\"Item Price.modified\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}", "name": "__common__", "ref_doctype": "Price List", "report_name": "Item-wise Price List Rate", diff --git a/stock/page/stock_home/stock_home.js b/stock/page/stock_home/stock_home.js index 63db6086ab..70fba89e6c 100644 --- a/stock/page/stock_home/stock_home.js +++ b/stock/page/stock_home/stock_home.js @@ -202,8 +202,8 @@ wn.module_page["Stock"] = [ }, { "label":wn._("Item-wise Price List Rate"), - route: "Report/Price List/Item-Wise Price List", - doctype: "Price List" + route: "Report/Item Price/Item-wise Price List Rate", + doctype: "Item Price" }, { "label":wn._("Purchase In Transit"), From cd80d86dbb0d73ef7b09096720a8fa91f3114a55 Mon Sep 17 00:00:00 2001 From: Akhilesh Darjee Date: Fri, 18 Oct 2013 15:35:13 +0530 Subject: [PATCH 06/26] [fix] [minor] renamed edit prices button from price list and item --- setup/doctype/price_list/price_list.js | 2 +- stock/doctype/item/item.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup/doctype/price_list/price_list.js b/setup/doctype/price_list/price_list.js index 1f0693497d..84c4c2f957 100644 --- a/setup/doctype/price_list/price_list.js +++ b/setup/doctype/price_list/price_list.js @@ -7,7 +7,7 @@ $.extend(cur_frm.cscript, { }, refresh: function() { - cur_frm.add_custom_button("Edit Prices", function() { + cur_frm.add_custom_button("Add / Edit Prices", function() { wn.route_options = { "price_list": cur_frm.doc.name }; diff --git a/stock/doctype/item/item.js b/stock/doctype/item/item.js index 8ea4cd21ea..ecd46125a5 100644 --- a/stock/doctype/item/item.js +++ b/stock/doctype/item/item.js @@ -30,7 +30,7 @@ cur_frm.cscript.make_dashboard = function() { } cur_frm.cscript.edit_prices_button = function() { - cur_frm.add_custom_button("Edit Prices", function() { + cur_frm.add_custom_button("Add / Edit Prices", function() { wn.route_options = { "item_code": cur_frm.doc.name }; From f29569293740eabd71440d5972fb5ce36777743b Mon Sep 17 00:00:00 2001 From: Akhilesh Darjee Date: Fri, 18 Oct 2013 16:21:32 +0530 Subject: [PATCH 07/26] [fix] [minor] item price added in setup page and stock --- setup/page/setup/setup.py | 1 + stock/page/stock_home/stock_home.js | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/setup/page/setup/setup.py b/setup/page/setup/setup.py index 6e6be3102b..1569ef00da 100644 --- a/setup/page/setup/setup.py +++ b/setup/page/setup/setup.py @@ -41,6 +41,7 @@ items = [ {"doctype":"UOM"}, {"doctype":"Brand"}, {"doctype":"Price List"}, + {"doctype": "Item Price"}, { "title": "Stock Settings", "route": "Form/Stock Settings", "type": "Link", "icon": "icon-cog" }, ], diff --git a/stock/page/stock_home/stock_home.js b/stock/page/stock_home/stock_home.js index 70fba89e6c..713fe28296 100644 --- a/stock/page/stock_home/stock_home.js +++ b/stock/page/stock_home/stock_home.js @@ -77,7 +77,12 @@ wn.module_page["Stock"] = [ { "doctype":"Price List", "label": wn._("Price List"), - "description": wn._("Multiple Item Prices") + "description": wn._("Multiple Price list.") + }, + { + "doctype":"Item Price", + "label": wn._("Price List"), + "description": wn._("Multiple Item prices.") }, { "doctype":"Quality Inspection", From c559ecf278de0684df3d6638fba47e4e9786d20d Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Sun, 20 Oct 2013 21:26:55 +0530 Subject: [PATCH 08/26] [fix] [minor] update values from report --- .../item_wise_price_list_rate/item_wise_price_list_rate.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup/report/item_wise_price_list_rate/item_wise_price_list_rate.txt b/setup/report/item_wise_price_list_rate/item_wise_price_list_rate.txt index a28ebfd241..d217bf66af 100644 --- a/setup/report/item_wise_price_list_rate/item_wise_price_list_rate.txt +++ b/setup/report/item_wise_price_list_rate/item_wise_price_list_rate.txt @@ -2,14 +2,14 @@ { "creation": "2013-09-25 10:21:15", "docstatus": 0, - "modified": "2013-10-18 15:08:36", + "modified": "2013-10-20 21:26:28", "modified_by": "Administrator", "owner": "Administrator" }, { "doctype": "Report", "is_standard": "Yes", - "json": "{\"filters\":[[\"Item Price\",\"price_list\",\"like\",\"%\"],[\"Item Price\",\"item_code\",\"like\",\"%\"]],\"columns\":[[\"price_list\",\"Item Price\"],[\"item_code\",\"Item Price\"],[\"item_name\",\"Item Price\"],[\"item_description\",\"Item Price\"],[\"ref_rate\",\"Item Price\"],[\"buying_or_selling\",\"Item Price\"]],\"sort_by\":\"Item Price.modified\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}", + "json": "{\"filters\":[[\"Item Price\",\"price_list\",\"like\",\"%\"],[\"Item Price\",\"item_code\",\"like\",\"%\"]],\"columns\":[[\"name\",\"Item Price\"],[\"price_list\",\"Item Price\"],[\"item_code\",\"Item Price\"],[\"item_name\",\"Item Price\"],[\"item_description\",\"Item Price\"],[\"ref_rate\",\"Item Price\"],[\"buying_or_selling\",\"Item Price\"]],\"sort_by\":\"Item Price.modified\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}", "name": "__common__", "ref_doctype": "Price List", "report_name": "Item-wise Price List Rate", From 953d0a955f84889075910a37d357fa045c7be38a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 21 Oct 2013 12:53:10 +0530 Subject: [PATCH 09/26] [feature] Replace Company Abbr --- setup/doctype/company/company.js | 43 ++++++++++++++++++++++++++-- setup/doctype/company/company.py | 21 +++++++++++--- stock/doctype/warehouse/warehouse.py | 7 +++-- 3 files changed, 62 insertions(+), 9 deletions(-) diff --git a/setup/doctype/company/company.js b/setup/doctype/company/company.js index ca3c93b49b..d023f8df49 100644 --- a/setup/doctype/company/company.js +++ b/setup/doctype/company/company.js @@ -2,14 +2,53 @@ // License: GNU General Public License v3. See license.txt cur_frm.cscript.refresh = function(doc, cdt, cdn) { - if(doc.abbr && !doc.__islocal) - cur_frm.set_df_property("abbr", "read_only", 1) + if(doc.abbr && !doc.__islocal) { + cur_frm.set_df_property("abbr", "read_only", 1); + if(in_list(user_roles, "System Manager")) + cur_frm.add_custom_button("Replace Abbreviation", cur_frm.cscript.replace_abbr) + } if(!doc.__islocal) { cur_frm.toggle_enable("default_currency", !cur_frm.doc.__transactions_exist); } } +cur_frm.cscript.replace_abbr = function() { + var dialog = new wn.ui.Dialog({ + title: "Replace Abbr", + fields: [ + {"fieldtype": "Data", "label": "New Abbreviation", "fieldname": "new_abbr", + "reqd": 1 }, + {"fieldtype": "Button", "label": "Update", "fieldname": "update"}, + ] + }); + + dialog.fields_dict.update.$input.click(function() { + args = dialog.get_values(); + if(!args) return; + return wn.call({ + method: "setup.doctype.company.company.replace_abbr", + args: { + "company": cur_frm.doc.name, + "old": cur_frm.doc.abbr, + "new": args.new_abbr + }, + callback: function(r) { + if(r.exc) { + msgprint(wn._("There were errors.")); + return; + } else { + cur_frm.set_value("abbr", args.new_abbr); + } + dialog.hide(); + cur_frm.refresh(); + }, + btn: this + }) + }); + dialog.show(); +} + cur_frm.cscript.has_special_chars = function(t) { var iChars = "!@#$%^*+=-[]\\\';,/{}|\":<>?"; for (var i = 0; i < t.length; i++) { diff --git a/setup/doctype/company/company.py b/setup/doctype/company/company.py index 9746eb240b..7da231031e 100644 --- a/setup/doctype/company/company.py +++ b/setup/doctype/company/company.py @@ -5,9 +5,7 @@ from __future__ import unicode_literals import webnotes from webnotes import _, msgprint -from webnotes.utils import cstr, cint -from webnotes.model.doc import Document -from webnotes.model.code import get_obj +from webnotes.utils import cstr import webnotes.defaults sql = webnotes.conn.sql @@ -316,4 +314,19 @@ class DocType: where doctype='Global Defaults' and field='default_company' and value=%s""", (newdn, olddn)) - webnotes.defaults.clear_default("company", value=olddn) \ No newline at end of file + webnotes.defaults.clear_default("company", value=olddn) + +@webnotes.whitelist() +def replace_abbr(company, old, new): + webnotes.conn.set_value("Company", company, "abbr", new) + + def _rename_record(dt): + for d in webnotes.conn.sql("select name from `tab%s` where company=%s" % (dt, '%s'), company): + parts = d[0].split(" - ") + if parts[-1].lower() == old.lower(): + name_without_abbr = " - ".join(parts[:-1]) + webnotes.rename_doc(dt, d[0], name_without_abbr + " - " + new) + + for dt in ["Account", "Cost Center", "Warehouse"]: + _rename_record(dt) + webnotes.conn.commit() \ No newline at end of file diff --git a/stock/doctype/warehouse/warehouse.py b/stock/doctype/warehouse/warehouse.py index 476a6f6478..cfa278278d 100644 --- a/stock/doctype/warehouse/warehouse.py +++ b/stock/doctype/warehouse/warehouse.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import webnotes -from webnotes.utils import cint, flt, validate_email_add +from webnotes.utils import cint, validate_email_add from webnotes import msgprint, _ sql = webnotes.conn.sql @@ -115,8 +115,9 @@ class DocType: sql("delete from `tabStock Ledger Entry` where warehouse = %s", self.doc.name) def on_rename(self, newdn, olddn, merge=False): - webnotes.conn.set_value("Account", {"account_type": "Warehouse", "master_name": olddn}, - "master_name", newdn) + account = webnotes.conn.get_value("Account", {"account_type": "Warehouse", + "master_name": olddn}) + webnotes.conn.set_value("Account", account, "master_name", newdn) if merge: from stock.stock_ledger import update_entries_after From 41e4fb2bb8f045592304c0361618c2d7b2523baf Mon Sep 17 00:00:00 2001 From: Akhilesh Darjee Date: Mon, 21 Oct 2013 16:14:02 +0530 Subject: [PATCH 10/26] [fix] [minor] item wise price list rate report currency fix --- setup/doctype/item_price/item_price.txt | 2 +- .../item_wise_price_list_rate/item_wise_price_list_rate.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup/doctype/item_price/item_price.txt b/setup/doctype/item_price/item_price.txt index b101460f42..779bbd47e0 100644 --- a/setup/doctype/item_price/item_price.txt +++ b/setup/doctype/item_price/item_price.txt @@ -2,7 +2,7 @@ { "creation": "2013-05-02 16:29:48", "docstatus": 0, - "modified": "2013-10-18 13:45:46", + "modified": "2013-10-21 15:11:20", "modified_by": "Administrator", "owner": "Administrator" }, diff --git a/setup/report/item_wise_price_list_rate/item_wise_price_list_rate.txt b/setup/report/item_wise_price_list_rate/item_wise_price_list_rate.txt index d217bf66af..888203d2b7 100644 --- a/setup/report/item_wise_price_list_rate/item_wise_price_list_rate.txt +++ b/setup/report/item_wise_price_list_rate/item_wise_price_list_rate.txt @@ -2,14 +2,14 @@ { "creation": "2013-09-25 10:21:15", "docstatus": 0, - "modified": "2013-10-20 21:26:28", + "modified": "2013-10-21 16:06:22", "modified_by": "Administrator", "owner": "Administrator" }, { "doctype": "Report", "is_standard": "Yes", - "json": "{\"filters\":[[\"Item Price\",\"price_list\",\"like\",\"%\"],[\"Item Price\",\"item_code\",\"like\",\"%\"]],\"columns\":[[\"name\",\"Item Price\"],[\"price_list\",\"Item Price\"],[\"item_code\",\"Item Price\"],[\"item_name\",\"Item Price\"],[\"item_description\",\"Item Price\"],[\"ref_rate\",\"Item Price\"],[\"buying_or_selling\",\"Item Price\"]],\"sort_by\":\"Item Price.modified\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}", + "json": "{\"filters\":[[\"Item Price\",\"price_list\",\"like\",\"%\"],[\"Item Price\",\"item_code\",\"like\",\"%\"]],\"columns\":[[\"name\",\"Item Price\"],[\"price_list\",\"Item Price\"],[\"item_code\",\"Item Price\"],[\"item_name\",\"Item Price\"],[\"item_description\",\"Item Price\"],[\"ref_rate\",\"Item Price\"],[\"buying_or_selling\",\"Item Price\"],[\"currency\",\"Item Price\"]],\"sort_by\":\"Item Price.modified\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}", "name": "__common__", "ref_doctype": "Price List", "report_name": "Item-wise Price List Rate", From b0224d0ce0fe2cc373ad313b5290883c0bbf0e9f Mon Sep 17 00:00:00 2001 From: Priya Date: Mon, 21 Oct 2013 17:07:46 +0530 Subject: [PATCH 11/26] [docs] item tax added --- docs/user/setup/docs.user.setup.taxes.md | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/docs/user/setup/docs.user.setup.taxes.md b/docs/user/setup/docs.user.setup.taxes.md index 91ed5916e3..7043429096 100644 --- a/docs/user/setup/docs.user.setup.taxes.md +++ b/docs/user/setup/docs.user.setup.taxes.md @@ -7,14 +7,18 @@ One of the primary motivator for compulsory use of accounting tools is calculati ### 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. + +## 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. + +![Item Tax](img/item-tax-1.png) + -- **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) - **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 @@ You must usually collect taxes from your Customer and pay them to the government 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 @@ The tax rate you define here will be the standard tax rate for all Items. If the 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). From fb21c560786324c02527ac25fd215fe50690c502 Mon Sep 17 00:00:00 2001 From: Maxwell Date: Mon, 21 Oct 2013 17:29:18 -0200 Subject: [PATCH 12/26] Fix UnicodeDecodeError Traceback (most recent call last): File "./lib/wnf.py", line 590, in run() File "./lib/wnf.py", line 314, in run build.bundle(False, cms_make) File "/home/maxwell/erp/lib/webnotes/build.py", line 27, in bundle on_build() File "app/startup/event_handlers.py", line 69, in on_build File "app/home/page/latest_updates/latest_updates.py", line 42, in make File "app/home/page/latest_updates/latest_updates.py", line 18, in add_to_logs UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 9: ordinal not in range(128) --- home/page/latest_updates/latest_updates.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/home/page/latest_updates/latest_updates.py b/home/page/latest_updates/latest_updates.py index 4eb208f952..b4e3f440a9 100644 --- a/home/page/latest_updates/latest_updates.py +++ b/home/page/latest_updates/latest_updates.py @@ -14,6 +14,7 @@ def make(): out.seek(0) last_commit = None for l in out.readlines(): + l = l.decode('utf-8') if last_commit is not None: if l.startswith("Date:"): last_commit["date"] = l[8:-1] @@ -59,4 +60,4 @@ def make(): lufile.write(json.dumps(logs, indent=1, sort_keys=True)) if __name__=="__main__": - make() \ No newline at end of file + make() From 6a589be1c5d57467a4b83b49232922192083e09b Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 22 Oct 2013 10:54:59 +0530 Subject: [PATCH 13/26] [patch] remove sales and purchase return tool --- .../march_2013/p06_remove_sales_purchase_return_tool.py | 6 ++++-- .../p03_remove_sales_and_purchase_return_tool.py | 8 ++++++++ patches/patch_list.py | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 patches/october_2013/p03_remove_sales_and_purchase_return_tool.py 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 ed8fbc87fd..ac11eccc0a 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_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 0000000000..e0965ab0a0 --- /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/patch_list.py b/patches/patch_list.py index 0b27a2e0d8..e353ab628a 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -224,4 +224,5 @@ patch_list = [ "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", ] \ No newline at end of file From 1500c83cce68b9dd0214bfcaa22c812c3ef27ffd Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 22 Oct 2013 11:42:50 +0530 Subject: [PATCH 14/26] -am --- patches/october_2013/p04_update_report_permission.py | 9 +++++++++ patches/patch_list.py | 1 + 2 files changed, 10 insertions(+) create mode 100644 patches/october_2013/p04_update_report_permission.py 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 0000000000..1a9f99d533 --- /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/patch_list.py b/patches/patch_list.py index e353ab628a..11bb8dc7fd 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -225,4 +225,5 @@ patch_list = [ "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", ] \ No newline at end of file From 49f9e284ffdac2f48ab152221ebba1ac6926968d Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 22 Oct 2013 12:11:20 +0530 Subject: [PATCH 15/26] [report] lead details --- selling/page/selling_home/selling_home.js | 5 +++++ selling/report/lead_details/__init__.py | 0 selling/report/lead_details/lead_details.txt | 22 ++++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 selling/report/lead_details/__init__.py create mode 100644 selling/report/lead_details/lead_details.txt diff --git a/selling/page/selling_home/selling_home.js b/selling/page/selling_home/selling_home.js index a69e50b06b..4981ee77f5 100644 --- a/selling/page/selling_home/selling_home.js +++ b/selling/page/selling_home/selling_home.js @@ -167,6 +167,11 @@ wn.module_page["Selling"] = [ right: true, 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", diff --git a/selling/report/lead_details/__init__.py b/selling/report/lead_details/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/selling/report/lead_details/lead_details.txt b/selling/report/lead_details/lead_details.txt new file mode 100644 index 0000000000..6da9b79c49 --- /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 From cf8ae7c3d970ccf80e88f70fe35a440c8a31841a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 22 Oct 2013 12:57:19 +0530 Subject: [PATCH 16/26] [fix] [minor] perpetual inventory related --- controllers/stock_controller.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/controllers/stock_controller.py b/controllers/stock_controller.py index d4c92a90a7..54b6d9f983 100644 --- a/controllers/stock_controller.py +++ b/controllers/stock_controller.py @@ -91,9 +91,6 @@ class StockController(AccountsController): 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 From 145e5e26fa0e0f4dbff051b42eaddc33ef9e2255 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 22 Oct 2013 23:51:41 +0530 Subject: [PATCH 17/26] [patch] delete gl entries for cancelled vouchers --- controllers/stock_controller.py | 20 +++++++++---------- ...elete_gl_entries_for_cancelled_vouchers.py | 17 ++++++++++++++++ patches/patch_list.py | 1 + 3 files changed, 27 insertions(+), 11 deletions(-) create mode 100644 patches/october_2013/p05_delete_gl_entries_for_cancelled_vouchers.py diff --git a/controllers/stock_controller.py b/controllers/stock_controller.py index 54b6d9f983..359dc9e86f 100644 --- a/controllers/stock_controller.py +++ b/controllers/stock_controller.py @@ -12,18 +12,17 @@ from accounts.general_ledger import make_gl_entries, delete_gl_entries 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): @@ -96,7 +95,6 @@ class StockController(AccountsController): 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/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 0000000000..ebe7a695f3 --- /dev/null +++ b/patches/october_2013/p05_delete_gl_entries_for_cancelled_vouchers.py @@ -0,0 +1,17 @@ +# 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: + print entry + 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 11bb8dc7fd..565ff9915f 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -226,4 +226,5 @@ patch_list = [ "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 From decf51de4a4c2761151cd4e060b36846bdb07d75 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 22 Oct 2013 23:55:34 +0530 Subject: [PATCH 18/26] [patch] delete gl entries for cancelled vouchers --- patches/october_2012/fix_cancelled_gl_entries.py | 1 + 1 file changed, 1 insertion(+) diff --git a/patches/october_2012/fix_cancelled_gl_entries.py b/patches/october_2012/fix_cancelled_gl_entries.py index b610985dcd..475ea1c053 100644 --- a/patches/october_2012/fix_cancelled_gl_entries.py +++ b/patches/october_2012/fix_cancelled_gl_entries.py @@ -11,6 +11,7 @@ def execute(): 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'])) From 688c2ef588ea14d26b3d2c34aecaca7d1d578898 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 23 Oct 2013 00:26:53 +0530 Subject: [PATCH 19/26] [patch] delete gl entries for cancelled vouchers --- .../october_2013/p05_delete_gl_entries_for_cancelled_vouchers.py | 1 - 1 file changed, 1 deletion(-) 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 index ebe7a695f3..1d8657abb3 100644 --- a/patches/october_2013/p05_delete_gl_entries_for_cancelled_vouchers.py +++ b/patches/october_2013/p05_delete_gl_entries_for_cancelled_vouchers.py @@ -10,7 +10,6 @@ def execute(): 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: - print entry webnotes.conn.sql("""delete from `tabGL Entry` where voucher_type = %s and voucher_no = %s""", (entry['voucher_type'], entry['voucher_no'])) except: From 4ed7f6834452f97b0f15c83ee0ac346217a7208e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 23 Oct 2013 11:50:09 +0530 Subject: [PATCH 20/26] [utility] repost stock --- setup/doctype/global_defaults/global_defaults.txt | 9 +-------- utilities/repost_stock.py | 7 +++++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/setup/doctype/global_defaults/global_defaults.txt b/setup/doctype/global_defaults/global_defaults.txt index fbfa8ca14d..a8a80b1045 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" }, @@ -175,13 +175,6 @@ "options": "Standard\nClassic\nModern\nSpartan", "read_only": 0 }, - { - "doctype": "DocField", - "fieldname": "hr", - "fieldtype": "Section Break", - "label": "HR", - "read_only": 0 - }, { "doctype": "DocPerm" } diff --git a/utilities/repost_stock.py b/utilities/repost_stock.py index 735930486e..e2ecdeeb9b 100644 --- a/utilities/repost_stock.py +++ b/utilities/repost_stock.py @@ -13,8 +13,11 @@ def repost(): """ 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`)"""): + repost_stock(d[0], d[1]) webnotes.conn.auto_commit_on_many_writes = 0 From c2caae53dd93219b7cafb2a75dbf9b37b2f508e2 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 23 Oct 2013 12:02:08 +0530 Subject: [PATCH 21/26] [utility] repost stock --- utilities/repost_stock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/repost_stock.py b/utilities/repost_stock.py index e2ecdeeb9b..136a7620b5 100644 --- a/utilities/repost_stock.py +++ b/utilities/repost_stock.py @@ -16,7 +16,7 @@ def repost(): 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`)"""): + select item_code, warehouse from `tabStock Ledger Entry`) a"""): repost_stock(d[0], d[1]) webnotes.conn.auto_commit_on_many_writes = 0 From 5048c98911b430af899a423a73f74214674235b7 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 23 Oct 2013 12:14:32 +0530 Subject: [PATCH 22/26] [utility] repost stock --- utilities/repost_stock.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utilities/repost_stock.py b/utilities/repost_stock.py index 136a7620b5..536df81e8b 100644 --- a/utilities/repost_stock.py +++ b/utilities/repost_stock.py @@ -34,7 +34,10 @@ def repost_stock(item_code, warehouse): 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(""" From d32b6a8d323dcdc55aa169dc771f918d9201e929 Mon Sep 17 00:00:00 2001 From: Akhilesh Darjee Date: Wed, 23 Oct 2013 14:03:46 +0530 Subject: [PATCH 23/26] [fix] production order transfer raw material to fetch all necessary data --- stock/doctype/stock_entry/stock_entry.js | 9 ++++- stock/doctype/stock_entry/stock_entry.py | 33 ++++++++++++++----- .../stock_entry_detail/stock_entry_detail.txt | 8 ++++- 3 files changed, 40 insertions(+), 10 deletions(-) diff --git a/stock/doctype/stock_entry/stock_entry.js b/stock/doctype/stock_entry/stock_entry.js index 7301bd5b1a..b471256dd9 100644 --- a/stock/doctype/stock_entry/stock_entry.js +++ b/stock/doctype/stock_entry/stock_entry.js @@ -144,11 +144,18 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ }, 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 e4fa9d9a63..56808a4f01 100644 --- a/stock/doctype/stock_entry/stock_entry.py +++ b/stock/doctype/stock_entry/stock_entry.py @@ -472,11 +472,12 @@ class DocType(StockController): 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 @@ class DocType(StockController): }, bom_no=self.doc.bom_no) self.get_stock_and_rate() - def get_bom_raw_materials(self, qty): """ @@ -503,9 +503,12 @@ class DocType(StockController): 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 @@ class DocType(StockController): 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 @@ class DocType(StockController): # 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,21 @@ class DocType(StockController): return issued_item_qty def add_to_stock_entry_detail(self, item_dict, bom_no=None): + idx = 1 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"] + se_child.cost_center = item_dict[d]["cost_center"] # in stock uom se_child.transfer_qty = flt(item_dict[d]["qty"]) @@ -617,6 +631,9 @@ class DocType(StockController): # 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 +699,8 @@ class DocType(StockController): @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 b766250670..4721747965 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 13:46:52", "modified_by": "Administrator", "owner": "Administrator" }, @@ -65,6 +65,12 @@ "reqd": 1, "search_index": 1 }, + { + "doctype": "DocField", + "fieldname": "item_name", + "fieldtype": "Data", + "label": "Item Name" + }, { "doctype": "DocField", "fieldname": "description", From 2cdeb3bb7a344ac428d7ee6d09a9d794939bf2f3 Mon Sep 17 00:00:00 2001 From: Akhilesh Darjee Date: Wed, 23 Oct 2013 14:46:07 +0530 Subject: [PATCH 24/26] [fix] [minor] if difference account blank then fetch from company --- stock/doctype/stock_entry/stock_entry.py | 6 ++++-- stock/doctype/stock_entry_detail/stock_entry_detail.txt | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/stock/doctype/stock_entry/stock_entry.py b/stock/doctype/stock_entry/stock_entry.py index 56808a4f01..39c5b4db90 100644 --- a/stock/doctype/stock_entry/stock_entry.py +++ b/stock/doctype/stock_entry/stock_entry.py @@ -621,8 +621,10 @@ class DocType(StockController): 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"] - se_child.cost_center = item_dict[d]["cost_center"] + se_child.expense_account = item_dict[d]["expense_account"] or \ + webnotes.conn.get_value("Company", self.doc.company, "default_expense_account") + se_child.cost_center = item_dict[d]["cost_center"] or \ + webnotes.conn.get_value("Company", self.doc.company, "cost_center") # in stock uom se_child.transfer_qty = flt(item_dict[d]["qty"]) diff --git a/stock/doctype/stock_entry_detail/stock_entry_detail.txt b/stock/doctype/stock_entry_detail/stock_entry_detail.txt index 4721747965..5218c1a4ed 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-23 13:46:52", + "modified": "2013-10-23 14:35:46", "modified_by": "Administrator", "owner": "Administrator" }, @@ -69,7 +69,9 @@ "doctype": "DocField", "fieldname": "item_name", "fieldtype": "Data", - "label": "Item Name" + "label": "Item Name", + "print_hide": 1, + "read_only": 1 }, { "doctype": "DocField", From 97e55710dadbc259e1ee948329f4a8f55ee6ca0b Mon Sep 17 00:00:00 2001 From: Akhilesh Darjee Date: Wed, 23 Oct 2013 15:22:22 +0530 Subject: [PATCH 25/26] [fix] [minor] get_items function fix --- stock/doctype/stock_entry/stock_entry.py | 9 +++++---- stock/page/stock_home/stock_home.js | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/stock/doctype/stock_entry/stock_entry.py b/stock/doctype/stock_entry/stock_entry.py index 39c5b4db90..7ec2ba32bd 100644 --- a/stock/doctype/stock_entry/stock_entry.py +++ b/stock/doctype/stock_entry/stock_entry.py @@ -609,6 +609,9 @@ class DocType(StockController): 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) @@ -621,10 +624,8 @@ class DocType(StockController): 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 \ - webnotes.conn.get_value("Company", self.doc.company, "default_expense_account") - se_child.cost_center = item_dict[d]["cost_center"] or \ - webnotes.conn.get_value("Company", self.doc.company, "cost_center") + 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"]) diff --git a/stock/page/stock_home/stock_home.js b/stock/page/stock_home/stock_home.js index 713fe28296..ecfc6fe571 100644 --- a/stock/page/stock_home/stock_home.js +++ b/stock/page/stock_home/stock_home.js @@ -81,7 +81,7 @@ wn.module_page["Stock"] = [ }, { "doctype":"Item Price", - "label": wn._("Price List"), + "label": wn._("Item Price"), "description": wn._("Multiple Item prices.") }, { From 88f3cd5bf33c8fc433f65ba65f90d12b3a8b636b Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 23 Oct 2013 16:29:19 +0530 Subject: [PATCH 26/26] [fix] [minor] gl entry negative debit/credit --- accounts/general_ledger.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/accounts/general_ledger.py b/accounts/general_ledger.py index 995fdc061b..b0c585a3a3 100644 --- a/accounts/general_ledger.py +++ b/accounts/general_ledger.py @@ -30,8 +30,12 @@ def process_gl_map(gl_map, merge_entries=True): 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