Please help.... 6 hours straight making test and stuff, an I've just came to the conclusion I hit into a bug or something.
METHOD PUBLIC VOID RecalcularCFDI(pSerie AS CHARACTER, pFolio AS INTEGER, OUTPUT pTotal AS DECIMAL ): FIND Cfdi33_comprobante WHERE Cfdi33_comprobante.ciFolio = pFolio AND Cfdi33_comprobante.ccSerie = pSerie NO-LOCK. FOR EACH Cfdi33_concepto WHERE Cfdi33_concepto.xcFKcomprobante = Cfdi33_comprobante.xcPK: ASSIGN pTotal = pTotal + Cfdi33_concepto.cdImporte. END. FIND CURRENT Cfdi33_comprobante EXCLUSIVE-LOCK. ASSIGN Cfdi33_comprobante.cdTotal = DECIMAL(pTotal) Cfdi33_comprobante.cdSubTotal = DECIMAL(pTotal). MESSAGE "Cfdi33_comprobante.cdTotal decimal: " STRING(Cfdi33_comprobante.cdTotal, ">>>>>>>9.9999<"). MESSAGE "Cfdi33_comprobante.cdSubTotal decimal: " STRING(Cfdi33_comprobante.cdSubTotal, ">>>>>>>9.9999<"). MESSAGE "pTotal: " pTotal. RELEASE Cfdi33_comprobante. RETURN. END METHOD.
and this is output
[18/01/29@21:19:23.445-0600] P-006164 T-006168 1 AS -- (Procedure: 'RecalcularCFDI Procs.SAT.v3_3.Comprobante' Line:375) Cfdi33_comprobante.cdTotal decimal: 15150.0000
[18/01/29@21:19:23.445-0600] P-006164 T-006168 1 AS -- (Procedure: 'RecalcularCFDI Procs.SAT.v3_3.Comprobante' Line:376) Cfdi33_comprobante.cdSubTotal decimal: 15150.0000
[18/01/29@21:19:23.445-0600] P-006164 T-006168 1 AS -- (Procedure: 'RecalcularCFDI Procs.SAT.v3_3.Comprobante' Line:377) pTotal: 15149.68
and day 30th is deadline!!!
prowin 11.7.2 code executes on appserver windows:
(appserver's proenv)
Inserting C:\Progress\OpenEdge\bin to beginning of path and
the current directory is
C:\OpenEdge\WRK
OpenEdge Release 11.5 as of Fri Dec 5 19:02:00 EST 2014
proenv>
on code showed up, there are the messages and decimal castings I have tryed, made shure fields on db are decimai, but writing this I went to revisit the decimals specification I have on database, and found that it is set as '?' instead the original 6.
This is the temp-table definitions derived from a XSD, wich then was used to load data definition on dictionary.
FIELD cdDescuento AS DECIMAL DECIMALS 6 LABEL "cdDescuento" COLUMN-LABEL "cdDescuento"
FIELD cdSubTotal AS DECIMAL DECIMALS 6 FORMAT "->>,>>9.999999" LABEL "cdSubTotal" COLUMN-LABEL "cdSubTotal"
FIELD cdTipoCambio AS DECIMAL DECIMALS 6 FORMAT "->>,>>9.999999" LABEL "cdTipoCambio" COLUMN-LABEL "cdTipoCambio"
FIELD cdTotal AS DECIMAL DECIMALS 6 FORMAT "->>,>>9.999999" LABEL "cdTotal" COLUMN-LABEL "cdTotal"
Another version is this, yet it show exactly the same output on appserver
METHOD PUBLIC VOID RecalcularCFDI(pSerie AS CHARACTER, pFolio AS INTEGER, OUTPUT pTotal AS DECIMAL ): DEFINE VARIABLE foo AS DECIMAL DECIMALS 6 NO-UNDO. FIND Cfdi33_comprobante WHERE Cfdi33_comprobante.ciFolio = pFolio AND Cfdi33_comprobante.ccSerie = pSerie NO-LOCK. FOR EACH Cfdi33_concepto WHERE Cfdi33_concepto.xcFKcomprobante = Cfdi33_comprobante.xcPK GROUP BY Cfdi33_concepto.ccNoIdentificacion: ASSIGN foo = foo + Cfdi33_concepto.cdImporte. END. FIND CURRENT Cfdi33_comprobante EXCLUSIVE-LOCK. ASSIGN Cfdi33_comprobante.cdTotal = DECIMAL(foo) Cfdi33_comprobante.cdSubTotal = DECIMAL(foo) pTotal = foo. MESSAGE "Cfdi33_comprobante.cdTotal decimal: " STRING(Cfdi33_comprobante.cdTotal, ">>>>>>>9.9999<"). MESSAGE "Cfdi33_comprobante.cdSubTotal decimal: " STRING(Cfdi33_comprobante.cdSubTotal, ">>>>>>>9.9999<"). MESSAGE "pTotal: " pTotal. RELEASE Cfdi33_comprobante. RETURN. END METHOD.
I'm really desperate, as it defies every knowing I had about datatypes..
TIA
I went to datadictionary, set those fields to 6 decimals, recomplied, and re-run.. but no change....
Thanks.. Yes there is no trigger for this (and for no other data anyway). And I've posted several updates to this thread and the solution... but,,, agin I'm missing those post on the thread..
I went to datadictionary, set those fields to 6 decimals, recomplied, and re-run.. but no change....
removing the DECIMAL() make problem go away... but decimal function was introduced last hour only...... so previous five hours problem was the decimals definition on datadictiionary?
Thanks.. Yes there is no trigger for this (and for no other data anyway). And I've posted several updates to this thread and the solution... but,,, agin I'm missing those post on the thread..
Anyway... removing the DECIMAL() on the fields solved this, after making shure on db that decimals is set to 6, instead a '?' that showed on datadict. Recompiled and rerun to avail... yes.
The problem is that DECIMAL() was introduced last hour... but previous 5 hours, it behavied different... Datadictionary was created from XSD with bproxsdto4gl, and data definitions goes as:
FIELD cdSubTotal AS DECIMAL DECIMALS 6 FORMAT "->>,>>9.999999" LABEL "cdSubTotal" COLUMN-LABEL "cdSubTotal"
FIELD cdTotal AS DECIMAL DECIMALS 6 FORMAT "->>,>>9.999999" LABEL "cdTotal" COLUMN-LABEL "cdTotal"