#6 editare factura emisa: harnessul S8 de creare documente intra in versionare
Cele trei fisiere erau pe disc, netrackuite, iar ce se stia despre ele traia intr-un handoff intre sesiuni. Handoff-ul a fost desfiintat: ce era durabil a intrat in antetul harnessului - plaja de serii care chiar prinde (FACTURA cere gnIdUtil=8 cu gnIdSucursala=167, AVIZ merge si cu -3), faptul ca alocarea consuma numere ireversibil chiar cand documentul nu se scrie, ordinea gresita de incarcare a lui mock_amessagebox care e suspectul principal pentru agatari, si riscul de curs EUR ramas neconfirmat pe cursor_contract. Harnessul nu a scris inca niciun document cu succes - antetul spune asta explicit, ca sa nu fie luat drept unealta functionala. test_init_env_auto_roafacturare.prg e generic si folosit deja de alte suite: seteaza gcNumeProgram=[ROAFACTURARE], fara de care garzile proprii fluxului de facturare nu se declanseaza. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SN8snvkk94KuhWwoXUUey3
This commit is contained in:
264
utile/Teste/test_init_env_auto_roafacturare.prg
Normal file
264
utile/Teste/test_init_env_auto_roafacturare.prg
Normal file
@@ -0,0 +1,264 @@
|
||||
* test_init_env_auto_roafacturare.prg
|
||||
* Varianta ROAFACTURARE a test_init_env_auto.prg (COMUN\utile\Teste): acela seteaza gcAppPath fix
|
||||
* pe D:\ROA\ROACONT\ (harness scris pentru ROACONT) si gcNumeProgram=[ROACONT] - insuficient pentru
|
||||
* fluxul de facturare/avizare (ofacturare.vc2), care conditioneaza garzi proprii de
|
||||
* gcNumeProgram=[ROAFACTURARE] (ex. frm_alte_date.inainte_de_do_termin, ferestre_cere_date.vc2).
|
||||
* Acelasi tipar ca test_init_env_auto_acnpro.prg / test_init_env_auto_roagest.prg: cale + SET
|
||||
* PATH/CLASSLIB/PROCEDURE specifice ROAFACTURARE (lista alianata cu harnessul UI validat
|
||||
* test_pret_cu_tva_nivel2.prg), plus initializarea de conexiune Oracle REALA (identica in toate
|
||||
* variantele).
|
||||
*
|
||||
* Utilizare: DO test_init_env_auto_roafacturare WITH 'CENTRAL', 'MARIUSM_AUTO', 'parola'
|
||||
* ATENTIE: mentine sincronizat cu test_init_env_auto.prg pentru partea comuna.
|
||||
|
||||
LPARAMETERS tcHost, tcSchema, tcPassword, tnAn, tnLuna
|
||||
|
||||
tcHost = IIF(EMPTY(tcHost), 'CENTRAL', tcHost)
|
||||
tcSchema = IIF(EMPTY(tcSchema), 'MARIUSM_AUTO', tcSchema)
|
||||
tcPassword = IIF(EMPTY(tcPassword), 'ROMFASTSOFT', tcPassword)
|
||||
|
||||
SET DELETED ON
|
||||
SET ANSI ON
|
||||
SET EXACT ON
|
||||
SET SAFETY OFF
|
||||
CLOSE DATABASES
|
||||
SET CENTURY ON
|
||||
SET DATE DMY
|
||||
SET NULLDISPLAY TO ''
|
||||
|
||||
PUBLIC CT_SUCCES, CT_INSUCCES, crlf, gnAn, gnLuna, gnIdUtil, glEMama, gnIdFirma, gcCondSucursala, ;
|
||||
gnIdSucursala, gcS, gcFirma, gcUserName, gcNumeProgram, gcAppName, glLunaInchisa, ;
|
||||
buton, gnButon, pnButon, gl406, gcAcces
|
||||
CT_SUCCES = 1
|
||||
CT_INSUCCES = -1
|
||||
crlf = CHR(13) + CHR(10)
|
||||
gnAn = IIF(EMPTY(tnAn), YEAR(DATE()), tnAn)
|
||||
gnLuna = IIF(EMPTY(tnLuna), MONTH(DATE()), tnLuna)
|
||||
gnIdUtil = -3
|
||||
gnIdFirma = 110
|
||||
gcCondSucursala = []
|
||||
gnIdSucursala = m.gnIdFirma
|
||||
gcS = UPPER(ALLTRIM(tcSchema))
|
||||
gcFirma = m.gcS
|
||||
gcUserName = m.gcS
|
||||
gcNumeProgram = [ROAFACTURARE]
|
||||
gcAppName = [ROAFACTURARE]
|
||||
glLunaInchisa = .F.
|
||||
glEMama = .F.
|
||||
gl406 = .F.
|
||||
PUBLIC nror(65000)
|
||||
buton = 1
|
||||
gnButon = 1
|
||||
pnButon = 1
|
||||
|
||||
LOCAL lcPath
|
||||
PUBLIC gcAppPath, DIRGEN, gcBasePath, gcTempPath, gcGeneralIniFile, gcSettingsFile
|
||||
gcAppPath = [D:\ROA\ROAFACTURARE\]
|
||||
Set Default To (gcAppPath)
|
||||
lcPath = gcAppPath + 'Date;' + ;
|
||||
gcAppPath + 'Include;' + ;
|
||||
gcAppPath + 'FERESTRE;' + ;
|
||||
gcAppPath + 'GRAFICE;' + ;
|
||||
gcAppPath + 'CLASE;' + ;
|
||||
gcAppPath + 'MENIURI;' + ;
|
||||
gcAppPath + 'PROGRAME;' + ;
|
||||
gcAppPath + 'RAPOARTE;' + ;
|
||||
gcAppPath + 'COMUN;' + ;
|
||||
gcAppPath + 'COMUN\CLASE;' + ;
|
||||
gcAppPath + 'COMUN\FERESTRE;' + ;
|
||||
gcAppPath + 'COMUN\PROGRAME;' + ;
|
||||
gcAppPath + 'COMUN\GRAFICE;' + ;
|
||||
gcAppPath + 'COMUN\RAPOARTE;' + ;
|
||||
gcAppPath + 'COMUN\UTILE\CALENDAR;' + ;
|
||||
gcAppPath + 'COMUN\UTILE\CTL32;' + ;
|
||||
gcAppPath + 'COMUN\UTILE\HPDF;' + ;
|
||||
gcAppPath + 'COMUN\UTILE\HPDF\REPORTOUTPUT;' + ;
|
||||
gcAppPath + 'COMUN\UTILE\WEB;' + ;
|
||||
gcAppPath + 'COMUN\UTILE\EMAIL;' + ;
|
||||
gcAppPath + 'COMUN\UTILE\NFJSON;' + ;
|
||||
gcAppPath + 'COMUN\UTILE\NFXML;' + ;
|
||||
ADDBS(SUBSTR(gcAppPath,1,RAT([\],gcAppPath,2)))+[COMUNROA\]
|
||||
SET PATH TO &lcPath ADDITIVE
|
||||
|
||||
Set Classlib To (gcAppPath + "comun\clase\appwiz") Additive
|
||||
Set Classlib To registry Additive
|
||||
Set Classlib To cauta_alfa_forms Additive
|
||||
Set Classlib To ofacturare.vcx Additive
|
||||
Set Classlib To ofacturare_comun.vcx Additive
|
||||
Set Classlib To accessibility.vcx Additive
|
||||
Set Classlib To ocriterii.vcx Additive
|
||||
Set Classlib To ctl32_statusbar.vcx Additive
|
||||
Set Classlib To ctl32_common.vcx Additive
|
||||
Set Classlib To ctl32_structs.vcx Additive
|
||||
Set Classlib To ctl32_progressbar.vcx Additive
|
||||
Set Classlib To DECABAZA Additive
|
||||
Set Classlib To onomenclatoare Additive
|
||||
Set Classlib To onomenclatoare2 Additive
|
||||
Set Classlib To ofacturare_rapoarte Additive
|
||||
Set Classlib To orapoarte Additive
|
||||
Set Classlib To ferestre_oracle Additive
|
||||
Set Classlib To messagebox Additive
|
||||
Set Classlib To otoolbar Additive
|
||||
Set Classlib To onom_curs Additive
|
||||
Set Classlib To comun Additive
|
||||
Set Classlib To ferestre_cere_date Additive
|
||||
Set Classlib To baza Additive
|
||||
Set Classlib To caut Additive
|
||||
Set Classlib To ointroduceri Additive
|
||||
Set Classlib To serii_numere Additive
|
||||
Set Classlib To caut_ora Additive
|
||||
Set Classlib To wwdialogs.vcx Additive
|
||||
Set Classlib To _calendar.vcx Additive
|
||||
Set Classlib To locale Additive
|
||||
Set Classlib To overificari Additive
|
||||
Set Classlib To ocomenzi Additive
|
||||
Set Classlib To anaf_efactura Additive
|
||||
|
||||
Set Procedure To proceduri_comune Additive
|
||||
Set Procedure To quitapp Additive
|
||||
Set Procedure To init_program Additive
|
||||
Set Procedure To onomenclatoare.prg Additive
|
||||
Set Procedure To onomenclatoare2.prg Additive
|
||||
Set Procedure To oproceduri_rapoarte_fact.prg Additive
|
||||
Set Procedure To email.prg Additive
|
||||
Set Procedure To GENCURSOR.PRG Additive
|
||||
Set Procedure To OPROCEDURI_COMUNE.PRG Additive
|
||||
Set Procedure To OINIT_OPTIUNI.PRG Additive
|
||||
Set Procedure To updateserver.PRG Additive
|
||||
Set Procedure To OPROCEDURI_aMS.PRG Additive
|
||||
Set Procedure To ocautare Additive
|
||||
Set Procedure To odocumente Additive
|
||||
Set Procedure To osecurity Additive
|
||||
Set Procedure To acces_meniu Additive
|
||||
Set Procedure To wwxmlhttp.prg Additive
|
||||
Set Procedure To wwcodeupdate.prg Additive
|
||||
Set Procedure To ini.prg Additive
|
||||
Set Procedure To cauta_alfa.prg Additive
|
||||
Set Procedure To oHeader.prg Additive
|
||||
Set Procedure To oproceduri_curs.prg Additive
|
||||
Set Procedure To proceduri.prg Additive
|
||||
Set Procedure To oproceduri_facturare.prg Additive
|
||||
Set Procedure To proceduri_rapoarte.prg Additive
|
||||
Set Procedure To ofacturare.prg Additive
|
||||
Set Procedure To oserii_numere.prg Additive
|
||||
Set Procedure To wwutils.prg Additive
|
||||
Set Procedure To wwConfig.prg Additive
|
||||
Set Procedure To wwApi.prg Additive
|
||||
Set Procedure To oexport.prg Additive
|
||||
Set Procedure To validare.prg Additive
|
||||
Set Procedure To ofacturare_comun.prg Additive
|
||||
Set Procedure To ofacturare_stoc.prg Additive
|
||||
Set Procedure To pmenu.prg Additive
|
||||
Set Procedure To ointroduceri.prg Additive
|
||||
Set Procedure To ovariabile_globale.prg Additive
|
||||
Set Procedure To ooperatii_comune.prg Additive
|
||||
Set Procedure To oproceduri_util.prg Additive
|
||||
Set Procedure To filebringer.prg Additive
|
||||
Set Procedure To iniacces.prg Additive
|
||||
Set Procedure To oupdate.prg Additive
|
||||
Set Procedure To procese.prg Additive
|
||||
Set Procedure To version.prg Additive
|
||||
Set Procedure To wwhttp.prg Additive
|
||||
Set Procedure To xmlaccess.prg Additive
|
||||
Set Procedure To xmlparser.prg Additive
|
||||
Set Procedure To xdate.prg Additive
|
||||
Set Procedure To suma_in_vorbe.prg Additive
|
||||
Set Procedure To controllerecr Additive
|
||||
Set Procedure To regex.prg Additive
|
||||
SET PROCEDURE TO anaf_efactura.prg ADDITIVE
|
||||
|
||||
Declare Integer GetPrivateProfileString In WIN32API ;
|
||||
string, String, String, String @, Integer, String
|
||||
Declare Integer WritePrivateProfileString In Win32Api ;
|
||||
string, String, String, String
|
||||
Declare Integer CopyFile In WIN32API ;
|
||||
STRING lpExistingFileName, STRING lpNewFileName, INTEGER bFailIfExists
|
||||
Declare Integer PathFileExists In shlwapi STRING pszPath
|
||||
|
||||
If Type('goApi') = 'U'
|
||||
Public goApi
|
||||
goApi = Newobject("wwAPI", "wwAPI.prg")
|
||||
ENDIF
|
||||
|
||||
set procedure to oinit_optiuni.prg additive
|
||||
set procedure to oproceduri_comune.prg additive
|
||||
|
||||
PUBLIC gnHandle, goExecutor, goConn, goFirma, goCalendar, poLog, goLog, goApp, goExport
|
||||
DIRGEN = [D:\ROA\]
|
||||
gcBasePath = dirgen
|
||||
gcGeneralIniFile = DIRGEN + "settings.ini"
|
||||
gcSettingsFile = m.gcGeneralIniFile
|
||||
gcTempPath = Addbs(shortpath(goApi.GetTempPath())) + gcS + [\]
|
||||
If !Directory(gcTempPath)
|
||||
Md (gcTempPath)
|
||||
Endif
|
||||
gcAcces = [1;2;3;4;5;6;7;8;]
|
||||
|
||||
poLog = Newobject("Log_Mesaje","Log_Mesaje.prg")
|
||||
goLog = poLog
|
||||
goApp = Createobject("wzApplication")
|
||||
goExport = Createobject("oExportConfig")
|
||||
gnHandle = 0
|
||||
goExecutor = createobject("oExecutor")
|
||||
goConn = createobject("oConn")
|
||||
goConn.Connect(m.tcHost, m.tcSchema, m.tcPassword)
|
||||
IF m.gnHandle <= 0
|
||||
RETURN .F.
|
||||
ENDIF
|
||||
|
||||
LOCAL llSucces, lcSql
|
||||
goFirma = null
|
||||
llSucces = goExecutor.oExecuta("select * from syn_v_nom_firme where schema = ?gcS", "cFirma")
|
||||
IF m.llSucces
|
||||
SELECT cFirma
|
||||
gnIdFirma = id_firma
|
||||
gnIdSucursala = null
|
||||
gcFirma = ALLTRIM(firma)
|
||||
SCATTER NAME goFirma
|
||||
IF TYPE('goFirma.codfiscalfro') = 'U'
|
||||
ADDPROPERTY(goFirma, 'codfiscalfro', ALLTRIM(STRTRAN(ALLTRIM(NVL(goFirma.cod_fiscal, '')), 'RO', '')))
|
||||
ENDIF
|
||||
ELSE
|
||||
goFirma = CREATEOBJECT('custom')
|
||||
goFirma.addproperty('cod_fiscal', '')
|
||||
goFirma.addproperty('schema', m.gcS)
|
||||
goFirma.addproperty('firma', m.gcS)
|
||||
goFirma.addproperty('codfiscalfro', '')
|
||||
ENDIF
|
||||
USE IN (SELECT('cFirma'))
|
||||
|
||||
goCalendar = null
|
||||
llSucces = goExecutor.oExecuta('SELECT anul, luna, tva_incasare FROM calendar WHERE an*12+luna = (select MAX(an*12+luna) FROM calendar)', 'cCalendar')
|
||||
IF m.llSucces
|
||||
SELECT cCalendar
|
||||
GO TOP
|
||||
IF EMPTY(m.tnAn)
|
||||
gnAn = anul
|
||||
gnLuna = luna
|
||||
ENDIF
|
||||
SCATTER NAME goCalendar
|
||||
ENDIF
|
||||
USE IN (SELECT('cCalendar'))
|
||||
|
||||
CREATE CURSOR dual (dummy c(10))
|
||||
INSERT INTO dual (dummy) VALUES ("")
|
||||
|
||||
actualizeaza_optiuni()
|
||||
Do optiuni_firma IN oinit_optiuni.prg
|
||||
|
||||
lcSql = [begin pack_sesiune.set_Id_Util(?gnIdUtil); end;]
|
||||
llSucces = goExecutor.oExecuta(lcSql)
|
||||
lcSql = [begin pack_sesiune.setluna(?gnLuna); pack_sesiune.setan(?gnAn); end;]
|
||||
llSucces = goExecutor.oExecuta(lcSql)
|
||||
lcSql = [begin pack_sesiune.setlunabal(?gnLuna); pack_sesiune.setanbal(?gnAn); end;]
|
||||
llSucces = goExecutor.oExecuta(lcSql)
|
||||
lcSql = [begin pack_contafin.SET_DATA_RON(?gcS); end;]
|
||||
llSucces = goExecutor.oExecuta(lcSql)
|
||||
lcSql = [begin pack_sesiune.set_data_ron(?gcS); end;]
|
||||
llSucces = goExecutor.oExecuta(lcSql)
|
||||
lcSql = [begin pack_contafin.set_id_sucursala(?gnIdSucursala); end;]
|
||||
llSucces = goExecutor.oExecuta(lcSql)
|
||||
lcSql = [begin pack_contafin.set_id_firma(?gnIdFirma); end;]
|
||||
llSucces = goExecutor.oExecuta(lcSql)
|
||||
|
||||
RETURN .T.
|
||||
Reference in New Issue
Block a user