_save
Sets the variables in a Requisition Order Entry
Parameters
ro_id
The ID of the Requisition Order with this Entry.
id
The ID of the Entry.
stock_type
The type of Entry: 0 => Empty 1 => Stock 2 => Free Text
supplier_id
The ID of a Supplier which can be selected for the Entry.
stock_id
The ID of the Stock selected in the Entry.
stock_text
Used as a string variable for the description of the Entry if "stock_type" is 2, or otherwise as the name of the Stock selected for the Entry.
qty
The quantity of Stock units in the Entry.
cost
The cost of one Stock unit in the Entry.
nominal
The Nominal Code for the Entry.
taxtype
The Tax Rate selected for the Entry.
totalnet
The Net Total for the Entry.
totaltax
The Total Tax for the Entry.
Example
FM_api('RequisitionOrderEntry_save',[
'ro_id'=>'270001',
'id'=>'150001',
'stock_type'=>'1',
'supplier_id'=>'398040',
'stock_id'=>'487372',
'stock_text'=>'Office Chair',
'qty'=> '1',
'cost'=>'70',
'nominal'=>'234-a',
'taxtype'=>'Furniture Tax',
'totalnet'=>'70',
'totaltax'=>'5'
]
);
Result
On Success
{"ok":1}
On Failure
If the "ro_id" parameter is not set:
{"error":"missing or invalid parameter: ro_id"}
If the "id" parameter is not set:
{"error":"missing or invalid parameter: id"}
If the "stock_type" parameter is not set:
{"error":"missing or invalid parameter: stock_type"}
If the "supplier_id" parameter is not set:
{"error":"missing or invalid parameter: supplier_id"}
If the "stock_id" parameter is not set:
{"error":"missing or invalid parameter: stock_id"}
If the "stock_text" parameter has a trimmed string value with a length higher than 255:
{"error":"description too long. max length 255"}
If the "qty" parameter is not set:
{"error":"missing or invalid parameter: qty"}
If the "cost" parameter is not set:
{"error":"missing or invalid parameter: cost"}
If the "nominal" parameter is not set:
{"error":"missing or invalid parameter: nominal"}
If the "taxtype" parameter is not set:
{"error":"missing or invalid parameter: taxtype"}
If the "totalnet" parameter is not set:
{"error":"missing or invalid parameter: totalnet"}
If the "totaltax" parameter is not set:
{"error":"missing or invalid parameter: totaltax"}
If the "ro_id" parameter is set but does not have any integers:
{"error":"no ro_id supplied"}
If the "id" parameter is set but does not have any integers:
{"error":"no entry id supplied"}
Last updated