Deepesh Garg
3 years ago
committed by
GitHub
9 changed files with 209 additions and 120 deletions
@ -0,0 +1,16 @@ |
|||
# Copyright (c) 2020, Wahni Green Technologies and Contributors |
|||
# License: GNU General Public License v3. See license.txt |
|||
|
|||
import frappe |
|||
|
|||
|
|||
def execute(): |
|||
company = frappe.get_all('Company', filters = {'country': 'Saudi Arabia'}) |
|||
if company: |
|||
return |
|||
|
|||
if frappe.db.exists('DocType', 'Print Format'): |
|||
frappe.reload_doc("regional", "print_format", "ksa_vat_invoice", force=True) |
|||
frappe.reload_doc("regional", "print_format", "ksa_pos_invoice", force=True) |
|||
for d in ('KSA VAT Invoice', 'KSA POS Invoice'): |
|||
frappe.db.set_value("Print Format", d, "disabled", 1) |
@ -0,0 +1,16 @@ |
|||
# Copyright (c) 2020, Wahni Green Technologies and Contributors |
|||
# License: GNU General Public License v3. See license.txt |
|||
|
|||
import frappe |
|||
from frappe.model.utils.rename_field import rename_field |
|||
|
|||
|
|||
def execute(): |
|||
company = frappe.get_all('Company', filters = {'country': 'Saudi Arabia'}) |
|||
if not company: |
|||
return |
|||
|
|||
if frappe.db.exists('DocType', 'Sales Invoice'): |
|||
frappe.reload_doc('accounts', 'doctype', 'sales_invoice', force=True) |
|||
if frappe.db.has_column('Sales Invoice', 'qr_code'): |
|||
rename_field('Sales Invoice', 'qr_code', 'ksa_einv_qr') |
@ -0,0 +1,32 @@ |
|||
{ |
|||
"absolute_value": 0, |
|||
"align_labels_right": 0, |
|||
"creation": "2021-12-07 13:25:05.424827", |
|||
"css": "", |
|||
"custom_format": 1, |
|||
"default_print_language": "en", |
|||
"disabled": 1, |
|||
"doc_type": "POS Invoice", |
|||
"docstatus": 0, |
|||
"doctype": "Print Format", |
|||
"font_size": 0, |
|||
"html": "<style>\n\t.print-format table, .print-format tr, \n\t.print-format td, .print-format div, .print-format p {\n\t\tline-height: 150%;\n\t\tvertical-align: middle;\n\t}\n\t@media screen {\n\t\t.print-format {\n\t\t\twidth: 4in;\n\t\t\tpadding: 0.25in;\n\t\t\tmin-height: 8in;\n\t\t}\n\t}\n</style>\n\n{% if letter_head %}\n {{ letter_head }}\n{% endif %}\n\n<p class=\"text-center\" style=\"margin-bottom: 1rem\">\n\t{{ doc.company }}<br>\n\t<b>{{ doc.select_print_heading or _(\"Invoice\") }}</b><br>\n\t<img src={{doc.ksa_einv_qr}}>\n</p>\n<p>\n\t<b>{{ _(\"Receipt No\") }}:</b> {{ doc.name }}<br>\n\t<b>{{ _(\"Cashier\") }}:</b> {{ doc.owner }}<br>\n\t<b>{{ _(\"Customer\") }}:</b> {{ doc.customer_name }}<br>\n\t<b>{{ _(\"Date\") }}:</b> {{ doc.get_formatted(\"posting_date\") }}<br>\n\t<b>{{ _(\"Time\") }}:</b> {{ doc.get_formatted(\"posting_time\") }}<br>\n</p>\n\n<hr>\n<table class=\"table table-condensed\">\n\t<thead>\n\t\t<tr>\n\t\t\t<th width=\"40%\">{{ _(\"Item\") }}</th>\n\t\t\t<th width=\"25%\" class=\"text-right\">{{ _(\"Qty\") }}</th>\n\t\t\t<th width=\"35%\" class=\"text-right\">{{ _(\"Amount\") }}</th>\n\t\t</tr>\n\t</thead>\n\t<tbody>\n\t\t{%- for item in doc.items -%}\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t{{ item.item_code }}\n\t\t\t\t{%- if item.item_name != item.item_code -%}\n\t\t\t\t\t<br>{{ item.item_name }}\n\t\t\t\t{%- endif -%}\n\t\t\t\t{%- if item.serial_no -%}\n\t\t\t\t\t<br><b>{{ _(\"SR.No\") }}:</b><br>\n\t\t\t\t\t{{ item.serial_no | replace(\"\\n\", \", \") }}\n\t\t\t\t{%- endif -%}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">{{ item.qty }}</td>\n\t\t\t<td class=\"text-right\">{{ item.get_formatted(\"net_amount\") }}</td>\n\t\t</tr>\n\t\t{%- endfor -%}\n\t</tbody>\n</table>\n<table class=\"table table-condensed no-border\">\n\t<tbody>\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 60%\">\n\t\t\t\t{{ _(\"Total Excl. Tax\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"net_total\", doc) }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{%- for row in doc.taxes -%}\n\t\t\t<tr>\n\t\t\t\t<td class=\"text-right\" style=\"width: 60%\">\n\t\t\t\t {% if '%' in row.description %}\n\t\t\t\t\t {{ row.description }}\n\t\t\t\t\t{% else %}\n\t\t\t\t\t {{ row.description }}@{{ row.rate }}%\n\t\t\t\t\t{% endif %}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"text-right\">\n\t\t\t\t\t{{ row.get_formatted(\"tax_amount\", doc) }}\n\t\t\t\t</td>\n\t\t\t<tr>\n\t\t{%- endfor -%}\n\n\t\t{%- if doc.discount_amount -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 60%\">\n\t\t\t\t{{ _(\"Discount\") }}\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"discount_amount\") }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{%- endif -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 60%\">\n\t\t\t\t<b>{{ _(\"Grand Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"grand_total\") }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{%- if doc.rounded_total -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 60%\">\n\t\t\t\t<b>{{ _(\"Rounded Total\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"rounded_total\") }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{%- endif -%}\n\t\t<tr>\n\t\t\t<td class=\"text-right\" style=\"width: 60%\">\n\t\t\t\t<b>{{ _(\"Paid Amount\") }}</b>\n\t\t\t</td>\n\t\t\t<td class=\"text-right\">\n\t\t\t\t{{ doc.get_formatted(\"paid_amount\") }}\n\t\t\t</td>\n\t\t</tr>\n\t\t{%- if doc.change_amount -%}\n\t\t\t<tr>\n\t\t\t\t<td class=\"text-right\" style=\"width: 60%\">\n\t\t\t\t\t<b>{{ _(\"Change Amount\") }}</b>\n\t\t\t\t</td>\n\t\t\t\t<td class=\"text-right\">\n\t\t\t\t\t{{ doc.get_formatted(\"change_amount\") }}\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t{%- endif -%}\n\t</tbody>\n</table>\n<hr>\n<p>{{ doc.terms or \"\" }}</p>\n<p class=\"text-center\">{{ _(\"Thank you, please visit again.\") }}</p>", |
|||
"idx": 0, |
|||
"line_breaks": 0, |
|||
"margin_bottom": 0.0, |
|||
"margin_left": 0.0, |
|||
"margin_right": 0.0, |
|||
"margin_top": 0.0, |
|||
"modified": "2021-12-08 10:25:01.930885", |
|||
"modified_by": "Administrator", |
|||
"module": "Regional", |
|||
"name": "KSA POS Invoice", |
|||
"owner": "Administrator", |
|||
"page_number": "Hide", |
|||
"print_format_builder": 0, |
|||
"print_format_builder_beta": 0, |
|||
"print_format_type": "Jinja", |
|||
"raw_printing": 0, |
|||
"show_section_headings": 0, |
|||
"standard": "Yes" |
|||
} |
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue