[conflicts] resolved merge conflicts

This commit is contained in:
mbauskar 2017-10-09 15:20:30 +05:30
commit 966b3c156a
11 changed files with 88 additions and 45 deletions

View File

@ -4,7 +4,7 @@ import inspect
import frappe import frappe
from erpnext.hooks import regional_overrides from erpnext.hooks import regional_overrides
__version__ = '9.1.1' __version__ = '9.1.2'
def get_default_company(user=None): def get_default_company(user=None):
'''Get default company for user''' '''Get default company for user'''

View File

@ -37,10 +37,10 @@ frappe.ui.form.on('POS Profile', {
return { filters: { doc_type: "Sales Invoice", print_format_type: "Js"} }; return { filters: { doc_type: "Sales Invoice", print_format_type: "Js"} };
}); });
frappe.db.get_value('POS Settings', {name: 'POS Settings'}, 'is_online', (r) => { frappe.db.get_value('POS Settings', {name: 'POS Settings'}, 'use_pos_in_offline_mode', (r) => {
is_online = r && cint(r.is_online) is_offline = r && cint(r.use_pos_in_offline_mode)
frm.toggle_display('offline_pos_section', !is_online); frm.toggle_display('offline_pos_section', is_offline);
frm.toggle_display('print_format_for_online', is_online); frm.toggle_display('print_format_for_online', !is_offline);
}); });
}, },

View File

@ -88,7 +88,7 @@ def update_pos_profile_data(doc, pos_profile, company_data):
doc.naming_series = pos_profile.get('naming_series') or 'SINV-' doc.naming_series = pos_profile.get('naming_series') or 'SINV-'
doc.letter_head = pos_profile.get('letter_head') or company_data.default_letter_head doc.letter_head = pos_profile.get('letter_head') or company_data.default_letter_head
doc.ignore_pricing_rule = pos_profile.get('ignore_pricing_rule') or 0 doc.ignore_pricing_rule = pos_profile.get('ignore_pricing_rule') or 0
doc.apply_discount_on = pos_profile.get('apply_discount_on') if pos_profile.get('apply_discount') else '' doc.apply_discount_on = pos_profile.get('apply_discount_on') or ''
doc.customer_group = pos_profile.get('customer_group') or get_root('Customer Group') doc.customer_group = pos_profile.get('customer_group') or get_root('Customer Group')
doc.territory = pos_profile.get('territory') or get_root('Territory') doc.territory = pos_profile.get('territory') or get_root('Territory')
doc.terms = frappe.db.get_value('Terms and Conditions', pos_profile.get('tc_name'), 'terms') or doc.terms or '' doc.terms = frappe.db.get_value('Terms and Conditions', pos_profile.get('tc_name'), 'terms') or doc.terms or ''

View File

@ -183,16 +183,20 @@ var btn_create_vital_signs = function (frm) {
var btn_update_status = function(frm, status){ var btn_update_status = function(frm, status){
var doc = frm.doc; var doc = frm.doc;
frappe.confirm(__('Are you sure you want to cancel this appointment?'),
function() {
frappe.call({ frappe.call({
method: method:
"erpnext.healthcare.doctype.patient_appointment.patient_appointment.update_status", "erpnext.healthcare.doctype.patient_appointment.patient_appointment.update_status",
args: {appointmentId: doc.name, status:status}, args: {appointmentId: doc.name, status:status},
callback: function(data){ callback: function(data){
if(!data.exc){ if(!data.exc){
cur_frm.reload_doc(); frm.reload_doc();
} }
} }
}); });
}
);
}; };
var btn_invoice_consultation = function(frm){ var btn_invoice_consultation = function(frm){

View File

@ -128,7 +128,7 @@ class BOM(WebsiteGenerator):
'uom' : item and args['stock_uom'] or '', 'uom' : item and args['stock_uom'] or '',
'conversion_factor': 1, 'conversion_factor': 1,
'bom_no' : args['bom_no'], 'bom_no' : args['bom_no'],
'rate' : rate / self.conversion_rate, 'rate' : rate / self.conversion_rate if self.conversion_rate else rate,
'qty' : args.get("qty") or args.get("stock_qty") or 1, 'qty' : args.get("qty") or args.get("stock_qty") or 1,
'stock_qty' : args.get("qty") or args.get("stock_qty") or 1, 'stock_qty' : args.get("qty") or args.get("stock_qty") or 1,
'base_rate' : rate 'base_rate' : rate
@ -374,7 +374,7 @@ class BOM(WebsiteGenerator):
if d.workstation: if d.workstation:
if not d.hour_rate: if not d.hour_rate:
hour_rate = flt(frappe.db.get_value("Workstation", d.workstation, "hour_rate")) hour_rate = flt(frappe.db.get_value("Workstation", d.workstation, "hour_rate"))
d.hour_rate = hour_rate / flt(self.conversion_rate) d.hour_rate = hour_rate / flt(self.conversion_rate) if self.conversion_rate else hour_rate
if d.hour_rate and d.time_in_mins: if d.hour_rate and d.time_in_mins:
d.base_hour_rate = flt(d.hour_rate) * flt(self.conversion_rate) d.base_hour_rate = flt(d.hour_rate) * flt(self.conversion_rate)

View File

@ -451,3 +451,4 @@ erpnext.patches.v8_9.update_billing_gstin_for_indian_account
erpnext.patches.v9_0.fix_subscription_next_date erpnext.patches.v9_0.fix_subscription_next_date
erpnext.patches.v9_0.set_schedule_date_for_material_request_and_purchase_order erpnext.patches.v9_0.set_schedule_date_for_material_request_and_purchase_order
erpnext.patches.v9_0.student_admission_childtable_migrate erpnext.patches.v9_0.student_admission_childtable_migrate
erpnext.patches.v9_0.add_healthcare_domain

View File

@ -0,0 +1,14 @@
# Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
def execute():
domain = _('Healthcare')
if not frappe.db.exists('Domain', domain):
frappe.get_doc({
'doctype': 'Domain',
'domain': domain
}).insert(ignore_permissions=True)

View File

@ -1,39 +1,45 @@
frappe.ui.form.on("Communication", { frappe.ui.form.on("Communication", {
refresh: function(frm) { refresh: (frm) => {
// setup custom Make button only if Communication is Email
if(frm.doc.communication_medium == "Email" && frm.doc.sent_or_received == "Received") {
frm.events.setup_custom_buttons(frm);
}
},
setup_custom_buttons: (frm) => {
let confirm_msg = "Are you sure you want to create {0} from this email";
if(frm.doc.reference_doctype !== "Issue") { if(frm.doc.reference_doctype !== "Issue") {
frm.add_custom_button(__("Issue"), function() { frm.add_custom_button(__("Issue"), () => {
frappe.confirm("Are you sure you want to create Issue from this email", function(){ frappe.confirm(__(confirm_msg, [__("Issue")]), () => {
frm.trigger('make_issue_from_communication'); frm.trigger('make_issue_from_communication');
}) })
}, "Make"); }, "Make");
} }
if(!in_list(["Lead", "Opportunity"], frm.doc.reference_doctype)) { if(!in_list(["Lead", "Opportunity"], frm.doc.reference_doctype)) {
frm.add_custom_button(__("Lead"), function() { frm.add_custom_button(__("Lead"), () => {
frappe.confirm("Are you sure you want to create Lead from this email", function(){ frappe.confirm(__(confirm_msg, [__("Lead")]), () => {
frm.trigger('make_lead_from_communication'); frm.trigger('make_lead_from_communication');
}) })
}, "Make"); }, "Make");
frm.add_custom_button(__("Opportunity"), function() { frm.add_custom_button(__("Opportunity"), () => {
frappe.confirm("Are you sure you want to create Opportunity from this email", function(){ frappe.confirm(__(confirm_msg, [__("Opportunity")]), () => {
frm.trigger('make_opportunity_from_communication'); frm.trigger('make_opportunity_from_communication');
}) })
}, "Make"); }, "Make");
} }
frm.page.set_inner_btn_group_as_primary(__("Make")); frm.page.set_inner_btn_group_as_primary(__("Make"));
}, },
make_lead_from_communication: function(frm) { make_lead_from_communication: (frm) => {
return frappe.call({ return frappe.call({
method: "frappe.email.inbox.make_lead_from_communication", method: "frappe.email.inbox.make_lead_from_communication",
args: { args: {
communication: frm.doc.name communication: frm.doc.name
}, },
freeze: true, freeze: true,
callback: function(r) { callback: (r) => {
if(r.message) { if(r.message) {
frm.reload_doc() frm.reload_doc()
} }
@ -41,14 +47,14 @@ frappe.ui.form.on("Communication", {
}) })
}, },
make_issue_from_communication: function(frm) { make_issue_from_communication: (frm) => {
return frappe.call({ return frappe.call({
method: "frappe.email.inbox.make_issue_from_communication", method: "frappe.email.inbox.make_issue_from_communication",
args: { args: {
communication: frm.doc.name communication: frm.doc.name
}, },
freeze: true, freeze: true,
callback: function(r) { callback: (r) => {
if(r.message) { if(r.message) {
frm.reload_doc() frm.reload_doc()
} }
@ -56,14 +62,14 @@ frappe.ui.form.on("Communication", {
}) })
}, },
make_opportunity_from_communication: function(frm) { make_opportunity_from_communication: (frm) => {
return frappe.call({ return frappe.call({
method: "frappe.email.inbox.make_opportunity_from_communication", method: "frappe.email.inbox.make_opportunity_from_communication",
args: { args: {
communication: frm.doc.name communication: frm.doc.name
}, },
freeze: true, freeze: true,
callback: function(r) { callback: (r) => {
if(r.message) { if(r.message) {
frm.reload_doc() frm.reload_doc()
} }

View File

@ -37,7 +37,6 @@
<div class="cell price-cell text-right tax-table"> <div class="cell price-cell text-right tax-table">
</div> </div>
</div> </div>
{% if (apply_discount_on) { %}
<div class="pos-list-row discount-amount-area"> <div class="pos-list-row discount-amount-area">
<div class="cell"></div> <div class="cell"></div>
<div class="cell text-right">{%= __("Discount") %}</div> <div class="cell text-right">{%= __("Discount") %}</div>
@ -52,7 +51,6 @@
</div> </div>
</div> </div>
</div> </div>
{% } %}
<div class="pos-list-row grand-total-area collapse-btn" style="border-bottom:1px solid #d1d8dd;"> <div class="pos-list-row grand-total-area collapse-btn" style="border-bottom:1px solid #d1d8dd;">
<div class="cell"> <div class="cell">
<a class=""> <a class="">

View File

@ -50,6 +50,7 @@ class Fees(AccountsController):
select g.email_address select g.email_address
from `tabGuardian` g, `tabStudent Guardian` sg from `tabGuardian` g, `tabStudent Guardian` sg
where g.name = sg.guardian and sg.parent = %s and sg.parenttype = 'Student' where g.name = sg.guardian and sg.parent = %s and sg.parenttype = 'Student'
and ifnull(g.email_address, '')!=''
""", self.student) """, self.student)
student_email_id = frappe.db.get_value("Student", self.student, "student_email_id") student_email_id = frappe.db.get_value("Student", self.student, "student_email_id")

View File

@ -222,6 +222,11 @@ erpnext.pos.PointOfSale = class PointOfSale {
} }
update_item_in_frm(item, field, value) { update_item_in_frm(item, field, value) {
if (field == 'qty' && value < 0) {
frappe.msgprint(__("Quantity must be positive"));
value = item.qty;
}
if (field) { if (field) {
frappe.model.set_value(item.doctype, item.name, field, value); frappe.model.set_value(item.doctype, item.name, field, value);
} }
@ -518,7 +523,7 @@ class POSCart {
// Update totals // Update totals
this.$taxes_and_totals.find('.net-total') this.$taxes_and_totals.find('.net-total')
.html(format_currency(this.frm.doc.net_total, currency)); .html(format_currency(this.frm.doc.total, currency));
// Update taxes // Update taxes
const taxes_html = this.frm.doc.taxes.map(tax => { const taxes_html = this.frm.doc.taxes.map(tax => {
@ -943,6 +948,7 @@ class POSItems {
if (this.search_index[search_term]) { if (this.search_index[search_term]) {
const items = this.search_index[search_term]; const items = this.search_index[search_term];
this.render_items(items); this.render_items(items);
this.set_item_in_the_cart(items);
return; return;
} }
} else if (item_group == "All Item Groups") { } else if (item_group == "All Item Groups") {
@ -956,17 +962,30 @@ class POSItems {
} }
this.render_items(items); this.render_items(items);
this.set_item_in_the_cart(items, serial_no, batch_no);
});
}
set_item_in_the_cart(items, serial_no, batch_no) {
if (serial_no) { if (serial_no) {
this.events.update_cart(items[0].item_code, this.events.update_cart(items[0].item_code,
'serial_no', serial_no); 'serial_no', serial_no);
this.reset_search_field(); this.reset_search_field();
return;
} }
if (batch_no) { if (batch_no) {
this.events.update_cart(items[0].item_code, this.events.update_cart(items[0].item_code,
'batch_no', batch_no); 'batch_no', batch_no);
this.reset_search_field(); this.reset_search_field();
return;
}
if (items.length === 1) {
this.events.update_cart(items[0].item_code,
'qty', '+1');
this.reset_search_field();
} }
});
} }
reset_search_field() { reset_search_field() {