Joy Conner
27th June 2006, 22:09
I am having trouble passing parameters to print an invoice and the problem is not obvious. I think that I am getting the printed variable but not the invn.f, invn.t, ttyp.f and ttyp.t. Can anyone tell me what I am doing wrong?
function print.sales.invoices(domain tfgld.ttyp ttyp.in,
domain tcinvn invn.in)
{
domain tcmcs.str25 error
error = ""
stpapi.clear("tdsls4404m000")
stpapi.put.field("tdsls4404m000", "printed", str$(etol(printed)))
if printed = tcyesno.yes then
stpapi.put.field("tdsls4404m000", "invn.f", str$(invn.in))
stpapi.put.field("tdsls4404m000", "invn.t", str$(invn.in))
stpapi.put.field("tdsls4404m000", "ttyp.f", ttyp.in)
stpapi.put.field("tdsls4404m000", "ttyp.t", ttyp.in)
else
stpapi.put.field("tdsls4404m000", "selection", str$(etol(selection)))
stpapi.put.field("tdsls4404m000", "inv.date", str$(inv.date))
stpapi.put.field("tdsls4404m000", "cuno.f", cuno.f)
stpapi.put.field("tdsls4404m000", "cuno.t", cuno.t)
stpapi.put.field("tdsls4404m000", "orno.f", str$(orno.f))
stpapi.put.field("tdsls4404m000", "orno.t", str$(orno.t))
stpapi.put.field("tdsls4404m000", "cotp.f", cotp.f)
stpapi.put.field("tdsls4404m000", "cotp.t", cotp.t)
stpapi.put.field("tdsls4404m000", "definite", str$(etol(definite)))
stpapi.put.field("tdsls4404m000", "direct.process", str$(etol(direct.process)))
stpapi.put.field("tdsls4404m000", "totals", str$(etol(totals)))
stpapi.put.field("tdsls4404m000", "prnt.options", str$(etol(prnt.options)))
stpapi.put.field("tdsls4404m000", "prnt.sellpr", str$(etol(prnt.sellpr)))
stpapi.put.field("tdsls4404m000", "recal.tax", str$(etol(recal.tax)))
stpapi.put.field("tdsls4404m000", "disp.slash", "/")
endif
stpapi.put.field("tdsls4404m000", "comp.f", str$(comp.f))
stpapi.put.field("tdsls4404m000", "comp.t", str$(comp.t))
stpapi.put.field("tdsls4404m000", "amount.f", str$(amount.f))
stpapi.put.field("tdsls4404m000", "amount.t", str$(amount.t))
stpapi.set.report("tdsls4404m000", "rtdsls440401000", "ACCTLOGO", error )
stpapi.continue.process("tdsls4404m000", error)
if not isspace(error) then
message("Error when setting report: %s", error)
endif
stpapi.print.report("tdsls4404m000", error)
stpapi.end.session("tdsls4404m000")
}
function print.sales.invoices(domain tfgld.ttyp ttyp.in,
domain tcinvn invn.in)
{
domain tcmcs.str25 error
error = ""
stpapi.clear("tdsls4404m000")
stpapi.put.field("tdsls4404m000", "printed", str$(etol(printed)))
if printed = tcyesno.yes then
stpapi.put.field("tdsls4404m000", "invn.f", str$(invn.in))
stpapi.put.field("tdsls4404m000", "invn.t", str$(invn.in))
stpapi.put.field("tdsls4404m000", "ttyp.f", ttyp.in)
stpapi.put.field("tdsls4404m000", "ttyp.t", ttyp.in)
else
stpapi.put.field("tdsls4404m000", "selection", str$(etol(selection)))
stpapi.put.field("tdsls4404m000", "inv.date", str$(inv.date))
stpapi.put.field("tdsls4404m000", "cuno.f", cuno.f)
stpapi.put.field("tdsls4404m000", "cuno.t", cuno.t)
stpapi.put.field("tdsls4404m000", "orno.f", str$(orno.f))
stpapi.put.field("tdsls4404m000", "orno.t", str$(orno.t))
stpapi.put.field("tdsls4404m000", "cotp.f", cotp.f)
stpapi.put.field("tdsls4404m000", "cotp.t", cotp.t)
stpapi.put.field("tdsls4404m000", "definite", str$(etol(definite)))
stpapi.put.field("tdsls4404m000", "direct.process", str$(etol(direct.process)))
stpapi.put.field("tdsls4404m000", "totals", str$(etol(totals)))
stpapi.put.field("tdsls4404m000", "prnt.options", str$(etol(prnt.options)))
stpapi.put.field("tdsls4404m000", "prnt.sellpr", str$(etol(prnt.sellpr)))
stpapi.put.field("tdsls4404m000", "recal.tax", str$(etol(recal.tax)))
stpapi.put.field("tdsls4404m000", "disp.slash", "/")
endif
stpapi.put.field("tdsls4404m000", "comp.f", str$(comp.f))
stpapi.put.field("tdsls4404m000", "comp.t", str$(comp.t))
stpapi.put.field("tdsls4404m000", "amount.f", str$(amount.f))
stpapi.put.field("tdsls4404m000", "amount.t", str$(amount.t))
stpapi.set.report("tdsls4404m000", "rtdsls440401000", "ACCTLOGO", error )
stpapi.continue.process("tdsls4404m000", error)
if not isspace(error) then
message("Error when setting report: %s", error)
endif
stpapi.print.report("tdsls4404m000", error)
stpapi.end.session("tdsls4404m000")
}