sbt-idp/cope2n-ai-fi/common/AnyKey_Value/utils/kvu_dictionary.py
2023-11-30 18:22:16 +07:00

68 lines
3.5 KiB
Python
Executable File

DKVU2XML = {
"Ký hiệu mẫu hóa đơn": "form_no",
"Ký hiệu hóa đơn": "serial_no",
"Số hóa đơn": "invoice_no",
"Ngày, tháng, năm lập hóa đơn": "issue_date",
"Tên người bán": "seller_name",
"Mã số thuế người bán": "seller_tax_code",
"Thuế suất": "tax_rate",
"Thuế GTGT đủ điều kiện khấu trừ thuế": "VAT_input_amount",
"Mặt hàng": "item",
"Đơn vị tính": "unit",
"Số lượng": "quantity",
"Đơn giá": "unit_price",
"Doanh số mua chưa có thuế": "amount"
}
def ap_dictionary(header: bool):
header_dictionary = {
'productname': ['description', 'paticulars', 'articledescription', 'descriptionofgood', 'itemdescription', 'product', 'productdescription', 'modelname', 'device', 'items', 'itemno'],
'modelnumber': ['serialno', 'model', 'code', 'mcode', 'simimeiserial', 'serial', 'productcode', 'product', 'imeiccid', 'articles', 'article', 'articlenumber', 'articleidmaterialcode', 'transaction', 'itemcode'],
'qty': ['quantity', 'invoicequantity']
}
key_dictionary = {
'purchase_date': ['date', 'purchasedate', 'datetime', 'orderdate', 'orderdatetime', 'invoicedate', 'dateredeemed', 'issuedate', 'billingdocdate'],
'retailername': ['retailer', 'retailername', 'ownedoperatedby'],
'serial_number': ['serialnumber', 'serialno'],
'imei_number': ['imeiesim', 'imeislot1', 'imeislot2', 'imei', 'imei1', 'imei2']
}
return header_dictionary if header else key_dictionary
def vat_dictionary(header: bool):
header_dictionary = {
'Mặt hàng': ['tenhanghoa,dichvu', 'danhmuc,dichvu', 'dichvusudung', 'sanpham', 'tenquycachhanghoa','description', 'descriptionofgood', 'itemdescription'],
'Đơn vị tính': ['dvt', 'donvitinh'],
'Số lượng': ['soluong', 'sl','qty', 'quantity', 'invoicequantity'],
'Đơn giá': ['dongia'],
'Doanh số mua chưa có thuế': ['thanhtien', 'thanhtientruocthuegtgt', 'tienchuathue'],
# 'Số sản phẩm': ['serialno', 'model', 'mcode', 'simimeiserial', 'serial', 'sku', 'sn', 'productcode', 'product', 'particulars', 'imeiccid', 'articles', 'article', 'articleidmaterialcode', 'transaction', 'imei', 'articlenumber']
}
key_dictionary = {
'Ký hiệu mẫu hóa đơn': ['mausoformno', 'mauso'],
'Ký hiệu hóa đơn': ['kyhieuserialno', 'kyhieuserial', 'kyhieu'],
'Số hóa đơn': ['soinvoiceno', 'invoiceno'],
'Ngày, tháng, năm lập hóa đơn': [],
'Tên người bán': ['donvibanseller', 'donvibanhangsalesunit', 'donvibanhangseller', 'kyboisignedby'],
'Mã số thuế người bán': ['masothuetaxcode', 'maxsothuetaxcodenumber', 'masothue'],
'Thuế suất': ['thuesuatgtgttaxrate', 'thuesuatgtgt'],
'Thuế GTGT đủ điều kiện khấu trừ thuế': ['tienthuegtgtvatamount', 'tienthuegtgt'],
# 'Ghi chú': [],
# 'Ngày': ['ngayday', 'ngay', 'day'],
# 'Tháng': ['thangmonth', 'thang', 'month'],
# 'Năm': ['namyear', 'nam', 'year']
}
# exact_dictionary = {
# 'Số hóa đơn': ['sono', 'so'],
# 'Mã số thuế người bán': ['mst'],
# 'Tên người bán': ['kyboi'],
# 'Ngày, tháng, năm lập hóa đơn': ['kyngay', 'kyngaydate']
# }
return header_dictionary if header else key_dictionary