Message Details
Back to MessagesMessage ID:
#460
Timestamp:
2026-04-24 14:59:38
From:
DM +254721499435
To:
+254705209200
Message:
import json
import requests
import mylib5
import pandas as pd
from datetime import datetime
# Get the current date and time
now = datetime.now()
# Format the datetime object into the required string format "YYYYMMDDhhmmss"
datel = now.strftime("%Y%m%d%H%M%S")
dates = now.strftime("%Y%m%d")
invcNo = 1
dt = "20180131175302"
tin = "P051189216Y"
tin = "P051436757P"
tin = "P051109164C"
tin = "P600002996A"
dvcSrlNo = 'D04FTQ1'
bhfId = '00'
tin = "P052471029S"
tin = "P600002997A"
dvcSrlNo = 'IPOS 2026'
print("."*100)
data0 = {
"tin": tin,
"bhfId": bhfId,
"dvcSrlNo":dvcSrlNo
}
data2 = {
"tin": tin,
"bhfId": bhfId,
"lastReqDt":dt
}
response = mylib5.selectInitInfo(data0)
response = mylib5.selectCodes(data2)
response = mylib5.selectItemsClass(data2)
data3 = {
"tin": tin,
"bhfId": bhfId,
"custmTin": "A987654321Z"
}
response = mylib5.selectCustomer(data3)
data3 = {
"tin": tin,
"bhfId": bhfId,
"custmTin": "A123456789Z"
}
response = mylib5.selectCustomer(data3)
data3 = {
"tin": tin,
"bhfId": bhfId,
"custmTin": "A006330184N"
}
response = mylib5.selectCustomer(data3)
data3 = {
"tin": tin,
"bhfId": bhfId,
"custmTin": "P052180506J"
}
response = mylib5.selectCustomer(data3)
response = mylib5.selectBranches(data2)
print("-"*100)
data4 = {"tin": tin,"bhfId": bhfId,"custNo": "BEE987","custTin": "P052180506J","custNm": "BEE EAST LTD","adrs": "","telNo": "","email": "","faxNo": "","useYn": "Y","remark": "","regrNm": "sa","regrId": "sa","modrNm": "sa","modrId": "sa"}
response = mylib5.saveBrancheCustomers(data4)
data4 = {"tin": tin,"bhfId": bhfId,"custNo": "F000657X","custTin": "A006330184N","custNm": "BENARD KABUE NJUGUNA","adrs": "","telNo": "","email": "","faxNo": "","useYn": "Y","remark": "","regrNm": "sa","regrId": "sa","modrNm": "sa","modrId": "sa"}
response = mylib5.saveBrancheCustomers(data4)
data3 = {
"tin": tin,
"bhfId": bhfId,
"custmTin": "A006330184N"
}
response = mylib5.selectCustomer(data3)
response = mylib5.selectNotices(data2)
data = {
"tin": tin,
"bhfId": bhfId,
"userId": "userId2",
"userNm": "User Name2 ",
"pwd": "12341234",
"adrs": None,
"cntc": None,
"authCd": None,
"remark": None,
"useYn": "Y",
"regrNm": "Admin",
"regrId": "Admin",
"modrNm": "Admin",
"modrId": "Admin"
}
response = mylib5.saveBrancheUsers(data)
data = {
"tin": tin,
"bhfId": bhfId,
"isrccCd": "ISRCC01",
"isrccNm": "RSSB Insurance",
"isrcRt": 20,
"useYn": "Y",
"regrNm": "Admin",
"regrId": "Admin",
"modrNm": "Admin",
"modrId": "Admin"
}
response = mylib5.saveBrancheInsurances(data)
print("-"*100)
data = {
"tin": tin,
"bhfId": bhfId,
"lastReqDt":dt
}
data = {"tin": tin,"bhfId": bhfId,"itemClsCd": "56100000","itemCd": "KE2GRMBA0000001","itemTyCd": "2","itemNm": "Item 1","itemStdNm": "","orgnNatCd": "KE","pkgUnitCd": "BA","qtyUnitCd": "GRM","taxTyCd": "B","btchNo": "","bcd": "1","dftPrc": 232,"grpPrcL1": 232,"grpPrcL2": 0,"grpPrcL3": 0,"grpPrcL4": 0,"grpPrcL5": 0,"addInfo": "","sftyQty": 0,"isrcAplcbYn": "N","useYn": "N","regrNm": "sa","regrId": "sa","modrNm": "sa","modrId": "sa"}
data = {"tin": tin,"bhfId": bhfId,"itemClsCd": "56100000","itemCd": "KE2BLLAM0010005","itemTyCd": "2","itemNm": "Item 10","itemStdNm": "","orgnNatCd": "KE","pkgUnitCd": "AM","qtyUnitCd": "BLL","taxTyCd": "B","btchNo": "","bcd": "10","dftPrc": 232,"grpPrcL1": 232,"grpPrcL2": 0,"grpPrcL3": 0,"grpPrcL4": 0,"grpPrcL5": 0,"addInfo": "","sftyQty": 0,"isrcAplcbYn": "N","useYn": "N","regrNm": "sa","regrId": "sa","modrNm": "sa","modrId": "sa"}
response = mylib5.saveItems(data)
data = {"tin": tin,"bhfId": bhfId,"itemClsCd": "84110000","itemCd": "KE2KGAM0000002","itemTyCd": "2","itemNm": "Item 2","itemStdNm": "","orgnNatCd": "KE","pkgUnitCd": "AM","qtyUnitCd": "KG","taxTyCd": "B","btchNo": "","bcd": "2","dftPrc": 232,"grpPrcL1": 232,"grpPrcL2": 0,"grpPrcL3": 0,"grpPrcL4": 0,"grpPrcL5": 0,"addInfo": "","sftyQty": 0,"isrcAplcbYn": "N","useYn": "N","regrNm": "sa","regrId": "sa","modrNm": "sa","modrId": "sa"}
response = mylib5.saveItems(data)
data = {"tin": tin,"bhfId": bhfId,"itemClsCd": "12160000","itemCd": "KE2GRMBG0010002","itemTyCd": "2","itemNm": "Item 3","itemStdNm": "","orgnNatCd": "KE","pkgUnitCd": "BG","qtyUnitCd": "GRM","taxTyCd": "B","btchNo": "","bcd": "3","dftPrc": 232,"grpPrcL1": 232,"grpPrcL2": 0,"grpPrcL3": 0,"grpPrcL4": 0,"grpPrcL5": 0,"addInfo": "","sftyQty": 0,"isrcAplcbYn": "N","useYn": "N","regrNm": "sa","regrId": "sa","modrNm": "sa","modrId": "sa"}
response = mylib5.saveItems(data)
data = {"tin": tin,"bhfId": bhfId,"itemClsCd": "31200000","itemCd": "KE2GRMBL0010003","itemTyCd": "2","itemNm": "Item 4","itemStdNm": "","orgnNatCd": "KE","pkgUnitCd": "BL","qtyUnitCd": "GRM","taxTyCd": "B","btchNo": "","bcd": "4","dftPrc": 232,"grpPrcL1": 232,"grpPrcL2": 0,"grpPrcL3": 0,"grpPrcL4": 0,"grpPrcL5": 0,"addInfo": "","sftyQty": 0,"isrcAplcbYn": "N","useYn": "N","regrNm": "sa","regrId": "sa","modrNm": "sa","modrId": "sa"}
response = mylib5.saveItems(data)
data = {"tin": tin,"bhfId": bhfId,"itemClsCd": "84110000","itemCd": "KE2KGBZ0010004","itemTyCd": "2","itemNm": "Item 5","itemStdNm": "","orgnNatCd": "KE","pkgUnitCd": "BZ","qtyUnitCd": "KG","taxTyCd": "B","btchNo": "","bcd": "5","dftPrc": 232,"grpPrcL1": 232,"grpPrcL2": 0,"grpPrcL3": 0,"grpPrcL4": 0,"grpPrcL5": 0,"addInfo": "","sftyQty": 0,"isrcAplcbYn": "N","useYn": "N","regrNm": "sa","regrId": "sa","modrNm": "sa","modrId": "sa"}
response = mylib5.saveItems(data)
data = {"tin": tin,"bhfId": bhfId,"itemClsCd": "56100000","itemCd": "KE2GRMBA0000001","itemTyCd": "2","itemNm": "Item 1","itemStdNm": "","orgnNatCd": "KE","pkgUnitCd": "BA","qtyUnitCd": "GRM","taxTyCd": "B","btchNo": "","bcd": "1","dftPrc": 232,"grpPrcL1": 232,"grpPrcL2": 0,"grpPrcL3": 0,"grpPrcL4": 0,"grpPrcL5": 0,"addInfo": "","sftyQty": 0,"isrcAplcbYn": "N","useYn": "N","regrNm": "sa","regrId": "sa","modrNm": "sa","modrId": "sa"}
response = mylib5.saveItems(data)
data = {"tin": tin,"bhfId": bhfId,"itemClsCd": "84110000","itemCd": "KE2KGAM0000002","itemTyCd": "2","itemNm": "Item 2","itemStdNm": "","orgnNatCd": "KE","pkgUnitCd": "AM","qtyUnitCd": "KG","taxTyCd": "B","btchNo": "","bcd": "2","dftPrc": 232,"grpPrcL1": 232,"grpPrcL2": 0,"grpPrcL3": 0,"grpPrcL4": 0,"grpPrcL5": 0,"addInfo": "","sftyQty": 0,"isrcAplcbYn": "N","useYn": "N","regrNm": "sa","regrId": "sa","modrNm": "sa","modrId": "sa"}
response = mylib5.saveItems(data)
data = {"tin": tin,"bhfId": bhfId,"itemClsCd": "12160000","itemCd": "KE2GRMBG0010002","itemTyCd": "2","itemNm": "Item 3","itemStdNm": "","orgnNatCd": "KE","pkgUnitCd": "BG","qtyUnitCd": "GRM","taxTyCd": "B","btchNo": "","bcd": "3","dftPrc": 232,"grpPrcL1": 232,"grpPrcL2": 0,"grpPrcL3": 0,"grpPrcL4": 0,"grpPrcL5": 0,"addInfo": "","sftyQty": 0,"isrcAplcbYn": "N","useYn": "N","regrNm": "sa","regrId": "sa","modrNm": "sa","modrId": "sa"}
response = mylib5.saveItems(data)
data = {
"tin": tin,
"bhfId": bhfId,
"lastReqDt":dt
}
response = mylib5.selectItems(data)
print("-"*100)
data = {"tin": tin,"bhfId": bhfId,"itemCd": "KE2GRMBA0000001","cpstItemCd": "KE2KGAM0000002","cpstQty": 10,"regrId": "sa","regrNm": "sa"}
response = mylib5.saveItemComposition(data)
print("-"*100)
data = {
"tin": tin,
"bhfId": bhfId,
"lastReqDt":dt
}
response = mylib5.selectImportItems(data)
data = {
"tin": tin,
"bhfId": bhfId,
"taskCd": "2231943",
"dclDe": "20250128",
"itemSeq": 1,
"hsCd": "1231531231",
"itemClsCd": "5022110801",
"itemCd": "KE2GRMBA0000001",
"imptItemSttsCd": "1",
"remark": "remark",
"modrNm": "Admin",
"modrId": "Admin"
}
response = mylib5.updateImportItems(data)
data = {"tin": tin,"bhfId": bhfId,"trdInvcNo": "Invoice - TIS0101000001","invcNo": invcNo,"orgInvcNo": 0,"custTin": "","custNm": "","salesTyCd": "N","rcptTyCd": "S","pmtTyCd": "01","salesSttsCd": "02","cfmDt": "20260204071030","salesDt": "20260204","stockRlsDt": "20260204071030","cnclReqDt": "","cnclDt": "","rfdDt": "","rfdRsnCd": "","totItemCnt": 2,"taxblAmtA": 0,"taxblAmtB": 400,"taxblAmtC": 0,"taxblAmtD": 0,"taxblAmtE": 0,"taxRtA": 0,"taxRtB": 16,"taxRtC": 0,"taxRtD": 0,"taxRtE": 0,"taxAmtA": 0,"taxAmtB": 64,"taxAmtC": 0,"taxAmtD": 0,"taxAmtE": 0,"totTaxblAmt": 400,"totTaxAmt": 64,"totAmt": 464,"prchrAcptcYn": "N","remark": "","regrId": "sa","regrNm": "sa","modrId": "sa","modrNm": "sa","receipt":{"custTin": " ","custMblNo": " ","rptNo": 0,"trdeNm": " ","adrs": " ","topMsg": " ","btmMsg": " ","prchrAcptcYn": "N"},"itemList":[{"itemSeq": 1,"itemCd": "KE2GRMBA0000001","itemClsCd": "56100000","itemNm": "Item 1","bcd": "","pkgUnitCd": "BA","pkg": 1,"qtyUnitCd": "GRM","qty": 1,"prc": 232,"splyAmt": 232,"dcRt": 0,"dcAmt": 0,"taxTyCd": "B","taxblAmt": 200,"taxAmt": 32,"totAmt": 232},{"itemSeq": 2,"itemCd": "KE2KGAM0000002","itemClsCd": "84110000","itemNm": "Item 2","bcd": "","pkgUnitCd": "AM","pkg": 1,"qtyUnitCd": "KG","qty": 1,"prc": 232,"splyAmt": 232,"dcRt": 0,"dcAmt": 0,"taxTyCd": "B","taxblAmt": 200,"taxAmt": 32,"totAmt": 232}]}
response = mylib5.saveSales(data)
invcNo = invcNo+1
data = {"tin": tin,"bhfId": bhfId,"trdInvcNo": "Cash Sale - TCS01010001","invcNo": invcNo,"orgInvcNo": 0,"custTin": "","custNm": "","salesTyCd": "N","rcptTyCd": "S","pmtTyCd": "01","salesSttsCd": "02","cfmDt": "20260210154035","salesDt": "20260210","stockRlsDt": "20260210154035","cnclReqDt": "","cnclDt": "","rfdDt": "","rfdRsnCd": "","totItemCnt": 3,"taxblAmtA": 0,"taxblAmtB": 6000,"taxblAmtC": 0,"taxblAmtD": 0,"taxblAmtE": 0,"taxRtA": 0,"taxRtB": 16,"taxRtC": 0,"taxRtD": 0,"taxRtE": 0,"taxAmtA": 0,"taxAmtB": 960,"taxAmtC": 0,"taxAmtD": 0,"taxAmtE": 0,"totTaxblAmt": 6000,"totTaxAmt": 960,"totAmt": 6960,"prchrAcptcYn": "N","remark": "","regrId": "sa","regrNm": "sa","modrId": "sa","modrNm": "sa","receipt":{"custTin": " ","custMblNo": " ","rptNo": 0,"trdeNm": " ","adrs": " ","topMsg": " ","btmMsg": " ","prchrAcptcYn": "N"},"itemList":[{"itemSeq": 1,"itemCd": "KE2BA0000001","itemClsCd": "56100000","itemNm": "Item 1","bcd": "","pkgUnitCd": "BA","pkg": 1,"qtyUnitCd": "GRM","qty": 10,"prc": 232,"splyAmt": 2320,"dcRt": 0,"dcAmt": 0,"taxTyCd": "B","taxblAmt": 2000,"taxAmt": 320,"totAmt": 2320},{"itemSeq": 2,"itemCd": "KE2AM0000002","itemClsCd": "84110000","itemNm": "Item 2","bcd": "","pkgUnitCd": "AM","pkg": 1,"qtyUnitCd": "KG","qty": 10,"prc": 232,"splyAmt": 2320,"dcRt": 0,"dcAmt": 0,"taxTyCd": "B","taxblAmt": 2000,"taxAmt": 320,"totAmt": 2320},{"itemSeq": 3,"itemCd": "KE2BG0010002","itemClsCd": "12160000","itemNm": "Item 3","bcd": "","pkgUnitCd": "BG","pkg": 1,"qtyUnitCd": "GRM","qty": 10,"prc": 232,"splyAmt": 2320,"dcRt": 0,"dcAmt": 0,"taxTyCd": "B","taxblAmt": 2000,"taxAmt": 320,"totAmt": 2320}]}
response = mylib5.saveSales(data)
data = {
"tin": tin,
"bhfId": bhfId,
"lastReqDt":dt
}
response = mylib5.selectTrnsPurchaseSales(data)
data ={
"tin": tin,
"bhfId": bhfId,
"invcNo": 200,
"orgInvcNo": 0,
"spplrTin": None,
"spplrBhfId": None,
"spplrNm": None,
"spplrInvcNo": None,
"regTyCd": "M",
"pchsTyCd": "N",
"rcptTyCd": "P",
"pmtTyCd": "01",
"pchsSttsCd": "02",
"cfmDt": datel,
"pchsDt": dates,
"wrhsDt": "",
"cnclReqDt": "",
"cnclDt": "",
"rfdDt": "",
"totItemCnt": 2,
"taxblAmtA": 0,
"taxblAmtB": 250000,
"taxblAmtC": 0,
"taxblAmtD": 0,
"taxblAmtE": 0,
"taxRtA": 0,
"taxRtB": 18,
"taxRtC": 0,
"taxRtD": 0,
"taxRtE": 0,
"taxAmtA": 0,
"taxAmtB": 94576,
"taxAmtC": 0,
"taxAmtD": 0,
"taxAmtE": 0,
"totTaxblAmt": 10500,
"totTaxAmt": 1890,
"totAmt": 10500,
"remark": None,
"regrNm": "Admin",
"regrId": "Admin",
"modrNm": "Admin",
"modrId": "Admin",
"itemList": [
{
"itemSeq": 1,
"itemCd": "KE2GRMBA0000001",
"itemClsCd": "5059690800",
"itemNm": "test item 1",
"bcd": "",
"spplrItemClsCd": None,
"spplrItemCd": None,
"spplrItemNm": None,
"pkgUnitCd": "NT",
"pkg": 2,
"qtyUnitCd": "U",
"qty": 2,
"prc": 3500,
"splyAmt": 7000,
"dcRt": 0,
"dcAmt": 0,
"taxblAmt": 7000,
"taxTyCd": "B",
"taxAmt": 1260,
"totAmt": 7000,
"itemExprDt": None
},
{
"itemSeq": 2,
"itemCd": "KE2KGAM0000002",
"itemClsCd": "5022110801",
"itemNm": "test item 2",
"bcd": "",
"spplrItemClsCd": None,
"spplrItemCd": None,
"spplrItemNm": None,
"pkgUnitCd": "NT",
"pkg": 1,
"qtyUnitCd": "U",
"qty": 1,
"prc": 3500,
"splyAmt": 3500,
"dcRt": 0,
"dcAmt": 0,
"taxblAmt": 3500,
"taxTyCd": "B",
"taxAmt": 630,
"totAmt": 3500,
"itemExprDt": None
}
]
}
response = mylib5.savePurchases(data)
print("-"*100)
data = {
"tin": tin,
"bhfId": bhfId,
"itemCd": "KE2GRMBA0000001",
"rsdQty": 20,
"regrId": "Admin",
"regrNm": "Admin",
"modrNm": "Admin",
"modrId": "Admin"
}
response = mylib5.saveStockMaster(data)
print("-"*100)
data = {
"tin": tin,
"bhfId": bhfId,
"lastReqDt":dt
}
response = mylib5.selectStockItems(data)
sarno = 4
sarTyCd = "02"
data = {
"tin": tin,
"bhfId": bhfId,
"sarNo": sarno,
"orgSarNo": sarno,
"regTyCd": "M",
"custTin": None,
"custNm": None,
"custBhfId": None,
"sarTyCd": sarTyCd,
"ocrnDt": dates,
"totItemCnt": 2,
"totTaxblAmt": 70000,
"totTaxAmt": 12000,
"totAmt": 70000,
"remark": None,
"regrId": "Admin",
"regrNm": "Admin",
"modrNm": "Admin",
"modrId": "Admin",
"itemList": [
{
"itemSeq": 1,
"itemCd": "KE1NTXU0000001",
"itemClsCd": "5059690800",
"itemNm": "testitem1",
"bcd": None,
"pkgUnitCd": "BE",
"pkg": 10,
"qtyUnitCd": "U",
"qty": -10,
"itemExprDt": None,
"prc": 3500,
"splyAmt": -35000,
"totDcAmt": 0,
"taxblAmt": -35000,
"taxTyCd": "B",
"taxAmt": -6000,
"totAmt": -35000
},
{
"itemSeq": 2,
"itemCd": "KE1NTXU0000002",
"itemClsCd": "5059690800",
"itemNm": "testitem2",
"bcd": None,
"pkgUnitCd": "BE",
"pkg": 10,
"qtyUnitCd": "U",
"qty": 10,
"itemExprDt": None,
"prc": 3500,
"splyAmt": 35000,
"totDcAmt": 0,
"taxblAmt": 35000,
"taxTyCd": "B",
"taxAmt": 6000,
"totAmt": 35000
}
]
}
response = mylib5.saveStockItems(data)
print("-"*100)
import requests
import mylib5
import pandas as pd
from datetime import datetime
# Get the current date and time
now = datetime.now()
# Format the datetime object into the required string format "YYYYMMDDhhmmss"
datel = now.strftime("%Y%m%d%H%M%S")
dates = now.strftime("%Y%m%d")
invcNo = 1
dt = "20180131175302"
tin = "P051189216Y"
tin = "P051436757P"
tin = "P051109164C"
tin = "P600002996A"
dvcSrlNo = 'D04FTQ1'
bhfId = '00'
tin = "P052471029S"
tin = "P600002997A"
dvcSrlNo = 'IPOS 2026'
print("."*100)
data0 = {
"tin": tin,
"bhfId": bhfId,
"dvcSrlNo":dvcSrlNo
}
data2 = {
"tin": tin,
"bhfId": bhfId,
"lastReqDt":dt
}
response = mylib5.selectInitInfo(data0)
response = mylib5.selectCodes(data2)
response = mylib5.selectItemsClass(data2)
data3 = {
"tin": tin,
"bhfId": bhfId,
"custmTin": "A987654321Z"
}
response = mylib5.selectCustomer(data3)
data3 = {
"tin": tin,
"bhfId": bhfId,
"custmTin": "A123456789Z"
}
response = mylib5.selectCustomer(data3)
data3 = {
"tin": tin,
"bhfId": bhfId,
"custmTin": "A006330184N"
}
response = mylib5.selectCustomer(data3)
data3 = {
"tin": tin,
"bhfId": bhfId,
"custmTin": "P052180506J"
}
response = mylib5.selectCustomer(data3)
response = mylib5.selectBranches(data2)
print("-"*100)
data4 = {"tin": tin,"bhfId": bhfId,"custNo": "BEE987","custTin": "P052180506J","custNm": "BEE EAST LTD","adrs": "","telNo": "","email": "","faxNo": "","useYn": "Y","remark": "","regrNm": "sa","regrId": "sa","modrNm": "sa","modrId": "sa"}
response = mylib5.saveBrancheCustomers(data4)
data4 = {"tin": tin,"bhfId": bhfId,"custNo": "F000657X","custTin": "A006330184N","custNm": "BENARD KABUE NJUGUNA","adrs": "","telNo": "","email": "","faxNo": "","useYn": "Y","remark": "","regrNm": "sa","regrId": "sa","modrNm": "sa","modrId": "sa"}
response = mylib5.saveBrancheCustomers(data4)
data3 = {
"tin": tin,
"bhfId": bhfId,
"custmTin": "A006330184N"
}
response = mylib5.selectCustomer(data3)
response = mylib5.selectNotices(data2)
data = {
"tin": tin,
"bhfId": bhfId,
"userId": "userId2",
"userNm": "User Name2 ",
"pwd": "12341234",
"adrs": None,
"cntc": None,
"authCd": None,
"remark": None,
"useYn": "Y",
"regrNm": "Admin",
"regrId": "Admin",
"modrNm": "Admin",
"modrId": "Admin"
}
response = mylib5.saveBrancheUsers(data)
data = {
"tin": tin,
"bhfId": bhfId,
"isrccCd": "ISRCC01",
"isrccNm": "RSSB Insurance",
"isrcRt": 20,
"useYn": "Y",
"regrNm": "Admin",
"regrId": "Admin",
"modrNm": "Admin",
"modrId": "Admin"
}
response = mylib5.saveBrancheInsurances(data)
print("-"*100)
data = {
"tin": tin,
"bhfId": bhfId,
"lastReqDt":dt
}
data = {"tin": tin,"bhfId": bhfId,"itemClsCd": "56100000","itemCd": "KE2GRMBA0000001","itemTyCd": "2","itemNm": "Item 1","itemStdNm": "","orgnNatCd": "KE","pkgUnitCd": "BA","qtyUnitCd": "GRM","taxTyCd": "B","btchNo": "","bcd": "1","dftPrc": 232,"grpPrcL1": 232,"grpPrcL2": 0,"grpPrcL3": 0,"grpPrcL4": 0,"grpPrcL5": 0,"addInfo": "","sftyQty": 0,"isrcAplcbYn": "N","useYn": "N","regrNm": "sa","regrId": "sa","modrNm": "sa","modrId": "sa"}
data = {"tin": tin,"bhfId": bhfId,"itemClsCd": "56100000","itemCd": "KE2BLLAM0010005","itemTyCd": "2","itemNm": "Item 10","itemStdNm": "","orgnNatCd": "KE","pkgUnitCd": "AM","qtyUnitCd": "BLL","taxTyCd": "B","btchNo": "","bcd": "10","dftPrc": 232,"grpPrcL1": 232,"grpPrcL2": 0,"grpPrcL3": 0,"grpPrcL4": 0,"grpPrcL5": 0,"addInfo": "","sftyQty": 0,"isrcAplcbYn": "N","useYn": "N","regrNm": "sa","regrId": "sa","modrNm": "sa","modrId": "sa"}
response = mylib5.saveItems(data)
data = {"tin": tin,"bhfId": bhfId,"itemClsCd": "84110000","itemCd": "KE2KGAM0000002","itemTyCd": "2","itemNm": "Item 2","itemStdNm": "","orgnNatCd": "KE","pkgUnitCd": "AM","qtyUnitCd": "KG","taxTyCd": "B","btchNo": "","bcd": "2","dftPrc": 232,"grpPrcL1": 232,"grpPrcL2": 0,"grpPrcL3": 0,"grpPrcL4": 0,"grpPrcL5": 0,"addInfo": "","sftyQty": 0,"isrcAplcbYn": "N","useYn": "N","regrNm": "sa","regrId": "sa","modrNm": "sa","modrId": "sa"}
response = mylib5.saveItems(data)
data = {"tin": tin,"bhfId": bhfId,"itemClsCd": "12160000","itemCd": "KE2GRMBG0010002","itemTyCd": "2","itemNm": "Item 3","itemStdNm": "","orgnNatCd": "KE","pkgUnitCd": "BG","qtyUnitCd": "GRM","taxTyCd": "B","btchNo": "","bcd": "3","dftPrc": 232,"grpPrcL1": 232,"grpPrcL2": 0,"grpPrcL3": 0,"grpPrcL4": 0,"grpPrcL5": 0,"addInfo": "","sftyQty": 0,"isrcAplcbYn": "N","useYn": "N","regrNm": "sa","regrId": "sa","modrNm": "sa","modrId": "sa"}
response = mylib5.saveItems(data)
data = {"tin": tin,"bhfId": bhfId,"itemClsCd": "31200000","itemCd": "KE2GRMBL0010003","itemTyCd": "2","itemNm": "Item 4","itemStdNm": "","orgnNatCd": "KE","pkgUnitCd": "BL","qtyUnitCd": "GRM","taxTyCd": "B","btchNo": "","bcd": "4","dftPrc": 232,"grpPrcL1": 232,"grpPrcL2": 0,"grpPrcL3": 0,"grpPrcL4": 0,"grpPrcL5": 0,"addInfo": "","sftyQty": 0,"isrcAplcbYn": "N","useYn": "N","regrNm": "sa","regrId": "sa","modrNm": "sa","modrId": "sa"}
response = mylib5.saveItems(data)
data = {"tin": tin,"bhfId": bhfId,"itemClsCd": "84110000","itemCd": "KE2KGBZ0010004","itemTyCd": "2","itemNm": "Item 5","itemStdNm": "","orgnNatCd": "KE","pkgUnitCd": "BZ","qtyUnitCd": "KG","taxTyCd": "B","btchNo": "","bcd": "5","dftPrc": 232,"grpPrcL1": 232,"grpPrcL2": 0,"grpPrcL3": 0,"grpPrcL4": 0,"grpPrcL5": 0,"addInfo": "","sftyQty": 0,"isrcAplcbYn": "N","useYn": "N","regrNm": "sa","regrId": "sa","modrNm": "sa","modrId": "sa"}
response = mylib5.saveItems(data)
data = {"tin": tin,"bhfId": bhfId,"itemClsCd": "56100000","itemCd": "KE2GRMBA0000001","itemTyCd": "2","itemNm": "Item 1","itemStdNm": "","orgnNatCd": "KE","pkgUnitCd": "BA","qtyUnitCd": "GRM","taxTyCd": "B","btchNo": "","bcd": "1","dftPrc": 232,"grpPrcL1": 232,"grpPrcL2": 0,"grpPrcL3": 0,"grpPrcL4": 0,"grpPrcL5": 0,"addInfo": "","sftyQty": 0,"isrcAplcbYn": "N","useYn": "N","regrNm": "sa","regrId": "sa","modrNm": "sa","modrId": "sa"}
response = mylib5.saveItems(data)
data = {"tin": tin,"bhfId": bhfId,"itemClsCd": "84110000","itemCd": "KE2KGAM0000002","itemTyCd": "2","itemNm": "Item 2","itemStdNm": "","orgnNatCd": "KE","pkgUnitCd": "AM","qtyUnitCd": "KG","taxTyCd": "B","btchNo": "","bcd": "2","dftPrc": 232,"grpPrcL1": 232,"grpPrcL2": 0,"grpPrcL3": 0,"grpPrcL4": 0,"grpPrcL5": 0,"addInfo": "","sftyQty": 0,"isrcAplcbYn": "N","useYn": "N","regrNm": "sa","regrId": "sa","modrNm": "sa","modrId": "sa"}
response = mylib5.saveItems(data)
data = {"tin": tin,"bhfId": bhfId,"itemClsCd": "12160000","itemCd": "KE2GRMBG0010002","itemTyCd": "2","itemNm": "Item 3","itemStdNm": "","orgnNatCd": "KE","pkgUnitCd": "BG","qtyUnitCd": "GRM","taxTyCd": "B","btchNo": "","bcd": "3","dftPrc": 232,"grpPrcL1": 232,"grpPrcL2": 0,"grpPrcL3": 0,"grpPrcL4": 0,"grpPrcL5": 0,"addInfo": "","sftyQty": 0,"isrcAplcbYn": "N","useYn": "N","regrNm": "sa","regrId": "sa","modrNm": "sa","modrId": "sa"}
response = mylib5.saveItems(data)
data = {
"tin": tin,
"bhfId": bhfId,
"lastReqDt":dt
}
response = mylib5.selectItems(data)
print("-"*100)
data = {"tin": tin,"bhfId": bhfId,"itemCd": "KE2GRMBA0000001","cpstItemCd": "KE2KGAM0000002","cpstQty": 10,"regrId": "sa","regrNm": "sa"}
response = mylib5.saveItemComposition(data)
print("-"*100)
data = {
"tin": tin,
"bhfId": bhfId,
"lastReqDt":dt
}
response = mylib5.selectImportItems(data)
data = {
"tin": tin,
"bhfId": bhfId,
"taskCd": "2231943",
"dclDe": "20250128",
"itemSeq": 1,
"hsCd": "1231531231",
"itemClsCd": "5022110801",
"itemCd": "KE2GRMBA0000001",
"imptItemSttsCd": "1",
"remark": "remark",
"modrNm": "Admin",
"modrId": "Admin"
}
response = mylib5.updateImportItems(data)
data = {"tin": tin,"bhfId": bhfId,"trdInvcNo": "Invoice - TIS0101000001","invcNo": invcNo,"orgInvcNo": 0,"custTin": "","custNm": "","salesTyCd": "N","rcptTyCd": "S","pmtTyCd": "01","salesSttsCd": "02","cfmDt": "20260204071030","salesDt": "20260204","stockRlsDt": "20260204071030","cnclReqDt": "","cnclDt": "","rfdDt": "","rfdRsnCd": "","totItemCnt": 2,"taxblAmtA": 0,"taxblAmtB": 400,"taxblAmtC": 0,"taxblAmtD": 0,"taxblAmtE": 0,"taxRtA": 0,"taxRtB": 16,"taxRtC": 0,"taxRtD": 0,"taxRtE": 0,"taxAmtA": 0,"taxAmtB": 64,"taxAmtC": 0,"taxAmtD": 0,"taxAmtE": 0,"totTaxblAmt": 400,"totTaxAmt": 64,"totAmt": 464,"prchrAcptcYn": "N","remark": "","regrId": "sa","regrNm": "sa","modrId": "sa","modrNm": "sa","receipt":{"custTin": " ","custMblNo": " ","rptNo": 0,"trdeNm": " ","adrs": " ","topMsg": " ","btmMsg": " ","prchrAcptcYn": "N"},"itemList":[{"itemSeq": 1,"itemCd": "KE2GRMBA0000001","itemClsCd": "56100000","itemNm": "Item 1","bcd": "","pkgUnitCd": "BA","pkg": 1,"qtyUnitCd": "GRM","qty": 1,"prc": 232,"splyAmt": 232,"dcRt": 0,"dcAmt": 0,"taxTyCd": "B","taxblAmt": 200,"taxAmt": 32,"totAmt": 232},{"itemSeq": 2,"itemCd": "KE2KGAM0000002","itemClsCd": "84110000","itemNm": "Item 2","bcd": "","pkgUnitCd": "AM","pkg": 1,"qtyUnitCd": "KG","qty": 1,"prc": 232,"splyAmt": 232,"dcRt": 0,"dcAmt": 0,"taxTyCd": "B","taxblAmt": 200,"taxAmt": 32,"totAmt": 232}]}
response = mylib5.saveSales(data)
invcNo = invcNo+1
data = {"tin": tin,"bhfId": bhfId,"trdInvcNo": "Cash Sale - TCS01010001","invcNo": invcNo,"orgInvcNo": 0,"custTin": "","custNm": "","salesTyCd": "N","rcptTyCd": "S","pmtTyCd": "01","salesSttsCd": "02","cfmDt": "20260210154035","salesDt": "20260210","stockRlsDt": "20260210154035","cnclReqDt": "","cnclDt": "","rfdDt": "","rfdRsnCd": "","totItemCnt": 3,"taxblAmtA": 0,"taxblAmtB": 6000,"taxblAmtC": 0,"taxblAmtD": 0,"taxblAmtE": 0,"taxRtA": 0,"taxRtB": 16,"taxRtC": 0,"taxRtD": 0,"taxRtE": 0,"taxAmtA": 0,"taxAmtB": 960,"taxAmtC": 0,"taxAmtD": 0,"taxAmtE": 0,"totTaxblAmt": 6000,"totTaxAmt": 960,"totAmt": 6960,"prchrAcptcYn": "N","remark": "","regrId": "sa","regrNm": "sa","modrId": "sa","modrNm": "sa","receipt":{"custTin": " ","custMblNo": " ","rptNo": 0,"trdeNm": " ","adrs": " ","topMsg": " ","btmMsg": " ","prchrAcptcYn": "N"},"itemList":[{"itemSeq": 1,"itemCd": "KE2BA0000001","itemClsCd": "56100000","itemNm": "Item 1","bcd": "","pkgUnitCd": "BA","pkg": 1,"qtyUnitCd": "GRM","qty": 10,"prc": 232,"splyAmt": 2320,"dcRt": 0,"dcAmt": 0,"taxTyCd": "B","taxblAmt": 2000,"taxAmt": 320,"totAmt": 2320},{"itemSeq": 2,"itemCd": "KE2AM0000002","itemClsCd": "84110000","itemNm": "Item 2","bcd": "","pkgUnitCd": "AM","pkg": 1,"qtyUnitCd": "KG","qty": 10,"prc": 232,"splyAmt": 2320,"dcRt": 0,"dcAmt": 0,"taxTyCd": "B","taxblAmt": 2000,"taxAmt": 320,"totAmt": 2320},{"itemSeq": 3,"itemCd": "KE2BG0010002","itemClsCd": "12160000","itemNm": "Item 3","bcd": "","pkgUnitCd": "BG","pkg": 1,"qtyUnitCd": "GRM","qty": 10,"prc": 232,"splyAmt": 2320,"dcRt": 0,"dcAmt": 0,"taxTyCd": "B","taxblAmt": 2000,"taxAmt": 320,"totAmt": 2320}]}
response = mylib5.saveSales(data)
data = {
"tin": tin,
"bhfId": bhfId,
"lastReqDt":dt
}
response = mylib5.selectTrnsPurchaseSales(data)
data ={
"tin": tin,
"bhfId": bhfId,
"invcNo": 200,
"orgInvcNo": 0,
"spplrTin": None,
"spplrBhfId": None,
"spplrNm": None,
"spplrInvcNo": None,
"regTyCd": "M",
"pchsTyCd": "N",
"rcptTyCd": "P",
"pmtTyCd": "01",
"pchsSttsCd": "02",
"cfmDt": datel,
"pchsDt": dates,
"wrhsDt": "",
"cnclReqDt": "",
"cnclDt": "",
"rfdDt": "",
"totItemCnt": 2,
"taxblAmtA": 0,
"taxblAmtB": 250000,
"taxblAmtC": 0,
"taxblAmtD": 0,
"taxblAmtE": 0,
"taxRtA": 0,
"taxRtB": 18,
"taxRtC": 0,
"taxRtD": 0,
"taxRtE": 0,
"taxAmtA": 0,
"taxAmtB": 94576,
"taxAmtC": 0,
"taxAmtD": 0,
"taxAmtE": 0,
"totTaxblAmt": 10500,
"totTaxAmt": 1890,
"totAmt": 10500,
"remark": None,
"regrNm": "Admin",
"regrId": "Admin",
"modrNm": "Admin",
"modrId": "Admin",
"itemList": [
{
"itemSeq": 1,
"itemCd": "KE2GRMBA0000001",
"itemClsCd": "5059690800",
"itemNm": "test item 1",
"bcd": "",
"spplrItemClsCd": None,
"spplrItemCd": None,
"spplrItemNm": None,
"pkgUnitCd": "NT",
"pkg": 2,
"qtyUnitCd": "U",
"qty": 2,
"prc": 3500,
"splyAmt": 7000,
"dcRt": 0,
"dcAmt": 0,
"taxblAmt": 7000,
"taxTyCd": "B",
"taxAmt": 1260,
"totAmt": 7000,
"itemExprDt": None
},
{
"itemSeq": 2,
"itemCd": "KE2KGAM0000002",
"itemClsCd": "5022110801",
"itemNm": "test item 2",
"bcd": "",
"spplrItemClsCd": None,
"spplrItemCd": None,
"spplrItemNm": None,
"pkgUnitCd": "NT",
"pkg": 1,
"qtyUnitCd": "U",
"qty": 1,
"prc": 3500,
"splyAmt": 3500,
"dcRt": 0,
"dcAmt": 0,
"taxblAmt": 3500,
"taxTyCd": "B",
"taxAmt": 630,
"totAmt": 3500,
"itemExprDt": None
}
]
}
response = mylib5.savePurchases(data)
print("-"*100)
data = {
"tin": tin,
"bhfId": bhfId,
"itemCd": "KE2GRMBA0000001",
"rsdQty": 20,
"regrId": "Admin",
"regrNm": "Admin",
"modrNm": "Admin",
"modrId": "Admin"
}
response = mylib5.saveStockMaster(data)
print("-"*100)
data = {
"tin": tin,
"bhfId": bhfId,
"lastReqDt":dt
}
response = mylib5.selectStockItems(data)
sarno = 4
sarTyCd = "02"
data = {
"tin": tin,
"bhfId": bhfId,
"sarNo": sarno,
"orgSarNo": sarno,
"regTyCd": "M",
"custTin": None,
"custNm": None,
"custBhfId": None,
"sarTyCd": sarTyCd,
"ocrnDt": dates,
"totItemCnt": 2,
"totTaxblAmt": 70000,
"totTaxAmt": 12000,
"totAmt": 70000,
"remark": None,
"regrId": "Admin",
"regrNm": "Admin",
"modrNm": "Admin",
"modrId": "Admin",
"itemList": [
{
"itemSeq": 1,
"itemCd": "KE1NTXU0000001",
"itemClsCd": "5059690800",
"itemNm": "testitem1",
"bcd": None,
"pkgUnitCd": "BE",
"pkg": 10,
"qtyUnitCd": "U",
"qty": -10,
"itemExprDt": None,
"prc": 3500,
"splyAmt": -35000,
"totDcAmt": 0,
"taxblAmt": -35000,
"taxTyCd": "B",
"taxAmt": -6000,
"totAmt": -35000
},
{
"itemSeq": 2,
"itemCd": "KE1NTXU0000002",
"itemClsCd": "5059690800",
"itemNm": "testitem2",
"bcd": None,
"pkgUnitCd": "BE",
"pkg": 10,
"qtyUnitCd": "U",
"qty": 10,
"itemExprDt": None,
"prc": 3500,
"splyAmt": 35000,
"totDcAmt": 0,
"taxblAmt": 35000,
"taxTyCd": "B",
"taxAmt": 6000,
"totAmt": 35000
}
]
}
response = mylib5.saveStockItems(data)
print("-"*100)
Archived At:
2026-04-24 14:59:39