//============================================================================== // CopyRight (c) 1993-2000 Microarea SpA. All rights reserved //============================================================================== Release 3 Rect (54,56,481,753) uuid "{7C720672-64ED-4A8A-9C58-339D5D613AC8}" PageInfo (2,9,2970,2100,100,1,1,True ) Text (14,6,44,408) "Lista di spunta Elenco Fornitori" Begin Align 2128 ; FontStyle "TitoloLista" ; Borders (0,0,0,0) ; End Field (14,409,44,546) Alias 78 FormatStyle "Integer" Begin Align 2153 ; FontStyle "TitoloLista" ; Borders (0,0,0,0) ; End Text (26,885,40,1054) "Selezioni effettuate:" Begin Align 2128 ; FontStyle "DescrizioneAccessoria" ; Borders (0,0,0,0) ; End Field (45,885,59,1054) Alias 34 Begin Align 2150 ; Borders (0,0,0,0) ; Label "Dal fornitore" End Text (51,4,90,93) Begin "Ragione Sociale" "Dichiarante" End Begin Align 2128 ; Borders (1,1,1,0) ; End Field (51,93,90,408) Alias 1 Begin Align 2136 ; FontStyle "SottotitoloListaFiscale" ; Borders (1,0,1,1) ; End Field (51,407,90,666) Alias 83 Begin Align 2153 ; FontStyle "SottotitoloListaFiscale" ; Label "Part. IVA Dichiarante" End Field (61,885,75,1054) Alias 35 Begin Align 2150 ; Borders (0,0,0,0) ; Label "Al fornitore" End Text (728,998,746,1031) "pag." Begin Align 2128 ; FontStyle "DescrizioneAccessoria" ; Borders (0,0,0,0) ; End Field (726,1028,745,1061) Alias 3 FormatStyle "Integer" Begin Align 2153 ; FontStyle "DescrizioneAccessoria" ; Borders (0,0,0,0) ; End Field (731,6,749,157) Alias 2 FormatStyle "Date" Begin Align 2148 ; FontStyle "DescrizioneAccessoria" ; Borders (0,0,0,0) ; End Text (693,4,711,383) "Totali generali " Align 2146 ; Text (732,207,752,923) "Legenda colonna Tipo: M = Dati inseriti manualmente, NV Nota di variazione relativa a fatture di anni precedenti" Begin Align 2128 ; FontStyle "DescrizioneAccessoria" ; Borders (0,0,0,0) ; End Table (37,16) "ELENCO FORNITORI" Alias 7 Origin (2,89) Heights (18,32,15,17) Begin "CliFor" Alias 5 Width 49 ; "Ragione Sociale" Alias 6 Width 120 ; "Tipo" Alias 335 Width 31 ; "" Alias 324 Width 0 FormatStyle "Long" ; "Data Doc" Alias 333 Width 68 FormatStyle "Date" ; "Nr.Doc" Alias 332 Width 79 ; "Cod. IVA" Alias 329 Width 34 ; "Nr.di Ft." Alias 88 Width 35 FormatStyle "Long" Total ; "Imponibile" Alias 9 Width 91 FormatStyle "Currency" Total ; "IVA" Alias 10 Width 91 FormatStyle "Currency" Total ; "Non imponibile" Alias 90 Width 83 FormatStyle "Currency" Total ; "Esente" Alias 14 Width 83 FormatStyle "Currency" Total ; "Op.Imp. IVA non esp" Alias 92 Width 76 FormatStyle "Currency" Total ; "Op.Imp. con IVA" Alias 301 Width 72 FormatStyle "Money" Total ; "IMPORTI IGNORATI" Alias 337 Width 71 FormatStyle "Money" Total ; "TOTALE" Alias 22 Width 91 FormatStyle "Currency" Total ; Title Begin Column (0,13) Align 2133 ; Column (14) TextColor (128,0,0) Align 2133 ; Column (15) Align 2133 ; End ColTotal Begin Column (1) Align 2132 ; Column (2) Align 2149 ; Column (7) Align 2149 ; End Body Begin Cell (0,2,36,2) Align 2149 ; Cell (0,7,36,7) Align 2149 ; End End Select LinkForm "RunFormCompletaFor" Alias 7, 5 Begin Enum["Tipo clifor"] TipoCliFor {"Tipo clifor":"Fornitore"} String CliFor Alias 7, 5 End Select LinkForm "RunFormPrimaNotaDocIvaRicevuti" Alias 7, 332 Long IdPNota Alias 7, 324 Report Begin NoName Tables Tabella_1 [37] Alias 7 ; End Variables String Ragionesociale [64] Alias 1 ; Date ApplicationDate [8] Alias 2 Init = AppDate ( ) ; Integer w_NrPage [6] = w_NrPage + 1 Alias 3 Init = 1 ; String CustSupp [9] Alias 5 Column ; String CustCompanyName [23] Alias 6 Column ; Money TaxableAmount [15] Alias 9 Column ; Money TaxAmount [15] Alias 10 Column ; Money Exempt [15] Alias 14 Column ; Money TotalAmount [15] Alias 22 Column ; String CustSuppStart [12] Alias 34 Input Init = "" ; String CustSuppEnd [12] Alias 35 Input Init = "" ; Money TotTaxableAmount = Csum (TaxableAmount ) Alias 39 ColTotal ; Money TotExempt = Csum (Exempt ) Alias 41 ColTotal ; Money TotTotalAmount = Csum (TotalAmount ) Alias 45 ColTotal ; Money TotTax = Csum (TaxAmount ) Alias 47 ColTotal ; Integer w_ParamCurrYear [5] Alias 50 Hidden Init = 0 ; Integer CurrYear [5] Alias 78 Input Init = w_ParamCurrYear == 0 ? Year ( AppDate ( ) ) - 1 : w_ParamCurrYear ; String PartIVADichiarante [12] Alias 83 ; Bool CreditNotes [2] Alias 87 Hidden ; Long NumberOfInvoices [12] Alias 88 Column ; Long TotNumberOfInvoices = Csum (NumberOfInvoices ) Alias 89 ColTotal ; Money NoTaxable [23] Alias 90 Column ; Money TotNoTaxable = Csum (NoTaxable ) Alias 91 ColTotal ; Money TaxAmountNotInInvoice [23] Alias 92 Column ; Money TotTaxAmountNotInInvoice = Csum (TaxAmountNotInInvoice ) Alias 93 ColTotal ; Bool FirstTime [2] Alias 100 Hidden Init = TRUE ; Money TaxableAmountWithTax [23] Alias 301 Column ; Money TotTaxableAmountWithTax = Csum (TaxableAmountWithTax ) Alias 302 ColTotal ; Long TotCustSuppNumberOfInvoices [12] = Csum (NumberOfInvoices ) Alias 288 SubTotal ; Money TotCustSuppTaxableAmount [15] = Csum (TaxableAmount ) Alias 289 SubTotal ; Money TotCustSuppTaxAmount [15] = Csum (TaxAmount ) Alias 290 SubTotal ; Money TotCustSuppExempt [15] = Csum (Exempt ) Alias 291 SubTotal ; Money TotCustSuppTotalAmount [15] = Csum (TotalAmount ) Alias 292 SubTotal ; Money TotCustSuppNoTaxable [23] = Csum (NoTaxable ) Alias 293 SubTotal ; Money TotCustSuppTaxAmountNotInInvoice [23] = Csum (TaxAmountNotInInvoice ) Alias 294 SubTotal ; Money TotCustSuppTaxableAmountWithTax [23] = Csum (TaxableAmountWithTax ) Alias 304 SubTotal ; Enum["Tipo clifor"] w_Custsupptype [15] Alias 300 Hidden Init = { "Tipo clifor" : "Fornitore" } ; Enum["Natura Prima Nota"] NaturaDefinitiva [15] Alias 320 Hidden Input Init = { "Natura Prima Nota" : "Definitiva" } ; Date DataInizio [8] Alias 321 Hidden Input ; Date DataFine [8] Alias 322 Hidden Input ; Enum["Segno IVA"] SegnoIVA [15] Alias 323 Hidden ; Long PNIVA_IdPNota [12] Alias 324 Column ; Money ImponibileFiscale [23] Alias 325 Hidden ; Money ImpostaFiscale [23] Alias 326 Hidden ; Integer PNIVAR_Riga [6] Alias 327 Hidden ; Integer PNIVAR_Riga_OLD [6] Alias 328 Hidden Init = 0 ; String PNIVAR_CodIVA [6] Alias 329 Column ; Enum["Tipo Elenco CliFor"] TipoElencoClienti [15] Alias 330 Hidden Init = { "Tipo Elenco CliFor" : "Ignora" } ; Enum["Tipo Elenco CliFor"] TipoElencoFornitori [15] Alias 331 Hidden Init = { "Tipo Elenco CliFor" : "Ignora" } ; String NrDoc [15] Alias 332 Column ; Date DtaDoc [26] Alias 333 Column ; Bool NoteCreditoAnniPrecedenti [2] Alias 334 Hidden ; String TipoRiga [5] Alias 335 Column ; Long PNIVA_IdPNota_OLD [12] Alias 336 Hidden ; Money IgnoreAmount [23] Alias 337 Column ; Money TotIgnoreAmount = Csum (IgnoreAmount ) Alias 338 ColTotal ; Money TotCustSuppIgnoreAmount [23] = Csum (IgnoreAmount ) Alias 339 SubTotal ; End Rules From Azienda Select Not NULL RagSoc Into Ragionesociale , PartIVA Into PartIVADichiarante ; From CFAnagra Select Not NULL CliFor Into CustSupp , RagSoc Into CustCompanyName Where CFAnagra.TipoCliFor == w_Custsupptype And CFAnagra.CliFor Between CustSuppStart And CustSuppEnd And CFAnagra.SoggCEE == FALSE And CFAnagra.InAllegati == TRUE Order By CFAnagra.CliFor ; From ElenchiCliForFile Select Imponibili Into TaxableAmount , Imposta Into TaxAmount , Esenti Into Exempt , NotaCredito Into CreditNotes , NumeroFatture Into NumberOfInvoices , NonImponibili Into NoTaxable , IVAnonEsposta Into TaxAmountNotInInvoice , ComprensiveIVA Into TaxableAmountWithTax Where ElenchiCliForFile.TipoCliFor == w_Custsupptype And ElenchiCliForFile.CliFor == CustSupp And ElenchiCliForFile.Anno == CurrYear And ElenchiCliForFile.NotaCredito == FALSE And ElenchiCliForFile.Manuale = TRUE ; From PNIVA Select SegnoIVA Into SegnoIVA , NoteCreditoAnniPrecedenti Into NoteCreditoAnniPrecedenti , NrDoc Into NrDoc , DtaDoc Into DtaDoc , IdPNota Into PNIVA_IdPNota Where ( PNIVA.DtaDoc >= DataInizio And PNIVA.DtaDoc <= DataFine ) And PNIVA.TipoCliFor == w_Custsupptype And PNIVA.CliFor == CustSupp And PNIVA.Natura == NaturaDefinitiva Order By PNIVA.DtaDoc, PNIVA.NrDoc ; From PNIVAR Select Riga Into PNIVAR_Riga , CodIVA Into PNIVAR_CodIVA , ImponibileFisca Into ImponibileFiscale , ImpostaFisca Into ImpostaFiscale Where PNIVAR.IdPNota = PNIVA_IdPNota ; From IVAParEl Select TipoElencoClienti Into TipoElencoClienti , TipoElencoFornitori Into TipoElencoFornitori Where IVAParEl.CodIVA == PNIVAR_CodIVA ; End Events FormFeed : Do Before Begin End After Begin Eval w_NrPage ; End Report : Do Always Begin If ( PNIVAR_CodIVA IS NOT NULL ) Then Begin If ( TipoElencoFornitori IS NULL ) Then TipoElencoFornitori = { "Tipo Elenco CliFor" : "Ignora" } ; If ( PNIVA_IdPNota_OLD <> PNIVA_IdPNota ) Then Begin NumberOfInvoices = 1 ; PNIVA_IdPNota_OLD = PNIVA_IdPNota ; End Else Begin NumberOfInvoices = 0 ; End ; Reset TaxableAmount ; Reset TaxAmount ; Reset NoTaxable ; Reset Exempt ; Reset TaxAmountNotInInvoice ; Reset TaxableAmountWithTax ; Reset IgnoreAmount ; If ( SegnoIVA == { "Segno IVA" : "Negativo" } ) Then Begin ImponibileFiscale = ImponibileFiscale * - 1 ; ImpostaFiscale = ImpostaFiscale * - 1 ; End ; If ( TipoElencoFornitori == { "Tipo Elenco CliFor" : "Operazioni imponibili" } ) Then Begin TaxableAmount = ImponibileFiscale ; TaxAmount = ImpostaFiscale ; End ; If ( TipoElencoFornitori == { "Tipo Elenco CliFor" : "Operazioni non imponibili" } ) Then NoTaxable = ImponibileFiscale ; If ( TipoElencoFornitori == { "Tipo Elenco CliFor" : "Operazioni esenti" } ) Then Exempt = ImponibileFiscale ; If ( TipoElencoFornitori == { "Tipo Elenco CliFor" : "Operazioni imp. IVA non esposta" } ) Then TaxAmountNotInInvoice = ImponibileFiscale ; If ( TipoElencoFornitori == { "Tipo Elenco CliFor" : "Operazioni imp. comprensive IVA" } ) Then TaxableAmountWithTax = ImponibileFiscale ; If ( TipoElencoFornitori == { "Tipo Elenco CliFor" : "Ignora" } ) Then IgnoreAmount = ImponibileFiscale + ImpostaFiscale ; TotalAmount = TaxableAmount + TaxAmount + NoTaxable + Exempt + TaxAmountNotInInvoice + TaxableAmountWithTax + IgnoreAmount ; Call PrintLine ; End ; End Before Begin If ( GetAllParameters ( CustSuppStart , CustSuppEnd , CurrYear ) == FALSE ) Then Ask Selezione ; DataInizio = Date ( 1 , 1 , CurrYear ) ; DataFine = Date ( 31 , 12 , CurrYear ) ; End After Begin Display TotNumberOfInvoices ; Display TotTaxableAmount ; Display TotTax ; Display TotNoTaxable ; Display TotExempt ; Display TotTaxAmountNotInInvoice ; Display TotTaxableAmountWithTax ; Display TotIgnoreAmount ; Display TotTotalAmount ; End EventoCambioCliente : Breaking CustSupp Do Before Begin If ( TotCustSuppTotalAmount <> 0.0 ) Then Begin Display TotCustSuppNumberOfInvoices ; Display TotCustSuppTaxableAmount ; Display TotCustSuppTaxAmount ; Display TotCustSuppExempt ; Display TotCustSuppNoTaxable ; Display TotCustSuppTaxAmountNotInInvoice ; Display TotCustSuppTaxableAmountWithTax ; Display TotCustSuppIgnoreAmount ; Display TotCustSuppTotalAmount ; CustCompanyName = "Totale fornitore" + " " + CustSupp ; Display CustCompanyName ; NextLine ; InterLine ; End ; End After Begin Reset TotCustSuppNumberOfInvoices ; Reset TotCustSuppTaxableAmount ; Reset TotCustSuppTaxAmount ; Reset TotCustSuppExempt ; Reset TotCustSuppNoTaxable ; Reset TotCustSuppTaxAmountNotInInvoice ; Reset TotCustSuppTaxableAmountWithTax ; Reset TotCustSuppIgnoreAmount ; Reset TotCustSuppTotalAmount ; If ( CreditNotes IS NOT NULL ) Then Begin TotalAmount = TaxableAmount + TaxAmount + NoTaxable + Exempt + TaxAmountNotInInvoice + TaxableAmountWithTax + IgnoreAmount ; TotCustSuppNumberOfInvoices = NumberOfInvoices ; TotCustSuppTaxableAmount = TaxableAmount ; TotCustSuppTaxAmount = TaxAmount ; TotCustSuppExempt = Exempt ; TotCustSuppNoTaxable = NoTaxable ; TotCustSuppTaxAmountNotInInvoice = TaxAmountNotInInvoice ; TotCustSuppTaxableAmountWithTax = TaxableAmountWithTax ; TotCustSuppIgnoreAmount = IgnoreAmount ; TotCustSuppTotalAmount = TotalAmount ; End ; Call PrintFirstLine ; End End Procedure PrintFirstLine Begin InterLine ; If ( TotCustSuppNumberOfInvoices == 0 and TotCustSuppTaxableAmount == 0 and TotCustSuppTaxAmount == 0 and TotCustSuppNoTaxable == 0 and TotCustSuppExempt == 0 and TotCustSuppTaxAmountNotInInvoice == 0 and TotCustSuppTaxableAmountWithTax == 0 and TotCustSuppIgnoreAmount == 0 ) Then Begin If ( PNIVA_IdPNota IS NOT NULL And PNIVA_IdPNota <> 0 ) Then Begin TipoRiga = "" ; Display CustSupp ,CustCompanyName ,TipoRiga ; End ; End Else Begin TipoRiga = "M" ; Display CustSupp ,CustCompanyName ,TipoRiga ; NumberOfInvoices = TotCustSuppNumberOfInvoices ; TaxableAmount = TotCustSuppTaxableAmount ; TaxAmount = TotCustSuppTaxAmount ; NoTaxable = TotCustSuppNoTaxable ; Exempt = TotCustSuppExempt ; TaxAmountNotInInvoice = TotCustSuppTaxAmountNotInInvoice ; TaxableAmountWithTax = TotCustSuppTaxableAmountWithTax ; IgnoreAmount = TotCustSuppIgnoreAmount ; TotalAmount = TotCustSuppTotalAmount ; Display NumberOfInvoices ; Display TaxableAmount ; Display TaxAmount ; Display NoTaxable ; Display Exempt ; Display TaxAmountNotInInvoice ; Display TaxableAmountWithTax ; Display IgnoreAmount ; Display TotalAmount ; NextLine ; Eval TotNumberOfInvoices ; Eval TotTaxableAmount ; Eval TotTax ; Eval TotNoTaxable ; Eval TotExempt ; Eval TotTaxAmountNotInInvoice ; Eval TotTaxableAmountWithTax ; Eval TotIgnoreAmount ; Eval TotTotalAmount ; End ; End Procedure PrintLine Begin If ( NumberOfInvoices <> 0 or TaxableAmount <> 0 or TaxAmount <> 0 or NoTaxable <> 0 or Exempt <> 0 or TaxAmountNotInInvoice <> 0 or IgnoreAmount <> 0 or TotalAmount <> 0 ) Then Begin If ( NoteCreditoAnniPrecedenti ) Then TipoRiga = "NV" ; Else TipoRiga = "" ; If ( NumberOfInvoices <> 0 ) Then Display DtaDoc ,NrDoc ; Display TipoRiga ,PNIVA_IdPNota ,PNIVAR_CodIVA ; TotCustSuppNumberOfInvoices = TotCustSuppNumberOfInvoices + NumberOfInvoices ; TotCustSuppTaxableAmount = TotCustSuppTaxableAmount + TaxableAmount ; TotCustSuppTaxAmount = TotCustSuppTaxAmount + TaxAmount ; TotCustSuppNoTaxable = TotCustSuppNoTaxable + NoTaxable ; TotCustSuppExempt = TotCustSuppExempt + Exempt ; TotCustSuppTaxAmountNotInInvoice = TotCustSuppTaxAmountNotInInvoice + TaxAmountNotInInvoice ; TotCustSuppTaxableAmountWithTax = TotCustSuppTaxableAmountWithTax + TaxableAmountWithTax ; TotCustSuppIgnoreAmount = TotCustSuppIgnoreAmount + IgnoreAmount ; TotCustSuppTotalAmount = TotCustSuppTotalAmount + TotalAmount ; Display NumberOfInvoices ; Display TaxableAmount ; Display TaxAmount ; Display NoTaxable ; Display Exempt ; Display TaxAmountNotInInvoice ; Display TaxableAmountWithTax ; Display IgnoreAmount ; Display TotalAmount ; NextLine ; Eval TotNumberOfInvoices ; Eval TotTaxableAmount ; Eval TotTax ; Eval TotNoTaxable ; Eval TotExempt ; Eval TotTaxAmountNotInInvoice ; Eval TotTaxableAmountWithTax ; Eval TotIgnoreAmount ; Eval TotTotalAmount ; End ; End Dialog On Ask Selezione "Selezioni" Begin "Fornitori" CurrYear Prompt = "Elenco dell''anno..." ; CustSuppStart Prompt = "Dal fornitore" LowerLimit HotLink = HKLCliFor [ 1 ; 2 ] ; CustSuppEnd Prompt = "Al fornitore" UpperLimit HotLink = HKLCliFor [ 1 ; 2 ] ; End End