Merge branch 'hotfix'
This commit is contained in:
commit
b70767b08e
@ -2,7 +2,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
|
|
||||||
__version__ = '7.2.12'
|
__version__ = '7.2.13'
|
||||||
|
|
||||||
def get_default_company(user=None):
|
def get_default_company(user=None):
|
||||||
'''Get default company for user'''
|
'''Get default company for user'''
|
||||||
|
@ -2385,7 +2385,7 @@
|
|||||||
"in_standard_filter": 0,
|
"in_standard_filter": 0,
|
||||||
"label": "Sales Invoice Payment",
|
"label": "Sales Invoice Payment",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 1,
|
||||||
"options": "Sales Invoice Payment",
|
"options": "Sales Invoice Payment",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "",
|
"precision": "",
|
||||||
@ -3188,6 +3188,7 @@
|
|||||||
"ignore_xss_filter": 0,
|
"ignore_xss_filter": 0,
|
||||||
"in_filter": 1,
|
"in_filter": 1,
|
||||||
"in_list_view": 0,
|
"in_list_view": 0,
|
||||||
|
"in_standard_filter": 0,
|
||||||
"label": "Status",
|
"label": "Status",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
@ -4182,7 +4183,7 @@
|
|||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"menu_index": 0,
|
"menu_index": 0,
|
||||||
"modified": "2016-11-09 14:18:24.760263",
|
"modified": "2017-01-17 11:07:25.814402",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Sales Invoice",
|
"name": "Sales Invoice",
|
||||||
|
@ -455,10 +455,12 @@ class calculate_taxes_and_totals(object):
|
|||||||
|
|
||||||
def calculate_paid_amount(self):
|
def calculate_paid_amount(self):
|
||||||
paid_amount = base_paid_amount = 0.0
|
paid_amount = base_paid_amount = 0.0
|
||||||
for payment in self.doc.get('payments'):
|
|
||||||
payment.base_amount = flt(payment.amount * self.doc.conversion_rate)
|
if self.doc.is_pos:
|
||||||
paid_amount += payment.amount
|
for payment in self.doc.get('payments'):
|
||||||
base_paid_amount += payment.base_amount
|
payment.base_amount = flt(payment.amount * self.doc.conversion_rate)
|
||||||
|
paid_amount += payment.amount
|
||||||
|
base_paid_amount += payment.base_amount
|
||||||
|
|
||||||
self.doc.paid_amount = flt(paid_amount, self.doc.precision("paid_amount"))
|
self.doc.paid_amount = flt(paid_amount, self.doc.precision("paid_amount"))
|
||||||
self.doc.base_paid_amount = flt(base_paid_amount, self.doc.precision("base_paid_amount"))
|
self.doc.base_paid_amount = flt(base_paid_amount, self.doc.precision("base_paid_amount"))
|
||||||
|
@ -290,10 +290,8 @@ class ProcessPayroll(Document):
|
|||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_start_end_dates(payroll_frequency, start_date=None):
|
def get_start_end_dates(payroll_frequency, start_date=None):
|
||||||
'''Returns dict of start and end dates for given payroll frequency based on start_date'''
|
'''Returns dict of start and end dates for given payroll frequency based on start_date'''
|
||||||
if not payroll_frequency:
|
|
||||||
frappe.throw(_("Please set Payroll Frequency first"))
|
|
||||||
|
|
||||||
if payroll_frequency == "Monthly" or payroll_frequency == "Bimonthly":
|
if payroll_frequency == "Monthly" or payroll_frequency == "Bimonthly" or payroll_frequency == "":
|
||||||
fiscal_year = get_fiscal_year(start_date)[0]
|
fiscal_year = get_fiscal_year(start_date)[0]
|
||||||
month = "%02d" % getdate(start_date).month
|
month = "%02d" % getdate(start_date).month
|
||||||
m = get_month_details(fiscal_year, month)
|
m = get_month_details(fiscal_year, month)
|
||||||
|
@ -8,6 +8,8 @@ from frappe.utils import flt, getdate, get_url
|
|||||||
from frappe import _
|
from frappe import _
|
||||||
|
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
from erpnext.controllers.queries import get_filters_cond
|
||||||
|
from frappe.desk.reportview import get_match_cond
|
||||||
|
|
||||||
class Project(Document):
|
class Project(Document):
|
||||||
def get_feed(self):
|
def get_feed(self):
|
||||||
@ -215,12 +217,29 @@ def get_list_context(context=None):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def get_users_for_project(doctype, txt, searchfield, start, page_len, filters):
|
def get_users_for_project(doctype, txt, searchfield, start, page_len, filters):
|
||||||
return frappe.db.sql("""select name, concat_ws(' ', first_name, middle_name, last_name)
|
conditions = []
|
||||||
|
return frappe.db.sql("""select name, concat_ws(' ', first_name, middle_name, last_name)
|
||||||
from `tabUser`
|
from `tabUser`
|
||||||
where enabled=1
|
where enabled=1
|
||||||
and name not in ("Guest", "Administrator")
|
and name not in ("Guest", "Administrator")
|
||||||
|
and ({key} like %(txt)s
|
||||||
|
or full_name like %(txt)s)
|
||||||
|
{fcond} {mcond}
|
||||||
order by
|
order by
|
||||||
name asc""")
|
if(locate(%(_txt)s, name), locate(%(_txt)s, name), 99999),
|
||||||
|
if(locate(%(_txt)s, full_name), locate(%(_txt)s, full_name), 99999),
|
||||||
|
idx desc,
|
||||||
|
name, full_name
|
||||||
|
limit %(start)s, %(page_len)s""".format(**{
|
||||||
|
'key': searchfield,
|
||||||
|
'fcond': get_filters_cond(doctype, filters, conditions),
|
||||||
|
'mcond': get_match_cond(doctype)
|
||||||
|
}), {
|
||||||
|
'txt': "%%%s%%" % txt,
|
||||||
|
'_txt': txt.replace("%", ""),
|
||||||
|
'start': start,
|
||||||
|
'page_len': page_len
|
||||||
|
})
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_cost_center_name(project):
|
def get_cost_center_name(project):
|
||||||
|
@ -588,11 +588,13 @@ erpnext.taxes_and_totals = erpnext.payments.extend({
|
|||||||
calculate_paid_amount: function(){
|
calculate_paid_amount: function(){
|
||||||
var me = this;
|
var me = this;
|
||||||
var paid_amount = base_paid_amount = 0.0;
|
var paid_amount = base_paid_amount = 0.0;
|
||||||
$.each(this.frm.doc['payments'] || [], function(index, data){
|
if(this.frm.doc.is_pos) {
|
||||||
data.base_amount = flt(data.amount * me.frm.doc.conversion_rate, precision("base_amount"));
|
$.each(this.frm.doc['payments'] || [], function(index, data){
|
||||||
paid_amount += data.amount;
|
data.base_amount = flt(data.amount * me.frm.doc.conversion_rate, precision("base_amount"));
|
||||||
base_paid_amount += data.base_amount;
|
paid_amount += data.amount;
|
||||||
})
|
base_paid_amount += data.base_amount;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
this.frm.doc.paid_amount = flt(paid_amount, precision("paid_amount"));
|
this.frm.doc.paid_amount = flt(paid_amount, precision("paid_amount"));
|
||||||
this.frm.doc.base_paid_amount = flt(base_paid_amount, precision("base_paid_amount"));
|
this.frm.doc.base_paid_amount = flt(base_paid_amount, precision("base_paid_amount"));
|
||||||
|
@ -219,9 +219,9 @@ class StockEntry(StockController):
|
|||||||
|
|
||||||
# validate qty during submit
|
# validate qty during submit
|
||||||
if d.docstatus==1 and d.s_warehouse and not allow_negative_stock and d.actual_qty < d.transfer_qty:
|
if d.docstatus==1 and d.s_warehouse and not allow_negative_stock and d.actual_qty < d.transfer_qty:
|
||||||
frappe.throw(_("Row {0}: Qty not available for {4} in warehouse {1} at posting time of the entry ({2} {3})".format(d.idx,
|
frappe.throw(_("Row {0}: Qty not available for {4} in warehouse {1} at posting time of the entry ({2} {3})").format(d.idx,
|
||||||
frappe.bold(d.s_warehouse), formatdate(self.posting_date),
|
frappe.bold(d.s_warehouse), formatdate(self.posting_date),
|
||||||
format_time(self.posting_time), frappe.bold(d.item_code)))
|
format_time(self.posting_time), frappe.bold(d.item_code))
|
||||||
+ '<br><br>' + _("Available qty is {0}, you need {1}").format(frappe.bold(d.actual_qty),
|
+ '<br><br>' + _("Available qty is {0}, you need {1}").format(frappe.bold(d.actual_qty),
|
||||||
frappe.bold(d.transfer_qty)),
|
frappe.bold(d.transfer_qty)),
|
||||||
NegativeStockError, title=_('Insufficient Stock'))
|
NegativeStockError, title=_('Insufficient Stock'))
|
||||||
@ -867,4 +867,4 @@ def get_warehouse_details(args):
|
|||||||
"basic_rate" : get_incoming_rate(args)
|
"basic_rate" : get_incoming_rate(args)
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
Loading…
x
Reference in New Issue
Block a user