@ -0,0 +1,52 @@ |
|||
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg |
|||
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html |
|||
:alt: License: AGPL-3 |
|||
|
|||
Advanced VAT Invoice |
|||
==================== |
|||
This module allow us to print vat invoice report and simplified tax invoice |
|||
report in arabic language and also this module have an option for generating |
|||
qr code and display invoice reports while scanning the QR code. |
|||
|
|||
License |
|||
------- |
|||
General Public License, Version 3 (AGPL v3). |
|||
https://www.gnu.org/licenses/agpl-3.0-standalone.html |
|||
|
|||
Configuration |
|||
============= |
|||
* Select QR code generation method from Configuration --> Settings --> QR Code |
|||
|
|||
Company |
|||
------- |
|||
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
|||
|
|||
Credits |
|||
------- |
|||
Developer: (V16) Athira P S , |
|||
(V17) Gayathri V , |
|||
(V18) Mufeeda Shirin |
|||
|
|||
Contact: odoo@cybrosys.com |
|||
|
|||
Contacts |
|||
-------- |
|||
* Mail Contact : odoo@cybrosys.com |
|||
* Website : https://cybrosys.com |
|||
|
|||
Bug Tracker |
|||
----------- |
|||
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
|||
|
|||
Maintainer |
|||
========== |
|||
.. image:: https://cybrosys.com/images/logo.png |
|||
:target: https://cybrosys.com |
|||
|
|||
This module is maintained by Cybrosys Technologies. |
|||
|
|||
For support and more information, please visit `Our Website <https://cybrosys.com/>`__ |
|||
|
|||
Further information |
|||
=================== |
|||
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,22 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
|
|||
############################################################################### |
|||
from . import models |
@ -0,0 +1,50 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
|
|||
############################################################################### |
|||
{ |
|||
'name': 'E-Invoicing For Saudi | Saudi VAT Invoice ' |
|||
'| Saudi Electronic Invoice | Saudi Zatca', |
|||
'version': '18.0.1.0.0', |
|||
'category': 'Accounting', |
|||
'summary': "This module enables VAT-compliant e-Invoicing for Saudi Arabia," |
|||
" following ZATCA (Fatoorah) regulations. It supports generating" |
|||
" electronic invoices with QR codes and structured formats for " |
|||
"both simplified and standard invoices", |
|||
'description': "e-Invoicing For Saudi,Saudi VAT Invoice,Saudi Electronic " |
|||
"Invoice,Saudi Zatca,Zatca,Saudi,e-Invoicing", |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'maintainer': 'Cybrosys Techno Solutions', |
|||
'website': 'https://www.cybrosys.com', |
|||
'depends': ['account', 'account_payment'], |
|||
'data': [ |
|||
'views/res_config_settings_views.xml', |
|||
'views/account_move_views.xml', |
|||
'report/account_move_reports.xml', |
|||
'report/vat_invoice_report_templates.xml', |
|||
'report/simplified_tax_report_templates.xml' |
|||
], |
|||
'images': ['static/description/banner.png'], |
|||
'license': 'AGPL-3', |
|||
'installable': True, |
|||
'application': False, |
|||
'auto_install': False, |
|||
} |
@ -0,0 +1,7 @@ |
|||
## Module <advanced_vat_invoice> |
|||
|
|||
#### 13.11.2024 |
|||
#### Version 18.0.1.0.0 |
|||
##### ADD |
|||
|
|||
- Initial Commit for Advanced VAT Invoice |
@ -0,0 +1,23 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
|
|||
############################################################################### |
|||
from . import account_move |
|||
from . import res_config_settings |
@ -0,0 +1,184 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
|
|||
############################################################################### |
|||
from io import BytesIO |
|||
import binascii |
|||
import pytz |
|||
|
|||
from odoo import api, fields, models, _ |
|||
from odoo.exceptions import UserError |
|||
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT |
|||
|
|||
try: |
|||
import qrcode |
|||
except ImportError: |
|||
qrcode = None |
|||
try: |
|||
import base64 |
|||
except ImportError: |
|||
base64 = None |
|||
|
|||
|
|||
class AccountMove(models.Model): |
|||
"""Class for adding new button and a page in account move""" |
|||
_inherit = 'account.move' |
|||
|
|||
qr = fields.Binary(string="QR Code", compute='generate_qrcode', store=True, |
|||
help="QR code") |
|||
qr_button = fields.Boolean(string="Qr Button", compute="_compute_qr", |
|||
help="Is QR button is enable or not") |
|||
qr_page = fields.Boolean(string="Qr Page", compute="_compute_qr", |
|||
help="Is QR page is enable or not") |
|||
|
|||
@api.depends('qr_button') |
|||
def _compute_qr(self): |
|||
"""Compute function for checking the value of a field in settings.""" |
|||
for record in self: |
|||
qr_code = self.env['ir.config_parameter'].sudo().get_param( |
|||
'advanced_vat_invoice.is_qr' |
|||
) |
|||
qr_code_generate_method = self.env[ |
|||
'ir.config_parameter'].sudo().get_param( |
|||
'advanced_vat_invoice.generate_qr' |
|||
) |
|||
record.qr_button = ( |
|||
True if ( |
|||
qr_code and qr_code_generate_method == 'manually') |
|||
else False |
|||
) |
|||
record.qr_page = ( |
|||
True if ( |
|||
qr_code |
|||
and record.state in ['posted', 'cancelled'] |
|||
and qr_code_generate_method == 'manually' |
|||
or qr_code_generate_method == 'automatically' |
|||
) |
|||
else False |
|||
) |
|||
|
|||
def timezone(self, userdate): |
|||
"""Function to convert a user's date to their timezone.""" |
|||
tz_name = self.env.context.get('tz') or self.env.user.tz |
|||
contex_tz = pytz.timezone(tz_name) |
|||
date_time = pytz.utc.localize(userdate).astimezone(contex_tz) |
|||
return date_time.strftime(DEFAULT_SERVER_DATETIME_FORMAT) |
|||
|
|||
def string_hexa(self, value): |
|||
"""Convert a string to a hexadecimal representation.""" |
|||
if value: |
|||
string = str(value) |
|||
string_bytes = string.encode("UTF-8") |
|||
encoded_hex_value = binascii.hexlify(string_bytes) |
|||
hex_value = encoded_hex_value.decode("UTF-8") |
|||
return hex_value |
|||
|
|||
def hexa(self, tag, length, value): |
|||
"""Generate a hex value with tag, length, and value.""" |
|||
if tag and length and value: |
|||
hex_string = self.string_hexa(value) |
|||
length = int(len(hex_string) / 2) |
|||
conversion_table = ['0', '1', '2', '3', '4', '5', '6', '7', '8', |
|||
'9', 'a', 'b', 'c', 'd', 'e', 'f'] |
|||
hexadecimal = '' |
|||
while (length > 0): |
|||
remainder = length % 16 |
|||
hexadecimal = conversion_table[remainder] + hexadecimal |
|||
length = length // 16 |
|||
if len(hexadecimal) == 1: |
|||
hexadecimal = "0" + hexadecimal |
|||
return tag + hexadecimal + hex_string |
|||
|
|||
def qr_code_data(self): |
|||
"""Generate QR code data for the current record.""" |
|||
seller_name = str(self.company_id.name) |
|||
seller_vat_no = self.company_id.vat or '' |
|||
seller_hex = self.hexa("01", "0c", seller_name) |
|||
vat_hex = self.hexa("02", "0f", seller_vat_no) or "" |
|||
time_stamp = self.timezone(self.create_date) |
|||
date_hex = self.hexa("03", "14", time_stamp) |
|||
amount_total = self.currency_id._convert( |
|||
self.amount_total, |
|||
self.env.ref('base.SAR'), |
|||
self.env.company, self.invoice_date or fields.Date.today()) |
|||
total_with_vat_hex = self.hexa("04", "0a", |
|||
str(round(amount_total, 2))) |
|||
amount_tax = self.currency_id._convert( |
|||
self.amount_tax, |
|||
self.env.ref('base.SAR'), |
|||
self.env.company, self.invoice_date or fields.Date.today()) |
|||
total_vat_hex = self.hexa("05", "09", |
|||
str(round(amount_tax, 2))) |
|||
qr_hex = (seller_hex + vat_hex + date_hex + total_with_vat_hex + |
|||
total_vat_hex) |
|||
encoded_base64_bytes = base64.b64encode(bytes.fromhex(qr_hex)).decode() |
|||
return encoded_base64_bytes |
|||
|
|||
@api.depends('state') |
|||
def generate_qrcode(self): |
|||
"""Generate and save QR code after the invoice is posted.""" |
|||
param = self.env['ir.config_parameter'].sudo() |
|||
qr_code = param.get_param('advanced_vat_invoice.generate_qr') |
|||
for rec in self: |
|||
if rec.state == 'posted': |
|||
if qrcode and base64: |
|||
if qr_code == 'automatically': |
|||
qr = qrcode.QRCode( |
|||
version=4, |
|||
error_correction=qrcode.constants.ERROR_CORRECT_L, |
|||
box_size=4, |
|||
border=1, |
|||
) |
|||
qr.add_data(self._origin.qr_code_data()) |
|||
qr.make(fit=True) |
|||
img = qr.make_image() |
|||
temp = BytesIO() |
|||
img.save(temp, format="PNG") |
|||
qr_image = base64.b64encode(temp.getvalue()) |
|||
rec.qr = qr_image |
|||
else: |
|||
raise UserError( |
|||
_('Necessary Requirements To Run This Operation Is ' |
|||
'Not Satisfied')) |
|||
|
|||
def generate_qr_button(self): |
|||
"""Manually generate and save QR code.""" |
|||
param = self.env['ir.config_parameter'].sudo() |
|||
qr_code = param.get_param('advanced_vat_invoice.generate_qr') |
|||
for rec in self: |
|||
if qrcode and base64: |
|||
if qr_code == 'manually': |
|||
qr = qrcode.QRCode( |
|||
version=4, |
|||
error_correction=qrcode.constants.ERROR_CORRECT_L, |
|||
box_size=4, |
|||
border=1, |
|||
) |
|||
qr.add_data(self.qr_code_data()) |
|||
qr.make(fit=True) |
|||
img = qr.make_image() |
|||
temp = BytesIO() |
|||
img.save(temp, format="PNG") |
|||
qr_image = base64.b64encode(temp.getvalue()) |
|||
rec.qr = qr_image |
|||
else: |
|||
raise UserError( |
|||
_('Necessary Requirements To Run This Operation Is ' |
|||
'Not Satisfied')) |
@ -0,0 +1,55 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################### |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU AFFERO |
|||
# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE |
|||
# (AGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
|
|||
############################################################################### |
|||
from odoo import api, fields, models |
|||
|
|||
|
|||
class ResConfigSettings(models.TransientModel): |
|||
"""Class foe adding qr code generation configuration""" |
|||
_inherit = 'res.config.settings' |
|||
|
|||
generate_qr = fields.Selection( |
|||
[('automatically', 'Generate QR Code when invoice validate/post'), |
|||
('manually', 'Manually Generate')], string="Generate", |
|||
help="Select the way of generating QR code") |
|||
is_qr = fields.Boolean(string="QR Code", |
|||
help="QR code Generation Configuration") |
|||
|
|||
@api.model |
|||
def get_values(self): |
|||
"""Get the current configuration values.""" |
|||
res = super().get_values() |
|||
res.update( |
|||
generate_qr=self.env['ir.config_parameter'].sudo().get_param( |
|||
'advanced_vat_invoice.generate_qr'), |
|||
is_qr=self.env['ir.config_parameter'].sudo().get_param( |
|||
'advanced_vat_invoice.is_qr'), |
|||
) |
|||
return res |
|||
|
|||
def set_values(self): |
|||
"""Set the configuration values.""" |
|||
super().set_values() |
|||
param = self.env['ir.config_parameter'].sudo() |
|||
generate_qr = self.generate_qr and self.generate_qr or False |
|||
is_qr = self.is_qr and self.is_qr or False |
|||
param.set_param('advanced_vat_invoice.generate_qr', generate_qr) |
|||
param.set_param('advanced_vat_invoice.is_qr', is_qr) |
@ -0,0 +1,47 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<!-- VAT Invoice Report --> |
|||
<record id="action_report_vat_report" model="ir.actions.report"> |
|||
<field name="name">VAT Invoice</field> |
|||
<field name="model">account.move</field> |
|||
<field name="report_type">qweb-pdf</field> |
|||
<field name="report_name">advanced_vat_invoice.vat_template</field> |
|||
<field name="report_file">advanced_vat_invoice.vat_template</field> |
|||
<field name="binding_model_id" eval="False"/> |
|||
<field name="binding_type">report</field> |
|||
</record> |
|||
<!-- Report action for VAT invoice report--> |
|||
<record id="action_vat_invoice" model="ir.actions.report"> |
|||
<field name="name">VAT Invoice</field> |
|||
<field name="model">account.move</field> |
|||
<field name="report_type">qweb-pdf</field> |
|||
<field name="report_name">advanced_vat_invoice.vat_template</field> |
|||
<field name="report_file">advanced_vat_invoice.vat_template</field> |
|||
<field name="print_report_name">(object._get_report_base_filename()) |
|||
</field> |
|||
<field name="binding_model_id" ref="model_account_move"/> |
|||
<field name="binding_type">report</field> |
|||
</record> |
|||
<!-- Simplified Tax Report --> |
|||
<record id="action_report_simplified_report" model="ir.actions.report"> |
|||
<field name="name">Simplified Tax</field> |
|||
<field name="model">account.move</field> |
|||
<field name="report_type">qweb-pdf</field> |
|||
<field name="report_name">advanced_vat_invoice.simplified_tax_template</field> |
|||
<field name="report_file">advanced_vat_invoice.simplified_tax_template</field> |
|||
<field name="binding_model_id" eval="False"/> |
|||
<field name="binding_type">report</field> |
|||
</record> |
|||
<!-- Report action for simplified VAT invoice report--> |
|||
<record id="action_tax_invoice" model="ir.actions.report"> |
|||
<field name="name">Simplified Tax invoice</field> |
|||
<field name="model">account.move</field> |
|||
<field name="report_type">qweb-pdf</field> |
|||
<field name="report_name">advanced_vat_invoice.simplified_tax_template</field> |
|||
<field name="report_file">advanced_vat_invoice.simplified_tax_template</field> |
|||
<field name="print_report_name">(object._get_report_base_filename()) |
|||
</field> |
|||
<field name="binding_model_id" ref="model_account_move"/> |
|||
<field name="binding_type">report</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,158 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<!--Template for simplified tax report--> |
|||
<template id="simplified_tax_template"> |
|||
<t t-call="web.html_container"> |
|||
<t t-call="web.external_layout"> |
|||
<t t-foreach="docs" t-as="doc"> |
|||
<div class="page"> |
|||
<h4> |
|||
<center> |
|||
<span class="text-right">فاتورة ضريبية مبسطة |
|||
</span> |
|||
<br/> |
|||
<span>Simplified Tax Invoice</span> |
|||
</center> |
|||
</h4> |
|||
</div> |
|||
<br/> |
|||
<div> |
|||
<div style="float:left !important;"> |
|||
<span>Invoice Number :</span> |
|||
<t t-esc="doc.name"/> |
|||
<br/> |
|||
<span>Issue Date:</span> |
|||
<t t-esc="doc.invoice_date"/> |
|||
</div> |
|||
|
|||
<div style="float:right !important;"> |
|||
<img t-attf-src="data:image/png;base64, {{doc.qr}}"/> |
|||
</div> |
|||
</div> |
|||
<br/> |
|||
|
|||
<table style="border:2pt solid grey;width:100%;color:black;" |
|||
class="table-condensed"> |
|||
<thead> |
|||
<tr style="background-color:#DCDCDC"> |
|||
<td width="40%" |
|||
style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
Description |
|||
<br/> |
|||
<span class="description">تفاصيل السلع أو |
|||
الخدمات |
|||
</span> |
|||
</td> |
|||
<td width="20%" |
|||
style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
Unit Price |
|||
<br/> |
|||
<span class="unit_price">سعر الوحدة</span> |
|||
</td> |
|||
<td width="20%" |
|||
style="border:2pt solid grey;text-align:center;padding:2pt;width:7%"> |
|||
Quantity |
|||
<br/> |
|||
<span class="qty"/> |
|||
الكمية |
|||
</td> |
|||
<td width="20%" |
|||
style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
Total |
|||
<br/> |
|||
(excl.vat) |
|||
<br/> |
|||
<span class="total">المجموع (شامل ضريبة |
|||
القيمة المضافة) |
|||
</span> |
|||
</td> |
|||
</tr> |
|||
</thead> |
|||
<t t-set="tax_total" t-value="0"/> |
|||
<tbody class="invoice_line"> |
|||
<tr t-foreach="doc.invoice_line_ids" t-as="line"> |
|||
<t t-set="line_tax_total" t-value="0"/> |
|||
<t t-foreach="line.tax_ids" t-as="tax"> |
|||
<t t-set="tax_total" |
|||
t-value="tax_total + line.price_subtotal* tax.amount/100"/> |
|||
<t t-set="line_tax_total" |
|||
t-value="line_tax_total + tax.amount"/> |
|||
</t> |
|||
<td style="border-right:2pt solid grey;text-align:center;padding:3pt"> |
|||
<span t-field="line.name"/> |
|||
<br/> |
|||
</td> |
|||
<td style="border-right:2pt solid grey;text-align:center;padding:3pt"> |
|||
<span t-field="line.price_unit" t-options='{" widget": "monetary", " |
|||
display_currency": doc.currency_id}'/> |
|||
</td> |
|||
<td style="border-right:2pt solid grey;text-align:center;padding:3pt"> |
|||
<span t-esc="'%.2f %s '%(line.quantity,line.product_uom_id.name)"/> |
|||
</td> |
|||
<td style="border-right:2pt solid grey;text-align:center;padding:3pt"> |
|||
<span t-field="line.price_subtotal" |
|||
t-options='{" widget": "monetary", " |
|||
display_currency": doc.currency_id}'/> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<br/> |
|||
<table style="border:2pt solid grey;width:100%;color:black;" |
|||
class="table table-bordered table-sm"> |
|||
<thead> |
|||
<tr> |
|||
<td width="40%" |
|||
style="font-weight: bold;text-align:left;padding:2pt"> |
|||
Total Taxable |
|||
Amount (excl. VAT) |
|||
</td> |
|||
<td class="amount" width="40%" |
|||
style="text-align:right;padding:2pt">إجمالي |
|||
المبلغ |
|||
الخاضع للضريبة (غير شامل ضريبة القيمة |
|||
المضافة) |
|||
</td> |
|||
<td width="40%" |
|||
style="text-align:right;padding:2pt" |
|||
class="text-right"> |
|||
<span t-esc="doc.currency_id.symbol"/> |
|||
<span t-esc="doc.amount_untaxed"/> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="font-weight: bold;text-align:left;padding:3pt"> |
|||
Total VAT |
|||
</td> |
|||
<td class="total" |
|||
style="text-align:right;padding:3pt">مجموع |
|||
ضريبة القيمة المضافة |
|||
</td> |
|||
<td style="text-align:right;padding:3pt" |
|||
class="text-right"> |
|||
<span t-esc="doc.currency_id.symbol"/> |
|||
<span t-esc="tax_total"/> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="font-weight: bold;text-align:left;padding:3pt"> |
|||
Amount Due |
|||
</td> |
|||
<td class="due" |
|||
style="text-align:right;padding:3pt">اجمالي |
|||
المبلغ المستحق |
|||
</td> |
|||
<td style="text-align:right;padding:3pt" |
|||
class="text-right"> |
|||
<span t-esc="doc.currency_id.symbol"/> |
|||
<span t-esc="doc.amount_residual"/> |
|||
</td> |
|||
</tr> |
|||
</thead> |
|||
</table> |
|||
<br/> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
</odoo> |
@ -0,0 +1,378 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<!--Template for VAT invoice report--> |
|||
<template id="vat_template"> |
|||
<t t-call="web.html_container"> |
|||
<t t-call="web.external_layout"> |
|||
<t t-foreach="docs" t-as="doc"> |
|||
<div class="page"> |
|||
<h4> |
|||
<center> |
|||
<span class="text-right">فاتورة ضريبية مبسطة |
|||
</span> |
|||
<br/> |
|||
<span>VAT Invoice</span> |
|||
</center> |
|||
</h4> |
|||
</div> |
|||
<div> |
|||
<table> |
|||
<tr style="border:2pt solid grey;"> |
|||
<td width="16%"> |
|||
<span/>Invoice Number |
|||
</td> |
|||
<td width="16%"> |
|||
<span>رقم الفاتورة</span> |
|||
</td> |
|||
<td width="16%"> |
|||
<t t-esc="doc.name"/> |
|||
</td> |
|||
</tr> |
|||
<br/> |
|||
</table> |
|||
</div> |
|||
<br/> |
|||
<div class="row mt32 mb32"> |
|||
<div class="col-9" style="color:black; "> |
|||
<table style="border:2pt solid grey;width:100%;padding:10pt;color:black;" |
|||
class="table table-bordered table-sm"> |
|||
<tr> |
|||
<td style="font-weight:bold; width:25%;"> |
|||
Invoice Issue Date: |
|||
</td> |
|||
<td class="issue" |
|||
style="width:25%; text-align:right;"> |
|||
رقم الفاتورة |
|||
</td> |
|||
<td style="width:30%; text-align:center;"> |
|||
<t t-esc="doc.invoice_date"/> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="font-weight:bold; width:25%;"> |
|||
Due Date: |
|||
</td> |
|||
<td class="due" |
|||
style="width:25%; text-align:right;"> |
|||
تاريخ الاستحقاق |
|||
</td> |
|||
<td style="width:30%; text-align:center;"> |
|||
<t t-esc="doc.invoice_payment_term_id.name"/> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
<br/> |
|||
</div> |
|||
<div class="col-3" |
|||
style="margin-top: -8pt; padding-left:30pt;"> |
|||
<img t-attf-src="data:image/png;base64, {{doc.qr}}"/> |
|||
</div> |
|||
</div> |
|||
<br/> |
|||
<table style="border:2pt solid grey;width:100%;color:black; margin-top:0pt; color:black;" |
|||
class="table-condensed"> |
|||
<thead> |
|||
<tr style="background-color:#DCDCDC"> |
|||
<td width="15%" |
|||
style="border:2pt solid grey;text-align:center;padding:2pt; "> |
|||
Seller |
|||
</td> |
|||
<td width="15%" |
|||
style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
تاجر |
|||
</td> |
|||
<td width="20%" |
|||
style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
</td> |
|||
<td width="15%" |
|||
style="border:2pt solid grey;text-align:center;padding:2pt; "> |
|||
Buyer |
|||
</td> |
|||
<td width="15%" |
|||
style="border:2pt solid grey;text-align:center;padding:2pt; "> |
|||
مشتر |
|||
</td> |
|||
<td width="20%" |
|||
style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
</td> |
|||
</tr> |
|||
</thead> |
|||
<tr> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
Name: |
|||
</td> |
|||
<td width="15%" |
|||
style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
اسم |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
<t t-esc="doc.company_id.name"/> |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
<span>Name:</span> |
|||
</td> |
|||
<td width="15%" |
|||
style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
اسم |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
<t t-esc="doc.partner_id.name"/> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
Street Name: |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
اسم الشارع |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
<t t-esc="doc.company_id.street"/> |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
Street Name: |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
اسم الشارع |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
<t t-esc="doc.partner_id.street"/> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="border:2pt solid grey;text-align:center; width:10%;padding:2pt"> |
|||
District: |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
منطقة |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
<t t-esc="doc.company_id.city"/> |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
District: |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
منطقة |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
<t t-esc="doc.partner_id.city"/> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;width:8%"> |
|||
State: |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
حالة |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
<t t-esc="doc.company_id.state_id.name"/> |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
State: |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
حالة |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
<t t-esc="doc.partner_id.state_id.name"/> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="border:2pt solid grey;text-align:center; width:10%;padding:2pt"> |
|||
Country: |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
بلد |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
<t t-esc="doc.company_id.country_id.name"/> |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
Country: |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
بلد |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
<t t-esc="doc.partner_id.country_id.name"/> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
PIN Code: |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
الرمز البريدي |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
<t t-esc="doc.company_id.zip"/> |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
PIN Code: |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
الرمز البريدي |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
<t t-esc="doc.partner_id.zip"/> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
Phone Number: |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
رقم الهاتف |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
<t t-esc="doc.company_id.phone"/> |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
Phone Number: |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
رقم الهاتف |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
<t t-esc="doc.partner_id.phone"/> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
VAT Number: |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
ظريبه الشراء |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
<t t-esc="doc.company_id.vat"/> |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
VAT Number: |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
ظريبه الشراء |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
<t t-esc="doc.partner_id.vat"/> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
<br/> |
|||
<table style="border:2pt solid grey;width:100%; height: 23px;color:black; margin-top:10pt;" |
|||
class="table-condensed table-sm"> |
|||
<tr> |
|||
<td style="padding:2pt;margin:0pt;font-weight: bold;text-align:center;"> |
|||
<span class="text-right arabic">Order Line |
|||
Items/البنود |
|||
</span> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
<table style="border:2pt solid grey;width:100%;color:black; margin-top:0pt; color:black;" |
|||
class="table-condensed"> |
|||
<thead> |
|||
<tr style="background-color:#DCDCDC"> |
|||
<td width="20%" |
|||
style="border:2pt solid grey;text-align:center;padding:2pt; "> |
|||
Product Name |
|||
<br/> |
|||
<span class="product">تفاصيل السلع أو |
|||
الخدمات |
|||
</span> |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
Unit Price |
|||
<br/> |
|||
<span class="price">سعر الوحدة</span> |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;width:7%"> |
|||
Quantity |
|||
<br/> |
|||
<span class="qty">الكمية</span> |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
Tax Amount |
|||
<br/> |
|||
<span class="tax">المبلغ الخاضع للضريبة |
|||
</span> |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center; width:10%;padding:2pt"> |
|||
Discount Price |
|||
<br/> |
|||
<span class="discount">خصومات</span> |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;width:8%"> |
|||
Tax Rate |
|||
<br/> |
|||
<span class="tax_rate">نسبة الضريبة</span> |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center; width:10%;padding:2pt"> |
|||
Tax Amount |
|||
<br/> |
|||
<span class="amount">مبلغ الضريبة</span> |
|||
</td> |
|||
<td style="border:2pt solid grey;text-align:center;padding:2pt;"> |
|||
Subtotal |
|||
<br/> |
|||
(excl.vat) |
|||
<br/> |
|||
<span class="sub_total">المجموع (شامل ضريبة |
|||
القيمة المضافة) |
|||
</span> |
|||
</td> |
|||
</tr> |
|||
</thead> |
|||
<t t-set="tax_total" t-value="0"/> |
|||
<t t-set="discount_total" t-value="0"/> |
|||
<tbody class="invoice_line"> |
|||
<tr t-foreach="doc.invoice_line_ids" t-as="line"> |
|||
<t t-set="line_tax_total" t-value="0"/> |
|||
<t t-foreach="line.tax_ids" t-as="tax"> |
|||
<t t-set="tax_total" |
|||
t-value="tax_total + line.price_subtotal* tax.amount/100"/> |
|||
<t t-set="line_tax_total" |
|||
t-value="line_tax_total + tax.amount"/> |
|||
</t> |
|||
<t t-set="discount_total" |
|||
t-value="discount_total + ((line.price_unit * line.quantity) - line.price_subtotal)"/> |
|||
<td style="border-right:2pt solid grey;padding:3pt"> |
|||
<span t-field="line.name"/> |
|||
<br/> |
|||
</td> |
|||
<td style="border-right:2pt solid grey;text-align:right;padding:3pt"> |
|||
<span t-field="line.price_unit"/> |
|||
</td> |
|||
<td style="border-right:2pt solid grey;text-align:center;padding:3pt"> |
|||
<span t-esc="'%.2f %s '%(line.quantity,line.product_uom_id.name)"/> |
|||
</td> |
|||
<td style="padding:2pt;border-right:2pt solid grey;text-align:right;"> |
|||
<sapn t-esc="line.price_unit * line.quantity"/> |
|||
</td> |
|||
<td style="border-right:2pt solid grey;text-align:right;padding:3pt;"> |
|||
<span t-field="line.discount"/>% |
|||
</td> |
|||
<td style="border-right:2pt solid grey;padding:2pt;text-align:center;"> |
|||
<t t-foreach="line.tax_ids" t-as="tax"> |
|||
<span t-esc="'%.2f'%(tax.amount)"/>% |
|||
</t> |
|||
<span t-if="not line.tax_ids">0.0 %</span> |
|||
</td> |
|||
<td style="padding:2pt;border-right:2pt solid grey;text-align:right;"> |
|||
<t t-set="line_tax_total" |
|||
t-value="line.price_subtotal*line_tax_total/100"/> |
|||
<sapn t-esc="line_tax_total"/> |
|||
</td> |
|||
<td style="border-right:2pt solid grey;text-align:right;padding:3pt"> |
|||
<span t-field="line.price_subtotal"/> |
|||
</td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
</t> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
</odoo> |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 738 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 126 KiB |
After Width: | Height: | Size: 86 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 118 KiB |
After Width: | Height: | Size: 142 KiB |
After Width: | Height: | Size: 138 KiB |
After Width: | Height: | Size: 213 KiB |
After Width: | Height: | Size: 89 KiB |
After Width: | Height: | Size: 100 KiB |
After Width: | Height: | Size: 101 KiB |
After Width: | Height: | Size: 113 KiB |
After Width: | Height: | Size: 89 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 96 KiB |
After Width: | Height: | Size: 880 KiB |
After Width: | Height: | Size: 94 KiB |
After Width: | Height: | Size: 8.2 KiB |
@ -0,0 +1,32 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<!-- Account move views for adding a field--> |
|||
<record id="view_move_form" model="ir.ui.view"> |
|||
<field name="name"> |
|||
account.move.view.form.inherit.advanced.vat.invoice |
|||
</field> |
|||
<field name="model">account.move</field> |
|||
<field name="inherit_id" ref="account.view_move_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//notebook/page[@id='other_tab']" position="after"> |
|||
<page string="QR Code" |
|||
invisible="qr_page != True"> |
|||
<group> |
|||
<group> |
|||
<label for="qr"/> |
|||
<field name="qr" widget='image' nolabel="1" |
|||
invisible="state != 'posted'"/> |
|||
<field name="qr_button" invisible="1"/> |
|||
<field name="qr_page" invisible="1"/> |
|||
</group> |
|||
</group> |
|||
</page> |
|||
</xpath> |
|||
<xpath expr="header" position="inside"> |
|||
<button name="generate_qr_button" string="Generate QR" |
|||
type="object" |
|||
invisible="qr_button == False or state != 'posted'"/> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,34 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<!-- Res config settings view for adding new boolean fields--> |
|||
<record id="res_config_settings_view_form" model="ir.ui.view"> |
|||
<field name="name"> |
|||
res.config.settings.view.form.inherit.advanced.vat.invoice |
|||
</field> |
|||
<field name="model">res.config.settings</field> |
|||
<field name="inherit_id" ref="account.res_config_settings_view_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//block[@id='account_vendor_bills']" position="after"> |
|||
<h2>QR Code</h2> |
|||
<div class="row mt16 o_settings_container" id="account_qr"> |
|||
<div class="col-xs-12 col-md-6 o_setting_box" id="show_qr"> |
|||
<div class="o_setting_left_pane"> |
|||
<field name="is_qr"/> |
|||
</div> |
|||
<div class="o_setting_right_pane" name="is_qr_right"> |
|||
<label for="is_qr"/> |
|||
<div class="text-muted"> |
|||
QR Code Generation Method |
|||
</div> |
|||
<br/> |
|||
<div id="qr_code" class="content-group"> |
|||
<field name="generate_qr" widget="radio" |
|||
invisible="is_qr == False"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |