Import initial din SVN ROAAUTO/Trunk @HEAD
This commit is contained in:
BIN
Formulare/AUTOHAUS/20070911/sigla.jpg
Normal file
BIN
Formulare/AUTOHAUS/20070911/sigla.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.9 KiB |
BIN
Formulare/AUTOHAUS/20070911/usr_fact_cuchit.FRT
Normal file
BIN
Formulare/AUTOHAUS/20070911/usr_fact_cuchit.FRT
Normal file
Binary file not shown.
BIN
Formulare/AUTOHAUS/20070911/usr_fact_cuchit.frx
Normal file
BIN
Formulare/AUTOHAUS/20070911/usr_fact_cuchit.frx
Normal file
Binary file not shown.
BIN
Formulare/AUTOHAUS/20070911/usr_fact_farachit.FRT
Normal file
BIN
Formulare/AUTOHAUS/20070911/usr_fact_farachit.FRT
Normal file
Binary file not shown.
BIN
Formulare/AUTOHAUS/20070911/usr_fact_farachit.frx
Normal file
BIN
Formulare/AUTOHAUS/20070911/usr_fact_farachit.frx
Normal file
Binary file not shown.
BIN
Formulare/AUTOHAUS/20070911/usr_factav_cuchit.FRT
Normal file
BIN
Formulare/AUTOHAUS/20070911/usr_factav_cuchit.FRT
Normal file
Binary file not shown.
BIN
Formulare/AUTOHAUS/20070911/usr_factav_cuchit.frx
Normal file
BIN
Formulare/AUTOHAUS/20070911/usr_factav_cuchit.frx
Normal file
Binary file not shown.
BIN
Formulare/AUTOHAUS/20070911/usr_factav_farachit.FRT
Normal file
BIN
Formulare/AUTOHAUS/20070911/usr_factav_farachit.FRT
Normal file
Binary file not shown.
BIN
Formulare/AUTOHAUS/20070911/usr_factav_farachit.frx
Normal file
BIN
Formulare/AUTOHAUS/20070911/usr_factav_farachit.frx
Normal file
Binary file not shown.
BIN
Formulare/AUTOHAUS/20070911/usr_rap_deviz.FRT
Normal file
BIN
Formulare/AUTOHAUS/20070911/usr_rap_deviz.FRT
Normal file
Binary file not shown.
BIN
Formulare/AUTOHAUS/20070911/usr_rap_deviz.frx
Normal file
BIN
Formulare/AUTOHAUS/20070911/usr_rap_deviz.frx
Normal file
Binary file not shown.
BIN
Formulare/AUTOHAUS/A4usr_fact_farachit.FRT
Normal file
BIN
Formulare/AUTOHAUS/A4usr_fact_farachit.FRT
Normal file
Binary file not shown.
BIN
Formulare/AUTOHAUS/A4usr_fact_farachit.frx
Normal file
BIN
Formulare/AUTOHAUS/A4usr_fact_farachit.frx
Normal file
Binary file not shown.
BIN
Formulare/AUTOHAUS/A4usr_factav_farachit.FRT
Normal file
BIN
Formulare/AUTOHAUS/A4usr_factav_farachit.FRT
Normal file
Binary file not shown.
BIN
Formulare/AUTOHAUS/A4usr_factav_farachit.frx
Normal file
BIN
Formulare/AUTOHAUS/A4usr_factav_farachit.frx
Normal file
Binary file not shown.
BIN
Formulare/FRUVIMED/fruvimed 20070830.tif
Normal file
BIN
Formulare/FRUVIMED/fruvimed 20070830.tif
Normal file
Binary file not shown.
BIN
Formulare/GGMOTORS/usr__preco.FRT
Normal file
BIN
Formulare/GGMOTORS/usr__preco.FRT
Normal file
Binary file not shown.
BIN
Formulare/GGMOTORS/usr__preco.frx
Normal file
BIN
Formulare/GGMOTORS/usr__preco.frx
Normal file
Binary file not shown.
BIN
Formulare/SIGMA/usr_fact_cuchit_l.FRT
Normal file
BIN
Formulare/SIGMA/usr_fact_cuchit_l.FRT
Normal file
Binary file not shown.
BIN
Formulare/SIGMA/usr_fact_cuchit_l.frx
Normal file
BIN
Formulare/SIGMA/usr_fact_cuchit_l.frx
Normal file
Binary file not shown.
BIN
Formulare/SIGMA/usr_fact_farachit_l.FRT
Normal file
BIN
Formulare/SIGMA/usr_fact_farachit_l.FRT
Normal file
Binary file not shown.
BIN
Formulare/SIGMA/usr_fact_farachit_l.frx
Normal file
BIN
Formulare/SIGMA/usr_fact_farachit_l.frx
Normal file
Binary file not shown.
BIN
Formulare/test_listare_factura/ACTACTAN.DBF
Normal file
BIN
Formulare/test_listare_factura/ACTACTAN.DBF
Normal file
Binary file not shown.
BIN
Formulare/test_listare_factura/FOXUSER.DBF
Normal file
BIN
Formulare/test_listare_factura/FOXUSER.DBF
Normal file
Binary file not shown.
BIN
Formulare/test_listare_factura/FOXUSER.FPT
Normal file
BIN
Formulare/test_listare_factura/FOXUSER.FPT
Normal file
Binary file not shown.
2374
Formulare/test_listare_factura/oproceduri_comune.prg
Normal file
2374
Formulare/test_listare_factura/oproceduri_comune.prg
Normal file
File diff suppressed because it is too large
Load Diff
179
Formulare/test_listare_factura/proceduri_rapoarte.prg
Normal file
179
Formulare/test_listare_factura/proceduri_rapoarte.prg
Normal file
@@ -0,0 +1,179 @@
|
||||
*!* PROCEDURI_RAPOARTE.PRG
|
||||
|
||||
|
||||
*!* LISTARE RAPORT UTILIZATOR
|
||||
*!* PARAMETRI : tcAlias - alias-ul cursorului; tcTipExport - FRX/XLS; tcRaport - numele raportului
|
||||
*!* Se listeaza raportul USR_<tcRaport> din directorul \\SERVER\ROA\USERREPORTS\<APPLICATIE>\<FIRMA>\ daca exista
|
||||
*!* Daca nu exista raporturl USR_<tcRaport> se listeaza raportul <tcRaport> default
|
||||
PROCEDURE LISTAREUSERREPORT
|
||||
LPARAMETERS tcAlias, tcTipExport, tcRaport, toListener, tnPreview, tcImprimanta
|
||||
** Valori pentru tnPreview
|
||||
** 1 - cu vizualizare
|
||||
** 2 - listare directa
|
||||
|
||||
LOCAL lcSelect, lcRaportPath, lcTipExport, lnPreview, lcImprimanta
|
||||
STORE [] TO lcImprimanta
|
||||
|
||||
IF TYPE('tcTipExport') = 'C'
|
||||
lcTipExport = UPPER(ALLTRIM(tcTipExport))
|
||||
ELSE
|
||||
IF EMPTY(tcRaport)
|
||||
lcTipExport = 'XLS'
|
||||
ELSE
|
||||
lcTipExport = 'FRX'
|
||||
ENDIF
|
||||
ENDIF
|
||||
IF EMPTY(tcAlias)
|
||||
RETURN
|
||||
ENDIF
|
||||
IF !USED(tcAlias)
|
||||
RETURN
|
||||
ENDIF
|
||||
IF EMPTY(tnPreview)
|
||||
lnPreview = 1
|
||||
ELSE
|
||||
lnPreview = tnPreview
|
||||
ENDIF
|
||||
|
||||
DO CASE
|
||||
CASE lcTipExport = 'FRX'
|
||||
IF !EMPTY(tcImprimanta)
|
||||
*!* verificare ca tcImprimanta este instalata pe calculatorul respectiv
|
||||
IF APRINTERS(laPrinters) > 0 AND ASCAN(laPrinters,tcImprimanta,1,ALEN(laPrinters,1),1,15) > 0
|
||||
lcImprimanta = tcImprimanta
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
RELEASE laPrinters
|
||||
|
||||
lcRaportPath = getUserRepPath() + [USR_] + JUSTSTEM(tcRaport) + [.FRX]
|
||||
|
||||
IF !FILE(lcRaportPath)
|
||||
lcRaportPath = tcRaport
|
||||
ENDIF
|
||||
|
||||
lcSelect = SELECT()
|
||||
IF !EMPTY(tcAlias) AND USED(tcAlias)
|
||||
SELECT (tcAlias)
|
||||
ENDIF
|
||||
|
||||
lnRaspuns = 6
|
||||
DO WHILE lnRaspuns = 6
|
||||
TRY
|
||||
IF !EMPTY(toListener)
|
||||
REPORT FORM (lcRaportPath) OBJECT toListener
|
||||
ELSE
|
||||
IF lnPreview = 1
|
||||
KEYBOARD '{CTRL+F10}'
|
||||
REPORT FORM (lcRaportPath) TO PRINTER PROMPT PREVIEW
|
||||
ELSE
|
||||
IF !EMPTY(lcImprimanta)
|
||||
lcImprimantaTemp = SYS(6)
|
||||
SET PRINTER TO NAME (lcImprimanta)
|
||||
REPORT FORM (lcRaportPath) TO PRINTER
|
||||
IF !EMPTY(NVL(lcImprimantaTemp,[]))
|
||||
SET PRINTER TO (lcImprimantaTemp)
|
||||
ELSE
|
||||
SET PRINTER TO
|
||||
ENDIF
|
||||
ELSE
|
||||
REPORT FORM (lcRaportPath) TO PRINTER PROMPT
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
lnRaspuns = 7
|
||||
CATCH TO oEroare
|
||||
IF oEroare.MESSAGE='Error loading driver error.'
|
||||
lnRaspuns = aMESSAGEBOX("Eroare la driverul imprimantei.Doriti sa reincercati listarea?",4+32+256,"Confirmare relistare")
|
||||
ELSE
|
||||
aMESSAGEBOX(oEroare.MESSAGE,16,"Eroare")
|
||||
lnRaspuns = 7
|
||||
ENDIF
|
||||
ENDTRY
|
||||
ENDDO
|
||||
|
||||
SELECT (lcSelect)
|
||||
|
||||
CASE lcTipExport = 'XLS'
|
||||
export_xls(tcAlias)
|
||||
ENDCASE
|
||||
|
||||
|
||||
ENDPROC && LISTAREUSERREPORT
|
||||
|
||||
********************* INCEPUT Modifica_raport_utilizator **********************
|
||||
* PROCEDURE Modifica_raport_utilizator
|
||||
* Date : 26.07.2006, 17:44:33
|
||||
* author : marius.mutu
|
||||
PROCEDURE Modifica_raport_utilizator
|
||||
|
||||
lcUserRepPath = getUserRepPath()
|
||||
CD (lcUserRepPath)
|
||||
lcFile = GETFILE("frx","Alegeti un raport","Alege")
|
||||
IF FILE(lcFile) AND UPPER(JUSTEXT(lcFile)) = "FRX"
|
||||
MODIFY REPORT (lcFile)
|
||||
ENDIF
|
||||
|
||||
ENDPROC && Modifica_raport_utilizator
|
||||
********************* SFARSIT Modifica_raport_utilizator **********************
|
||||
|
||||
*!* INTOARCE DIRECTORUL CU RAPOARTE UTILIZATOR PENTRU APLICATIA, SCHEMA CURENTA
|
||||
FUNCTION getUserRepPath
|
||||
LOCAL lcAppPath, lcAppName, liAt, lcDirgen, lcUserRepPath
|
||||
lcAppPath=ADDBS(JUSTPATH(SYS(16,0)))
|
||||
lcAppName=ALLT(UPPE(JUSTSTEM(SYS(16,0))))
|
||||
liAt=RAT("\",lcAppPath,2)
|
||||
lcDirgen=ADDBS(LEFT(lcAppPath,liAt-1))
|
||||
lcUserRepPath = lcDirgen + 'USERREPORTS\'
|
||||
IF !DIRECTORY(lcUserRepPath)
|
||||
MD (lcUserRepPath)
|
||||
ENDIF
|
||||
lcUserRepPath = lcUserRepPath + lcAppName + '\'
|
||||
IF !DIRECTORY(lcUserRepPath)
|
||||
MD (lcUserRepPath)
|
||||
ENDIF
|
||||
lcUserRepPath = lcUserRepPath + gcS + '\'
|
||||
IF !DIRECTORY(lcUserRepPath)
|
||||
MD (lcUserRepPath)
|
||||
ENDIF
|
||||
|
||||
RETURN lcUserRepPath
|
||||
|
||||
ENDFUNC
|
||||
|
||||
****************************************************************************
|
||||
*!* extrage frx din executabil pe disc in directorul USERREPORTS
|
||||
PROCEDURE UserReport2File
|
||||
LPARAMETERS tcRaport
|
||||
|
||||
LOCAL lcRaport, lcFile
|
||||
IF EMPTY(tcRaport)
|
||||
lcRaport= INPUTBOX("Raport","Scrieti numele raportului","raport.frx")
|
||||
ELSE
|
||||
lcRaport = tcRaport
|
||||
ENDIF
|
||||
|
||||
IF EMPTY(lcRaport)
|
||||
RETURN
|
||||
ENDIF
|
||||
|
||||
lcRaport = JUSTSTEM(lcRaport) + '.frx'
|
||||
lcFile = getUserRepPath() + "USR_" + lcRaport
|
||||
IF FILE(lcFile)
|
||||
RETURN
|
||||
ENDIF
|
||||
|
||||
*!* TRY
|
||||
*!* USE (lcRaport) IN 0 again SHARED ALIAS crsRaportTemp
|
||||
*!* ENDTRY
|
||||
|
||||
IF !FILE(lcRaport)
|
||||
aMESSAGEBOX('Nu exista raportul ' + lcRaport)
|
||||
ELSE
|
||||
USE (lcRaport) IN 0 AGAIN SHARED ALIAS crsRaportTemp
|
||||
SELECT crsRaportTemp
|
||||
COPY TO (lcFile)
|
||||
USE IN crsRaportTemp
|
||||
ENDIF
|
||||
|
||||
ENDPROC && UserReport2File
|
||||
1
Formulare/test_listare_factura/sel.txt
Normal file
1
Formulare/test_listare_factura/sel.txt
Normal file
@@ -0,0 +1 @@
|
||||
select 1 as tip,(case when tip_persoana = 1 then prefix||' '||denumire||' '||sufix else denumire end) as denumire,cod_fiscal,adresa,telefon,'' as telefon2,'' as telefon3,'' as fax,reg_comert,banca,cont_banca,sysdate as dataora,tip_persoana,0 as capital_soc_var,0 as capital_soc_sub from jcsserver.vnom_parteneri where id_part = ?poDate.id_client union all select 2 as tip,denumire,cod_fiscal,'' as adresa,'' as telefon,'' as telefon2,'' as telefon3,'' as fax,reg_comert,'' as banca,'' as cont_banca,null as dataora,tip_persoana,0 as capital_soc_var,0 as capital_soc_sub from jcsserver.nom_parteneri where sters = 0 and inactiv = 0 and id_part in (select id_partener from jcsserver.utilizatori_rol_intern where sters = 0 and id_util = ?gnIdUtil)union all select 3 as tip,antet as denumire,cod_fiscal,adresa,telefon,telefon2,telefon3,fax,reg_comert,banca1 as banca,cont_banca1 as cont_banca,null as dataora,0 as tip_persoana,capital_soc_var,capital_soc_sub from syn_nom_firme where id_firma = ?gnIdFirma
|
||||
205
Formulare/test_listare_factura/suma_in_vorbe.prg
Normal file
205
Formulare/test_listare_factura/suma_in_vorbe.prg
Normal file
@@ -0,0 +1,205 @@
|
||||
*!* Function SUMA_IN_VORBE
|
||||
Parameter tnSuma
|
||||
Local i,lit,numar1,numar2
|
||||
Store 0 To i,j,lnSuma,lnSuma2
|
||||
Store 1 To putere
|
||||
Store '' To lit,numar1,numar2
|
||||
If Used('mila1')
|
||||
Use In mila1
|
||||
Endif
|
||||
Use mila1 In 0 Shared
|
||||
|
||||
lnSuma=Round(tnSuma,2)
|
||||
lnSuma2=(lnSuma-Int(lnSuma))*100
|
||||
lnSuma=Int(lnSuma)
|
||||
|
||||
*!* lnSuma=ROUND(lnSuma,gnPa)
|
||||
*!* FOR j=1 TO gnPa
|
||||
*!* putere=10*putere
|
||||
*!* ENDFOR
|
||||
*!* lnSuma2=(lnSuma-Int(lnSuma))*putere
|
||||
|
||||
numar1=Space(12)
|
||||
*!* numar2=Space(gnPa)
|
||||
numar2=Space(2)
|
||||
|
||||
numar1=Str(lnSuma,12)
|
||||
*!* numar2=Str(lnSuma2,gnPa)
|
||||
numar2=Str(lnSuma2,2)
|
||||
|
||||
Dimension A(12)
|
||||
A(1)=Subs(numar1,12,1)
|
||||
A(2)=Subs(numar1,11,1)
|
||||
A(3)=Subs(numar1,10,1)
|
||||
A(4)=Subs(numar1,9,1)
|
||||
A(5)=Subs(numar1,8,1)
|
||||
A(6)=Subs(numar1,7,1)
|
||||
A(7)=Subs(numar1,6,1)
|
||||
A(8)=Subs(numar1,5,1)
|
||||
A(9)=Subs(numar1,4,1)
|
||||
A(10)=Subs(numar1,3,1)
|
||||
A(11)=Subs(numar1,2,1)
|
||||
A(12)=Subs(numar1,1,1)
|
||||
Sele mila1
|
||||
*********************
|
||||
Loca For NR=Val(A(12))
|
||||
lit=lit+Alltri(cr1)
|
||||
|
||||
If Val(A(11))=1
|
||||
If Val(A(10))=0
|
||||
Loca For NR=Val(A(11))
|
||||
lit=lit+Alltri(cr5)
|
||||
Else
|
||||
Loca For NR=Val(A(10))
|
||||
lit=lit+Alltri(cr4)
|
||||
Endif
|
||||
Else
|
||||
If Val(A(10))=0
|
||||
Loca For NR=Val(A(11))
|
||||
lit=lit+Alltrim(cr5)
|
||||
Else
|
||||
Loca For NR=Val(A(11))
|
||||
lit=lit+Alltrim(cr2)
|
||||
Loca For NR=Val(A(10))
|
||||
lit=lit+Alltrim(cr3)
|
||||
Endif
|
||||
Endif
|
||||
Do Case
|
||||
Case Val(A(12)) # 0
|
||||
lit=lit+' miliarde'
|
||||
Case Val(A(11)) # 0
|
||||
lit=lit+' miliarde'
|
||||
Case Val(A(10)) # 0
|
||||
lit=lit+' miliarde'
|
||||
Endcase
|
||||
***********************
|
||||
Loca For NR=Val(A(9))
|
||||
lit=lit+Alltri(cr1)
|
||||
|
||||
If Val(A(8))=1
|
||||
If Val(A(7))=0
|
||||
Loca For NR=Val(A(8))
|
||||
lit=lit+Alltri(cr5)
|
||||
Else
|
||||
Loca For NR=Val(A(7))
|
||||
lit=lit+Alltri(cr4)
|
||||
Endif
|
||||
Else
|
||||
If Val(A(7))=0
|
||||
Loca For NR=Val(A(8))
|
||||
lit=lit+Alltrim(cr5)
|
||||
Else
|
||||
Loca For NR=Val(A(8))
|
||||
lit=lit+Alltrim(cr2)
|
||||
Loca For NR=Val(A(7))
|
||||
lit=lit+Alltrim(cr3)
|
||||
Endif
|
||||
Endif
|
||||
Do Case
|
||||
Case Val(A(9)) # 0
|
||||
lit=lit+' milioane'
|
||||
Case Val(A(8)) # 0
|
||||
lit=lit+' milioane'
|
||||
Case Val(A(7)) # 0
|
||||
lit=lit+' milioane'
|
||||
Endcase
|
||||
***********************
|
||||
Loca For NR=Val(A(6))
|
||||
lit=lit+Alltri(cr1)
|
||||
|
||||
If Val(A(5))=1
|
||||
If Val(A(4))=0
|
||||
Loca For NR=Val(A(5))
|
||||
lit=lit+Alltri(cr5)
|
||||
Else
|
||||
Loca For NR=Val(A(4))
|
||||
lit=lit+Alltri(cr4)
|
||||
Endif
|
||||
Else
|
||||
If Val(A(4))=0
|
||||
Loca For NR=Val(A(5))
|
||||
lit=lit+Alltrim(cr5)
|
||||
Else
|
||||
Loca For NR=Val(A(5))
|
||||
lit=lit+Alltrim(cr2)
|
||||
Loca For NR=Val(A(4))
|
||||
lit=lit+Alltrim(cr3)
|
||||
Endif
|
||||
Endif
|
||||
Do Case
|
||||
Case Val(A(6)) # 0
|
||||
lit=lit+' mii'
|
||||
Case Val(A(5)) # 0
|
||||
lit=lit+' mii'
|
||||
Case Val(A(4)) # 0
|
||||
lit=lit+' mii'
|
||||
Endcase
|
||||
|
||||
*********************
|
||||
Loca For NR=Val(A(3))
|
||||
lit=lit+Alltri(cr1)
|
||||
|
||||
If Val(A(2))=1
|
||||
If Val(A(1))=0
|
||||
Loca For NR=Val(A(2))
|
||||
lit=lit+Alltri(cr5)
|
||||
Else
|
||||
Loca For NR=Val(A(1))
|
||||
lit=lit+Alltri(cr4)
|
||||
Endif
|
||||
Else
|
||||
If Val(A(1))=0
|
||||
Loca For NR=Val(A(2))
|
||||
lit=lit+Alltrim(cr5)
|
||||
Else
|
||||
Loca For NR=Val(A(2))
|
||||
lit=lit+Alltrim(cr2)
|
||||
Loca For NR=Val(A(1))
|
||||
lit=lit+Alltrim(cr3)
|
||||
Endif
|
||||
Endif
|
||||
Do Case
|
||||
Case Val(A(3)) # 0
|
||||
lit=lit+' lei'
|
||||
Case Val(A(2)) # 0
|
||||
lit=lit+' lei'
|
||||
Case Val(A(1)) # 0
|
||||
lit=lit+' lei'
|
||||
Endcase
|
||||
|
||||
|
||||
*********************
|
||||
Do Case
|
||||
Case lnSuma2>1
|
||||
lit=lit+' si'
|
||||
Dimension B(2)
|
||||
B(1)=Subs(numar2,2,1)
|
||||
B(2)=Subs(numar2,1,1)
|
||||
|
||||
Do Case
|
||||
Case Val(B(2))=1 And Val(B(1))!=0
|
||||
Loca For NR=Val(B(1))
|
||||
lit=lit+Alltri(cr4)
|
||||
Case Val(B(2))=0
|
||||
Loca For NR=Val(B(1))
|
||||
lit=lit+Alltrim(cr3)
|
||||
Case Val(B(1))=0
|
||||
Loca For NR=Val(B(2))
|
||||
lit=lit+Alltrim(cr5)
|
||||
Otherwise
|
||||
Loca For NR=Val(B(2))
|
||||
lit=lit+Alltrim(cr2)
|
||||
Loca For NR=Val(B(1))
|
||||
lit=lit+Alltrim(cr3)
|
||||
Endcase
|
||||
lit=lit+' bani'
|
||||
Case lnSuma2=1
|
||||
lit=lit+'si un ban'
|
||||
Endcase
|
||||
|
||||
Sele mila1
|
||||
*!* use
|
||||
|
||||
lit=Strtran(lit,' ','')
|
||||
Use In mila1
|
||||
Return lit
|
||||
245
Formulare/test_listare_factura/test_listare_factura.prg
Normal file
245
Formulare/test_listare_factura/test_listare_factura.prg
Normal file
@@ -0,0 +1,245 @@
|
||||
*tnIdClient,tcCursor,tcSirNrOrd,tcNrInmat,tnTipfact,tnProcDiscM,tnProcDiscN,tnDiscountM,tnDiscountN,tnDiscountTvaM,tnDiscountTvaN,tcdenop
|
||||
SET DELETED ON
|
||||
SET CENTURY ON
|
||||
SET ANSI ON
|
||||
SET EXACT ON
|
||||
SET DATE DMY
|
||||
SET SAFETY OFF
|
||||
|
||||
*CLOSE DATABASES ALL
|
||||
|
||||
lcDir = "C:\TEST_LISTARE_FACTURA\"
|
||||
*lcDir = "d:\roa_rb\roaauto\test\test_listare_factura\"
|
||||
CD (lcDir)
|
||||
messagebox(lcDir)
|
||||
lcHost = "roa_arrow"
|
||||
lcUserName = "auto_arrow"
|
||||
lcPassword = "123"
|
||||
PRIVATE gnHandle
|
||||
gnHandle = 0
|
||||
gnTIP_LFACTURA = 1
|
||||
plEmiteBon = .F.
|
||||
PRIVATE gcS
|
||||
gcS = lcUserName
|
||||
PRIVATE gnIdFirma, gnIdUtil
|
||||
gnIdFirma = 1
|
||||
gnIdUtil = 1
|
||||
PRIVATE GNCGARANTIE
|
||||
GNCGARANTIE = 0
|
||||
PRIVATE GNPA, gnLuna, gnAn, gnAnRon, gnLunaRon, gnPc
|
||||
gnLuna = 7
|
||||
gnAn = 2007
|
||||
gnAnRon = 2005
|
||||
gnLunaRon = 7
|
||||
gnPc = 2
|
||||
GNPA = 2
|
||||
pntotftva = 100
|
||||
pntottva = 19
|
||||
pntotctva = 119
|
||||
pcNumeresp = ""
|
||||
pcbidresp = ""
|
||||
pccnpresp = ""
|
||||
|
||||
SET DEFAULT TO (lcDir)
|
||||
SET PATH TO (lcDir)
|
||||
SET PROCEDURE TO oproceduri_comune.prg ADDITIVE
|
||||
SET PROCEDURE TO proceduri_rapoarte.prg ADDITIVE
|
||||
SET PROCEDURE TO test_listare_factura.prg ADDITIVE
|
||||
|
||||
PRIVATE goExecutor
|
||||
goExecutor = CREATEOBJECT("oExecutor")
|
||||
|
||||
PRIVATE goConn
|
||||
goConn = CREATEOBJECT("oConn")
|
||||
gnHandle = goConn.CONNECT(lcHost, lcUserName, lcPassword)
|
||||
|
||||
|
||||
IF !USED('actactan')
|
||||
USE actactan IN 0 SHARED
|
||||
ENDIF
|
||||
|
||||
|
||||
DO listare_factura WITH 34,"actactan","59/CT-02-ZIP","CT-02-ZIP",1,0,0,0,0,0,0,"MANOPERA"
|
||||
|
||||
goConn.Disconnect()
|
||||
|
||||
PROCEDURE listare_factura
|
||||
PARAMETERS tnIdClient,tcCursor,tcSirNrOrd,tcNrInmat,tnTipfact,tnProcDiscM,tnProcDiscN,tnDiscountM,tnDiscountN,tnDiscountTvaM,tnDiscountTvaN,tcdenop
|
||||
|
||||
IF EMPTY(tcdenop)
|
||||
STORE 'MANOPERA' TO tcdenop
|
||||
ENDIF
|
||||
|
||||
IF EMPTY(tnProcDiscN)
|
||||
STORE 0 TO tnProcDiscN,tnDiscountN,tnDiscountTvaN
|
||||
ENDIF
|
||||
|
||||
IF EMPTY(tnProcDiscM)
|
||||
STORE 0 TO tnProcDiscM,tnDiscountM,tnDiscountTvaM
|
||||
ENDIF
|
||||
|
||||
tnDiscountN = ABS(tnDiscountN)
|
||||
tnDiscountM = ABS(tnDiscountM)
|
||||
|
||||
PRIVATE poDate,poFirma,poClient,ptDataOra
|
||||
poDate = CREATEOBJECT('oDateFacturaDevize',tnIdClient,tcSirNrOrd,tcNrInmat,IIF(tnTipfact=4,1,0))
|
||||
lcSql = [select 1 as tip,(case when tip_persoana = 1 then prefix||' '||denumire||' '||sufix else denumire end) as denumire,]+;
|
||||
[cod_fiscal,adresa,telefon,'' as telefon2,'' as telefon3,'' as fax,reg_comert,banca,cont_banca,sysdate as dataora,tip_persoana,0 as capital_soc_var,] + ;
|
||||
[0 as capital_soc_sub from ] + gcS + [.vnom_parteneri where id_part = ?poDate.id_client ] + ;
|
||||
[union all ] + ;
|
||||
[select 2 as tip,denumire,cod_fiscal,'' as adresa,'' as telefon,'' as telefon2,'' as telefon3,'' as fax,reg_comert,'' as banca,'' as cont_banca,] + ;
|
||||
[null as dataora,tip_persoana,0 as capital_soc_var,0 as capital_soc_sub from ] + gcS + [.nom_parteneri ] + ;
|
||||
[where sters = 0 and inactiv = 0 and id_part in ] + ;
|
||||
[(select id_partener from ] + gcS + [.utilizatori_rol_intern where sters = 0 and id_util = ?gnIdUtil)] + ;
|
||||
[union all ] + ;
|
||||
[select 3 as tip,antet as denumire,cod_fiscal,adresa,telefon,telefon2,telefon3,fax,reg_comert,banca1 as banca,] + ;
|
||||
[cont_banca1 as cont_banca,null as dataora,0 as tip_persoana,capital_soc_var,capital_soc_sub ] + ;
|
||||
[from syn_nom_firme where id_firma = ?gnIdFirma ]
|
||||
IF USED('crsdatefacturare')
|
||||
USE IN crsdatefacturare
|
||||
ENDIF
|
||||
lcCursor = [crsdatefacturare]
|
||||
lnSucces = goExecutor.oExecute(lcSql,lcCursor)
|
||||
IF lnSucces<0
|
||||
amessagebox(goExecutor.oPrelucrareEroare(),16,"Eroare")
|
||||
RETURN
|
||||
ENDIF
|
||||
SELECT crsdatefacturare
|
||||
SCAN
|
||||
DO CASE
|
||||
CASE tip = 1
|
||||
SCATTER NAME poClient
|
||||
ptDataOra = poClient.dataora
|
||||
CASE tip = 2
|
||||
WITH poDate
|
||||
.nume_responsabil = denumire
|
||||
.BIresp = reg_comert
|
||||
.CNPresp = cod_fiscal
|
||||
ENDWITH
|
||||
OTHERWISE
|
||||
SCATTER NAME poFirma
|
||||
ENDCASE
|
||||
ENDSCAN
|
||||
USE IN crsdatefacturare
|
||||
|
||||
*!* ofrmdelegat=Createobject("frm_delegat_factura")
|
||||
*!* ofrmdelegat.nidpartener = poDate.id_client
|
||||
*!* ofrmdelegat.cclient = poDate.nume_client
|
||||
*!* ofrmdelegat.cnrinmat_exp = poDate.nrinmat_del
|
||||
*!* ofrmdelegat.Show(1)
|
||||
*!* Release ofrmdelegat
|
||||
|
||||
PRIVATE pnSumaMat,pnSumaMan,pnTvaMat,pnTvaMan,pnDiscMan,pnDiscMat,pnTvaDiscMan,pnTvaDiscMat,pnAvans,pnTvaAvans
|
||||
STORE 0 TO pnSumaMat,pnSumaMan,pnTvaMat,pnTvaMan,pnDiscMan,pnDiscMat,pnTvaDiscMan,pnTvaDiscMat,pnAvans,pnTvaAvans
|
||||
|
||||
SELECT &tcCursor
|
||||
SUM suma FOR ALLTRIM(scd) = '4111' AND ALLTRIM(scc) = '707' AND LEFT(ALLTRIM(explicatia),3) = "MAT" TO pnSumaMat
|
||||
SUM suma FOR ALLTRIM(scd) = '4111' AND ALLTRIM(scc) = '4427' AND LEFT(ALLTRIM(explicatia),7) = "TVA MAT" TO pnTvaMat
|
||||
*!* Sum suma For Alltrim(scd) = '411' And Alltrim(scc) = '707' And Left(Alltrim(explicatia),12) = "DISCOUNT MAT" To pnDiscMat
|
||||
SUM suma FOR ALLTRIM(scd) = '4111' AND ALLTRIM(scc) = '4427' AND LEFT(ALLTRIM(explicatia),12) = "DISCOUNT MAT" TO pnTvaDiscMat
|
||||
|
||||
SUM suma FOR ALLTRIM(scd) = '4111' AND ALLTRIM(scc) = '704' AND LEFT(ALLTRIM(explicatia),3) = "MAN" TO pnSumaMan
|
||||
SUM suma FOR ALLTRIM(scd) = '4111' AND ALLTRIM(scc) = '4427' AND LEFT(ALLTRIM(explicatia),7) = "TVA MAN" TO pnTvaMan
|
||||
*!* Sum suma For Alltrim(scd) = '411' And Alltrim(scc) = '704' And Left(Alltrim(explicatia),12) = "DISCOUNT MAN" To pnDiscMan
|
||||
SUM suma FOR ALLTRIM(scd) = '4111' AND ALLTRIM(scc) = '4427' AND LEFT(ALLTRIM(explicatia),12) = "DISCOUNT MAN" TO pnTvaDiscMan
|
||||
|
||||
SELECT &tcCursor
|
||||
*!* Locate For Alltrim(explicatia ) = 'STORNARE AVANS'
|
||||
*!* If Found()
|
||||
*!* pnAvans = (-1) * Abs(&tcCursor..suma)
|
||||
*!* Endif
|
||||
CALCULATE SUM(suma) FOR ALLTRIM(explicatia)='STORNARE AVANS' TO pnAvans
|
||||
CALCULATE SUM(suma) FOR ALLTRIM(explicatia)='STORNARE AVANS' AND ALLTRIM(scc)<>'4427' TO pnAvansFTva
|
||||
CALCULATE SUM(suma) FOR ALLTRIM(explicatia)='STORNARE AVANS' AND ALLTRIM(scc)='4427' TO pnAvansTva
|
||||
pnAvans=(-1) * ABS(ROUND(pnAvans,GNPA))
|
||||
pnAvansTva=(-1) * ABS(ROUND(pnAvansTva,GNPA))
|
||||
pnAvansFTva=(-1) * ABS(ROUND(pnAvansFTva,GNPA))
|
||||
|
||||
PRIVATE plAchitat,plEmiteBon
|
||||
STORE .T. TO plAchitat,plEmiteBon
|
||||
|
||||
SELECT &tcCursor
|
||||
LOCATE FOR ALLTRIM(scd) = '4111'
|
||||
IF FOUND()
|
||||
poDate.nract = &tcCursor..nract
|
||||
poDate.dataact = &tcCursor..dataact
|
||||
poDate.proc_tva = &tcCursor..proc_tva*100-100
|
||||
poDate.datascad = &tcCursor..datascad
|
||||
ENDIF
|
||||
|
||||
SELECT &tcCursor
|
||||
LOCATE FOR ALLTRIM(scd) = '5311'
|
||||
DO CASE
|
||||
CASE FOUND() AND pnTipIncasare=2
|
||||
STORE .F. TO plAchitat
|
||||
STORE .T. TO plEmiteBon
|
||||
poDate.nrchit = &tcCursor..nract
|
||||
poDate.sumaachit = &tcCursor..suma
|
||||
CASE FOUND() AND pnTipIncasare=3
|
||||
STORE .F. TO plEmiteBon
|
||||
poDate.nrchit = &tcCursor..nract
|
||||
poDate.datachit = &tcCursor..dataact
|
||||
poDate.sumaachit = &tcCursor..suma
|
||||
poDate.sumavorbe = SUMA_IN_VORBE(ROUND(poDate.sumaachit,gnPc))
|
||||
OTHERWISE
|
||||
STORE .F. TO plEmiteBon
|
||||
STORE .F. TO plAchitat
|
||||
ENDCASE
|
||||
|
||||
*-------------------
|
||||
*!* modificare 07.04
|
||||
*!* pnDiscMan = tnDiscountM
|
||||
*!* pnDiscMat = tnDiscountN
|
||||
pnDiscMan = SIGN(pnSumaMan) * tnDiscountM
|
||||
tnDiscountM = SIGN(pnSumaMan) * tnDiscountM
|
||||
pnTvaDiscMan = (-1) * pnTvaDiscMan
|
||||
|
||||
pnDiscMat = SIGN(pnSumaMat) * tnDiscountN
|
||||
tnDiscountN = SIGN(pnSumaMat) * tnDiscountN
|
||||
pnTvaDiscMat = (-1) * pnTvaDiscMat
|
||||
*!* modificare ^
|
||||
|
||||
|
||||
REPORT FORM usr_factav_cuchit TO PRINTER PROMPT PREVIEW
|
||||
|
||||
|
||||
RELEASE poDate
|
||||
ENDPROC && listare_factura
|
||||
*********************************************************************************************************
|
||||
|
||||
DEFINE CLASS oDateFacturaDevize AS CUSTOM
|
||||
devize_multiple = 0
|
||||
listanrord = []
|
||||
dataact = {}
|
||||
datascad = {}
|
||||
nract = 0
|
||||
id_client = NULL
|
||||
nume_client = []
|
||||
nume_responsabil= [] && alte date pentru facturare
|
||||
BIresp = []
|
||||
CNPresp = []
|
||||
id_delegat = NULL
|
||||
nume_delegat = []
|
||||
BIdelegat = []
|
||||
elibdelegat = []
|
||||
CNPdelegat = []
|
||||
eliberatde = []
|
||||
nrinmat_del = []
|
||||
proc_tva = 0
|
||||
nrchit = 0
|
||||
datachit = {}
|
||||
sumaachit = 0
|
||||
sumavorbe = []
|
||||
text_aditional = []
|
||||
|
||||
PROCEDURE INIT
|
||||
LPARAMETERS tnIdPartener,tcSirNrOrd,tcNrInmat,tnDevize
|
||||
WITH THIS
|
||||
.id_client = tnIdPartener
|
||||
.nrinmat_del = tcNrInmat
|
||||
.devize_multiple = tnDevize
|
||||
.listanrord = tcSirNrOrd
|
||||
ENDWITH
|
||||
ENDPROC
|
||||
|
||||
ENDDEFINE
|
||||
BIN
Formulare/test_listare_factura/usr_fact_cuchit.FRT
Normal file
BIN
Formulare/test_listare_factura/usr_fact_cuchit.FRT
Normal file
Binary file not shown.
BIN
Formulare/test_listare_factura/usr_fact_cuchit.frx
Normal file
BIN
Formulare/test_listare_factura/usr_fact_cuchit.frx
Normal file
Binary file not shown.
BIN
Formulare/test_listare_factura/usr_fact_farachit.FRT
Normal file
BIN
Formulare/test_listare_factura/usr_fact_farachit.FRT
Normal file
Binary file not shown.
BIN
Formulare/test_listare_factura/usr_fact_farachit.frx
Normal file
BIN
Formulare/test_listare_factura/usr_fact_farachit.frx
Normal file
Binary file not shown.
BIN
Formulare/test_listare_factura/usr_factav_cuchit.frt
Normal file
BIN
Formulare/test_listare_factura/usr_factav_cuchit.frt
Normal file
Binary file not shown.
BIN
Formulare/test_listare_factura/usr_factav_cuchit.frx
Normal file
BIN
Formulare/test_listare_factura/usr_factav_cuchit.frx
Normal file
Binary file not shown.
BIN
Formulare/test_listare_factura/usr_factav_farachit.FRT
Normal file
BIN
Formulare/test_listare_factura/usr_factav_farachit.FRT
Normal file
Binary file not shown.
BIN
Formulare/test_listare_factura/usr_factav_farachit.frx
Normal file
BIN
Formulare/test_listare_factura/usr_factav_farachit.frx
Normal file
Binary file not shown.
Reference in New Issue
Block a user