fix: function name issue
This commit is contained in:
parent
90eb046ce6
commit
00b2dede14
@ -7,68 +7,10 @@ from erpnext.regional.saudi_arabia.wizard.operations.setup_ksa_vat_setting impor
|
|||||||
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
|
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
|
||||||
|
|
||||||
def setup(company=None, patch=True):
|
def setup(company=None, patch=True):
|
||||||
make_custom_fields()
|
|
||||||
add_print_formats()
|
add_print_formats()
|
||||||
add_permissions()
|
add_permissions()
|
||||||
make_custom_fields()
|
make_custom_fields()
|
||||||
|
|
||||||
def make_custom_fields():
|
|
||||||
is_zero_rated = dict(fieldname='is_zero_rated', label='Is Zero Rated',
|
|
||||||
fieldtype='Check', fetch_from='item_code.is_zero_rated', insert_after='description',
|
|
||||||
print_hide=1)
|
|
||||||
|
|
||||||
is_exempt = dict(fieldname='is_exempt', label='Is Exempt',
|
|
||||||
fieldtype='Check', fetch_from='item_code.is_exempt', insert_after='is_zero_rated',
|
|
||||||
print_hide=1)
|
|
||||||
|
|
||||||
purchase_invoice_fields = [
|
|
||||||
dict(fieldname='company_trn', label='Company TRN',
|
|
||||||
fieldtype='Read Only', insert_after='shipping_address',
|
|
||||||
fetch_from='company.tax_id', print_hide=1),
|
|
||||||
dict(fieldname='supplier_name_in_arabic', label='Supplier Name in Arabic',
|
|
||||||
fieldtype='Read Only', insert_after='supplier_name',
|
|
||||||
fetch_from='supplier.supplier_name_in_arabic', print_hide=1)
|
|
||||||
]
|
|
||||||
|
|
||||||
sales_invoice_fields = [
|
|
||||||
dict(fieldname='company_trn', label='Company TRN',
|
|
||||||
fieldtype='Read Only', insert_after='company_address',
|
|
||||||
fetch_from='company.tax_id', print_hide=1),
|
|
||||||
dict(fieldname='customer_name_in_arabic', label='Customer Name in Arabic',
|
|
||||||
fieldtype='Read Only', insert_after='customer_name',
|
|
||||||
fetch_from='customer.customer_name_in_arabic', print_hide=1)
|
|
||||||
]
|
|
||||||
|
|
||||||
custom_fields = {
|
|
||||||
'Item': [is_zero_rated, is_exempt],
|
|
||||||
'Customer': [
|
|
||||||
dict(fieldname='customer_name_in_arabic', label='Customer Name in Arabic',
|
|
||||||
fieldtype='Data', insert_after='customer_name'),
|
|
||||||
],
|
|
||||||
'Supplier': [
|
|
||||||
dict(fieldname='supplier_name_in_arabic', label='Supplier Name in Arabic',
|
|
||||||
fieldtype='Data', insert_after='supplier_name'),
|
|
||||||
],
|
|
||||||
'Purchase Invoice': purchase_invoice_fields,
|
|
||||||
'Purchase Order': purchase_invoice_fields,
|
|
||||||
'Purchase Receipt': purchase_invoice_fields,
|
|
||||||
'Sales Invoice': sales_invoice_fields,
|
|
||||||
'POS Invoice': sales_invoice_fields,
|
|
||||||
'Sales Order': sales_invoice_fields,
|
|
||||||
'Delivery Note': sales_invoice_fields,
|
|
||||||
'Sales Invoice Item': [is_zero_rated, is_exempt],
|
|
||||||
'POS Invoice Item': [is_zero_rated, is_exempt],
|
|
||||||
'Purchase Invoice Item': [is_zero_rated, is_exempt],
|
|
||||||
'Sales Order Item': [is_zero_rated, is_exempt],
|
|
||||||
'Delivery Note Item': [is_zero_rated, is_exempt],
|
|
||||||
'Quotation Item': [is_zero_rated, is_exempt],
|
|
||||||
'Purchase Order Item': [is_zero_rated, is_exempt],
|
|
||||||
'Purchase Receipt Item': [is_zero_rated, is_exempt],
|
|
||||||
'Supplier Quotation Item': [is_zero_rated, is_exempt],
|
|
||||||
}
|
|
||||||
|
|
||||||
create_custom_fields(custom_fields)
|
|
||||||
|
|
||||||
def add_print_formats():
|
def add_print_formats():
|
||||||
frappe.reload_doc("regional", "print_format", "detailed_tax_invoice", force=True)
|
frappe.reload_doc("regional", "print_format", "detailed_tax_invoice", force=True)
|
||||||
frappe.reload_doc("regional", "print_format", "simplified_tax_invoice", force=True)
|
frappe.reload_doc("regional", "print_format", "simplified_tax_invoice", force=True)
|
||||||
@ -96,38 +38,67 @@ def make_custom_fields():
|
|||||||
- Company Name in Arabic
|
- Company Name in Arabic
|
||||||
- Address in Arabic
|
- Address in Arabic
|
||||||
"""
|
"""
|
||||||
|
is_zero_rated = dict(fieldname='is_zero_rated', label='Is Zero Rated',
|
||||||
|
fieldtype='Check', fetch_from='item_code.is_zero_rated', insert_after='description',
|
||||||
|
print_hide=1)
|
||||||
|
|
||||||
|
is_exempt = dict(fieldname='is_exempt', label='Is Exempt',
|
||||||
|
fieldtype='Check', fetch_from='item_code.is_exempt', insert_after='is_zero_rated',
|
||||||
|
print_hide=1)
|
||||||
|
|
||||||
|
purchase_invoice_fields = [
|
||||||
|
dict(fieldname='company_trn', label='Company TRN',
|
||||||
|
fieldtype='Read Only', insert_after='shipping_address',
|
||||||
|
fetch_from='company.tax_id', print_hide=1),
|
||||||
|
dict(fieldname='supplier_name_in_arabic', label='Supplier Name in Arabic',
|
||||||
|
fieldtype='Read Only', insert_after='supplier_name',
|
||||||
|
fetch_from='supplier.supplier_name_in_arabic', print_hide=1)
|
||||||
|
]
|
||||||
|
|
||||||
|
sales_invoice_fields = [
|
||||||
|
dict(fieldname='company_trn', label='Company TRN',
|
||||||
|
fieldtype='Read Only', insert_after='company_address',
|
||||||
|
fetch_from='company.tax_id', print_hide=1),
|
||||||
|
dict(fieldname='customer_name_in_arabic', label='Customer Name in Arabic',
|
||||||
|
fieldtype='Read Only', insert_after='customer_name',
|
||||||
|
fetch_from='customer.customer_name_in_arabic', print_hide=1),
|
||||||
|
dict(fieldname='ksa_einv_qr', label='KSA E-Invoicing QR',
|
||||||
|
fieldtype='Attach Image', read_only=1, no_copy=1, hidden=1)
|
||||||
|
]
|
||||||
|
|
||||||
custom_fields = {
|
custom_fields = {
|
||||||
'Sales Invoice': [
|
'Item': [is_zero_rated, is_exempt],
|
||||||
dict(
|
'Customer': [
|
||||||
fieldname='ksa_einv_qr',
|
dict(fieldname='customer_name_in_arabic', label='Customer Name in Arabic',
|
||||||
label='KSA E-Invoicing QR',
|
fieldtype='Data', insert_after='customer_name'),
|
||||||
fieldtype='Attach Image',
|
|
||||||
read_only=1, no_copy=1, hidden=1
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
'POS Invoice': [
|
'Supplier': [
|
||||||
dict(
|
dict(fieldname='supplier_name_in_arabic', label='Supplier Name in Arabic',
|
||||||
fieldname='ksa_einv_qr',
|
fieldtype='Data', insert_after='supplier_name'),
|
||||||
label='KSA E-Invoicing QR',
|
|
||||||
fieldtype='Attach Image',
|
|
||||||
read_only=1, no_copy=1, hidden=1
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
|
'Purchase Invoice': purchase_invoice_fields,
|
||||||
|
'Purchase Order': purchase_invoice_fields,
|
||||||
|
'Purchase Receipt': purchase_invoice_fields,
|
||||||
|
'Sales Invoice': sales_invoice_fields,
|
||||||
|
'POS Invoice': sales_invoice_fields,
|
||||||
|
'Sales Order': sales_invoice_fields,
|
||||||
|
'Delivery Note': sales_invoice_fields,
|
||||||
|
'Sales Invoice Item': [is_zero_rated, is_exempt],
|
||||||
|
'POS Invoice Item': [is_zero_rated, is_exempt],
|
||||||
|
'Purchase Invoice Item': [is_zero_rated, is_exempt],
|
||||||
|
'Sales Order Item': [is_zero_rated, is_exempt],
|
||||||
|
'Delivery Note Item': [is_zero_rated, is_exempt],
|
||||||
|
'Quotation Item': [is_zero_rated, is_exempt],
|
||||||
|
'Purchase Order Item': [is_zero_rated, is_exempt],
|
||||||
|
'Purchase Receipt Item': [is_zero_rated, is_exempt],
|
||||||
|
'Supplier Quotation Item': [is_zero_rated, is_exempt],
|
||||||
'Address': [
|
'Address': [
|
||||||
dict(
|
dict(fieldname='address_in_arabic', label='Address in Arabic',
|
||||||
fieldname='address_in_arabic',
|
fieldtype='Data',insert_after='address_line2')
|
||||||
label='Address in Arabic',
|
|
||||||
fieldtype='Data',
|
|
||||||
insert_after='address_line2'
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
'Company': [
|
'Company': [
|
||||||
dict(
|
dict(fieldname='company_name_in_arabic', label='Company Name In Arabic',
|
||||||
fieldname='company_name_in_arabic',
|
fieldtype='Data', insert_after='company_name')
|
||||||
label='Company Name In Arabic',
|
|
||||||
fieldtype='Data',
|
|
||||||
insert_after='company_name'
|
|
||||||
)
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user