Merge branch 'hotfix'

This commit is contained in:
Nabin Hait 2016-10-31 16:37:29 +05:30
commit 6ece870b6e
15 changed files with 91 additions and 24 deletions

View File

@ -2,7 +2,7 @@
from __future__ import unicode_literals from __future__ import unicode_literals
import frappe import frappe
__version__ = '7.1.2' __version__ = '7.1.3'
def get_default_company(user=None): def get_default_company(user=None):
'''Get default company for user''' '''Get default company for user'''

View File

@ -305,24 +305,7 @@ class PurchaseInvoice(BuyingController):
if not self.grand_total: if not self.grand_total:
return return
self.auto_accounting_for_stock = \ gl_entries = self.get_gl_entries()
cint(frappe.defaults.get_global_default("auto_accounting_for_stock"))
self.stock_received_but_not_billed = self.get_company_default("stock_received_but_not_billed")
self.expenses_included_in_valuation = self.get_company_default("expenses_included_in_valuation")
self.negative_expense_to_be_booked = 0.0
gl_entries = []
self.make_supplier_gl_entry(gl_entries)
self.make_item_gl_entries(gl_entries)
self.make_tax_gl_entries(gl_entries)
gl_entries = merge_similar_entries(gl_entries)
self.make_payment_gl_entries(gl_entries)
self.make_write_off_gl_entry(gl_entries)
if gl_entries: if gl_entries:
update_outstanding = "No" if (cint(self.is_paid) or self.write_off_account) else "Yes" update_outstanding = "No" if (cint(self.is_paid) or self.write_off_account) else "Yes"
@ -342,6 +325,26 @@ class PurchaseInvoice(BuyingController):
elif self.docstatus == 2 and cint(self.update_stock) and self.auto_accounting_for_stock: elif self.docstatus == 2 and cint(self.update_stock) and self.auto_accounting_for_stock:
delete_gl_entries(voucher_type=self.doctype, voucher_no=self.name) delete_gl_entries(voucher_type=self.doctype, voucher_no=self.name)
def get_gl_entries(self, warehouse_account=None):
self.auto_accounting_for_stock = \
cint(frappe.defaults.get_global_default("auto_accounting_for_stock"))
self.stock_received_but_not_billed = self.get_company_default("stock_received_but_not_billed")
self.expenses_included_in_valuation = self.get_company_default("expenses_included_in_valuation")
self.negative_expense_to_be_booked = 0.0
gl_entries = []
self.make_supplier_gl_entry(gl_entries)
self.make_item_gl_entries(gl_entries)
self.make_tax_gl_entries(gl_entries)
gl_entries = merge_similar_entries(gl_entries)
self.make_payment_gl_entries(gl_entries)
self.make_write_off_gl_entry(gl_entries)
return gl_entries
def make_supplier_gl_entry(self, gl_entries): def make_supplier_gl_entry(self, gl_entries):
if self.grand_total: if self.grand_total:

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 KiB

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

View File

@ -69,6 +69,25 @@ ready to make the Payment. Payment process is divided into 3 steps -
Submit the document to finalise the record. After the document is submitted, Submit the document to finalise the record. After the document is submitted,
you can either print or email it directly to the customer. you can either print or email it directly to the customer.
### Write off Amount
Outstanding amount can be write off from the POS, user has to enter the amount under write off field on the payment screen.
<img class="screenshot" alt="POS Payment" src="{{docs_base_url}}/assets/img/accounts/write-off.png">
System books the write off amount into the ledger which has selected on the POS Profile.
### Change Amount
POS calculate the extra amount paid by the customer, which user can return from the cash account. User has to set the account for the change amount on the POS profile.
<img class="screenshot" alt="POS Payment" src="{{docs_base_url}}/assets/img/accounts/change-amount.png">
### Offline Records
All the records from the POS stores into the browser's local storegae and sync submitted records after every minute of the interval if system is connected to internet. User can view the offline records by clicking on Menu > View Offline Records
<img class="screenshot" alt="POS Payment" src="{{docs_base_url}}/assets/img/accounts/offline-records.png">
#### Accounting entries (GL Entry) for a Point of Sale: #### Accounting entries (GL Entry) for a Point of Sale:
Debits: Debits:
@ -82,6 +101,7 @@ Credits:
* Taxes (liabilities to be paid to the government) * Taxes (liabilities to be paid to the government)
* Customer (payment) * Customer (payment)
* Write Off (optional) * Write Off (optional)
* Account for Change Amount (optional)
To see entries after “Submit”, click on “View Ledger”. To see entries after “Submit”, click on “View Ledger”.

View File

@ -79,4 +79,31 @@ Check to Disable Pricing Rule.
<img alt="Disable" class="screenshot" src="{{docs_base_url}}/assets/img/articles/pricing-rule-disable.png"> <img alt="Disable" class="screenshot" src="{{docs_base_url}}/assets/img/articles/pricing-rule-disable.png">
### Add Margin
Using pricing rule user can add margin on the sales transactions
For example : User want to add 10% margin on the supplier price list at the time of sales
####1. Make Price List
Create price list for supllier and create item price against the price list.
<img alt="Disable" class="screenshot" src="{{docs_base_url}}/assets/img/articles/price-list.png">
####2. Make Pricing Rule
Create pricing rule for the item against which supplier rate has created
<img alt="Disable" class="screenshot" src="{{docs_base_url}}/assets/img/articles/pricing-rule-margin.png">
####2. Make Invoice
System apply the margin rate on the item price on selection of an item.
<img alt="Disable" class="screenshot" src="{{docs_base_url}}/assets/img/articles/pricing-rule-invoice.png">
For more details about pricing rule [Click Here]({{docs_base_url}}/user/manual/en/selling/articles/adding-margin.html)
<!-- markdown --> <!-- markdown -->

View File

@ -9,7 +9,7 @@ To setup Pricing Rule, go to:
####Adding Margin in Pricing Rule ####Adding Margin in Pricing Rule
<img alt="Adding Margin in Pricing Rule" class="screenshot" src="{{docs_base_url}}/assets/img/articles/margin-pricing-rule.png"> <img alt="Adding Margin in Pricing Rule" class="screenshot" src="{{docs_base_url}}/assets/img/selling/margin-pricing-rule.png">
Total Margin is calculated as follows: Total Margin is calculated as follows:
`Rate = Price List Rate + Margin Rate` `Rate = Price List Rate + Margin Rate`
@ -22,7 +22,7 @@ To add Price List, go to:
####Adding Item Price ####Adding Item Price
<img alt="Adding Margin in Pricing Rule" class="screenshot" src="{{docs_base_url}}/assets/img/articles/margin-item-price-list.png"> <img alt="Adding Margin in Pricing Rule" class="screenshot" src="{{docs_base_url}}/assets/img/selling/margin-item-price-list.png">
2) Apply margin direct on Item: If user wants to apply the margin without pricing rule, they can use this option. In Quotation Item and Sales Order Item, user can select the margin type and rate or amount. The system will calculate the margin and apply it on price list rate to calculate the rate of the product. 2) Apply margin direct on Item: If user wants to apply the margin without pricing rule, they can use this option. In Quotation Item and Sales Order Item, user can select the margin type and rate or amount. The system will calculate the margin and apply it on price list rate to calculate the rate of the product.
@ -34,4 +34,4 @@ add item and scroll down to section where you can find the Margin Type
####Adding Margin in Quotation ####Adding Margin in Quotation
<img alt="Adding Margin in Quotation" class="screenshot" src="{{docs_base_url}}/assets/img/articles/margin-quotation-item.png"> <img alt="Adding Margin in Quotation" class="screenshot" src="{{docs_base_url}}/assets/img/selling/margin-quotation-item.png">

View File

@ -342,3 +342,4 @@ erpnext.patches.v7_0.repost_bin_qty_and_item_projected_qty
erpnext.patches.v7_1.set_prefered_contact_email erpnext.patches.v7_1.set_prefered_contact_email
execute:frappe.db.sql("update `tabSingles` set value = 1 where field = 'unlink_payment_on_cancellation_of_invoice' and doctype = 'Accounts Settings'") execute:frappe.db.sql("update `tabSingles` set value = 1 where field = 'unlink_payment_on_cancellation_of_invoice' and doctype = 'Accounts Settings'")
execute:frappe.db.sql("update `tabStock Entry` set total_amount = null where purpose in('Repack', 'Manufacture')") execute:frappe.db.sql("update `tabStock Entry` set total_amount = null where purpose in('Repack', 'Manufacture')")
erpnext.patches.v7_1.repost_gle_for_pi_with_update_stock

View File

@ -0,0 +1,16 @@
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cint
def execute():
if not cint(frappe.defaults.get_global_default("auto_accounting_for_stock")):
return
for pi in frappe.db.sql("""select name from `tabPurchase Invoice`
where update_stock=1 and docstatus=1 order by posting_date asc""", as_dict=1):
pi_doc = frappe.get_doc("Purchase Invoice", pi.name)
pi_doc.make_gl_entries()
frappe.db.commit()