PeterH
15th July 2005, 15:39
Hello all,
Thanx to Marc_h script, I've created a script to insert sales invoices, tfacr1110s000 followed by tfacr1111s000 and tpppc3101m000. If i use a transactiontype with documents in fixed sequence is no, and use the following script, then I get documentnumber 1 from BaaN back instead off the value for fact.nr.
stpapi.handle.subproc("tfgld1101m000", "tfacr1110s000", "add")
stpapi.continue.process("tfgld1101m000", errmsg)
stpapi.put.field("tfacr1110s000", "tfacr200.cuno", str$(fact.cuno))
|stpapi.put.field("tfacr1110s000", "tfacr200.ttyp", "VKT")
stpapi.put.field("tfacr1110s000", "tfacr200.ttyp", "VKA")
stpapi.put.field("tfacr1110s000", "tfacr200.nivn", str$(fact.nr))
stpapi.put.field("tfacr1110s000", "screen.amnt", str$(fact.brto))
value = "TOS " & str$(fact.nr)
stpapi.put.field("tfacr1110s000", "tfacr200.refr", value)
stpapi.put.field("tfacr1110s000", "tfacr200.cvat", str$(fact.cvat))
stpapi.put.field("tfacr1110s000", "tfacr200.proj", str$(fact.cprj))
ret = stpapi.insert("tfacr1110s000", false, errmsg)
if ret = 1 then
e = stpapi.save("tfacr1110s000", errmsg)
|*
|* mutaties Verkoopfacturen muteren
|*
fact.leac = "380200"
stpapi.handle.subproc ("tfacr1110s000", "tfacr1111s000", "add")
stpapi.put.field("tfacr1111s000", "tfgld102.leac", str$(fact.leac))
Is there somebody out there who faced a similar problem and solved it???
THANX
Peter.
Thanx to Marc_h script, I've created a script to insert sales invoices, tfacr1110s000 followed by tfacr1111s000 and tpppc3101m000. If i use a transactiontype with documents in fixed sequence is no, and use the following script, then I get documentnumber 1 from BaaN back instead off the value for fact.nr.
stpapi.handle.subproc("tfgld1101m000", "tfacr1110s000", "add")
stpapi.continue.process("tfgld1101m000", errmsg)
stpapi.put.field("tfacr1110s000", "tfacr200.cuno", str$(fact.cuno))
|stpapi.put.field("tfacr1110s000", "tfacr200.ttyp", "VKT")
stpapi.put.field("tfacr1110s000", "tfacr200.ttyp", "VKA")
stpapi.put.field("tfacr1110s000", "tfacr200.nivn", str$(fact.nr))
stpapi.put.field("tfacr1110s000", "screen.amnt", str$(fact.brto))
value = "TOS " & str$(fact.nr)
stpapi.put.field("tfacr1110s000", "tfacr200.refr", value)
stpapi.put.field("tfacr1110s000", "tfacr200.cvat", str$(fact.cvat))
stpapi.put.field("tfacr1110s000", "tfacr200.proj", str$(fact.cprj))
ret = stpapi.insert("tfacr1110s000", false, errmsg)
if ret = 1 then
e = stpapi.save("tfacr1110s000", errmsg)
|*
|* mutaties Verkoopfacturen muteren
|*
fact.leac = "380200"
stpapi.handle.subproc ("tfacr1110s000", "tfacr1111s000", "add")
stpapi.put.field("tfacr1111s000", "tfgld102.leac", str$(fact.leac))
Is there somebody out there who faced a similar problem and solved it???
THANX
Peter.