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
commit 91c811f170
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 51 additions and 65 deletions

View File

@ -16,8 +16,6 @@ def execute(filters=None):
return [], []
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 \
not filters.get('account'):

View File

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

View File

@ -231,6 +231,13 @@ def get_columns():
"options": "Account",
"width": 300
},
{
"fieldname": "currency",
"label": _("Currency"),
"fieldtype": "Link",
"options": "Currency",
"hidden": 1
},
{
"fieldname": "opening_debit",
"label": _("Opening (Dr)"),
@ -272,13 +279,6 @@ def get_columns():
"fieldtype": "Currency",
"options": "currency",
"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', {
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) {
if (frm.doc.from_date && !frm.doc.to_date) {

View File

@ -1,5 +1,6 @@
{
"allow_copy": 0,
"allow_events_in_timeline": 0,
"allow_guest_to_view": 0,
"allow_import": 1,
"allow_rename": 0,
@ -444,39 +445,6 @@
"translatable": 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_in_quick_entry": 0,
@ -1032,7 +1000,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-08-28 14:44:32.912004",
"modified": "2018-11-15 07:58:42.629845",
"modified_by": "Administrator",
"module": "Projects",
"name": "Timesheet",

View File

@ -33,7 +33,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
item.margin_rate_or_amount = 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.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() {
if(!in_list(["Delivery Note", "Sales Invoice", "Purchase Receipt", "Purchase Invoice"], this.frm.doc.doctype)) {
return;

View File

@ -6,8 +6,7 @@
"docstatus": 0,
"doctype": "Report",
"idx": 0,
"is_standard": "Yes",
"letter_head": "Test",
"is_standard": "Yes",
"modified": "2018-06-01 09:39:39.604944",
"modified_by": "Administrator",
"module": "Selling",
@ -30,4 +29,4 @@
"role": "Accounts User"
}
]
}
}

View File

@ -594,22 +594,21 @@ def get_pos_profile(company, pos_profile=None, user=None):
if not user:
user = frappe.session['user']
pos_profile = frappe.db.sql("""select pf.*
from
`tabPOS Profile` pf, `tabPOS Profile User` pfu
where
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
pos_profile = frappe.db.sql("""SELECT pf.*
FROM
`tabPOS Profile` pf LEFT JOIN `tabPOS Profile User` pfu
ON
pf.name = pfu.parent
where
ifnull(pfu.user, '') = '' and pf.company = %s
and pf.disabled = 0""", (company), as_dict=1)
WHERE
(
(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

View File

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