* curata_s9_5_atasamente.prg - sterge fizic atasamentele semanate de probele S9-5 si S11 pe * documentele atinse (S9-5: 1073 controlul negativ, 1074 rularea verde; S11: 1127 rularea verde, * 1128 controlul negativ, 1076/1111/1129 rulari care nu au consumat documentul). * Randurile legate prin COD (cele 20 mostenite) NU se ating. SET SAFETY OFF SET TALK OFF PUBLIC gcErrLog gcErrLog = 'D:\ROA\ROAFACTURARE\COMUN\utile\Teste\editare_factura\curata_s9_5_atasamente_log.txt' STRTOFILE('start ' + TRANSFORM(DATETIME()) + CHR(13) + CHR(10), gcErrLog) ON ERROR DO test_error_handler WITH ERROR(), MESSAGE(), PROGRAM(), LINENO() DO ('D:\ROA\ROAFACTURARE\COMUN\utile\Teste\test_init_env_auto_roafacturare.prg') WITH 'CENTRAL', 'MARIUSM_AUTO', 'ROMFASTSOFT' IF gnHandle <= 0 STRTOFILE('EROARE: conectare esuata' + CHR(13) + CHR(10), gcErrLog, 1) QUIT ENDIF LOCAL lnNr lnNr = -1 goExecutor.oSelecteaza2Value([select count(*) as nr from ] + gcs + [.atasamente_vanzari where id_vanzare in (1073,1074,1076,1111,1127,1128,1129)], @lnNr) STRTOFILE('inainte: ' + TRANSFORM(lnNr) + ' randuri' + CHR(13) + CHR(10), gcErrLog, 1) IF goExecutor.oExecuta([delete from ] + gcs + [.atasamente_vanzari where id_vanzare in (1073,1074,1076,1111,1127,1128,1129)]) goExecutor.oExecuta([COMMIT]) ENDIF lnNr = -1 goExecutor.oSelecteaza2Value([select count(*) as nr from ] + gcs + [.atasamente_vanzari where id_vanzare in (1073,1074,1076,1111,1127,1128,1129)], @lnNr) STRTOFILE('dupa: ' + TRANSFORM(lnNr) + ' randuri' + CHR(13) + CHR(10), gcErrLog, 1) lnNr = -1 goExecutor.oSelecteaza2Value([select count(*) as nr from ] + gcs + [.atasamente_vanzari], @lnNr) STRTOFILE('total ramas in tabela: ' + TRANSFORM(lnNr) + CHR(13) + CHR(10), gcErrLog, 1) STRTOFILE('end ' + TRANSFORM(DATETIME()) + CHR(13) + CHR(10), gcErrLog, 1) QUIT PROCEDURE test_error_handler LPARAMETERS tnError, tcMessage, tcProgram, tnLineNo STRTOFILE('EROARE ' + TRANSFORM(tnError) + ' [' + tcProgram + ':' + TRANSFORM(tnLineNo) + '] ' + tcMessage + CHR(13) + CHR(10), gcErrLog, 1) ENDPROC