2023-02-18

〔ZOHO Creator〕API:產生Books庫存調整單

 程式碼:


void BooksStockUpdate(string xWO_No, decimal xWO_Qty)

{

//表頭

        head = Map();

        head.put("date",zoho.currentdate.tostring("yyyy-MM-dd"));

head.put("reason","xxxxx");

head.put("reference_number","xxxxx");

head.put("adjustment_type","quantity");

head.put("description","xxxxx");

//表身

        iteml = list();

iteml.clear();

for each  WOD in F_WODetail[WO_No = WO.ID]

{

IM_No_BooksID = F_Item[ID = WOD.IM_No].Books_ID;    'Item寫入必需寫入ID

ii = Map();

ii.put("item_id",品目ID);

ii.put("quantity_adjusted",調整數量);

ii.put("unit","qty");

ii.put("is_combo_product",false);

ii.put("adjustment_account_id",帳目ID);

ii.put("warehouse_id",倉庫ID);

iteml.add(ii);

}

head.put("line_items",iteml);

        data = Map();

data.put("JSONString",head);

aaa = invokeurl

[

url :"https://inventory.zoho.com/api/v1/inventoryadjustments?organization_id=ORG_ID"

type :POST

parameters:data

connection:"Connection Name"

];


if (aaa.get("code")=0)

{

success message ""

}

else

{

alert ""

}

5 章老師的電腦小講堂: 〔ZOHO Creator〕API:產生Books庫存調整單  程式碼: void BooksStockUpdate(string xWO_No, decimal xWO_Qty) { //表頭           head = Map();           head.put("date", zoho.cur...
小講堂經過多次搬移,舊文章連結及內容較難整理~
大家可以新文章為主~
每篇文章後有代碼,任何文章問題可至FB小講堂用代碼提問唷~