Create a manual Receipt Document or display Receipt Documents.
Note: For receipt on work order documents use ReceiptWo.
odata4/v1/receipt
{
"DocumentLines": [
{"ItemCode": "RM_B",
"WhsCode":"01",
"BatchNumbers":[
{"DistNumber":"BT-014","Quantity":2 }
]
}
]
}
Examples
POST
|
HTTP: post new receipt document
|
|
Create receipt document
|
// Create a receipt document with 5 new serial numbers
// in this example you can see, how to work with place holder
instance bsl b
setvar=ls_json=
for ll_loop=1 to 5
addvar=ls_json={"ItemCode":"RM_S","WhsCode":"01","DistNumber":"<time,hhmmss><ll_loop>","Quantity":1}
if <ll_loop> <> 5 then
addvar=ls_json=,
end if
next
setvar=ls_json={"DocumentLines":[<ls_json>]}
// in post command use only variable.
// follow is not working: b.post=receipt={"DocumentLines":[<ls_json>]}
// because the system convert placeholder only, if the string don't start with {
b.post=receipt=<ls_json>
messagebox=<b.ret_code> <b.ret_text> <b.ret_value>
destroy b
|
Create receipt document for Work order 1308, Position 10, Pos Id 30
|
For work order we must define the transaction "receiptwo" and base document information
BaseDocEntry=work order, BaseLineNumber=work order position, BaseLineNumber2 = Bill of Material position
#define ls_json
{"Transaction":"receiptwo",
"DocumentLines":
[
{"BaseDocEntry":1308,"BaseLineNumber":10,"BaseLineNumber2":30,"ItemCode":"9348-purchase",
"Quantity":1,"WhsCode":"01"}
]
}
#end
instance bsl b
b.post=Receipt=<ls_json>
messagebox=<b.ret_code> <b.ret_text> <b.ret_value>
|