Monday, 23 July 2018

LN DLL to convert Text (i.e. field with domain tctxtn) to String

function extern domain tcmcs.s512 gp.cus.dll0200.convert.text.field.to.value(
domain tcmcs.st20m i.text.variable)
{
string l.text.buffer(200, 10) mb
string l.return.value(512) mb
long l.number.of.text.lines
long i

l.return.value = ""
l.number.of.text.lines = text.to.buf(i.text.variable,
     language$,
             10, l.text.buffer)
if l.number.of.text.lines > 0 then
for i = 1 to l.number.of.text.lines
l.return.value = l.return.value & " " & trim$(l.text.buffer(1,i))
endfor
endif
return(l.return.value)
}

Thursday, 29 March 2018

AFS to Process Billing Request (Compose, Print & Post)

#pragma used dll ottstpapihand
#pragma used dll ottdllbw

function extern domain  tcbool cicust.dll0001.compose.print.post.invoices( domain tcncmp i.financial.company,
domain cisli.brid i.billing.request,
domain cisli.devc i.device,
domain tcdate i.date,
ref domain tcmcs.s132m o.error.msg mb )
{
DllUsage
Expl : This function is used to completely process a given billing
  request. This does composing, printing and posting.
Pre : Financial Company should be the Current Company
Post : NA
Input : i.financial.company
  i.billing.request
  i.device -> Device to display the report.
  i.print.euro ->
Indicator whether EMU amount have to be printed
also in Euro or not.
Output : o.error.msg -> Error message when returning false
Returns : True -> When Billing Request is processed successfully
  False  -> Error in processing Billing Request
EndDllUsage

string error(200)
     
error = ""
o.error.msg = ""
        stpapi.put.field( "cisli2200m000", "f.billing.req.f", str$(i.billing.request))
        stpapi.put.field( "cisli2200m000", "f.billing.req.t", str$(i.billing.request))
        stpapi.put.field( "cisli2200m000", "f.composing", str$(etol(tcyesno.yes)))
        stpapi.put.field( "cisli2200m000", "f.br.compose", str$(etol(tcyesno.yes)))
        stpapi.put.field( "cisli2200m000", "f.invoice.date", str$(i.date))
        stpapi.put.field( "cisli2200m000", "f.br.print", str$(etol(tcyesno.yes)))
        stpapi.put.field( "cisli2200m000", "f.print.option", str$(etol(cisli.prno.original)))
        stpapi.put.field( "cisli2200m000", "f.print.in.euro", str$(etol(tcyesno.no)))
        stpapi.put.field( "cisli2200m000", "f.print.trans.dt", str$(i.date))
        stpapi.put.field( "cisli2200m000", "f.br.post", str$(etol(tcyesno.yes)))
        stpapi.put.field( "cisli2200m000", "f.post.trans.dt", str$(i.date))
        stpapi.put.field( "cisli2200m000", "f.br.set.device", i.device)
        stpapi.put.field( "cisli2200m000", "f.print.device", i.device)
        stpapi.put.field( "cisli2200m000", "f.post.device", i.device)
        stpapi.put.field( "cisli2200m000", "f.excp.device", i.device)

stpapi.form.command( "cisli2200m000", 5, "exec.cont.process", error )
        stpapi.end.session( "cisli2200m000" )

if not isspace(error) then
o.error.msg = error
return(false)
endif
return(true)
}

Wednesday, 14 February 2018

Issue: Opening Balance of Ledger became 0 for Periods

When you have closed the previous year provisionally and then you run session: tfgld3203m000 (Rebuild Opening Balance/History from Transactions) for current year with checkbox "Opening Balance" selected. System will set the Opening Balance for all the periods of current year as zero.

To avoid this, you must run the "Rebuild Opening Balance/History from Transactions" session without selecting "Opening Balance" checkbox for current year.

Correct unbalanced finalized transactions (tfgld6209m000)