Merge branch 'Helkyd-develop' into develop

This commit is contained in:
Nabin Hait 2017-10-05 15:29:05 +05:30
commit 31e6f75dbf
2 changed files with 22 additions and 8 deletions

View File

@ -12,21 +12,21 @@
{% } %}
</tr>
</thead>
<tbody>
<tbody>
{% for(var j=0, k=data.length; j<k; j++) { %}
{%
{%
var row = data[j];
%}
<tr>
{% for(var i=1, l=report.columns.length; i<l; i++) { %}
<td class="text-right">
{% var fieldname = report.columns[i].field; %}
{% if (i > 10) { %}
{%= format_currency(row[fieldname]) %}
{% } else { %}
{% if (!is_null(row[fieldname])) { %}
{%= row[fieldname] %}
{% } %}
{% if (report.columns[i].fieldtype=='Currency' && !isNaN(row[fieldname])) { %}
{%= format_currency(row[fieldname]) %}
{% } else { %}
{% if (!is_null(row[fieldname])) { %}
{%= row[fieldname] %}
{% } %}
{% } %}
</td>
{% } %}

View File

@ -19,6 +19,12 @@ def execute(filters=None):
row = [ss.name, ss.employee, ss.employee_name, ss.branch, ss.department, ss.designation,
ss.company, ss.start_date, ss.end_date, ss.leave_withut_pay, ss.payment_days]
if not ss.branch == None:columns[3] = columns[3].replace('-1','120')
if not ss.department == None: columns[4] = columns[4].replace('-1','120')
if not ss.designation == None: columns[5] = columns[5].replace('-1','120')
if not ss.leave_withut_pay == None: columns[9] = columns[9].replace('-1','130')
for e in earning_types:
row.append(ss_earning_map.get(ss.name, {}).get(e))
@ -34,12 +40,20 @@ def execute(filters=None):
return columns, data
def get_columns(salary_slips):
"""
columns = [
_("Salary Slip ID") + ":Link/Salary Slip:150",_("Employee") + ":Link/Employee:120", _("Employee Name") + "::140", _("Branch") + ":Link/Branch:120",
_("Department") + ":Link/Department:120", _("Designation") + ":Link/Designation:120",
_("Company") + ":Link/Company:120", _("Start Date") + "::80", _("End Date") + "::80", _("Leave Without Pay") + ":Float:130",
_("Payment Days") + ":Float:120"
]
"""
columns = [
_("Salary Slip ID") + ":Link/Salary Slip:150",_("Employee") + ":Link/Employee:120", _("Employee Name") + "::140", _("Branch") + ":Link/Branch:-1",
_("Department") + ":Link/Department:-1", _("Designation") + ":Link/Designation:-1",
_("Company") + ":Link/Company:120", _("Start Date") + "::80", _("End Date") + "::80", _("Leave Without Pay") + ":Float:-1",
_("Payment Days") + ":Float:120"
]
salary_components = {_("Earning"): [], _("Deduction"): []}