Compare commits

..

11 Commits

Author SHA1 Message Date
mbauskar
9fbdf14e61 Merge branch 'hotfix' 2017-07-05 11:25:14 +05:30
mbauskar
4b7a30b527 bumped to version 8.2.4 2017-07-05 11:55:14 +06:00
rohitwaghchaure
10a4a13e5e Remove gst reports for non indian accounts (#9553)
* remove gst reports for non indian accounts

* [Fix] GSN code auto name
2017-07-04 16:45:29 +05:30
rohitwaghchaure
e5ca48a76a [fix] Don't update the sales invoice number into the serial no if update stock is disabled in the invoice (#9593) 2017-07-04 10:54:23 +05:30
rohitwaghchaure
3e4bcfe2d8 [Fix] Opening Entry, Unknown column 'warehouse' in 'where clause' (#9585)
* [Fix] Opening Entry, Unknown column 'warehouse' in 'where clause'

* escaped company name in get_opening_accounts
2017-07-04 10:49:37 +05:30
mbauskar
ea92682cfd Merge branch 'hotfix' 2017-07-01 14:16:46 +05:30
mbauskar
af9d3a4db6 bumped to version 8.2.3 2017-07-01 14:46:46 +06:00
Makarand Bauskar
f39a9f1c5b Merge pull request #9562 from mbauskar/gst-hsn-code
[minor] fix autoname for GST HSN Code (#9536)
2017-07-01 14:15:18 +05:30
Sagar Vora
067991ee30 [minor] fix autoname for GST HSN Code (#9536) 2017-07-01 14:14:14 +05:30
rohitwaghchaure
6691856d08 Merge pull request #9554 from mbauskar/sales-register
[minor] fixed AttributeError: 'dict' object has no attribute 'company' in sales register
2017-06-30 16:48:10 +05:30
mbauskar
22aaf0cbd0 [minor] fixed AttributeError: 'dict' object has no attribute 'company' in sales register 2017-06-30 16:43:25 +05:30
10 changed files with 44 additions and 21 deletions

View File

@@ -2,7 +2,7 @@
from __future__ import unicode_literals
import frappe
__version__ = '8.2.2'
__version__ = '8.2.4'
def get_default_company(user=None):

View File

@@ -733,11 +733,10 @@ def get_opening_accounts(company):
accounts = frappe.db.sql_list("""select
name from tabAccount
where
is_group=0 and
report_type='Balance Sheet' and
ifnull(warehouse, '') = '' and
company=%s
order by name asc""", company)
is_group=0 and report_type='Balance Sheet' and company=%s and
name not in(select distinct account from tabWarehouse where
account is not null and account != '')
order by name asc""", frappe.db.escape(company))
return [{"account": a, "balance": get_balance_on(a)} for a in accounts]

View File

@@ -324,10 +324,12 @@ cur_frm.cscript.hide_fields = function(doc) {
}
}
/*
var item_fields_stock = ['batch_no', 'actual_batch_qty', 'actual_qty', 'expense_account',
'warehouse', 'expense_account', 'quality_inspection']
cur_frm.fields_dict['items'].grid.set_column_disp(item_fields_stock,
(cint(doc.update_stock)==1 || cint(doc.is_return)==1 ? true : false));
*/
// India related fields
if (frappe.boot.sysdefaults.country == 'India') unhide_field(['c_form_applicable', 'c_form_no']);

View File

@@ -131,6 +131,8 @@ class SalesInvoice(SellingController):
if not self.is_return:
self.update_billing_status_for_zero_amount_refdoc("Sales Order")
self.check_credit_limit()
if self.update_stock:
self.update_serial_no()
if not cint(self.is_pos) == 1 and not self.is_return:
@@ -793,19 +795,18 @@ class SalesInvoice(SellingController):
def update_serial_no(self, in_cancel=False):
""" update Sales Invoice refrence in Serial No """
invoice = None if (in_cancel or self.is_return) else self.name
if in_cancel and self.is_return:
invoice = self.return_against
for item in self.items:
if not item.serial_no:
continue
serial_nos = ["'%s'"%serial_no for serial_no in item.serial_no.split("\n")]
frappe.db.sql(""" update `tabSerial No` set sales_invoice='{invoice}'
where name in ({serial_nos})""".format(
invoice='' if in_cancel else self.name,
serial_nos=",".join(serial_nos)
)
)
for serial_no in item.serial_no.split("\n"):
sno = frappe.get_doc('Serial No', serial_no)
sno.sales_invoice = invoice
sno.db_update()
def validate_serial_numbers(self):
"""

View File

@@ -1423,7 +1423,7 @@
"collapsible": 1,
"collapsible_depends_on": "eval:doc.serial_no || doc.batch_no",
"columns": 0,
"depends_on": "eval: parent.update_stock",
"depends_on": "",
"fieldname": "warehouse_and_reference",
"fieldtype": "Section Break",
"hidden": 0,
@@ -2165,7 +2165,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2017-05-10 17:14:42.681757",
"modified": "2017-07-03 19:34:14.820285",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Item",

View File

@@ -24,7 +24,7 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum
"fieldtype": "Data",
"width": 80
})
company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
company_currency = frappe.db.get_value("Company", filters.get("company"), "default_currency")
mode_of_payments = get_mode_of_payments(set([d.parent for d in item_list]))
data = []

View File

@@ -26,7 +26,7 @@ def _execute(filters, additional_table_columns=None, additional_query_columns=No
invoice_so_dn_map = get_invoice_so_dn_map(invoice_list)
customers = list(set([inv.customer for inv in invoice_list]))
customer_map = get_customer_details(customers)
company_currency = frappe.db.get_value("Company", filters.company, "default_currency")
company_currency = frappe.db.get_value("Company", filters.get("company"), "default_currency")
mode_of_payments = get_mode_of_payments([inv.name for inv in invoice_list])
data = []

View File

@@ -409,3 +409,5 @@ erpnext.patches.v8_0.update_sales_cost_in_project
erpnext.patches.v8_0.save_system_settings
erpnext.patches.v8_1.delete_deprecated_reports
erpnext.patches.v8_1.setup_gst_india #2017-06-27
execute:frappe.reload_doc('regional', 'doctype', 'gst_hsn_code')
erpnext.patches.v8_1.removed_roles_from_gst_report_non_indian_account

View File

@@ -0,0 +1,18 @@
# Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doc('core', 'doctype', 'has_role')
company = frappe.get_all('Company', filters = {'country': 'India'})
if not company:
frappe.db.sql("""
delete from
`tabHas Role`
where
parenttype = 'Report' and parent in('GST Sales Register',
'GST Purchase Register', 'GST Itemised Sales Register',
'GST Itemised Purchase Register')""")

View File

@@ -3,7 +3,7 @@
"allow_guest_to_view": 0,
"allow_import": 0,
"allow_rename": 0,
"autoname": "fieldname:hsn_code",
"autoname": "field:hsn_code",
"beta": 0,
"creation": "2017-06-21 10:48:56.422086",
"custom": 0,
@@ -84,7 +84,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-06-21 13:27:59.149202",
"modified": "2017-06-30 20:12:57.903983",
"modified_by": "Administrator",
"module": "Regional",
"name": "GST HSN Code",
@@ -94,10 +94,11 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"search_fields": "description",
"search_fields": "hsn_code, description",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "hsn_code",
"track_changes": 1,
"track_seen": 0
}