749 lines
22 KiB
Plaintext
749 lines
22 KiB
Plaintext
***------------------------------------------------------------------------------------
|
|
Procedure set_set
|
|
LParameters tnId_set
|
|
|
|
&& adauga in mg_indicatori inregistrarile din mg_tmp_indicatori
|
|
|
|
Private pnId_set
|
|
Local lcSql, lnSucces
|
|
If Empty(tnId_set)
|
|
Return
|
|
Else
|
|
pnId_set = tnId_set
|
|
Endif
|
|
|
|
lcSql = [begin PACK_MG_EVOLUTIE.SET_SET(?pnId_set); end;]
|
|
lnSucces = goExecutor.oExecute(lcSql)
|
|
|
|
If lnSucces < 0
|
|
AMESSAGEBOX(goExecutor.cEroare, 0 + 16, "Eroare")
|
|
Endif
|
|
Return m.lnSucces
|
|
Endproc && set_set
|
|
***------------------------------------------------------------------------------------
|
|
Procedure viz_toate_seturile
|
|
|
|
* DO make_cFCentre IN oproceduri_manager.prg
|
|
Create Cursor cTipuri_seturi (id_tip_set N(5), nume_tip_set C(30), ales N(1))
|
|
Select cTipuri_seturi
|
|
|
|
|
|
Private poSeturi
|
|
Store '' To poSeturi
|
|
|
|
Local lcSchema1, lcSelect1, lcOrder1, lcFiltru1, llAfiseaza
|
|
*!* lcSchema1 = [id_ctr N(5), id_part N(10), nume C(30), nr_ctr N(10), data_ctr D(8), obiect C(200), tip N(1), durata N(3), valftva N(20,4), proc_tva N(5,2), avans N(20,4), proc_avans N(5,2),]+;
|
|
*!* [val_finant N(20,4), proc_finant N(5,2), dobanda N(20,4), proc_dobanda N(5,2), val_rezid N(20,4), proc_rezid N(5,2), ]+;
|
|
*!* [rata N(20,4), comision N(20,4), proc_comision N(5,2), proc_asigurare N(5,2), val_asigurare N(20,4), val_ctr N(20,4), id_valuta N(5), nume_val C(4), curs N(10,4), zi_plata N(2), incetat N(1), sters N(1) ]
|
|
*!*
|
|
*!* lcSelect1 = [select c.id_ctr, c.id_part, p.nume, c.nr_ctr, c.data_ctr, c.obiect, c.tip, c.durata, c.valftva, c.proc_tva, c.avans, c.proc_avans, ]+;
|
|
*!* [c.val_finant, c.proc_finant, c.dobanda, c.proc_dobanda, c.val_rezid, c.proc_rezid, ]+;
|
|
*!* [c.rata, c.comision, c.proc_comision, c.proc_asigurare, c.val_asigurare, c.val_ctr, c.id_valuta, v.nume_val, c.curs, c.zi_plata, c.incetat, c.sters from ] + gcS + ;
|
|
*!* [.cf_contracte c join ] + gcS + [.nom_parteneri p on p.id_part = c.id_part]+;
|
|
*!* [ join ] + gcS + [.nom_valute v on c.id_valuta = v.id_valuta]
|
|
lcSelect1 = [select s1.*, nvl(s2.uzual,0) as uzual from (select s.* from mg_seturi s) s1 left join (select distinct id_set, 1 as uzual from mg_seturi_uzuale u where u.sters = 0) s2 on s1.id_set = s2.id_set]
|
|
lcOrder1 = [s1.nume_set]
|
|
lcgroup = []
|
|
lcFiltru1 = [1=2]
|
|
lcFiltruOriginal = []
|
|
llModParam = .T.
|
|
llAfiseaza = .F.
|
|
|
|
gencursor('poSeturi', 'crsSeturi', lcSelect1, lcFiltru1, lcSchema1, lcOrder1, llAfiseaza, lcgroup, llModParam, lcFiltruOriginal)
|
|
poSeturi.ca_baza1.afisare()
|
|
|
|
lots = Createobject("frm_toate_seturile")
|
|
lots.Show(1)
|
|
|
|
*!* IF USED("cFCentre")
|
|
*!* USE IN cFCentre
|
|
*!* ENDIF
|
|
|
|
Endproc && viz_toate_seturile
|
|
***------------------------------------------------------------------------------------
|
|
Procedure modifica_parametri
|
|
Parameters tnTip, tcAlias, tlDinFormModi
|
|
&& tnTip: 1 - toate seturile; 2 - seturi uzuale
|
|
|
|
|
|
Private pnTip, pnId_set, pnLunaI, pnAnulI, pnLunaF, pnAnulF, pnCumul, pnIndAct, pnIndBal, pnDinFormModi && le trimit pe server
|
|
Store 0 To pnIndAct, pnIndBal
|
|
|
|
If !Empty(tnTip)
|
|
pnTip = tnTip
|
|
Else
|
|
pnTip = 0
|
|
Endif
|
|
|
|
Local lcalias, llDinFormModi
|
|
lcalias = Alltrim(tcAlias)
|
|
llDinFormModi = tlDinFormModi
|
|
If llDinFormModi
|
|
pnDinFormModi = 1
|
|
Else
|
|
pnDinFormModi = 0
|
|
Endif
|
|
|
|
Select (lcalias)
|
|
Scatter Name poset
|
|
pnId_set = id_set
|
|
|
|
***----
|
|
lcSql = [begin PACK_MG_EVOLUTIE.get_indicatori_nu_act(?pnId_set,?pnDinFormModi,?@pnIndAct,?@pnIndBal); end;]
|
|
lnSucces = goExecutor.oExecute(lcSql)
|
|
If lnSucces < 0
|
|
AMESSAGEBOX(goExecutor.cEroare, 0 + 16, "Eroare")
|
|
Return
|
|
Endif
|
|
***----
|
|
|
|
lopc = Createobject("frm_parametri_calcul", pnIndAct, pnIndBal)
|
|
If tnTip = 2
|
|
*!* lcSql = [select nume_set from mg_seturi where id_set = ]+Alltrim(Str(pnId_set))
|
|
*!* lcCursor = 'cNume_set'
|
|
*!* lnSucces = goExecutor.oExecute(lcSel, lcCursor)
|
|
*!* If lnSucces < 0
|
|
*!* AMESSAGEBOX(goExecutor.cEroare,0+16,"Eroare")
|
|
*!* Return
|
|
*!* Endif
|
|
*!* Select cNume_set
|
|
*!* lopc.lb_titlu_alb_b121.Caption = cNume_set.nume_set
|
|
*!* If Used('cNume_set')
|
|
*!* Use In cNume_set
|
|
*!* Endif
|
|
lopc.lb_titlu_alb_b121.Caption = 'set'
|
|
Else
|
|
lopc.lb_titlu_alb_b121.Caption = Alltrim(poset.nume_set)
|
|
Endif
|
|
lopc.Show(1)
|
|
|
|
If buton = 2
|
|
Return
|
|
Endif
|
|
|
|
Select (lcalias)
|
|
Gather Name poset
|
|
|
|
*pnId_set = poset.id_set
|
|
pnLunaI = poset.lunaI
|
|
pnAnulI = poset.anulI
|
|
pnLunaF = poset.lunaF
|
|
pnAnulF = poset.anulF
|
|
pnCumul = poset.cumul
|
|
|
|
lcSql = [begin PACK_MG_EVOLUTIE.set_parametri(?pnTip, ?pnId_set, ?pnLunaI, ?pnAnulI, ?pnLunaF, ?pnAnulF, ?pnCumul, ?gnIdutil); end;]
|
|
lnSucces = goExecutor.oExecute(lcSql)
|
|
|
|
If lnSucces < 0
|
|
AMESSAGEBOX(goExecutor.cEroare, 0 + 16, "Eroare")
|
|
Return
|
|
Endif
|
|
|
|
Endproc && modifica_parametri
|
|
***------------------------------------------------------------------------------------
|
|
Procedure adauga_indicator
|
|
Parameters tnId_set, tcAlias
|
|
|
|
Local lcalias, lnInd, llSucces
|
|
Private pnId_set, pnId_ind
|
|
|
|
If !Empty(tnId_set)
|
|
pnId_set = tnId_set
|
|
Else
|
|
pnId_set = 0
|
|
Endif
|
|
pnId_ind = 0
|
|
|
|
lcalias = Alltrim(tcAlias)
|
|
lnInd = 0
|
|
llSucces = .F.
|
|
|
|
Select (lcalias)
|
|
Scatter Name poIndicator Blank Memo
|
|
|
|
poIndicator.tip = 1
|
|
|
|
Calculate Max(Val(Rand)) To lnRandMax
|
|
lnRandMax = lnRandMax + 1
|
|
lcRandUrm = Padl(Alltrim(Str(lnRandMax, 4, 0)), 4, '0')
|
|
|
|
poIndicator.Rand = lcRandUrm
|
|
poIndicator.nume_ind = "INDICATOR_" + lcRandUrm
|
|
|
|
Calculate Cnt() For !Deleted() To lnInd
|
|
poIndicator.ord_rand = m.lnInd + 1
|
|
|
|
loib = Createobject("frm_tip_nume_rand_indicator")
|
|
loib.Show(1)
|
|
|
|
If buton = 2
|
|
RETURN m.llSucces
|
|
Endif
|
|
|
|
poIndicator.id_set = pnId_set
|
|
|
|
lcSql = [begin PACK_MG_EVOLUTIE.next_id_ind(?@pnId_ind); end;]
|
|
llSucces = goExecutor.oExecuta(lcSql)
|
|
|
|
If m.llSucces
|
|
poIndicator.id_ind = pnId_ind
|
|
lcSql = [begin PACK_MG_EVOLUTIE.adauga_indicator(?pnId_set, ?pnId_ind, ?ALLTRIM(poIndicator.Rand), ?ALLTRIM(poIndicator.nume_ind), ?poIndicator.tip, ?poindicator.ord_rand); end;]
|
|
llSucces = goExecutor.oExecuta(lcSql)
|
|
IF m.llSucces
|
|
Select (lcalias)
|
|
Append Blank
|
|
Gather Name poIndicator Memo
|
|
ENDIF
|
|
ENDIF
|
|
|
|
RETURN m.llSucces
|
|
Endproc && adauga_indicator
|
|
***------------------------------------------------------------------------------------
|
|
***------------------------------------------------------------------------------------
|
|
Procedure modifica_indicator
|
|
Parameters tnId_set, tnId_ind, tcAlias
|
|
|
|
Private pnId_set, pnId_ind
|
|
LOCAL lnTip, lcAlias, llSucces
|
|
pnId_set = tnId_set
|
|
pnId_ind = tnId_ind
|
|
|
|
lcalias = Alltrim(tcAlias)
|
|
llSucces = .F.
|
|
|
|
Select (lcalias)
|
|
Scatter Name poIndicator Memo
|
|
lnTip = poIndicator.tip
|
|
|
|
loib = Createobject("frm_tip_nume_rand_indicator")
|
|
loib.Show(1)
|
|
|
|
If buton = 2
|
|
RETURN m.llSucces
|
|
ENDIF
|
|
lcSql = [begin PACK_MG_EVOLUTIE.modifica_indicator(?pnId_set, ?pnId_ind, ?Alltrim(poIndicator.Rand), ?Alltrim(poIndicator.nume_ind), ?poIndicator.tip, ?poindicator.ord_rand); end;]
|
|
llSucces = goExecutor.oExecuta(lcSql)
|
|
|
|
If m.llSucces
|
|
IF poIndicator.tip <> m.lnTip
|
|
poIndicator.formula = ""
|
|
ENDIF
|
|
|
|
Select (lcalias)
|
|
Gather Name poIndicator Memo
|
|
Endif
|
|
|
|
RETURN m.llSucces
|
|
Endproc && modifica_indicator
|
|
***------------------------------------------------------------------------------------
|
|
Procedure test
|
|
|
|
loft = Createobject("frm_test")
|
|
loft.Show(1)
|
|
|
|
Endproc && test
|
|
*------------------------------------------------------------------------------------
|
|
Procedure test_List
|
|
|
|
pcLista = "+T201 +T203 +T204+T205+T206+T207-T208+T209"
|
|
|
|
lcLista = gcTempPath + "tLista.dbf"
|
|
Create Table (lcLista) (valoare C(11))
|
|
|
|
lnAparitiiP = 1
|
|
lnAparitiiM = 1
|
|
|
|
For i = 1 To Len(pcLista)
|
|
lcSemn = Substr(pcLista, i, 1)
|
|
If lcSemn = "+" Or lcSemn = "-"
|
|
If lcSemn = "+"
|
|
lnAparitiiP = lnAparitiiP + 1
|
|
Endif
|
|
If lcSemn = "-"
|
|
lnAparitiiM = lnAparitiiM + 1
|
|
Endif
|
|
lnNextSemnP = At("+", pcLista, lnAparitiiP)
|
|
lnNextSemnM = At("-", pcLista, lnAparitiiM)
|
|
|
|
If lnNextSemnP < lnNextSemnM And lnNextSemnP > 0
|
|
lnNextSemn = lnNextSemnP
|
|
Else
|
|
If lnNextSemnM > 0
|
|
lnNextSemn = lnNextSemnM
|
|
Else
|
|
lnNextSemn = lnNextSemnP
|
|
Endif
|
|
Endif
|
|
* ?'lnNextSemn = '+ALLTRIM(STR(lnNextSemn))
|
|
lnLen = lnNextSemn - i
|
|
If lnNextSemn = 0 And i < Len(pcLista) && ultimul cont
|
|
lcCont = Substr(pcLista, i)
|
|
Else
|
|
lcCont = Substr(pcLista, i, lnLen)
|
|
Endif
|
|
Select (lcLista)
|
|
Insert Into (lcLista) (valoare) Values (lcCont)
|
|
* ?lcCont
|
|
Endif
|
|
Endfor
|
|
|
|
|
|
Select (lcLista)
|
|
loft = Createobject("frm_test_List")
|
|
loft.Show(1)
|
|
|
|
Endproc && test_List
|
|
*------------------------------------------------------------------------------------
|
|
Procedure editare_set
|
|
Lparameters tnId_set, tnId_ModiPara, tnId_ind
|
|
|
|
Private pnId_set, pnCount, pcNume_set
|
|
pnId_set = Iif(!Empty(m.tnId_set), m.tnId_set, 0)
|
|
pnCount = 0 && cati indicatori are setul
|
|
pcNume_set = ''
|
|
llNou = Empty(m.tnId_set)
|
|
|
|
* Nume Set
|
|
If m.llNou
|
|
pcNume_set = "Set nou_" + Ttoc(Datetime())
|
|
lcSql = [begin PACK_MG_EVOLUTIE.next_id_set(?@pnId_set); end;]
|
|
lnSucces = goExecutor.oExecute(lcSql)
|
|
|
|
If lnSucces < 0
|
|
AMESSAGEBOX(goExecutor.cEroare, 0 + 16, "Eroare")
|
|
Return
|
|
Endif
|
|
Else
|
|
lcSql = [begin PACK_MG_EVOLUTIE.GET_NUME_SET(?ALLTRIM(STR(pnId_set)),?@pcNume_set);end;]
|
|
lnSucces = goExecutor.oExecute(lcSql)
|
|
If lnSucces < 0
|
|
AMESSAGEBOX(goExecutor.cEroare, 0 + 16, "Eroare")
|
|
Return
|
|
Endif
|
|
Endif
|
|
|
|
* Copii indicatori din mg_indicatori in temporarul mg_tmp_indicatori
|
|
* La editare lucrez cu mg_tmp_indicatori ca sa pot salva/renunta
|
|
lcSql = [begin PACK_MG_EVOLUTIE.GET_SET(?pnId_set,?@pnCount); end;]
|
|
lnSucces = goExecutor.oExecute(lcSql)
|
|
|
|
If lnSucces < 0
|
|
AMESSAGEBOX(goExecutor.cEroare, 0 + 16, "Eroare")
|
|
Return
|
|
Endif
|
|
|
|
* Selectez din mg_tmp_indicatori
|
|
Private poset, pcschema1, pcselect1
|
|
Store '' To poset
|
|
pcschema1 = ['']
|
|
pcselect1 = ['select id_ind, id_set, rand, ord_rand, nume_ind, formula, ales, tip, comentariu from mg_tmp_indicatori where 1=2']
|
|
pcorder1 = [ord_rand, rand]
|
|
pcfiltru1 = [sters=0 and id_set = ] + Alltrim(Str(pnId_set))
|
|
llAfiseaza = .F.
|
|
tcAlias = 'm_indicatori'
|
|
gencursor('poSet', 'm_indicatori', pcselect1, pcfiltru1, pcschema1, pcorder1, llAfiseaza)
|
|
poset.ca_baza1.afisare()
|
|
|
|
* Selectez din planul de conturi
|
|
Private poPlcont, pcschema1, pcselect1
|
|
Store '' To poPlcont
|
|
pcschema1 = ['']
|
|
pcschema1 = [cont C(4), acont C(4), explicatie C(100), an N(4) ]
|
|
pcselect1 = ['select distinct cont, acont, explicatie, an FROM plcont where 1=2']
|
|
pcorder1 = [cont, acont]
|
|
pcfiltru1 = []
|
|
pcfiltru1 = [AN = ] + Alltrim(Str(GNAN))
|
|
llAfiseaza = .F.
|
|
gencursor('poPlcont', 'crsPlcont', pcselect1, pcfiltru1, pcschema1, pcorder1, llAfiseaza)
|
|
poPlcont.ca_baza1.afisare()
|
|
|
|
* cursor temporar pentru indicatorii de tip jurnal
|
|
* lcTabelRJ = gcTempPath + "tLista_rj.dbf"
|
|
Create Cursor tLista_rj (camp_numeT C(30), camp_nume C(30), formula C(200), traducere C(200))
|
|
|
|
* DO make_cFCentre IN oproceduri_manager.prg && apelata in princ.set_uzual_requery
|
|
Select m_indicatori
|
|
If !Empty(tnId_ind)
|
|
Locate For id_ind = tnId_ind
|
|
If !Found()
|
|
Go Top
|
|
Endif
|
|
Else
|
|
Go Top
|
|
Endif
|
|
|
|
poms = Createobject("frm_set", pnId_set, pcNume_set, m.llNou, tnId_ModiPara)
|
|
poms.Show(1)
|
|
|
|
Use In (Select('tLista_rj'))
|
|
Use In (Select('m_indicatori'))
|
|
|
|
Release poset
|
|
|
|
Endproc && editare_set
|
|
*------------------------------------------------------------------------------------
|
|
Procedure desparte_formula_bal
|
|
Parameters tcFormula
|
|
|
|
Local lcFormula
|
|
lcFormula = Alltrim(tcFormula)
|
|
|
|
Store '' To pcPD1, pcPC1, pcPD, pcPC, pcRD, pcRC, pcTD, pcTC, pcSD, pcSC
|
|
Dimension laSir(100)
|
|
lnElem = lista2array(lcFormula, @laSir, ";")
|
|
For i = 1 To lnElem
|
|
lnPD1 = At("<PD1>", laSir(i))
|
|
lnPC1 = At("<PC1>", laSir(i))
|
|
lnPD = At("<PD>", laSir(i))
|
|
lnPC = At("<PC>", laSir(i))
|
|
lnRD = At("<RD>", laSir(i))
|
|
lnRC = At("<RC>", laSir(i))
|
|
lnTD = At("<TD>", laSir(i))
|
|
lnTC = At("<TC>", laSir(i))
|
|
lnSD = At("<SD>", laSir(i))
|
|
lnSC = At("<SC>", laSir(i))
|
|
Do Case
|
|
Case lnPD1 > 0
|
|
pcPD1 = Substr(laSir(i), 6)
|
|
Case lnPC1 > 0
|
|
pcPC1 = Substr(laSir(i), 6) && <PC1>-C1511
|
|
Case lnPD > 0
|
|
pcPD = Substr(laSir(i), 5)
|
|
Case lnPC > 0
|
|
pcPC = Substr(laSir(i), 5)
|
|
Case lnRD > 0
|
|
pcRD = Substr(laSir(i), 5)
|
|
Case lnRC > 0
|
|
pcRC = Substr(laSir(i), 5)
|
|
Case lnTD > 0
|
|
pcTD = Substr(laSir(i), 5)
|
|
Case lnTC > 0
|
|
pcTC = Substr(laSir(i), 5)
|
|
Case lnSD > 0
|
|
pcSD = Substr(laSir(i), 5)
|
|
Case lnSC > 0
|
|
pcSC = Substr(laSir(i), 5)
|
|
Endcase
|
|
Endfor
|
|
|
|
Endproc && desparte_formula_bal
|
|
*------------------------------------------------------------------------------------
|
|
Procedure completeaza_lista_bal
|
|
Parameters tcLista, tcTabel
|
|
|
|
Local lcLista, lcTabel, lnAparitiiP, lnAparitiiM
|
|
lcLista = Alltrim(tcLista)
|
|
lcTabel = Alltrim(tcTabel)
|
|
Store 1 To lnAparitiiP, lnAparitiiM
|
|
|
|
For i = 1 To Len(lcLista)
|
|
lcSemn = Substr(lcLista, i, 1)
|
|
If lcSemn = "+" Or lcSemn = "-"
|
|
If lcSemn = "+"
|
|
lnAparitiiP = lnAparitiiP + 1
|
|
Endif
|
|
If lcSemn = "-"
|
|
lnAparitiiM = lnAparitiiM + 1
|
|
Endif
|
|
lnNextSemnP = At("+", lcLista, lnAparitiiP)
|
|
lnNextSemnM = At("-", lcLista, lnAparitiiM)
|
|
|
|
If lnNextSemnP < lnNextSemnM And lnNextSemnP > 0
|
|
lnNextSemn = lnNextSemnP
|
|
Else
|
|
If lnNextSemnM > 0
|
|
lnNextSemn = lnNextSemnM
|
|
Else
|
|
lnNextSemn = lnNextSemnP
|
|
Endif
|
|
Endif
|
|
lnLen = lnNextSemn - i
|
|
If lnNextSemn = 0 And i < Len(lcLista) && ultimul cont
|
|
lcCont = Substr(lcLista, i)
|
|
Else
|
|
lcCont = Substr(lcLista, i, lnLen)
|
|
Endif
|
|
Select (lcTabel)
|
|
Insert Into (lcTabel) (valoare) Values (lcCont)
|
|
Endif
|
|
Endfor
|
|
|
|
Select (lcTabel)
|
|
Insert Into (lcTabel) (valoare) Values ("")
|
|
|
|
Endproc && completeaza_lista_bal
|
|
*------------------------------------------------------------------------------------
|
|
*------------------------------------------------------------------------------------
|
|
Procedure completeaza_lista_randuri
|
|
Parameters tcLista, tcTabel
|
|
|
|
Local lcLista, lcTabel
|
|
lcLista = Alltrim(tcLista)
|
|
lcTabel = Alltrim(tcTabel)
|
|
|
|
Do While Len(lcLista) > 0 && +[R01]+[R02]
|
|
lnRand = At("[R", lcLista) && 2
|
|
If lnRand > 0
|
|
|
|
For i = 1 To lnRand - 2
|
|
lcVal = Substr(lcLista, i, 1)
|
|
Select (lcTabel)
|
|
Insert Into (lcTabel) (valoare) Values (lcVal)
|
|
Endfor
|
|
|
|
lnPI = At("]", lcLista) && paranteza inchisa = "]"
|
|
lcVal = Substr(lcLista, lnRand - 1, lnPI - (lnRand - 2)) && rand
|
|
Select (lcTabel)
|
|
Insert Into (lcTabel) (valoare) Values (lcVal)
|
|
lcLista = Substr(lcLista, lnPI + 1)
|
|
Else
|
|
For i = 1 To Len(lcLista)
|
|
lcVal = Substr(lcLista, i, 1)
|
|
Insert Into (lcTabel) (valoare) Values (lcVal)
|
|
Endfor
|
|
lcLista = ""
|
|
Endif
|
|
|
|
Enddo
|
|
|
|
Select (lcTabel)
|
|
Insert Into (lcTabel) (valoare) Values ("")
|
|
|
|
Endproc && completeaza_lista_randuri
|
|
*------------------------------------------------------------------------------------
|
|
Procedure desparte_formula_rj
|
|
Parameters tcFormula, tcTabel
|
|
|
|
Local lcFormula, lcTabel
|
|
lcFormula = Alltrim(tcFormula)
|
|
lcTabel = Alltrim(tcTabel)
|
|
|
|
Select (lcTabel)
|
|
Delete All
|
|
|
|
If !Empty(lcFormula)
|
|
Dimension laSir(100), laSirCamp(100)
|
|
lnElem = lista2array(lcFormula, @laSir, ";") && pe cate campuri am definit formula
|
|
For i = 1 To lnElem &&
|
|
lnCampuri = lista2array(laSir[i], @laSirCamp, "|") && intotdeauna am 4 chestii:
|
|
* <traducere camp> <camp> <traducere_formula> <formula>
|
|
Select (lcTabel)
|
|
Append Blank
|
|
Replace camp_numeT With Substr(laSirCamp[1], 2, Len(laSirCamp[1]) - 2), ;
|
|
camp_nume With Substr(laSirCamp[2], 2, Len(laSirCamp[2]) - 2), ;
|
|
traducere With Substr(laSirCamp[3], 2, Len(laSirCamp[3]) - 2), ;
|
|
formula With Substr(laSirCamp[4], 2, Len(laSirCamp[4]) - 2)
|
|
Endfor
|
|
|
|
Select (lcTabel)
|
|
Go Top
|
|
Endif
|
|
|
|
Endproc && desparte_formula_rj
|
|
*------------------------------------------------------------------------------------
|
|
***------------------------------------------------------------------------------------
|
|
Procedure sterge_set_uzual
|
|
Parameters tnId_set
|
|
|
|
Private pnId_set
|
|
|
|
If !Empty(tnId_set)
|
|
pnId_set = tnId_set
|
|
Else
|
|
Return
|
|
Endif
|
|
|
|
**
|
|
lcSql = [begin pack_mg_evolutie.sterge_set_uzual(?pnId_set,?gnIdUtil); end;]
|
|
lnSucces = goExecutor.oExecute(lcSql)
|
|
|
|
If lnSucces < 0
|
|
AMESSAGEBOX(goExecutor.cEroare, 0 + 16, "Eroare")
|
|
Return
|
|
Endif
|
|
|
|
Endproc && sterge_set_uzual
|
|
***------------------------------------------------------------------------------------
|
|
Procedure calculeaza_set
|
|
Parameters tcFile, tcNumeSet
|
|
|
|
Local lcNumeSet, lcFisExport
|
|
|
|
|
|
lcalias = Juststem(tcFile)
|
|
|
|
Select Distinct id_set, ;
|
|
gnLuna As lunaI, GNAN As anulI, ;
|
|
gnLuna As lunaF, GNAN As anulF, ;
|
|
00 As cumul, 0 As faraGrafic ;
|
|
From (lcalias) ;
|
|
Into Cursor cParametri
|
|
|
|
Select cParametri
|
|
Scatter Name poset
|
|
|
|
poset.cumul = 1 && luni
|
|
|
|
loexport = Createobject("frm_parametri_calcul")
|
|
loexport.Show(1)
|
|
|
|
If buton = 2
|
|
Return
|
|
Endif
|
|
|
|
Endproc && calculeaza_set
|
|
***------------------------------------------------------------------------------------
|
|
***---------------------------------------------------------------------------------------------
|
|
Procedure listare_set
|
|
Parameters tnId_set
|
|
|
|
Private pcTitlu, pnId_set, pcNume_set && ,pcDataOra
|
|
Store '' To pcTitlu, pcNume_set
|
|
pnId_set = tnId_set
|
|
&& pcDataOra = Get_Ora(2)
|
|
|
|
Local aFormula, aImpart, lcSql, lnSucces, lcFormula
|
|
Declare aFormula[1], aImpart[1]
|
|
|
|
lcSql = [begin PACK_MG_EVOLUTIE.GET_NUME_SET(?ALLTRIM(STR(pnId_set)),?@pcNume_set);end;]
|
|
lnSucces = goExecutor.oExecute(lcSql)
|
|
If lnSucces < 0
|
|
AMESSAGEBOX(goExecutor.cEroare, 0 + 16, "Eroare")
|
|
Return
|
|
Endif
|
|
|
|
pcTitlu = Alltrim(pcNume_set)
|
|
|
|
Private poset
|
|
Store '' To poset
|
|
lcSchema1 = [rand C(4), nume_ind C(200), tip N(1), formula M(4), comentariu M(4)]
|
|
lcSelect1 = ['select rand, nume_ind, tip, formula, comentariu from mg_indicatori where 1=2']
|
|
lcOrder1 = [ord_rand, rand]
|
|
lcFiltru1 = [id_set=] + Alltrim(Str(pnId_set))
|
|
llAfiseaza = .F.
|
|
gencursor('poSet', 'cSet', lcSelect1, lcFiltru1, lcSchema1, lcOrder1, llAfiseaza)
|
|
poset.ca_baza1.afisare()
|
|
|
|
|
|
Select * From cSet Into Cursor cListSet Readwrite
|
|
|
|
Select cListSet
|
|
If _Tally = 0
|
|
AMESSAGEBOX("Setul nu contine indicatori", 0 + 48, "Atentie")
|
|
Return
|
|
Endif
|
|
|
|
Select cListSet
|
|
Replace All formula With Strtran(formula, ";<", ";" + Chr(13) + "<") For tip = 1
|
|
Replace All formula With Strtran(formula, "PD", "Precedent Debit") For tip = 1
|
|
Replace All formula With Strtran(formula, "PC", "Precedent Credit") For tip = 1
|
|
Replace All formula With Strtran(formula, "RD", "Rulaj Debit") For tip = 1
|
|
Replace All formula With Strtran(formula, "RC", "Rulaj Credit") For tip = 1
|
|
Replace All formula With Strtran(formula, "TD", "Total Debit") For tip = 1
|
|
Replace All formula With Strtran(formula, "TC", "Total Credit") For tip = 1
|
|
Replace All formula With Strtran(formula, "SD", "Sold Debit") For tip = 1
|
|
Replace All formula With Strtran(formula, "SC", "Sold Credit") For tip = 1
|
|
Replace All formula With Strtran(formula, ">", "> ") For tip = 1
|
|
|
|
Select cListSet
|
|
Scan For tip = 2 && registru jurnal
|
|
lcFormula = ''
|
|
lnCampuri = lista2array(formula, @aFormula, ";")
|
|
For i = 1 To lnCampuri
|
|
ln = lista2array(aFormula[i], @aImpart, "|")
|
|
lcFormula = lcFormula + aImpart[1] + ": " + Substr(aImpart[3], 2, Len(aImpart[3]) - 2) + Chr(13)
|
|
Replace formula With lcFormula
|
|
Endfor
|
|
Endscan
|
|
|
|
|
|
*!* Select cListSet
|
|
*!* Report Form rList_set To Printer Prompt Preview
|
|
goExport.export2frx([cListSet], [rList_set])
|
|
If Used("cListSet")
|
|
Use In cListSet
|
|
Endif
|
|
|
|
Release poset
|
|
Endproc && listare_set
|
|
***---------------------------------------------------------------------------------------------
|
|
Procedure pre_listare_formule_set
|
|
Parameters tnId_set
|
|
|
|
Local aFormula, aImpart, lcSql, lnSucces, lcFormula
|
|
Declare aFormula[1], aImpart[1]
|
|
|
|
Private poset
|
|
Store '' To poset
|
|
|
|
Local lcSchema1, lcSelect1, lcOrder1, lcFiltru1, llAfiseaza
|
|
lcSchema1 = [rand C(4), nume_ind C(200), tip N(1), formula M(4), comentariu M(4), ales N(1)]
|
|
lcSelect1 = [select rand, nume_ind, tip, formula, comentariu, ales from mg_indicatori]
|
|
lcOrder1 = []
|
|
lcgroup = []
|
|
lcFiltru1 = []
|
|
lcFiltruOriginal = [id_set=] + Alltrim(Str(tnId_set))
|
|
llModParam = .T.
|
|
llAfiseaza = .F.
|
|
|
|
gencursor('poset', 'cSet', lcSelect1, lcFiltru1, lcSchema1, lcOrder1, llAfiseaza, lcgroup, llModParam, lcFiltruOriginal)
|
|
poset.ca_baza1.afisare()
|
|
|
|
Release poset
|
|
|
|
Select * From cSet Into Cursor cListSet Readwrite
|
|
If Used("cSet")
|
|
Use In cSet
|
|
Endif
|
|
|
|
Select cListSet
|
|
If _Tally = 0
|
|
AMESSAGEBOX("Setul nu contine indicatori", 0 + 48, "Atentie")
|
|
Return
|
|
Endif
|
|
|
|
Select cListSet
|
|
Replace All formula With Strtran(formula, ";<", ";" + Chr(13) + "<") For tip = 1
|
|
Replace All formula With Strtran(formula, "PD", "Precedent Debit") For tip = 1
|
|
Replace All formula With Strtran(formula, "PC", "Precedent Credit") For tip = 1
|
|
Replace All formula With Strtran(formula, "RD", "Rulaj Debit") For tip = 1
|
|
Replace All formula With Strtran(formula, "RC", "Rulaj Credit") For tip = 1
|
|
Replace All formula With Strtran(formula, "TD", "Total Debit") For tip = 1
|
|
Replace All formula With Strtran(formula, "TC", "Total Credit") For tip = 1
|
|
Replace All formula With Strtran(formula, "SD", "Sold Debit") For tip = 1
|
|
Replace All formula With Strtran(formula, "SC", "Sold Credit") For tip = 1
|
|
Replace All formula With Strtran(formula, ">", "> ") For tip = 1
|
|
|
|
Select cListSet
|
|
Scan For tip = 2 && registru jurnal
|
|
lcFormula = ''
|
|
lnCampuri = lista2array(formula, @aFormula, ";")
|
|
For i = 1 To lnCampuri
|
|
ln = lista2array(aFormula[i], @aImpart, "|")
|
|
lcFormula = lcFormula + aImpart[1] + ": " + Substr(aImpart[3], 2, Len(aImpart[3]) - 2) + Chr(13)
|
|
Replace formula With lcFormula
|
|
Endfor
|
|
Endscan
|
|
|
|
Release poset
|
|
|
|
Return "cListSet"
|
|
|
|
Endproc && pre_listare_formule_set
|
|
***---------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|