| 1 |
from odoo import models, fields |
| 2 |
|
| 3 |
|
| 4 |
class L10nHrEdiAddendum(models.Model): |
| 5 |
_name = 'l10n_hr_edi.addendum' |
| 6 |
_description = 'EDI and fiscalization information for Croatian electronic invoicing' |
| 7 |
|
| 8 |
move_id = fields.Many2one('account.move', required=True, ondelete='cascade', index=True) |
| 9 |
|
| 10 |
# EDI and fiscalization-specific fields |
| 11 |
invoice_sending_time = fields.Datetime(string="Time of invoicing") |
| 12 |
business_document_status = fields.Selection( |
| 13 |
selection=[ |
| 14 |
('0', 'APPROVED'), |
| 15 |
('1', 'REJECTED'), |
| 16 |
('2', 'PAYMENT_FULFILLED'), |
| 17 |
('3', 'PAYMENT_PARTIALLY_FULLFILLED'), |
| 18 |
('4', 'RECEIVING_CONFIRMED'), |
| 19 |
('99', 'RECEIVED'), |
| 20 |
('None', 'None') |
| 21 |
], |
| 22 |
string='Business document status', |
| 23 |
) |
| 24 |
business_status_reason = fields.Char( |
| 25 |
string='Document rejection reason', |
| 26 |
default='None', |
| 27 |
) |
| 28 |
fiscalization_number = fields.Char( |
| 29 |
string='Invoice fiscalization number', |
| 30 |
) |
| 31 |
fiscalization_status = fields.Selection( |
| 32 |
selection=[ |
| 33 |
('0', "Successful"), |
| 34 |
('1', "Unsuccessful"), |
| 35 |
('2', "Pending"), |
| 36 |
], |
| 37 |
string='Fiscalization status', |
| 38 |
) |
| 39 |
fiscalization_error = fields.Char( |
| 40 |
string='Error reported for fiscalization', |
| 41 |
default='None', |
| 42 |
) |
| 43 |
fiscalization_request = fields.Char( |
| 44 |
string='Fiscalization request ID', |
| 45 |
) |
| 46 |
fiscalization_channel_type = fields.Selection( |
| 47 |
selection=[ |
| 48 |
('0', "Delivered via EDI"), |
| 49 |
('1', "Not delivered via EDI"), |
| 50 |
], |
| 51 |
string='Delivery channel type', |
| 52 |
help="If delivery via EDI fails, the invoice is reported to tax authorities but has to be delivered to the client via other means (ex. e-mail)." |
| 53 |
) |
| 54 |
# Payment reporting |
| 55 |
currency_id = fields.Many2one(related='move_id.currency_id') |
| 56 |
payment_reported_amount = fields.Monetary( |
| 57 |
string="Payment amount already reported to Tax Authority", |
| 58 |
currency_field='currency_id', |
| 59 |
default=0.0, |
| 60 |
) |
| 61 |
payment_method_type = fields.Selection( |
| 62 |
selection=[ |
| 63 |
('T', 'Transakcijski račun'), # Bank account |
| 64 |
('O', 'Obračunsko plaćanje'), # Settlement payment |
| 65 |
('Z', 'Ostalo'), # Other |
| 66 |
], |
| 67 |
string='Payment Method Type', |
| 68 |
default='T', |
| 69 |
) |
| 70 |
# MojEracun integration fields |
| 71 |
mer_document_eid = fields.Char(string='MojEracun document ElectronicId') |
| 72 |
mer_document_status = fields.Selection( |
| 73 |
selection=[ |
| 74 |
('20', 'In validation'), |
| 75 |
('30', 'Sent'), |
| 76 |
('40', 'Delivered'), |
| 77 |
('45', 'Canceled'), |
| 78 |
('50', 'Unsuccessful'), |
| 79 |
('70', 'Delivered (eReporting)'), |
| 80 |
], |
| 81 |
string='MojEracun document status', |
| 82 |
help="MojEracun internal document status - to be validated and received by the customer.", |
| 83 |
) |
| 84 |
mer_signed_xml_archived = fields.Boolean(string='Signed XML archived') |