From c62f9223df643f750ccd615a109b26d315314b4f Mon Sep 17 00:00:00 2001 From: Marius Mutu Date: Fri, 18 Sep 2026 17:54:05 +0300 Subject: [PATCH] sync SVN r18180 --- Programe/oproceduri_import.prg | 47 +++++++++++++++++++++++++++++----- changelog_roacont.txt | 15 +++++++++++ roacont.pj2 | 4 +-- 3 files changed, 58 insertions(+), 8 deletions(-) diff --git a/Programe/oproceduri_import.prg b/Programe/oproceduri_import.prg index 55b59ab..0d8c603 100644 --- a/Programe/oproceduri_import.prg +++ b/Programe/oproceduri_import.prg @@ -55,6 +55,10 @@ *!* marius.mutu *!* CreeazaNote - plata la Trezorerie recunoscuta dupa IBAN (TVA 4423, CAM 436, cont unic defalcat din frm_modific2024) +*!* 18.09.2026 +*!* marius.mutu +*!* csvGaranti - Ordonator/IBAN ordonator si cod fiscal structurat pe incasari, explicatie C(254), prefixe /ROC//URI/ din Detalii; numere de factura de la 2 cifre in alocare + ************************************* * Clasa ImportNote este fabrica de clase tip Export ************************************* @@ -1378,7 +1382,7 @@ Function ExtrageNumereFacturi lcRezultat = '' For lnI = 1 To Getwordcount(m.lcNumere, ',') lcNumar = Alltrim(Getwordnum(m.lcNumere, m.lnI, ',')) - If Len(m.lcNumar) >= 3 + If Len(m.lcNumar) >= 2 lcRezultat = m.lcRezultat + Iif(!Empty(m.lcRezultat), ',', '') + m.lcNumar Endif Endfor @@ -4104,7 +4108,7 @@ Define Class ExtrasBanca_General As ExtrasBanca Local mtextoriginal This.cIBAN = 'Garanti' mtextoriginal = "" - Create Cursor C_TMP_I (data_t C (16), explicatie C (200), suma C (15), sold C (15)) + Create Cursor C_TMP_I (data_t C (16), explicatie C (254), suma C (15), sold C (15)) Append From (pselectedfile) Delimited With Char ";" Scan For !Empty(data_t) .And. !Empty(setdategerman(C_TMP_I.data_t)) Select c_iex @@ -4146,6 +4150,11 @@ Define Class ExtrasBanca_General As ExtrasBanca mlenexpl = Len( "IBAN platitor:" ) + 1 miban = Substr(mexplicatie, mpoziban + mlenexpl, 24) Endif + If "IBAN ordonator:" $ mexplicatie + mpoziban = At( "IBAN ordonator:", mexplicatie) + mlenexpl = Len( "IBAN ordonator:" ) + 1 + miban = Substr(mexplicatie, mpoziban + mlenexpl, 24) + Endif If "IBAN beneficiar:" $ mexplicatie mpoziban = At( "IBAN beneficiar:", mexplicatie) mlenexpl = Len( "IBAN beneficiar:" ) + 1 @@ -4157,8 +4166,12 @@ Define Class ExtrasBanca_General As ExtrasBanca mexplicatie2 = mexplicatie Endif If tip = "C" - mpoztertstart = At( "Platitor: ", mexplicatie2) + 10 If "Platitor: " $ mexplicatie2 + mpoztertstart = At( "Platitor: ", mexplicatie2) + 10 + Else + mpoztertstart = At( "Ordonator: ", mexplicatie2) + 11 + Endif + If "Platitor: " $ mexplicatie2 .Or. "Ordonator: " $ mexplicatie2 If mpoziban > mpoztertstart mtert1 = Alltrim(Substr(mexplicatie2, mpoztertstart, mpoziban - mpoztertstart)) Else @@ -4185,17 +4198,39 @@ Define Class ExtrasBanca_General As ExtrasBanca Endif Endif Endif + mposslash = At("/", mtert) && taie prefixul structurat "N/" din numele tertului + If mposslash > 1 .And. Empty(Chrtran(Left(mtert, mposslash - 1), "0123456789", "")) + mtert = Substr(mtert, mposslash + 1) + Endif If "Cod fiscal:" $ mexplicatie - mcf = getdigitsfromstring(Alltrim(Substr(mexplicatie, At("Cod fiscal:", mexplicatie) + 12, 13)), 4, 1, ".") - If Alltrim(mcf) == Alltrim(gofirma.codfiscalfro) + mcftext = Alltrim(Substr(mexplicatie, At("Cod fiscal:", mexplicatie) + 12, 13)) + mposslashcf = At("/", mcftext) && cod fiscal structurat ("N/RO/oras,...") pe incasari, nu e CUI + If mposslashcf > 1 .And. Empty(Chrtran(Left(mcftext, mposslashcf - 1), "0123456789", "")) mcf = "" + Else + mcf = getdigitsfromstring(mcftext, 4, 1, ".") + If Alltrim(mcf) == Alltrim(gofirma.codfiscalfro) + mcf = "" + Endif Endif Endif Replace tert With mtert, iban With miban, cf With mcf, tip_2 With m.lcTip2 mtextoriginal = C_TMP_I.data_t + " " + Chr(13) + C_TMP_I.suma + " " + Chr(13) + Alltrim(mexplicatie) If Occurs("Detalii:", mexplicatie) > 0 - mexplicatie = Substr(mexplicatie, At("Detalii:", mexplicatie) + 8, 200) + mexplicatie = Alltrim(Substr(mexplicatie, At("Detalii:", mexplicatie) + 8, 200)) + If Left(mexplicatie, 5) == "/ROC/" + mexplicatie = Substr(mexplicatie, 6) + Endif + If "/URI/" $ mexplicatie && retine doar textul dintre /URI/ si urmatorul "/" + mposuri = At("/URI/", mexplicatie) + 5 + mposslashuri = At("/", Substr(mexplicatie, mposuri)) + If mposslashuri > 0 + mexplicatie = Substr(mexplicatie, mposuri, mposslashuri - 1) + Else + mexplicatie = Substr(mexplicatie, mposuri) + Endif + Endif Endif Replace explicatie With mexplicatie, original With mtextoriginal Endscan diff --git a/changelog_roacont.txt b/changelog_roacont.txt index 03ccc62..ab7bf40 100644 --- a/changelog_roacont.txt +++ b/changelog_roacont.txt @@ -1,3 +1,18 @@ + +