fix
This commit is contained in:
parent
43910a568b
commit
7220f80b66
|
|
@ -255,14 +255,15 @@ class SalaryRuleInput(models.Model):
|
|||
'partner_id': self.employee_id.user_id.partner_id.id,
|
||||
'credit': total,
|
||||
})
|
||||
move = self.env['account.move'].create({
|
||||
'journal_id': journal.id,
|
||||
# 'date': fields.Date.context_today(self),
|
||||
'date': self.date_to,
|
||||
'ref': self.name,
|
||||
'line_ids': [(0, 0, item) for item in total_list]
|
||||
})
|
||||
self.move_id = move.id
|
||||
if not self.move_id:
|
||||
move = self.env['account.move'].create({
|
||||
'journal_id': journal.id,
|
||||
# 'date': fields.Date.context_today(self),
|
||||
'date': self.date_to,
|
||||
'ref': self.name,
|
||||
'line_ids': [(0, 0, item) for item in total_list]
|
||||
})
|
||||
self.move_id = move.id
|
||||
self.write({'state': 'transfered'})
|
||||
|
||||
def compute_totals(self):
|
||||
|
|
@ -3058,17 +3059,18 @@ class HrPayslipRun(models.Model):
|
|||
|
||||
merged_list = self.merge_lists(new_record_list, 'name', 'account_id')
|
||||
record_final_item = merged_list + new_rec_loan_list
|
||||
move = self.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'journal_id': record.get('move'),
|
||||
# 'date': fields.Date.context_today(self),
|
||||
'date': self.date_end,
|
||||
'ref': self.name,
|
||||
'line_ids': [(0, 0, item) for item in record_final_item],
|
||||
'res_model': 'hr.payslip.run',
|
||||
'res_id': self.id
|
||||
})
|
||||
self.move_id = move.id
|
||||
if not self.move_id:
|
||||
move = self.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'journal_id': record.get('move'),
|
||||
# 'date': fields.Date.context_today(self),
|
||||
'date': self.date_end,
|
||||
'ref': self.name,
|
||||
'line_ids': [(0, 0, item) for item in record_final_item],
|
||||
'res_model': 'hr.payslip.run',
|
||||
'res_id': self.id
|
||||
})
|
||||
self.move_id = move.id
|
||||
|
||||
|
||||
########################## per_analytic_account ###########
|
||||
|
|
@ -3184,17 +3186,18 @@ class HrPayslipRun(models.Model):
|
|||
new_rec_loan_list = record.get('loans')
|
||||
merged_list = self.new_merge_lists(new_record_list, 'name', 'account_id', 'analytic_account_id')
|
||||
record_final_item = merged_list + new_rec_loan_list
|
||||
move = self.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'journal_id': record.get('move'),
|
||||
'date': self.date_end,
|
||||
if not self.move_id:
|
||||
move = self.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'journal_id': record.get('move'),
|
||||
'date': self.date_end,
|
||||
|
||||
'ref': self.name,
|
||||
'line_ids': [(0, 0, item) for item in record_final_item],
|
||||
'res_model': 'hr.payslip.run',
|
||||
'res_id': self.id
|
||||
})
|
||||
self.move_id = move.id
|
||||
'ref': self.name,
|
||||
'line_ids': [(0, 0, item) for item in record_final_item],
|
||||
'res_model': 'hr.payslip.run',
|
||||
'res_id': self.id
|
||||
})
|
||||
self.move_id = move.id
|
||||
|
||||
# import pdb
|
||||
# pdb.set_trace()
|
||||
|
|
@ -3275,18 +3278,19 @@ class HrPayslipRun(models.Model):
|
|||
new_record_list = record.get('list_ids')
|
||||
# merged_list = self.merge_lists(new_record_list, 'name', 'account_id')
|
||||
# record_final_item = merged_list
|
||||
move = self.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'partner_id': line.employee_id.user_id.partner_id.id,
|
||||
'journal_id': line.contract_id.journal_id.id,
|
||||
# 'date': fields.Date.context_today(self),
|
||||
'date': self.date_end,
|
||||
'ref': line.name,
|
||||
'line_ids': [(0, 0, item) for item in new_record_list],
|
||||
'res_model': 'hr.payslip.run',
|
||||
'res_id': self.id
|
||||
})
|
||||
line.move_id = move.id
|
||||
if not line.move_id:
|
||||
move = self.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'partner_id': line.employee_id.user_id.partner_id.id,
|
||||
'journal_id': line.contract_id.journal_id.id,
|
||||
# 'date': fields.Date.context_today(self),
|
||||
'date': self.date_end,
|
||||
'ref': line.name,
|
||||
'line_ids': [(0, 0, item) for item in new_record_list],
|
||||
'res_model': 'hr.payslip.run',
|
||||
'res_id': self.id
|
||||
})
|
||||
line.move_id = move.id
|
||||
|
||||
else:
|
||||
bank_id = ''
|
||||
|
|
@ -3448,17 +3452,18 @@ class HrPayslipRun(models.Model):
|
|||
new_rec_loan_list = record.get('loans')
|
||||
merged_list = self.merge_lists(new_record_list, 'name', 'account_id')
|
||||
record_final_item = merged_list + new_rec_loan_list
|
||||
move = self.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'journal_id': record.get('move'),
|
||||
# 'date': fields.Date.context_today(self),
|
||||
'date': self.date_end,
|
||||
'ref': bank_id,
|
||||
'line_ids': [(0, 0, item) for item in record_final_item],
|
||||
'res_model': 'hr.payslip.run',
|
||||
'res_id': self.id
|
||||
})
|
||||
line.move_id = move.id
|
||||
if not line.move_id:
|
||||
move = self.env['account.move'].create({
|
||||
'state': 'draft',
|
||||
'journal_id': record.get('move'),
|
||||
# 'date': fields.Date.context_today(self),
|
||||
'date': self.date_end,
|
||||
'ref': bank_id,
|
||||
'line_ids': [(0, 0, item) for item in record_final_item],
|
||||
'res_model': 'hr.payslip.run',
|
||||
'res_id': self.id
|
||||
})
|
||||
line.move_id = move.id
|
||||
|
||||
for line in self.slip_ids:
|
||||
payslip = self.env['hr.payslip'].search([('state', '=', line.state)])
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
<data>
|
||||
<template id="report_payroll_bank_pdf_docx"><t t-foreach="data" t-as="v"><t>IFH,IFILE,CSV,ABCD5953001,SASABBGSA003888815,<t><t t-esc="random_char"/></t><t t-set="date_value" t-value="pay_date"/><t t-esc="date_value.replace('-', '').replace('/', '').replace(':', '')"/>00,</t><t t-esc="datestamp" widget="datetime"></t>,<t><t t-esc="timestamp" widget="datetime"></t></t><t>,P,1.0,</t><t><t t-esc="number_of_records"/></t>
|
||||
<t>BATHDR,ACH-CR,<t><t t-esc="counter"/></t>,,,,<t><t t-esc="salary_type"/></t>,Salary,,@1ST@,<t t-set="date_value" t-value="pay_date"/><t t-esc="date_value.replace('-', '').replace('/', '')"/>,00<t t-esc="company_pay_no"></t>,<t t-esc="currency"></t>,<t t-esc="round(total_amount_salary,2)"></t>,,,,,,,<t t-esc="company_id"></t>,<t><t t-esc="company_hr_no"/></t>,<t><t t-esc="company_registry"/></t>,,,,<t><t t-esc="random_char2"/></t><t t-set="date_value" t-value="timestamp" widget="datetime"/><t t-esc="date_value.replace('-', '').replace('/', '').replace(':', '')"/>00</t><t t-if="bank_type=='rajhi'"><t t-foreach="v['docs']" t-as="o"><t></t>
|
||||
<t>SECPTY,</t><t><t t-esc="o['Account #']"/></t>,<t><t t-esc="o['Name']"/></t>,<t><t t-esc="o['ID']"/></t>,<t><t t-esc="o['Bank']"/></t>,,,<t><t t-esc="'%.2f' % (int(o['Salary'] * 100) / 100.0)"/></t>,,,,,,,N,N,,,,,,@SACH@,<t><t t-esc="o['National']"/></t>,<t><t t-esc="'%.2f'% o['Basic']"/></t>,<t><t t-esc="'%.2f'% o['Housing']"/></t><t>,<t t-esc="'%.2f'% o['Other']"/></t>,<t><t t-esc="'%.2f'% o['Deduction']"/></t>,<t>salary of <t t-esc="pay_slip"/></t></t></t>
|
||||
<t>SECPTY,</t><t><t t-esc="o['Account #']"/></t>,<t><t t-esc="o['Name']"/></t>,<t><t t-esc="o['ID']"/></t>,<t><t t-esc="o['Bank']"/></t>,,,<t><t t-esc="'%.2f'% o['Salary']"/></t>,,,,,,,N,N,,,,,,@SACH@,<t><t t-esc="o['National']"/></t>,<t><t t-esc="'%.2f'% o['Basic']"/></t>,<t><t t-esc="'%.2f'% o['Housing']"/></t><t>,<t t-esc="'%.2f'% o['Other']"/></t>,<t><t t-esc="'%.2f'% o['Deduction']"/></t>,<t>salary of <t t-esc="pay_slip"/></t></t></t>
|
||||
<t t-elif="bank_type=='alahli'"><t t-foreach="v['docs']" t-as="o"><t></t>
|
||||
<t>SECPTY,</t><t><t t-esc="o['Account #']"/></t>,<t><t t-esc="o['Name']"/></t>,<t><t t-esc="o['ID']"/></t>,<t><t t-esc="o['Bank']"/></t>,,,<t><t t-esc="'%.2f' % (int(o['Salary'] * 100) / 100.0)"/></t>,,,,,,,N,N,,,,,,@SACH@,<t><t t-esc="o['National']"/></t>,<t><t t-esc="'%.2f'% o['Basic']"/></t>,<t><t t-esc="'%.2f'% o['Housing']"/></t><t>,<t t-esc="'%.2f'% o['Other']"/></t>,<t><t t-esc="'%.2f'% o['Deduction']"/></t>,<t>salary of <t t-esc="pay_slip"/></t></t></t>
|
||||
<t>SECPTY,</t><t><t t-esc="o['Account #']"/></t>,<t><t t-esc="o['Name']"/></t>,<t><t t-esc="o['ID']"/></t>,<t><t t-esc="o['Bank']"/></t>,,,<t><t t-esc="'%.2f'% o['Salary']"/></t>,,,,,,,N,N,,,,,,@SACH@,<t><t t-esc="o['National']"/></t>,<t><t t-esc="'%.2f'% o['Basic']"/></t>,<t><t t-esc="'%.2f'% o['Housing']"/></t><t>,<t t-esc="'%.2f'% o['Other']"/></t>,<t><t t-esc="'%.2f'% o['Deduction']"/></t>,<t>salary of <t t-esc="pay_slip"/></t></t></t>
|
||||
<t t-elif="bank_type=='riyadh'"><t t-foreach="v['docs']" t-as="o"><t></t>
|
||||
<t>SECPTY,</t><t><t t-esc="o+['Account #']"/></t>,<t><t t-esc="o['Name']"/></t>,<t><t t-esc="o['ID']"/></t>,<t><t t-esc="o['Bank']"/></t>,,,<t><t t-esc="'%.2f' % (int(o['Salary'] * 100) / 100.0)"/></t>,,,,,,,N,N,,,,,,@SACH@,<t><t t-esc="o['National']"/></t>,<t><t t-esc="'%.2f'% o['Basic']"/></t>,<t><t t-esc="'%.2f'% o['Housing']"/></t><t>,<t t-esc="'%.2f'% o['Other']"/></t>,<t><t t-esc="'%.2f'% o['Deduction']"/></t>,<t>salary of <t t-esc="pay_slip"/></t></t></t></t>
|
||||
<t>SECPTY,</t><t><t t-esc="o+['Account #']"/></t>,<t><t t-esc="o['Name']"/></t>,<t><t t-esc="o['ID']"/></t>,<t><t t-esc="o['Bank']"/></t>,,,<t><t t-esc="'%.2f'% o['Salary']"/></t>,,,,,,,N,N,,,,,,@SACH@,<t><t t-esc="o['National']"/></t>,<t><t t-esc="'%.2f'% o['Basic']"/></t>,<t><t t-esc="'%.2f'% o['Housing']"/></t><t>,<t t-esc="'%.2f'% o['Other']"/></t>,<t><t t-esc="'%.2f'% o['Deduction']"/></t>,<t>salary of <t t-esc="pay_slip"/></t></t></t></t>
|
||||
</template>
|
||||
</data>
|
||||
</odoo>
|
||||
|
|
|
|||
Loading…
Reference in New Issue