Merge branch 'staging-fixes' into staging

This commit is contained in:
Ameya Shenoy 2018-10-05 09:09:53 +00:00
commit 29fe8ce114
No known key found for this signature in database
GPG Key ID: AC016A555657D0A3
13 changed files with 561 additions and 529 deletions

View File

@ -5,7 +5,7 @@ import frappe
from erpnext.hooks import regional_overrides from erpnext.hooks import regional_overrides
from frappe.utils import getdate from frappe.utils import getdate
__version__ = '10.1.55' __version__ = '10.1.56'
def get_default_company(user=None): def get_default_company(user=None):
'''Get default company for user''' '''Get default company for user'''

View File

@ -24,7 +24,7 @@ frappe.ui.form.on("Journal Entry", {
}, "fa fa-table"); }, "fa fa-table");
} }
if(frm.doc.docstatus==1 && frm.doc.naming_series=="JV-") { if(frm.doc.docstatus==1) {
frm.add_custom_button(__('Reverse Journal Entry'), function() { frm.add_custom_button(__('Reverse Journal Entry'), function() {
return erpnext.journal_entry.reverse_journal_entry(frm); return erpnext.journal_entry.reverse_journal_entry(frm);
}); });

View File

@ -8,6 +8,7 @@ frappe.query_reports["TDS Computation Summary"] = {
"fieldname":"company", "fieldname":"company",
"label": __("Company"), "label": __("Company"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Company",
"default": frappe.defaults.get_default('company') "default": frappe.defaults.get_default('company')
}, },
{ {

View File

@ -41,8 +41,10 @@ def get_result(filters):
for supplier in filters.supplier: for supplier in filters.supplier:
tds = frappe.get_doc("Tax Withholding Category", supplier.tax_withholding_category) tds = frappe.get_doc("Tax Withholding Category", supplier.tax_withholding_category)
rate = [d.tax_withholding_rate for d in tds.rates if d.fiscal_year == filters.fiscal_year][0] rate = [d.tax_withholding_rate for d in tds.rates if d.fiscal_year == filters.fiscal_year][0]
account = [d.account for d in tds.accounts if d.company == filters.company][0] try:
account = [d.account for d in tds.accounts if d.company == filters.company][0]
except IndexError:
account = []
total_invoiced_amount, tds_deducted = get_invoice_and_tds_amount(supplier.name, account, total_invoiced_amount, tds_deducted = get_invoice_and_tds_amount(supplier.name, account,
filters.company, filters.from_date, filters.to_date) filters.company, filters.from_date, filters.to_date)

View File

@ -5,10 +5,19 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from frappe.utils.nestedset import NestedSet from frappe.utils.nestedset import NestedSet
import frappe
class HealthcareServiceUnit(NestedSet): class HealthcareServiceUnit(NestedSet):
nsm_parent_field = 'parent_healthcare_service_unit' nsm_parent_field = 'parent_healthcare_service_unit'
def autoname(self):
if self.company:
suffix = " - " + frappe.get_cached_value('Company', self.company, "abbr")
if not self.healthcare_service_unit_name.endswith(suffix):
self.name = self.healthcare_service_unit_name + suffix
else:
self.name = self.healthcare_service_unit_name
def on_update(self): def on_update(self):
super(HealthcareServiceUnit, self).on_update() super(HealthcareServiceUnit, self).on_update()
self.validate_one_root() self.validate_one_root()

View File

@ -142,6 +142,7 @@ frappe.ui.form.on('Patient Appointment', {
frm.set_value('service_unit', btn_selected.attr('data-service-unit') || ''); frm.set_value('service_unit', btn_selected.attr('data-service-unit') || '');
frm.set_value('duration', btn_selected.attr('data-duration')); frm.set_value('duration', btn_selected.attr('data-duration'));
d.hide(); d.hide();
frm.enable_save();
frm.save(); frm.save();
frm.enable_save(); frm.enable_save();
} }

View File

@ -12,7 +12,7 @@ app_license = "GNU General Public License (v3)"
source_link = "https://github.com/frappe/erpnext" source_link = "https://github.com/frappe/erpnext"
develop_version = '11.x.x-develop' develop_version = '11.x.x-develop'
staging_version = '11.0.3-beta.4' staging_version = '11.0.3-beta.5'
error_report_email = "support@erpnext.com" error_report_email = "support@erpnext.com"

View File

@ -15,7 +15,7 @@ def execute():
frappe.reload_doc('accounts', 'doctype', 'loyalty_program') frappe.reload_doc('accounts', 'doctype', 'loyalty_program')
frappe.reload_doc('accounts', 'doctype', 'sales_invoice_item') frappe.reload_doc('accounts', 'doctype', 'sales_invoice_item')
if "healthcare" not in frappe.get_active_domains(): if "Healthcare" not in frappe.get_active_domains():
return return
healthcare_custom_field_in_sales_invoice() healthcare_custom_field_in_sales_invoice()
@ -34,24 +34,25 @@ def execute():
frappe.reload_doc(get_doctype_module("Sales Invoice"), 'doctype', 'sales_invoice') frappe.reload_doc(get_doctype_module("Sales Invoice"), 'doctype', 'sales_invoice')
for doc_id in doc_list: for doc_id in doc_list:
invoice_id = frappe.db.get_value(si_ref_doc, doc_id[0], sales_invoice_referenced_doc[si_ref_doc]) invoice_id = frappe.db.get_value(si_ref_doc, doc_id[0], sales_invoice_referenced_doc[si_ref_doc])
invoice = frappe.get_doc("Sales Invoice", invoice_id) if frappe.db.exists("Sales Invoice", invoice_id):
if invoice.items: if si_ref_doc == "Lab Test":
marked = False template = frappe.db.get_value("Lab Test", doc_id[0], "template")
if not marked: if template:
item = frappe.db.get_value("Lab Test Template", template, "item")
if item:
frappe.db.sql("""update `tabSales Invoice Item` set reference_dt = '{0}',
reference_dn = '{1}' where parent = '{2}' and item_code='{3}'""".format\
(si_ref_doc, doc_id[0], invoice_id, item))
else:
invoice = frappe.get_doc("Sales Invoice", invoice_id)
for item_line in invoice.items: for item_line in invoice.items:
marked = True if not item_line.reference_dn:
frappe.db.sql(""" item_line.db_set({"reference_dt":si_ref_doc, "reference_dn": doc_id[0]})
update `tabSales Invoice Item` break
set reference_dt = '{0}', reference_dn = '{1}'
where name = '{2}'
""".format(si_ref_doc, doc_id[0], item_line.name))
# Documents mark invoiced for submitted sales invoice # Documents mark invoiced for submitted sales invoice
frappe.db.sql(""" frappe.db.sql("""update `tab{0}` doc, `tabSales Invoice` si
update `tab{0}` doc, `tabSales Invoice` si set doc.invoiced = 1 where si.docstatus = 1 and doc.{1} = si.name
set doc.invoiced = 1 """.format(si_ref_doc, sales_invoice_referenced_doc[si_ref_doc]))
where si.docstatus = 1 and doc.{1} = si.name
""".format(si_ref_doc, sales_invoice_referenced_doc[si_ref_doc]))
def healthcare_custom_field_in_sales_invoice(): def healthcare_custom_field_in_sales_invoice():
frappe.reload_doc('healthcare', 'doctype', 'patient') frappe.reload_doc('healthcare', 'doctype', 'patient')

View File

@ -7,7 +7,6 @@
"doctype": "Report", "doctype": "Report",
"idx": 0, "idx": 0,
"is_standard": "Yes", "is_standard": "Yes",
"letter_head": "test",
"modified": "2018-01-02 17:56:15.379347", "modified": "2018-01-02 17:56:15.379347",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Regional", "module": "Regional",
@ -27,4 +26,4 @@
"role": "Auditor" "role": "Auditor"
} }
] ]
} }

View File

@ -14,7 +14,7 @@ def get_data():
'transactions': [ 'transactions': [
{ {
'label': _('Related'), 'label': _('Related'),
'items': ['Sales Invoice', 'Packing Slip'] 'items': ['Sales Invoice', 'Packing Slip', 'Delivery Trip']
}, },
{ {
'label': _('Reference'), 'label': _('Reference'),

View File

@ -271,6 +271,24 @@ $.extend(erpnext.item, {
} }
} }
frm.fields_dict['deferred_revenue_account'].get_query = function() {
return {
filters: {
'root_type': 'Liability',
"is_group": 0
}
}
}
frm.fields_dict['deferred_expense_account'].get_query = function() {
return {
filters: {
'root_type': 'Asset',
"is_group": 0
}
}
}
frm.fields_dict.customer_items.grid.get_field("customer_name").get_query = function(doc, cdt, cdn) { frm.fields_dict.customer_items.grid.get_field("customer_name").get_query = function(doc, cdt, cdn) {
return { query: "erpnext.controllers.queries.customer_query" } return { query: "erpnext.controllers.queries.customer_query" }
} }
@ -707,4 +725,4 @@ frappe.ui.form.on("UOM Conversion Detail", {
}); });
} }
} }
}) })

View File

@ -951,7 +951,7 @@ def set_item_default(item_code, company, fieldname, value):
return return
# no row found, add a new row for the company # no row found, add a new row for the company
d = item.append('item_defaults', {fieldname: value, company: company}) d = item.append('item_defaults', {fieldname: value, "company": company})
d.db_insert() d.db_insert()
item.clear_cache() item.clear_cache()