Merge branch 'staging-fixes' into new-fix-branch

This commit is contained in:
Nabin Hait
2018-11-26 20:23:37 +05:30
committed by GitHub
10 changed files with 51 additions and 65 deletions

View File

@@ -16,8 +16,6 @@ def execute(filters=None):
return [], [] return [], []
account_details = {} account_details = {}
if not filters.get("group_by"):
filters['group_by'] = _('Group by Voucher (Consolidated)')
if filters and filters.get('print_in_account_currency') and \ if filters and filters.get('print_in_account_currency') and \
not filters.get('account'): not filters.get('account'):

View File

@@ -236,7 +236,7 @@ class GrossProfitGenerator(object):
previous_stock_value = len(my_sle) > i+1 and \ previous_stock_value = len(my_sle) > i+1 and \
flt(my_sle[i+1].stock_value) or 0.0 flt(my_sle[i+1].stock_value) or 0.0
if previous_stock_value: if previous_stock_value:
return previous_stock_value - flt(sle.stock_value) return (previous_stock_value - flt(sle.stock_value)) * flt(row.qty) / abs(flt(sle.qty))
else: else:
return flt(row.qty) * self.get_average_buying_rate(row, item_code) return flt(row.qty) * self.get_average_buying_rate(row, item_code)
else: else:

View File

@@ -231,6 +231,13 @@ def get_columns():
"options": "Account", "options": "Account",
"width": 300 "width": 300
}, },
{
"fieldname": "currency",
"label": _("Currency"),
"fieldtype": "Link",
"options": "Currency",
"hidden": 1
},
{ {
"fieldname": "opening_debit", "fieldname": "opening_debit",
"label": _("Opening (Dr)"), "label": _("Opening (Dr)"),
@@ -272,13 +279,6 @@ def get_columns():
"fieldtype": "Currency", "fieldtype": "Currency",
"options": "currency", "options": "currency",
"width": 120 "width": 120
},
{
"fieldname": "currency",
"label": _("Currency"),
"fieldtype": "Link",
"options": "Currency",
"hidden": 1
} }
] ]

View File

@@ -120,3 +120,16 @@ var btn_invoice_registration = function (frm) {
} }
}); });
}; };
frappe.ui.form.on('Patient Relation', {
patient_relation_add: function(frm){
frm.fields_dict['patient_relation'].grid.get_field('patient').get_query = function(frm){
var patient_list = [];
if(!frm.doc.__islocal) patient_list.push(frm.doc.name);
$.each(frm.doc.patient_relation, function(idx, val){
if (val.patient) patient_list.push(val.patient);
});
return { filters: [['Patient', 'name', 'not in', patient_list]] };
};
}
});

View File

@@ -3,7 +3,9 @@
frappe.ui.form.on('Holiday List', { frappe.ui.form.on('Holiday List', {
refresh: function(frm) { refresh: function(frm) {
frm.set_value('total_holidays', frm.doc.holidays.length); if (frm.doc.holidays) {
frm.set_value('total_holidays', frm.doc.holidays.length);
}
}, },
from_date: function(frm) { from_date: function(frm) {
if (frm.doc.from_date && !frm.doc.to_date) { if (frm.doc.from_date && !frm.doc.to_date) {

View File

@@ -1,5 +1,6 @@
{ {
"allow_copy": 0, "allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0, "allow_guest_to_view": 0,
"allow_import": 1, "allow_import": 1,
"allow_rename": 0, "allow_rename": 0,
@@ -444,39 +445,6 @@
"translatable": 0, "translatable": 0,
"unique": 0 "unique": 0
}, },
{
"allow_bulk_edit": 0,
"allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "start_date",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 1,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "User",
"length": 0,
"no_copy": 0,
"options": "User",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"translatable": 0,
"unique": 0
},
{ {
"allow_bulk_edit": 0, "allow_bulk_edit": 0,
"allow_in_quick_entry": 0, "allow_in_quick_entry": 0,
@@ -1032,7 +1000,7 @@
"issingle": 0, "issingle": 0,
"istable": 0, "istable": 0,
"max_attachments": 0, "max_attachments": 0,
"modified": "2018-08-28 14:44:32.912004", "modified": "2018-11-15 07:58:42.629845",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Projects", "module": "Projects",
"name": "Timesheet", "name": "Timesheet",

View File

@@ -33,7 +33,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
item.margin_rate_or_amount = 0; item.margin_rate_or_amount = 0;
item.rate_with_margin = 0; item.rate_with_margin = 0;
} }
item.base_rate_with_margin = item.rate_with_margin * flt(this.frm.doc.conversion_rate); item.base_rate_with_margin = item.rate_with_margin * flt(frm.doc.conversion_rate);
cur_frm.cscript.set_gross_profit(item); cur_frm.cscript.set_gross_profit(item);
cur_frm.cscript.calculate_taxes_and_totals(); cur_frm.cscript.calculate_taxes_and_totals();
@@ -185,6 +185,12 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
} }
}, },
is_return: function() {
if(!this.frm.doc.is_return && this.frm.doc.return_against) {
this.frm.set_value('return_against', '');
}
},
setup_quality_inspection: function() { setup_quality_inspection: function() {
if(!in_list(["Delivery Note", "Sales Invoice", "Purchase Receipt", "Purchase Invoice"], this.frm.doc.doctype)) { if(!in_list(["Delivery Note", "Sales Invoice", "Purchase Receipt", "Purchase Invoice"], this.frm.doc.doctype)) {
return; return;

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-06-01 09:39:39.604944", "modified": "2018-06-01 09:39:39.604944",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Selling", "module": "Selling",

View File

@@ -594,22 +594,21 @@ def get_pos_profile(company, pos_profile=None, user=None):
if not user: if not user:
user = frappe.session['user'] user = frappe.session['user']
pos_profile = frappe.db.sql("""select pf.* pos_profile = frappe.db.sql("""SELECT pf.*
from FROM
`tabPOS Profile` pf, `tabPOS Profile User` pfu `tabPOS Profile` pf LEFT JOIN `tabPOS Profile User` pfu
where ON
pfu.parent = pf.name and pfu.user = %s and pf.company = %s
and pf.disabled = 0 and pfu.default=1""", (user, company), as_dict=1)
if not pos_profile:
pos_profile = frappe.db.sql("""select pf.*
from
`tabPOS Profile` pf left join `tabPOS Profile User` pfu
on
pf.name = pfu.parent pf.name = pfu.parent
where WHERE
ifnull(pfu.user, '') = '' and pf.company = %s (
and pf.disabled = 0""", (company), as_dict=1) (pfu.user = %(user)s AND pf.company = %(company)s AND pfu.default=1)
OR (pfu.user = %(user)s AND pfu.default=1)
OR (ifnull(pfu.user, '') = '' AND pf.company = %(company)s)
) AND pf.disabled = 0
""", {
'user': user,
'company': company
}, as_dict=1)
return pos_profile and pos_profile[0] or None return pos_profile and pos_profile[0] or None

View File

@@ -7,7 +7,8 @@ frappe.query_reports["Stock Projected Qty"] = {
"fieldname":"company", "fieldname":"company",
"label": __("Company"), "label": __("Company"),
"fieldtype": "Link", "fieldtype": "Link",
"options": "Company" "options": "Company",
"default": frappe.defaults.get_user_default("Company")
}, },
{ {
"fieldname":"warehouse", "fieldname":"warehouse",