There is a new regulation from the Government asking all VAT registered companies to implement QR CODE in the new E-Invoice.
The QR code fields shall be encoded in Tag-Length-Value (TLV) format with the tag values specified in the “Tag” column of the adjacent table.
The TLV encoding shall be as follows:
- Tag: the tag value as mentioned above stored in one byte.
- Length: the length of the byte array resulted from the UTF8 encoding of the field value. The length shall be stored in one byte.
- Value: the byte array resulting from the UTF8 encoding of the field value.
How do I create TLV From an Array of Information? Is there a library that I can use?
$arr = [
1 => 'Company Name',
2 => '1234567890',
3 => '2021/10/11 17:20:00',
4 => '1000',
5 => '150'
];