teste storno eFactura: e2e runda 2-5, diagnostic ANAF 1814 (E1-E4: validare /prod/ inainte de upload /test/), Raspunsuri (nimic) (test6-8)
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WsxyCHJYL6W9MZ6FPnH8ax
This commit is contained in:
29
utile/Teste/storno/test6_raspunsuri_1zi.prg
Normal file
29
utile/Teste/storno/test6_raspunsuri_1zi.prg
Normal file
@@ -0,0 +1,29 @@
|
||||
* test6_raspunsuri_1zi.prg - DOAR CITIRE: listaMesajePaginatieFactura pe ANAF TEST, ultima zi (ca "Raspunsuri > Ultima zi").
|
||||
* Scop: textul exact din "eroare" cand nu sunt mesaje (Marius vede "Nimic"). Fara upload, fara procesare in baza.
|
||||
SET SAFETY OFF
|
||||
SET TALK OFF
|
||||
CLOSE DATABASES
|
||||
PUBLIC gcUILog
|
||||
gcUILog = "D:\ROA\ROACONT\COMUN\utile\Teste\storno\test6_raspunsuri_1zi_log.txt"
|
||||
STRTOFILE("START " + TTOC(DATETIME()) + CHR(13) + CHR(10), gcUILog)
|
||||
ON ERROR STRTOFILE('EROARE ' + TRANSFORM(ERROR()) + ' ' + MESSAGE() + ' ' + PROGRAM() + ' ' + TRANSFORM(LINENO()) + CHR(13) + CHR(10), gcUILog, 1)
|
||||
ON SHUTDOWN QUIT
|
||||
TRY
|
||||
DO "D:\ROA\ROACONT\COMUN\utile\Teste\test_init_env_auto.prg" WITH 'CENTRAL', 'MARIUSM_AUTO', 'ROMFASTSOFT'
|
||||
LOCAL loAnaf, loHTTP, ltEnd, ltStart, lcUrl, lnZile
|
||||
loAnaf = CREATEOBJECT('AnafeFacturaServer', .F., '', gcS, '')
|
||||
loAnaf.lTest = .T.
|
||||
loAnaf.RefreshTokenAuto()
|
||||
ltEnd = GetUtcTime(DATETIME()-60)
|
||||
ltStart = ltEnd - 1*24*60*60
|
||||
lcUrl = 'https://api.anaf.ro/test/FCTEL/rest/listaMesajePaginatieFactura?startTime=' + ALLTRIM(STR(Datetime2UnixTime(ltStart))) + '000&endTime=' + ALLTRIM(STR(Datetime2UnixTime(ltEnd))) + '000&cif=' + ALLTRIM(loAnaf.cCodFiscal) + '&pagina=1'
|
||||
STRTOFILE('cUser=[' + TRANSFORM(loAnaf.cUser) + '] url=' + lcUrl + CHR(13) + CHR(10), gcUILog, 1)
|
||||
loHTTP = CREATEOBJECT('winHTTP.winHTTPrequest.5.1')
|
||||
loHTTP.Open('GET', lcUrl, .F.)
|
||||
loHTTP.setRequestHeader('Authorization', 'Bearer ' + loAnaf.cToken)
|
||||
loHTTP.Send()
|
||||
STRTOFILE('status=' + TRANSFORM(loHTTP.Status) + CHR(13) + CHR(10) + loHTTP.ResponseText + CHR(13) + CHR(10), gcUILog, 1)
|
||||
CATCH TO loEx
|
||||
STRTOFILE('EXCEPTIE ' + loEx.Message + CHR(13) + CHR(10), gcUILog, 1)
|
||||
ENDTRY
|
||||
QUIT
|
||||
Reference in New Issue
Block a user