Fixed merge conflict
This commit is contained in:
commit
dd839055e3
@ -2,7 +2,7 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
__version__ = '7.2.12'
|
||||
__version__ = '7.2.13'
|
||||
|
||||
def get_default_company(user=None):
|
||||
'''Get default company for user'''
|
||||
|
@ -2385,7 +2385,7 @@
|
||||
"in_standard_filter": 0,
|
||||
"label": "Sales Invoice Payment",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"no_copy": 1,
|
||||
"options": "Sales Invoice Payment",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
@ -3188,6 +3188,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 1,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Status",
|
||||
"length": 0,
|
||||
"no_copy": 1,
|
||||
@ -4182,7 +4183,7 @@
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"menu_index": 0,
|
||||
"modified": "2016-11-09 14:18:24.760263",
|
||||
"modified": "2017-01-17 11:07:25.814402",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Sales Invoice",
|
||||
|
@ -456,10 +456,12 @@ class calculate_taxes_and_totals(object):
|
||||
|
||||
def calculate_paid_amount(self):
|
||||
paid_amount = base_paid_amount = 0.0
|
||||
for payment in self.doc.get('payments'):
|
||||
payment.base_amount = flt(payment.amount * self.doc.conversion_rate)
|
||||
paid_amount += payment.amount
|
||||
base_paid_amount += payment.base_amount
|
||||
|
||||
if self.doc.is_pos:
|
||||
for payment in self.doc.get('payments'):
|
||||
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.base_paid_amount = flt(base_paid_amount, self.doc.precision("base_paid_amount"))
|
||||
|
@ -303,10 +303,8 @@ class ProcessPayroll(Document):
|
||||
@frappe.whitelist()
|
||||
def get_start_end_dates(payroll_frequency, start_date=None, company=None):
|
||||
'''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, company=company)[0]
|
||||
month = "%02d" % getdate(start_date).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.model.document import Document
|
||||
from erpnext.controllers.queries import get_filters_cond
|
||||
from frappe.desk.reportview import get_match_cond
|
||||
|
||||
class Project(Document):
|
||||
def get_feed(self):
|
||||
@ -228,12 +230,29 @@ def get_list_context(context=None):
|
||||
}
|
||||
|
||||
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`
|
||||
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
|
||||
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()
|
||||
def get_cost_center_name(project):
|
||||
|
@ -588,11 +588,13 @@ erpnext.taxes_and_totals = erpnext.payments.extend({
|
||||
calculate_paid_amount: function(){
|
||||
var me = this;
|
||||
var paid_amount = base_paid_amount = 0.0;
|
||||
$.each(this.frm.doc['payments'] || [], function(index, data){
|
||||
data.base_amount = flt(data.amount * me.frm.doc.conversion_rate, precision("base_amount"));
|
||||
paid_amount += data.amount;
|
||||
base_paid_amount += data.base_amount;
|
||||
})
|
||||
if(this.frm.doc.is_pos) {
|
||||
$.each(this.frm.doc['payments'] || [], function(index, data){
|
||||
data.base_amount = flt(data.amount * me.frm.doc.conversion_rate, precision("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.base_paid_amount = flt(base_paid_amount, precision("base_paid_amount"));
|
||||
|
Loading…
Reference in New Issue
Block a user