mirror of
https://gitlab.com/flectra-community/l10n-switzerland-flectra.git
synced 2024-11-17 03:22:03 +00:00
22 lines
777 B
Python
22 lines
777 B
Python
# -*- coding:utf-8 -*-
|
|
|
|
from flectra import api, models
|
|
|
|
class ReportSwissQR(models.AbstractModel):
|
|
_name = 'report.l10n_ch.qr_report_main'
|
|
_description = 'Swiss QR-bill report'
|
|
|
|
@api.model
|
|
def _get_report_values(self, docids, data=None):
|
|
docs = self.env['account.move'].browse(docids)
|
|
|
|
qr_code_urls = {}
|
|
for invoice in docs:
|
|
qr_code_urls[invoice.id] = invoice.partner_bank_id.build_qr_code_url(invoice.amount_residual, invoice.ref or invoice.name, invoice.payment_reference, invoice.currency_id, invoice.partner_id, qr_method='ch_qr', silent_errors=False)
|
|
|
|
return {
|
|
'doc_ids': docids,
|
|
'doc_model': 'account.move',
|
|
'docs': docs,
|
|
'qr_code_urls': qr_code_urls,
|
|
} |