feat(purchase): VAT Offset checkbox + line code on PO/PI

Add vat_offset (allow_on_submit) and vat_offset_line_code (308/314/316,
shown when vat_offset is set, allow_on_submit) to Purchase Order and
Purchase Invoice. Relabel the existing line_code to "YGB Line Code" to
distinguish the two independent line codes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ali 2026-06-29 12:56:16 +00:00
parent 96e1a7ae20
commit d1353767bf
1 changed files with 38 additions and 2 deletions

View File

@ -483,12 +483,30 @@ def create_custom_fields():
), ),
dict( dict(
fieldname='line_code', fieldname='line_code',
label='Line Code', label='YGB Line Code',
fieldtype='Select', fieldtype='Select',
options='\n310\n311\n314\n316', options='\n310\n311\n314\n316',
insert_after='ygb', insert_after='ygb',
depends_on='eval:doc.purchase_type || doc.agricultural_goods' depends_on='eval:doc.purchase_type || doc.agricultural_goods'
), ),
# VAT offset (Əvəzləşdirmə) — can be set on submitted documents.
dict(
fieldname='vat_offset',
label='VAT Offset',
fieldtype='Check',
insert_after='line_code',
default=0,
allow_on_submit=1
),
dict(
fieldname='vat_offset_line_code',
label='VAT Offset Line Code',
fieldtype='Select',
options='\n308\n314\n316',
insert_after='vat_offset',
depends_on='eval:doc.vat_offset',
allow_on_submit=1
),
# Purchase Order has no standard `remarks`, so comment 1 gets a # Purchase Order has no standard `remarks`, so comment 1 gets a
# dedicated general-purpose field placed at the SAME spot as the # dedicated general-purpose field placed at the SAME spot as the
@ -579,12 +597,30 @@ def create_custom_fields():
), ),
dict( dict(
fieldname='line_code', fieldname='line_code',
label='Line Code', label='YGB Line Code',
fieldtype='Select', fieldtype='Select',
options='\n310\n311\n314\n316', options='\n310\n311\n314\n316',
insert_after='ygb', insert_after='ygb',
depends_on='eval:doc.purchase_type || doc.agricultural_goods' depends_on='eval:doc.purchase_type || doc.agricultural_goods'
), ),
# VAT offset (Əvəzləşdirmə) — can be set on submitted documents.
dict(
fieldname='vat_offset',
label='VAT Offset',
fieldtype='Check',
insert_after='line_code',
default=0,
allow_on_submit=1
),
dict(
fieldname='vat_offset_line_code',
label='VAT Offset Line Code',
fieldtype='Select',
options='\n308\n314\n316',
insert_after='vat_offset',
depends_on='eval:doc.vat_offset',
allow_on_submit=1
),
# === E-TAXES INVOICE INFO (imported from e-taxes) === # === E-TAXES INVOICE INFO (imported from e-taxes) ===
# Series/number are parsed from the e-taxes serialNumber on import. # Series/number are parsed from the e-taxes serialNumber on import.