1287 lines
		
	
	
		
			50 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			1287 lines
		
	
	
		
			50 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
| #ifndef __PRINTAPP_H
 | |
| #include <printapp.h>
 | |
| #endif
 | |
| 
 | |
| #ifndef __MASK_H
 | |
| #include <mask.h>
 | |
| #endif
 | |
| 
 | |
| #ifndef __SHEET_H
 | |
| #include <sheet.h>
 | |
| #endif 
 | |
| 
 | |
| #ifndef __UTILITY_H
 | |
| #include <utility.h>
 | |
| #endif
 | |
|  
 | |
| #ifndef __LFFILES_H
 | |
| #include <lffiles.h>
 | |
| #endif
 | |
| 
 | |
| #ifndef __DITTE_H
 | |
| #include <nditte.h>
 | |
| #endif
 | |
| 
 | |
| #ifndef __CLIFO_H
 | |
| #include <clifo.h> 
 | |
| #endif
 | |
| 
 | |
| #ifndef __PCONTI_H
 | |
| #include <pconti.h>
 | |
| #endif
 | |
| 
 | |
| #ifndef __PARTITE_H
 | |
| #include <partite.h>
 | |
| #endif
 | |
| 
 | |
| #ifndef __SCADENZE_H
 | |
| #include <scadenze.h> 
 | |
| #endif
 | |
| 
 | |
| #ifndef _FLD_CAUS_H
 | |
| #include <caus.h>
 | |
| #endif
 | |
| 
 | |
| #include <pagsca.h>
 | |
| 
 | |
| #include "sc2.h"
 | |
| #include "sc2200.h"    
 | |
| #include "sc2201.h"
 | |
| 
 | |
| #define SCADCLIFO_ALIAS 51
 | |
| #define CLIFOSCAD_ALIAS 52
 | |
| #define SCADPCON_ALIAS  53
 | |
| #define PCONSCAD_ALIAS  54
 | |
| #define MaxRowsForTotal 17
 | |
| 
 | |
| #define TPString TParagraph_string   // Comodita'...
 | |
| 
 | |
| enum tipo_st {nessuno=0, tutti=1, clienti=2, fornitori=3, altri=4};
 | |
| 
 | |
| bool filter_func(const TRelation *);
 | |
| bool but_sel_handler(TMask_field&, KEY);
 | |
| 
 | |
| class TStampaScadenzario : public TPrintapp
 | |
| { 
 | |
|   TRelation     *_rel1, *_rel2, *_rel3;                      // Relazioni di lavoro...
 | |
|   int           _cur1, _cur11,                               // Identificatori dei cursori di lavoro... 
 | |
|                 _cur2, _cur3, _cur4, _cur41,                 // piu' avanti spiega tutto.
 | |
|                 _cur5, _cur6, _cur7;
 | |
|   TRelation     *_r;
 | |
|   TCursor       *_c;
 | |
|   TCursor_sheet_RecNo *_cs;                                  // Sheet di selezione dati.
 | |
|   TLocalisamfile *_partite;                                  // File delle partite.
 | |
|   TLocalisamfile *_pagsca;                                   // File dei pagamenti scadenze
 | |
|   TLocalisamfile *_caus;                                     // File delle causali, serve per reperire le descrizioni, nel caso non ci siano sul file parite
 | |
|   TString        _annopart,_datareg,_numdoc,_datadoc;        // Anno partita (2 cifre), data registrazione, nr. documento, data doc.
 | |
|   long           _protiva;                                   // Numero di protocollo IVA
 | |
|   TPString       *_descrizione,*_ragsoc,*_des_conto;         // Descrizione (da LF_PARTITE), ragione sociale (da LF_CLIFO)
 | |
|                                                              // Descrizione conto (da LF_PCON)
 | |
|   TString   _imp_scad,_imp_pag,_rimdir,_riba,_altri;         // Valori calcolati in preprocess_page: rimesse dirette, Ri.ba e altri
 | |
|                                                              // _imp_scad e _imp_pag vengono anch'essi calcolati in preprocess_page.
 | |
|   TDate     _datai, _dataf, _datas,                          // Data inizio, fine e stampa
 | |
|             _cur_data;                                       // Data di scadenza riferita al record corrente
 | |
|   long      _cur_codcf;                                      // Cli/Fo riferito al record corrente
 | |
|   int       _cur_gr,_cur_co;                                 // Gruppo/Conto riferito al record corrente.
 | |
|   tipo_st   _tipost,                                         // Tipo di stampa impostato
 | |
|             _tipostpr;                                       // Tipo di stampa precedente
 | |
|   bool      _modified,                                       // VERO=E' stato stampato il totale giornaliero (mensile)
 | |
|             _end_printed,                                    // VERO=riepilogo finale da stampare
 | |
|             _ratesald,                                       // VERO=stampa anche le rate saldate
 | |
|             _ordata,                                         // VERO=ordine primario per data, FALSO=ordine primario impostato da _ordcod
 | |
|             _ordcod,                                         // VERO=ordine per codice, FALSO=ordine per ragione sociale
 | |
|             _ordcodpr;                                       // ordine per codice precedente;
 | |
|                                                              // Se _tipost=tutti non e' possibile impostare l'ordine primario per 
 | |
|                                                              // ragione sociale o descrizione. L'unico tipo stampa possibile e' quello 
 | |
|                                                              // in ordine di data scadenza
 | |
|                                                              // Se _tipost=altri scorre il piano dei conti. 
 | |
|                                                              // Se _tipost=clienti || fornitori scorre clifo.
 | |
|   real      _tg_imp_scad, _tg_imp_pag, _tg_rim_dir, _tg_riba,// Totali del giorno: importo in scad., importo pagato
 | |
|             _tg_altri;                                       // rim. dirette, riba/tratte ed altri tipi di pagamento.
 | |
|   real      _tm_imp_scad, _tm_imp_pag, _tm_rim_dir, _tm_riba,// Totali del mese.
 | |
|             _tm_altri;
 | |
|   real      _tp_imp_scad, _tp_imp_pag, _tp_rim_dir, _tp_riba,// Totali del periodo.
 | |
|             _tp_altri;                         
 | |
|   friend bool filter_func(const TRelation *);                // Funzione di filtro [_datai.._dataf]
 | |
|   friend bool but_sel_handler(TMask_field&, KEY);            // Handler per la selezione dati
 | |
|   
 | |
| public:             
 | |
|   // print functions
 | |
|   virtual bool preprocess_page(int file, int counter);           // Qui stampa i totali e i riepiloghi
 | |
|   virtual bool preprocess_print(int file, int counter);          // Qui non fa proprio nulla!
 | |
|   virtual print_action postprocess_print(int file, int counter); // Qui setta i flags per stampare il riepilogo finale!
 | |
|   virtual print_action postprocess_page(int file, int counter);  // Qui resetta le righe di stampa
 | |
|   virtual void preprocess_header() {};                           // Very Very Dummy...
 | |
|   virtual bool user_create();                                    // Qui creo i cursori...
 | |
|   virtual bool user_destroy();                                   // e qui li distruggo.
 | |
|   virtual bool set_print(int);                                   // Qui c'e' la maschera di selezione.
 | |
|   virtual void set_page (int file, int counter);                 // Setta le righe di stampa.
 | |
|   void    set_page_tutti(int nriga);                             // Frammenti di set_page...
 | |
|   void    set_page_clifo(int nriga);
 | |
|   void    set_page_pcon (int nriga);
 | |
|   void    print_header();                                        // Stampa l'header.
 | |
|   // Le seguenti funzioni valgono con ordinamento principale per data.
 | |
|   void    print_riepilogo(int &nriga, bool type);                          // type == FALSE prints month totals, type == TRUE prints period totals.
 | |
|   void    print_totali_tutti(int &nriga, bool month_changed, bool ended);  // month_changed indica se il mese
 | |
|   void    print_totali_clifo(int &nriga, bool month_changed, bool ended);  // e' cambiato. ended indica il raggiungimento 
 | |
|   void    print_totali_pcon(int  &nriga, bool month_changed, bool ended);  // di fine periodo.   
 | |
|   // Le seguenti funzioni servono per il riepilogo dei totali nel caso l'ordinamento principale
 | |
|   // non sia per data.
 | |
|   void    print_riepilogo_c(int &nriga, bool type);                        // type == FALSE prints sigle totals, type == TRUE prints period totals
 | |
|   void    print_totali_clifo_c(int &nriga, bool ended);                    // ended indica di stampare anche             
 | |
|   void    print_totali_pcon_c(int &nriga, bool ended);                     // il riepilogo del periodo
 | |
|   void    calcola_pagamenti(real& is, real& ip, real& ir);                 // calcola i pagamenti effettuati per questa rata e il residuo eventuale
 | |
|   TStampaScadenzario();
 | |
| };
 | |
|                   
 | |
| inline TStampaScadenzario& app() {return (TStampaScadenzario&)main_app();}
 | |
| 
 | |
| bool filter_func(const TRelation *r) 
 | |
| {                                    // Filtro per rate saldate: se e' saldata e' ok solo quando
 | |
|   bool            rt      = FALSE;   // e' abilitato il flag; se non e' saldata va sempre bene. 
 | |
|   TLocalisamfile* scad    = &(r->lfile(LF_SCADENZE));      
 | |
|   bool            saldata = scad->get_bool(SCAD_PAGATA);
 | |
|   TRecnotype      n;
 | |
|   switch (app()._tipost)
 | |
|   {
 | |
|     case tutti:
 | |
|       n=scad->recno();
 | |
|     break;
 | |
|     case clienti:
 | |
|     case fornitori:
 | |
|     {
 | |
|       TLocalisamfile * clifo = &(r->lfile(LF_CLIFO));
 | |
|       n=clifo->recno();
 | |
|     }
 | |
|     break;
 | |
|     case altri:
 | |
|     {
 | |
|       TLocalisamfile * pcon = &(r->lfile(LF_PCON));
 | |
|       n=pcon->recno();
 | |
|     }
 | |
|     default:
 | |
|     break;
 | |
|   }
 | |
|   if (!saldata || (saldata && app()._ratesald))
 | |
|   {
 | |
|     // Questo dovrebbe fungere da filtro sulla selezione Cli/Fo - PConti - Scadenze.
 | |
|     // Might It be a good idea?
 | |
|     if (app()._cs->rec_checked(n)) 
 | |
|      rt=TRUE;
 | |
|   }
 | |
|   return rt;
 | |
| }
 | |
| 
 | |
| bool but_sel_handler(TMask_field& f, KEY k)
 | |
| {
 | |
|   TString t=f.mask().get(F_TIPO);
 | |
|   int nkey;
 | |
|   
 | |
|   if (t=="A") app()._tipost=altri;
 | |
|   else if (t=="C") app()._tipost=clienti;
 | |
|   else if (t=="F") app()._tipost=fornitori;
 | |
|   else app()._tipost=tutti;
 | |
|   app()._ordcod=((f.mask().get(F_ORDINE)=="C") ? TRUE : FALSE);
 | |
|   app()._ordata=f.mask().get_bool(F_ORDDATA);
 | |
|   
 | |
|   if (k == K_SPACE) 
 | |
|   { 
 | |
|     if (app()._ordcod != app()._ordcodpr || app()._tipost != app()._tipostpr)
 | |
|     {
 | |
|       if (app()._ordcod) nkey=1;      // Ordine per codice
 | |
|       else nkey=2;                    // Ordine per ragione sociale o descrizione
 | |
|       if (app()._cs) delete app()._cs;
 | |
|       if (app()._c)  delete app()._c;                              
 | |
|       if (app()._r)  delete app()._r;                              
 | |
|       app()._r=NULL;
 | |
|       app()._c=NULL;
 | |
|       app()._cs=NULL;
 | |
|       if (app()._tipost == fornitori || app()._tipost == clienti)
 | |
|       {   
 | |
|         app()._r  = new TRelation(LF_CLIFO);  
 | |
|         if (app()._tipost==clienti) app()._c  = new TCursor(app()._r,"TIPOCF=\"C\"",nkey);       // Clienti
 | |
|         else app()._c  = new TCursor(app()._r,"TIPOCF=\"F\"",nkey);                              // Fornitori
 | |
|         if (nkey==1)
 | |
|           app()._cs = new TCursor_sheet_RecNo(app()._c,"|TIPOCF|CODCF|RAGSOC","Selezione Cli/Fo",
 | |
|                           "@1|TipoCF@6|Codice@10|Ragione sociale@50",0);
 | |
|         else
 | |
|           app()._cs = new TCursor_sheet_RecNo(app()._c,"|TIPOCF|RAGSOC|CODCF","Selezione Cli/Fo",
 | |
|                           "@1|TipoCF@6|Ragione sociale@50|Codice@10",0);
 | |
|       }
 | |
|       else 
 | |
|         if (app()._tipost == altri)                 
 | |
|         { 
 | |
|           app()._r  = new TRelation(LF_PCON);  
 | |
|           app()._c  = new TCursor(app()._r,"",nkey);
 | |
|           if (nkey==1)
 | |
|             app()._cs = new TCursor_sheet_RecNo(app()._c,"|GRUPPO|CONTO|SOTTOCONTO|DESCR",
 | |
|                         "Selezione Conti","@1|Gruppo@7|Conto@7|Sottoconto@14|Descrizione@50",0);
 | |
|           else
 | |
|             app()._cs = new TCursor_sheet_RecNo(app()._c,"|DESCR|GRUPPO|CONTO|SOTTOCONTO",
 | |
|                         "Selezione Conti","@1|Descrizione@50|Gruppo@7|Conto@7|Sottoconto@14",0);
 | |
|         }
 | |
|         else
 | |
|           {
 | |
|             app()._r  = new TRelation(LF_SCADENZE); 
 | |
|             app()._c  = new TCursor(app()._r,"",2);
 | |
|             app()._cs = new TCursor_sheet_RecNo(app()._c,"|DATASCAD|TIPOC|GRUPPO|CONTO|"
 | |
|                         "SOTTOCONTO|ANNO|NUMPART|NRIGA|NRATA","Selezione scadenze","@1|Data scadenza@14|"
 | |
|                         "TipoCF@6|Gruppo@7|Conto@7|Sottoconto@14|Anno@4|Nr partita@12|Nr riga|Nr rata@8",0);
 | |
|           }  
 | |
|       app()._ordcodpr=app()._ordcod;
 | |
|       app()._tipostpr=app()._tipost;    
 | |
|     }
 | |
|     if (app()._cs)      
 | |
|       app()._cs->run();      
 | |
|   }
 | |
|   f.mask().set_focus();
 | |
|   return TRUE;
 | |
| } 
 | |
| 
 | |
| void TStampaScadenzario::calcola_pagamenti(real& is, real& ip, real& ir)
 | |
| {                               
 | |
|   // Qui dovra' calcolare e rettificare l'importo in scadenza e l'importo pagato
 | |
|   // relativo a questa rata.
 | |
|   
 | |
|   //TRectype rc(_pagsca->curr());
 | |
|   //rc.put(PAGSCA_NRIGP,9999);
 | |
|   ip = 0;
 | |
|   //_pagsca->read(_isgteq);
 | |
|   //if (_pagsca->good())
 | |
|   //{
 | |
|   //  for (; _pagsca->good() && _pagsca->curr() <= rc; _pagsca->next())
 | |
|   //    ip += _pagsca->get_real(PAGSCA_IMPORTO);
 | |
|   //}                   
 | |
|   ir = is - ip; // Il residuo e' uguale all'importo in scadenza - gl'importi pagati
 | |
| }
 | |
| 
 | |
| bool TStampaScadenzario::preprocess_page(int file, int counter)
 | |
| {   
 | |
|   TRectype &rc = current_cursor()->curr(LF_SCADENZE);
 | |
|   TRectype &rclifo=current_cursor()->curr(LF_CLIFO);
 | |
|   TRectype &rpcon=current_cursor()->curr(LF_PCON);
 | |
|   char    tipoc    = rc.get_char(SCAD_TIPOCF);     // Tipo
 | |
|   int     gruppo   = rc.get_int(SCAD_GRUPPO);      // Gruppo
 | |
|   int     conto    = rc.get_int(SCAD_CONTO);       // Conto
 | |
|   long    codcf    = rc.get_long(SCAD_SOTTOCONTO); // Codice Cliente/Fornitore/Conto
 | |
|   int     annop    = rc.get_int(SCAD_ANNO);        // Anno partita
 | |
|   TString nump     = rc.get(SCAD_NUMPART);         // Nr partita    
 | |
|   int     nrigap   = rc.get_int(SCAD_NRIGA);       // Nr riga      
 | |
|   int     nratap   = rc.get_int(SCAD_NRATA);       // Nr rata
 | |
|   TDate   datascad = rc.get_date(SCAD_DATASCAD);   // Data scadenza
 | |
|   int     tipo_pag = rc.get_int(SCAD_TIPOPAG);     // Tipo di pagamento
 | |
|   real    imp_scad = rc.get_real(SCAD_IMPORTO);    // Importo in scadenza
 | |
|   real    imp_pag;                                 // Importo pagato fino ad ora per la rata corrente
 | |
|   real    imp_res;                                 // imp_scad - imp_pag sarebbe la scadenza - tutto cio' che e' stato pagato
 | |
|     
 | |
|   
 | |
|   if (file == LF_SCADENZE)
 | |
|   {
 | |
|     _datareg = "";
 | |
|     _datadoc = "";
 | |
|     _numdoc  = "";
 | |
|     *_descrizione = "";
 | |
|                                                    // Legge dal file partite le
 | |
|     _partite->zero();                              // informazioni relative a descrizione
 | |
|     _partite->put(PART_ANNO,annop);                // data registrazione, data e numero
 | |
|     _partite->put(PART_NUMPART,nump);              // documento.
 | |
|     _partite->put(PART_NRIGA,1);
 | |
|     if (_partite->read() == NOERR)                          // Se lo trova setta _datareg _datadoc,_numdoc e _descrizione
 | |
|     {
 | |
|       _datareg = _partite->get_date(PART_DATAREG).string(brief);
 | |
|       _datadoc = _partite->get_date(PART_DATADOC).string(brief);
 | |
|       _numdoc  = _partite->get(PART_NUMDOC);
 | |
|       _protiva = _partite->get_long(PART_PROTIVA);
 | |
|       *_descrizione = _partite->get(PART_DESCR); 
 | |
|       if (_descrizione->items() == 0)  // Se sulla partita non c'e' descrizione
 | |
|       {                                // allora va leggerla sulla causale.
 | |
|         _caus->zero(); _caus->put(CAU_CODCAUS,_partite->get(PART_CODCAUS));
 | |
|         if (_caus->read() == NOERR) 
 | |
|           *_descrizione = _caus->get(CAU_DESCR); 
 | |
|       }
 | |
|     }              
 | |
|     _pagsca->zero();
 | |
|     _pagsca->put(PAGSCA_TIPOC,tipoc);  _pagsca->put(PAGSCA_GRUPPO,gruppo);
 | |
|     _pagsca->put(PAGSCA_CONTO,conto);  _pagsca->put(PAGSCA_SOTTOCONTO,codcf);
 | |
|     _pagsca->put(PAGSCA_ANNO,annop);   _pagsca->put(PAGSCA_NUMPART,nump);
 | |
|     _pagsca->put(PAGSCA_NRIGA,nrigap); _pagsca->put(PAGSCA_NRATA,nratap);
 | |
|     calcola_pagamenti(imp_scad, imp_pag, imp_res);
 | |
|     _annopart.format("%d",annop);
 | |
|     _annopart.ltrim(2);
 | |
|     _rimdir="";
 | |
|     _riba="";
 | |
|     _altri="";
 | |
|     _imp_pag=imp_pag.string(".");
 | |
|     _imp_scad=imp_scad.string(".");
 | |
|     switch (tipo_pag)
 | |
|     {
 | |
|       case 1:     // Rimesse dirette
 | |
|         if (imp_res != 0) _rimdir=imp_res.string(".");
 | |
|         break;
 | |
|       case 2:     // ri.ba / Tratte
 | |
|       case 3:
 | |
|       case 7:
 | |
|         if (imp_res != 0) _riba=imp_res.string(".");
 | |
|         break;
 | |
|       default:        // Altri
 | |
|         if (imp_res != 0) _altri=imp_scad.string(".");
 | |
|         break;
 | |
|     }
 | |
|   }           
 | |
| 
 | |
|   if (file==LF_CLIFO)
 | |
|     *_ragsoc = rclifo.get(CLI_RAGSOC);
 | |
| 
 | |
|   if (file ==LF_PCON)
 | |
|     *_des_conto = rpcon.get(PCN_DESCR);
 | |
| 
 | |
|   // Se l'ordinamento principale e' per data scadenza stampa il totale del giorno e del mese
 | |
|   if (_ordata && !_end_printed)                   
 | |
|     if ((file == LF_SCADENZE && _tipost == tutti) ||
 | |
|         (file == LF_PCON && _tipost == altri) ||
 | |
|         (file ==LF_CLIFO && (_tipost == clienti || _tipost == fornitori)))
 | |
|       {   
 | |
|         if (_cur_data != botime && _cur_data != datascad) 
 | |
|         {
 | |
|           // Se la data di scadenza e' cambiata e non e' il primo record della relazione
 | |
|           // allora stampa i totali del giorno. 
 | |
|           // Controlla poi se e' cambiato il mese, in caso affermativo stampa anche i 
 | |
|           // totali del mese e lo schema riepilogativo mensile
 | |
|           bool month_changed = _cur_data.month() != datascad.month();
 | |
|           
 | |
|           for (int n=1; n<MaxRowsForTotal; n++) reset_row(n);
 | |
|           n=1;
 | |
|           set_row(n++,"");
 | |
|           switch (_tipost)
 | |
|           {
 | |
|             case tutti:     
 | |
|               print_totali_tutti(n,month_changed,FALSE);
 | |
|               set_page_tutti(n);
 | |
|             break;
 | |
|             case clienti:
 | |
|             case fornitori:
 | |
|               print_totali_clifo(n,month_changed,FALSE);
 | |
|               set_page_clifo(n);
 | |
|             break;
 | |
|             case altri:
 | |
|               print_totali_pcon(n,month_changed,FALSE);
 | |
|               set_page_pcon(n);
 | |
|             break;
 | |
|           }
 | |
|           _modified=TRUE;
 | |
|           // Azzera i totali del giorno in ogni caso.
 | |
|           _tg_imp_pag  =  0;
 | |
|           _tg_imp_scad =  0;
 | |
|           _tg_rim_dir  =  0;
 | |
|           _tg_riba     =  0;
 | |
|           _tg_altri    =  0;
 | |
|           // Controlla se e' cambiato il mese azzera i relativi totali 
 | |
|           if (month_changed)
 | |
|           {  
 | |
|             _tm_imp_pag  = 0;
 | |
|             _tm_imp_scad = 0;
 | |
|             _tm_rim_dir  = 0;
 | |
|             _tm_riba     = 0;
 | |
|             _tm_altri    = 0;
 | |
|           }
 | |
|         }
 | |
|         // In ogni caso deve aggiornare tutti i totali con i valori del record appena letto
 | |
|         _tg_imp_pag  += imp_pag;
 | |
|         _tg_imp_scad += imp_scad;
 | |
|         _tm_imp_pag  += imp_pag;
 | |
|         _tm_imp_scad += imp_scad;
 | |
|         _tp_imp_pag  += imp_pag;
 | |
|         _tp_imp_scad += imp_scad;
 | |
|         switch (tipo_pag)
 | |
|         {
 | |
|           case 1:  
 | |
|             _tg_rim_dir += imp_res;
 | |
|             _tm_rim_dir += imp_res;
 | |
|             _tp_rim_dir += imp_res;
 | |
|           break;
 | |
|           case 2:  
 | |
|           case 3:
 | |
|           case 7:
 | |
|             _tg_riba += imp_res;
 | |
|             _tm_riba += imp_res;
 | |
|             _tp_riba += imp_res;
 | |
|           break;
 | |
|           default:            
 | |
|             _tg_altri += imp_res;
 | |
|             _tm_altri += imp_res;
 | |
|             _tp_altri += imp_res;
 | |
|           break;
 | |
|         }
 | |
|         _cur_data = datascad;
 | |
|      }      
 | |
|   // Qui stampa il totale generale e lo specchietto colonnello.
 | |
|   // Vale con l'ordinamento principale per data di scadenza.
 | |
|   // N.B viene eseguito solo come ultimo blocco, grazie ad una REPEAT_PAGE in postprocess_print()
 | |
|   if (_end_printed && file == LF_SCADENZE && _ordata)
 | |
|   {
 | |
|     reset_print();
 | |
|     int n=1;
 | |
|     set_row(n++,"");
 | |
|     switch (_tipost)
 | |
|     {
 | |
|       case tutti:     
 | |
|         print_totali_tutti(n,TRUE,TRUE);
 | |
|       break;
 | |
|       case clienti:
 | |
|       case fornitori:
 | |
|         print_totali_clifo(n,TRUE,TRUE);
 | |
|       break;
 | |
|       case altri:
 | |
|         print_totali_pcon(n,TRUE,TRUE);
 | |
|       break;
 | |
|     }
 | |
|   }   
 | |
|   // Qui stampa il totale di ogni cli/fo o conto, nel caso che l'ordinamento
 | |
|   // primario non sia per data di scadenza
 | |
|   if (!_ordata && !_end_printed && file!=LF_SCADENZE)  
 | |
|   {
 | |
|     int n;
 | |
|     // Vale anche con ordinamento primario per descrizione o ragione sociale: se essa cambia
 | |
|     // cambia anche il trio Gr/Co/So.
 | |
|     if ((_cur_gr != -1 && _cur_gr != gruppo) ||
 | |
|         (_cur_co != -1 && _cur_co != conto) ||
 | |
|         (_cur_codcf != -1 && _cur_codcf != codcf))
 | |
|     { 
 | |
|       for (n=1; n<MaxRowsForTotal; n++) reset_row(n);
 | |
|       n=1;
 | |
|       set_row(n++,"");
 | |
|       if (_tipost == altri)
 | |
|       {
 | |
|         print_totali_pcon_c(n,FALSE);
 | |
|         set_page_pcon(n);
 | |
|       }
 | |
|       else
 | |
|       {
 | |
|         print_totali_clifo_c(n,FALSE);
 | |
|         set_page_clifo(n);
 | |
|       }
 | |
|       _modified=TRUE;
 | |
|       _tp_imp_scad=0;
 | |
|       _tp_imp_pag=0;
 | |
|       _tp_rim_dir=0;
 | |
|       _tp_riba=0;
 | |
|       _tp_altri=0;
 | |
|     }                                    
 | |
|     _cur_gr=gruppo;
 | |
|     _cur_co=conto;
 | |
|     _cur_codcf=codcf;
 | |
|     // Tiene aggiornati i totali per cli/fo/conto e generale.
 | |
|     _tp_imp_scad += imp_scad;
 | |
|     _tg_imp_scad += imp_scad;
 | |
|     _tp_imp_pag  += imp_pag;
 | |
|     _tg_imp_pag  += imp_pag;
 | |
|     switch (tipo_pag)
 | |
|     {
 | |
|       case 1:  
 | |
|         _tg_rim_dir += imp_res;
 | |
|         _tp_rim_dir += imp_res;
 | |
|       break;
 | |
|       case 2:  
 | |
|       case 3:
 | |
|       case 7:
 | |
|         _tg_riba += imp_res;
 | |
|         _tp_riba += imp_res;
 | |
|       break;
 | |
|       default:            
 | |
|         _tg_altri += imp_res;
 | |
|         _tp_altri += imp_res;
 | |
|       break; 
 | |
|     }
 | |
|   }
 | |
|   // Qui stampa il totale generale e lo schema riepilogativo.
 | |
|   // Vale con l'ordinamento principale per codice/descrizione/ragione sociale.
 | |
|   // N.B viene eseguito solo come ultime blocco, grazie ad una REPEAT_PAGE in postprocess_print()
 | |
|   if (_end_printed && file == LF_SCADENZE && !_ordata)
 | |
|   {                              
 | |
|     int n=1;
 | |
|     set_row(n++,"");                         
 | |
|     // Il confronto posso farlo solo su clienti/fornitori/altri, anche perche'
 | |
|     // per tutti e' obbligatorio l'ordinamento principale per data.
 | |
|     if (_tipost == altri)
 | |
|         print_totali_pcon_c(n,TRUE);
 | |
|     else // e' per forza sul cli/fo!
 | |
|         print_totali_clifo_c(n,TRUE);
 | |
|   }
 | |
|   return TRUE;
 | |
| }
 | |
| 
 | |
| bool TStampaScadenzario::preprocess_print(int file, int counter)
 | |
| { 
 | |
|   return TRUE;
 | |
| }
 | |
|               
 | |
| print_action TStampaScadenzario::postprocess_print(int file, int counter)
 | |
| {  
 | |
|   print_action rt = NEXT_PAGE;            
 | |
|   // Setta _end_printed e ripete la pagina. Questa condizione puo' accadere
 | |
|   // solo alla fine dei record di LF_SCADENZE, percio' solo dopo aver stampato
 | |
|   // tutti gli altri; sia per LF_CLIFO che per LF_PCON, purche' LF_SCADENZE 
 | |
|   // sia sempre il file principale della relazione e dell'albero di stampa.
 | |
|   // Ritornando REPEAT_PAGE resettera' le righe di stampa, e all'interno della
 | |
|   // preprocess_page formera' le righe dei riepiloghi finali.
 | |
|   // Se LF_PCON o LF_CLIFO sono i file principali della relazione e' necessario aggiungere
 | |
|   // una seconda condzione, valevole solamente se l'ordine principale non e' per data scadenza.
 | |
|   if (!_end_printed)      // Se non e' ancora stato stampato il totale generale...
 | |
|     if ((file == LF_SCADENZE)) //&& _ordata) || (file !=LF_SCADENZE && !_ordata))
 | |
|     {             
 | |
|       rt = REPEAT_PAGE;
 | |
|       _end_printed = TRUE;
 | |
|     }
 | |
|   return rt;
 | |
| }
 | |
| 
 | |
| print_action TStampaScadenzario::postprocess_page(int file, int counter)
 | |
| {   
 | |
|   if (_modified)
 | |
|     reset_print();
 | |
|   return NEXT_PAGE;
 | |
| }
 | |
| 
 | |
| bool TStampaScadenzario::user_create()
 | |
| {                                                
 | |
|   _rel1 = new TRelation(LF_SCADENZE);           // Scadenze per data scadenza + CliFo (Codice & Ragione sociale)
 | |
|   _rel1->add(LF_CLIFO,"TIPOCF=TIPOC|CODCF=SOTTOCONTO",1,0,SCADCLIFO_ALIAS);
 | |
|   _cur1 = add_cursor(new TSorted_cursor(_rel1,"DATASCAD|SOTTOCONTO","",2));
 | |
|   // Per data scadenza + ragione sociale e' necessario un TSorted_cursor con update del file collegato:
 | |
|   _cur11 = add_cursor(new TSorted_cursor(_rel1,"DATASCAD|UPPER(20->RAGSOC)","",2));
 | |
|   
 | |
|   // Scadenze per CliFo (Codice & Ragione sociale) + data scadenza
 | |
|   _cur2 = add_cursor(new TSorted_cursor(_rel1,"SOTTOCONTO|DATASCAD|ANNO|NUMPART|NRIGA|NRATA","",2)); 
 | |
|   _cur3 = add_cursor(new TSorted_cursor(_rel1,"UPPER(20->RAGSOC)|DATASCAD|ANNO|NUMPART|NRIGA|NRATA","",2));
 | |
|   
 | |
|   _rel2 = new TRelation(LF_SCADENZE);           // Scadenze per data scadenza + piano dei conti (Codice & Descrizione)
 | |
|   _rel2->add(LF_PCON,"GRUPPO=GRUPPO|CONTO=CONTO|SOTTOCONTO=SOTTOCONTO",1,0,SCADPCON_ALIAS);
 | |
|   _cur4 = add_cursor(new TSorted_cursor(_rel2,"DATASCAD|GRUPPO|CONTO|SOTTOCONTO","",2)); 
 | |
|   // Per data scadenza + descrizione e' necessario un TSorted_cursor con update del file collegato:
 | |
|   _cur41 = add_cursor(new TSorted_cursor(_rel2,"DATASCAD|UPPER(19->DESCR)","",2));
 | |
|   
 | |
|   // Scadenze per Conti (Codice & descrizione) + data scadenza 
 | |
|   _cur5 = add_cursor(new TSorted_cursor(_rel2,"GRUPPO|CONTO|SOTTOCONTO|DATASCAD|ANNO|NUMPART|NRIGA|NRATA","",2)); 
 | |
|   _cur6 = add_cursor(new TSorted_cursor(_rel2,"UPPER(19->DESCR)|DATASCAD|ANNO|NUMPART|NRIGA|NRATA","",2));
 | |
|   
 | |
|   _rel3 = new TRelation(LF_SCADENZE);           // Scadenze (Tutte) per data scadenza
 | |
|   _cur7 = add_cursor(new TCursor(_rel3,"",2));
 | |
|   
 | |
|   _partite = new TLocalisamfile(LF_PARTITE);  
 | |
|   _pagsca  = new TLocalisamfile(LF_PAGSCA);
 | |
|   _caus    = new TLocalisamfile(LF_CAUSALI);
 | |
|   _descrizione = new TParagraph_string("",25);
 | |
|   _ragsoc = new TParagraph_string("",30);
 | |
|   _des_conto = new TParagraph_string("",25);
 | |
|   
 | |
|   enable_print_menu();               
 | |
|   return TRUE;
 | |
| }
 | |
| 
 | |
| bool TStampaScadenzario::user_destroy()
 | |
| {
 | |
| // 
 | |
| // Color che di Printapp conoscon nulla,
 | |
| // evitar, dovrebber, il delete che trastulla
 | |
| // onde la nausea, ch'assale il tuo fardello,
 | |
| // mejo la new lasciar nel suo castello.
 | |
| //
 | |
| // Nota del traduttore:
 | |
| // Mai fare la delete di un cursore usato
 | |
| // dalla printapp, poiche' e' lei stessa che
 | |
| // effettua tale operazione nella propria destroy().
 | |
| // 
 | |
|   if (_rel1)  delete _rel1;
 | |
|   if (_rel2)  delete _rel2;
 | |
|   if (_rel3)  delete _rel3;
 | |
|   if (_cs)    delete _cs;
 | |
|   if (_c)     delete _c;
 | |
|   if (_r)     delete _r;
 | |
|   if (_partite) 
 | |
|     delete _partite;  
 | |
|   if (_pagsca)
 | |
|     delete _pagsca;
 | |
|   if (_caus)
 | |
|     delete _caus;
 | |
|   if (_descrizione)
 | |
|     delete _descrizione;
 | |
|   if (_des_conto)
 | |
|     delete _des_conto;
 | |
|   if (_ragsoc)
 | |
|     delete _ragsoc;
 | |
| 
 | |
|   return TRUE;
 | |
| }
 | |
| 
 | |
| bool TStampaScadenzario::set_print(int)
 | |
| { 
 | |
|   bool rt=FALSE,ok=FALSE;
 | |
|   KEY t;
 | |
|   TMask m("sc2200a");
 | |
|   m.set_handler(SC21_BUT_SEL,but_sel_handler);
 | |
|   while (!ok)  
 | |
|   {
 | |
|     if ((t=m.run())==K_ENTER)
 | |
|     {       
 | |
|       if (_tipost != _tipostpr || _ordcod != _ordcodpr)
 | |
|         error_box("E' stato cambiato il tipo di stampa. Effettuare di nuovo la selezione.");
 | |
|       else 
 | |
|         if ( !_cs->checked())
 | |
|           error_box("Non e' stato effettuata alcuna selezione.");
 | |
|         else 
 | |
|           ok=TRUE;
 | |
|     }
 | |
|     else ok=TRUE;
 | |
|   }
 | |
|   
 | |
|   switch (t)
 | |
|   {        
 | |
|    case K_ENTER:
 | |
|    {
 | |
|     _end_printed = FALSE;
 | |
|     reset_files();
 | |
|     reset_print();
 | |
|     // Inizializza i membri necessari al calcolo totali nel caso sia stato scelto l'ordine
 | |
|     // primario secondo la data di scadenza.  
 | |
|     _cur_data = botime;                                                    
 | |
|     _tg_imp_scad = 0;_tg_imp_pag = 0;_tg_rim_dir = 0;_tg_riba = 0;_tg_altri = 0;
 | |
|     _tm_imp_scad = 0;_tm_imp_pag = 0;_tm_rim_dir = 0;_tm_riba = 0;_tm_altri = 0;
 | |
|     _tp_imp_scad = 0;_tp_imp_pag = 0;_tp_rim_dir = 0;_tp_riba = 0;_tp_altri = 0;
 | |
|     // Inizializza i membri necessari al calcolo totali nel caso sia stato scelto l'ordine 
 | |
|     // primario per codice/gr.co.so. ragione sociale/descrizione
 | |
|     _cur_codcf      = -1;
 | |
|     _cur_gr=_cur_co = -1;
 | |
|     // Per calcolare i totali nel caso l'ordine primario non sia per data scadenze
 | |
|     // utilizzera' le variabili _tg_* per il totale generale e _tp_* per i singoli totali.
 | |
|     // E' necessario resettare anche queste TParagraph_string... Puo' servire in futuro...
 | |
|     *_ragsoc      = "";
 | |
|     *_des_conto   = "";                                                                   
 | |
|     *_descrizione = "";
 | |
|     _ratesald = m.get_bool(F_RATESALDATE);
 | |
|     _ordata   = m.get_bool(F_ORDDATA);
 | |
|     _datai    = (const char *)(m.get(F_DATASCADENZAI));
 | |
|     _dataf    = (const char *)(m.get(F_DATASCADENZAF));
 | |
|     _datas    = (const char *)(m.get(F_DATASTAMPA));
 | |
| 
 | |
|     // N.B I cursori sono tutti TSorted_cursor; alcuni di questi(_cur11 e _cur41) referenziano a campi di sort
 | |
|     // presenti anche su altri file (LF_CLIFO o LF_PCON), percio' e' necessario che il metodo filtercursor() 
 | |
|     // (v. TCursor o TSorted_cursor) forzi un update della relazione ad ogni record che viene processato.
 | |
|     // I cursori 1,2,4 e 6 sono TSorted_cursor anch'essi, siccome la funzione di filtro deve reperire il nr.
 | |
|     // di record del file inerente alla selezione, e' necessario fare l'update ogni volta.
 | |
|     // I cursori hanno tutti la stessa funzione di filtro, per la stampa della rate saldate.
 | |
|     // L'unico TCursor e' _cur7, poiche' e' utilizzato per stampare solo i record di LF_SCADENZE.
 | |
|     get_cursor(_cur1)->set_filterfunction(filter_func,TRUE); // Cursore 1: Datascad + Clifo (codice)
 | |
|     get_cursor(_cur11)->set_filterfunction(filter_func,TRUE);// Cursore 1.1: Datascad + Clifo (ragione sociale) 
 | |
|     get_cursor(_cur2)->set_filterfunction(filter_func,TRUE); // Cursore 2: Clifo(codice) + Datascad
 | |
|     get_cursor(_cur3)->set_filterfunction(filter_func,TRUE); // Cursore 3: Clifo(ragione sociale) + Datascad
 | |
|     get_cursor(_cur4)->set_filterfunction(filter_func,TRUE); // Cursore 4: Datascad + PCon  (codice)
 | |
|     get_cursor(_cur41)->set_filterfunction(filter_func,TRUE);// Cursore 4.1: Datascad + PCon (descrizione)
 | |
|     get_cursor(_cur5)->set_filterfunction(filter_func,TRUE); // Cursore 5: PCon (Codice) + Datascad  
 | |
|     get_cursor(_cur6)->set_filterfunction(filter_func,TRUE); // Cursore 6: PCon (descrizione) + Datascad  
 | |
|     get_cursor(_cur7)->set_filterfunction(filter_func);      // Cursore 7: Datascad
 | |
|     
 | |
|     // Setta l'intervallo di data. Si puo' fare per tutti i cursori, poiche' 
 | |
|     // il file principale e' sempre LF_SCADENZE.
 | |
|     TRectype da_data(LF_SCADENZE), a_data(LF_SCADENZE);
 | |
|     da_data.zero();
 | |
|     a_data.zero();
 | |
|     da_data.put(SCAD_DATASCAD,_datai);
 | |
|     a_data.put(SCAD_DATASCAD,_dataf);
 | |
|     get_cursor(_cur1)->setregion(da_data,a_data);    
 | |
|     get_cursor(_cur11)->setregion(da_data,a_data);
 | |
|     get_cursor(_cur2)->setregion(da_data,a_data); 
 | |
|     get_cursor(_cur3)->setregion(da_data,a_data); 
 | |
|     get_cursor(_cur4)->setregion(da_data,a_data); 
 | |
|     get_cursor(_cur41)->setregion(da_data,a_data);
 | |
|     get_cursor(_cur5)->setregion(da_data,a_data); 
 | |
|     get_cursor(_cur6)->setregion(da_data,a_data); 
 | |
|     get_cursor(_cur7)->setregion(da_data,a_data); 
 | |
|     switch (_tipost)
 | |
|     {       
 | |
|      case tutti:
 | |
|        select_cursor(_cur7);
 | |
|        add_file(LF_SCADENZE);
 | |
|        break;
 | |
|      case clienti:
 | |
|      case fornitori:
 | |
|        if (_ordata)                    // Ordine primario per data
 | |
|        {                               // Controlla l'ordine secondario (codice o ragione sociale)
 | |
|          if (_ordcod)                  // Per codice...
 | |
|          {
 | |
|           select_cursor(_cur1);
 | |
|           if (_tipost==clienti)
 | |
|             get_cursor(_cur1)->setfilter("(TIPOC=\"C\")");
 | |
|           else
 | |
|             get_cursor(_cur1)->setfilter("(TIPOC=\"F\")");  
 | |
|          }
 | |
|          else
 | |
|          {
 | |
|           select_cursor(_cur11);    // Per ragione sociale
 | |
|           if (_tipost==clienti)
 | |
|           get_cursor(_cur11)->setfilter("(TIPOC=\"C\")");
 | |
|           else
 | |
|           get_cursor(_cur11)->setfilter("(TIPOC=\"F\")");  
 | |
|          }
 | |
|        }
 | |
|        else                            // Ordine primario per codice o ragione sociale
 | |
|        {                               
 | |
|          if (_ordcod)                  // Codice...
 | |
|          {
 | |
|            select_cursor(_cur2);               
 | |
|            if (_tipost==clienti)
 | |
|              get_cursor(_cur2)->setfilter("(TIPOC=\"C\")");
 | |
|            else
 | |
|              get_cursor(_cur2)->setfilter("(TIPOC=\"F\")");
 | |
|          }
 | |
|          else                          // Ragione sociale
 | |
|          {
 | |
|            select_cursor(_cur3);
 | |
|            if (_tipost==clienti)
 | |
|              get_cursor(_cur3)->setfilter("(TIPOC=\"C\")");
 | |
|            else
 | |
|              get_cursor(_cur3)->setfilter("(TIPOC=\"F\")");
 | |
|          }
 | |
|        }
 | |
|        add_file(LF_SCADENZE);
 | |
|        add_file(LF_CLIFO,LF_SCADENZE);
 | |
|        break;
 | |
|      case altri:
 | |
|        if (_ordata)                            // Ordine primario per data
 | |
|        {                                       // Controlla l'ordine secondario (Codice o descrizione)
 | |
|          if (_ordcod)                          // Per codice ...
 | |
|          {
 | |
|             select_cursor(_cur4);
 | |
|             get_cursor(_cur4)->setfilter("(TIPOC=\"\")"); // Filtro per i conti normali!
 | |
|          }
 | |
|          else
 | |
|          {
 | |
|             select_cursor(_cur41);            // Per descrizione.
 | |
|             get_cursor(_cur41)->setfilter("(TIPOC=\"\")");
 | |
|          }
 | |
|        }
 | |
|        else                                    // Ordine primario per codice o descrizione
 | |
|        {
 | |
|          if (_ordcod)                          // Codice...
 | |
|          {
 | |
|            select_cursor(_cur5);
 | |
|            get_cursor(_cur5)->setfilter("(TIPOC=\"\")"); // Filtro per i conti normali!
 | |
|          }
 | |
|          else                                  // Descrizione
 | |
|          {
 | |
|            select_cursor(_cur6);
 | |
|            get_cursor(_cur6)->setfilter("(TIPOC=\"\")"); // Filtro per i conti normali!
 | |
|          }
 | |
|        }
 | |
|        add_file(LF_SCADENZE);
 | |
|        add_file(LF_PCON,LF_SCADENZE);
 | |
|        break;
 | |
|      default:
 | |
|       break;
 | |
|     }
 | |
|     rt=TRUE;
 | |
|     break;
 | |
|    }
 | |
|    default:
 | |
|     break;
 | |
|   }
 | |
|   return rt;
 | |
| }                    
 | |
| 
 | |
| void TStampaScadenzario::print_header()
 | |
| // Setta le righe dell'intestazione
 | |
| {
 | |
|   int soh = 1;    
 | |
|   const long firm = get_firm();
 | |
| 
 | |
|   reset_header ();
 | |
|   TLocalisamfile ditte(LF_NDITTE);
 | |
|   ditte.zero();
 | |
|   ditte.put(NDT_CODDITTA, firm);
 | |
|   ditte.read();
 | |
|   if (ditte.bad()) ditte.zero();
 | |
| 
 | |
|   TString s;
 | |
|   s = ditte.get(NDT_RAGSOC);    
 | |
|   TString data = _datas.string();
 | |
|   TString datai = _datai.string();
 | |
|   TString dataf = _dataf.string();
 | |
| 
 | |
|   switch (_tipost)
 | |
|   {
 | |
|    case tutti:
 | |
|    {
 | |
|     TString rw(160);
 | |
|     set_header (soh++, "Ditta : %ld %s@109gData@114g%s  Pag. @#",
 | |
|                firm,  (const char *)s,  (const char *)data);
 | |
|     set_header(soh++, "@57g** SCADENZARIO **");                
 | |
|     set_header (soh++,"@39gPer il periodo dal %s al %s",(const char*)datai,(const char*)dataf);
 | |
|     rw.fill('-');
 | |
|     set_header(soh++, (const char *) rw);
 | |
|     set_header(soh++, "@2gRif.@18gData@27gData@35gData e Nr@45gProt.@77gCd/Tp");
 | |
|     set_header(soh++, "partita@16gscadenza@25gRegistr.@35gDocumento@45gIVA@52gDescrizione"
 | |
|                       "@77gPag.@86gRata@95gImp. in sca.@108gImp. pagati@120gRimesse dir."
 | |
|                       "@133gRi.ba/tratte@148gAltri");
 | |
|     set_header(soh++,(const char *)rw);
 | |
|     break;
 | |
|    }
 | |
|    case fornitori:
 | |
|    case clienti:    
 | |
|    {                           
 | |
|     TString rw(191);
 | |
|     TString s1,s2;
 | |
|     set_header (soh++, "Ditta : %ld %s@148gData@153g%s  Pag. @#",
 | |
|                firm,  (const char *)s,  (const char *)data);
 | |
|     if (_tipost==fornitori)   
 | |
|     {  
 | |
|      set_header(soh++,"@72g** SCADENZARIO FORNITORI **");
 | |
|      s1 = "Ns."; s2 = "Banca";
 | |
|     }
 | |
|     else                   
 | |
|     {
 | |
|      set_header(soh++,"@73g** SCADENZARIO CLIENTI **");
 | |
|      s1 =""; s2 = "";
 | |
|     }
 | |
|     set_header (soh++,"@64gPer il periodo dal %s al %s",(const char*)datai,(const char*)dataf);
 | |
|     rw.fill('-');
 | |
|     set_header(soh++, (const char *) rw);                          
 | |
|     set_header(soh++,"@41gRif.@51gData@60gData@69gData e Nr@79gProt.@110gCd/Tp@123g%s",s1);
 | |
|     set_header(soh++,"Codice@9gRagione sociale@41gpartita@51gscadenza@60gRegistr."
 | |
|                      "@69gDocumento@79gIVA@86gDescrizione@110gPag.@117gRata@123g%s"
 | |
|                      "@134gImp. in sca.@146gImp. pagati@158gRimesse dir.@171Ri.ba./Tratte@186gAltri",s2);
 | |
|     set_header(soh++,(const char *)rw);
 | |
|     break;
 | |
|    }
 | |
|    case altri:   // Piano dei conti
 | |
|    {
 | |
|     TString rw(191);
 | |
|     set_header (soh++, "Ditta : %ld %s@152gData@157g%s  Pag. @#",
 | |
|                firm,  (const char *)s,  (const char *)data);
 | |
|     set_header(soh++,"@79g** SCADENZARIO **");
 | |
|     set_header (soh++,"@66gPer il periodo dal %s al %s",(const char*)datai,(const char*)dataf);
 | |
|     rw.fill('-');
 | |
|     set_header(soh++, (const char *) rw);                    
 | |
|     set_header(soh++,"@47gRif.@56gData@66gData@76gData e Nr@86gProt.@116gCd/Tp");
 | |
|     set_header(soh++,"Gr. Co. So.@16gDescrizione@46gpartita@56gscadenza@66gRegistr."
 | |
|                      "@76gDocumento@86gIVA@92gDescrizione@116gPag.@123gRata@134gImp. in sca.@146gImp. pagati"
 | |
|                      "@158gRimesse dir.@171gRi.ba./Tratte@186gAltri");
 | |
|   
 | |
|     set_header(soh++,(const char *)rw);
 | |
|     break;
 | |
|    }
 | |
|    default:
 | |
|     break;
 | |
|   }
 | |
|   set_header(soh,"");
 | |
| }                          
 | |
| 
 | |
| void TStampaScadenzario::set_page_tutti(int nriga)
 | |
| // Setta le righe per stampare solo le scadenze
 | |
| {
 | |
|   set_row(nriga++,"");
 | |
|   set_row(nriga,"#2t/@7s",&_annopart,FLD(LF_SCADENZE,SCAD_NUMPART));
 | |
|   set_row(nriga,"@16g@d",FLD(LF_SCADENZE,SCAD_DATASCAD));
 | |
|   set_row(nriga,"@25g#t@35g#t@45g#5ld@51g#a",&_datareg,&_datadoc,&_protiva,_descrizione);
 | |
|   set_row(nriga,"@77g@4s/@1n@86g@4n",FLD(LF_SCADENZE,SCAD_CODPAG),FLD(LF_SCADENZE,SCAD_TIPOPAG),
 | |
|           FLD(LF_SCADENZE,SCAD_NRATA));
 | |
|   set_row(nriga,"@90g#12t@102g#12t",&_imp_scad, &_imp_pag); // importi in scadenza per questa rata e pagamenti
 | |
|   set_row(nriga,"@114g#12t",&_rimdir);   // rimesse dirette
 | |
|   set_row(nriga,"@126g#12t",&_riba);     // Ri.ba. / tratte
 | |
|   set_row(nriga++,"@138g#12t",&_altri);  // Altri tipi di pagamento 
 | |
|   set_row(nriga,"@35g#t",&_numdoc);
 | |
| }
 | |
| 
 | |
| void TStampaScadenzario::set_page_clifo(int nriga)
 | |
| // Setta le righe per stampare le scadenze clienti/fornitori
 | |
| {
 | |
|   set_row(nriga++,"");
 | |
|   set_row(nriga,"@6n",FLD(LF_CLIFO,CLI_CODCF));
 | |
|   set_row(nriga,"@9g#a",_ragsoc);
 | |
|   set_row(nriga,"@41g#2t/@7s",&_annopart,FLD(LF_SCADENZE,SCAD_NUMPART));
 | |
|   set_row(nriga,"@51g@d@60g#t",FLD(LF_SCADENZE,SCAD_DATASCAD),&_datareg);
 | |
|   set_row(nriga,"@69g#t@78g#5ld@85g#a",&_datadoc,&_protiva,_descrizione);
 | |
|   set_row(nriga,"@110g@4s/@1n@117g@4n",FLD(LF_SCADENZE,SCAD_CODPAG),FLD(LF_SCADENZE,SCAD_TIPOPAG),
 | |
|           FLD(LF_SCADENZE,SCAD_NRATA));
 | |
|   if (_tipost == fornitori)
 | |
|     set_row(nriga,"@123g@5pn",FLD(LF_SCADENZE,SCAD_CODABIPR,"@@@@@"));
 | |
|   set_row(nriga,"@129g#12t@141g#12t",&_imp_scad, &_imp_pag);
 | |
|   set_row(nriga,"@153g#12t",&_rimdir);    // rimesse dirette
 | |
|   set_row(nriga,"@166g#12t",&_riba);      // Ri.ba. / tratte
 | |
|   set_row(nriga++,"@178g#12t",&_altri);   // Altri tipi di pagamento
 | |
|   set_row(nriga,"@69g#t",&_numdoc);
 | |
| }
 | |
| 
 | |
| void TStampaScadenzario::set_page_pcon(int nriga)
 | |
| // Setta le righe per stampare le scadenze degli altri conti. 
 | |
| {
 | |
|   set_row(nriga++,"");
 | |
|   set_row(nriga,"@3n@5g@3n@9g@6n",FLD(LF_PCON,PCN_GRUPPO),FLD(LF_PCON,PCN_CONTO),
 | |
|           FLD(LF_PCON,PCN_SOTTOCONTO));
 | |
|   set_row(nriga,"@16g#a",_des_conto);
 | |
|   set_row(nriga,"@46g#2t/@7s",&_annopart,FLD(LF_SCADENZE,SCAD_NUMPART));
 | |
|   set_row(nriga,"@56g@d@66g#t",FLD(LF_SCADENZE,SCAD_DATASCAD),&_datareg);
 | |
|   set_row(nriga,"@76g#t@86g#5ld@92g#a",&_datadoc,&_protiva,_descrizione);
 | |
|   set_row(nriga,"@117g@4s/@1n@123g@4n",FLD(LF_SCADENZE,SCAD_CODPAG),FLD(LF_SCADENZE,SCAD_TIPOPAG),
 | |
|           FLD(LF_SCADENZE,SCAD_NRATA));
 | |
|   set_row(nriga,"@129g#12t@141g#12t",&_imp_scad, &_imp_pag);
 | |
|   set_row(nriga,"@153g#12t",&_rimdir);    // rimesse dirette
 | |
|   set_row(nriga,"@166g#12t",&_riba);      // Ri.ba. / tratte
 | |
|   set_row(nriga++,"@178g#12t",&_altri);   // Altri tipi di pagamento
 | |
|   set_row(nriga,"@76g#t",&_numdoc);
 | |
| }
 | |
| 
 | |
| void TStampaScadenzario::set_page(int file, int counter)
 | |
| { 
 | |
|   int nriga =1;                    
 | |
|   print_header();
 | |
|   switch (_tipost)
 | |
|   {
 | |
|    case tutti: // In questo caso l'unico file che manda in stampa e' LF_SCADENZE
 | |
|        set_page_tutti(nriga);
 | |
|        break;
 | |
|    case fornitori:
 | |
|    case clienti:
 | |
|         if ((file == LF_CLIFO)) //&& _ordata) || (!_ordata && file == LF_SCADENZE))
 | |
|           set_page_clifo(nriga);
 | |
|         break;
 | |
|    case altri:
 | |
|       if ((file == LF_PCON)) //&& _ordata) || (!_ordata && file == LF_SCADENZE))
 | |
|           set_page_pcon(nriga);
 | |
|         break;
 | |
|    default:
 | |
|         break;
 | |
|   }
 | |
| }
 | |
| 
 | |
| void TStampaScadenzario::print_riepilogo(int &nriga, bool type)
 | |
| // Setta le righe di stampa per lo schema riepilogativo con ordinamento primario per data
 | |
| // Con type == 1 stampa il riepilogo del periodo; viceversa quello del mese.
 | |
| {                 
 | |
|   TString s(56);       
 | |
|   real totale;
 | |
|   
 | |
|   s.fill('-');                                   
 | |
|   set_row(nriga++,"%s",(const char *)s);
 | |
|   if (!type)
 | |
|   {
 | |
|     set_row(nriga,"@2g%s",itom(_cur_data.month()));
 | |
|     if (_tm_rim_dir != 0)
 | |
|       set_row(nriga++,"@0g!@13g!@14gRimesse dirette@34g!@40g%12s@55g!",_tm_rim_dir.string("."));
 | |
|     if (_tm_riba != 0)
 | |
|       set_row(nriga++,"@0g!@13g!@14gRicevute bancarie@34g!@40g%12s@55g!",_tm_riba.string("."));
 | |
|     if (_tm_altri != 0)
 | |
|       set_row(nriga++,"@0g!@13g!@14gAltri tipi di pag.@34g!@40g%12s@55g!",_tm_altri.string("."));
 | |
|     set_row(nriga++,"%s",(const char *)s);
 | |
|     totale = _tm_rim_dir + _tm_riba + _tm_altri;
 | |
|     set_row(nriga++,"!@40g%12s@55g!",totale.string("."));
 | |
|   } else
 | |
|     {
 | |
|       set_row(nriga,"!@5gTotali dal %s al ",_datai.string(brief));
 | |
|       set_row(nriga++,"%s@55g!",_dataf.string(brief));
 | |
|       set_row(nriga++,"%s",(const char *)s);
 | |
|       if (_tp_rim_dir != 0)
 | |
|         set_row(nriga++,"!@11g!@14gRimesse dirette@34g!@40g%12s@55g!",_tp_rim_dir.string("."));
 | |
|       if (_tp_riba != 0)
 | |
|         set_row(nriga++,"!@11g!@14gRicevute bancarie@34g!@40g%12s@55g!",_tp_riba.string("."));
 | |
|       if (_tp_altri != 0)
 | |
|         set_row(nriga++,"!@11g!@14gAltri tipi di pag.@34g!@40g%12s@55g!",_tp_altri.string("."));
 | |
|       set_row(nriga++,"%s",(const char *)s);   
 | |
|       totale = _tp_rim_dir + _tp_riba + _tp_altri;
 | |
|       set_row(nriga++,"!@40g%12s@55g!",totale.string("."));
 | |
|     }
 | |
|   set_row(nriga++,"%s",(const char *)s);   
 | |
| }
 | |
| 
 | |
| void TStampaScadenzario::print_totali_tutti(int &nriga, bool month_changed, bool ended)
 | |
| // Setta le righe per stampare i totali (giorno e mese) delle sole scadenze
 | |
| // Ordinamento primario per data!
 | |
| {
 | |
|   set_row(nriga,"** TOTALI DEL @16g%s",_cur_data.string(brief));
 | |
|   if (_tg_imp_scad != 0)
 | |
|     set_row(nriga,"@90g%12s",_tg_imp_scad.string("."));
 | |
|   if (_tg_imp_pag != 0)
 | |
|     set_row(nriga,"@102g%12s",_tg_imp_pag.string("."));
 | |
|   if (_tg_rim_dir != 0)
 | |
|     set_row(nriga,"@114g%12s",_tg_rim_dir.string("."));
 | |
|   if (_tg_riba != 0)
 | |
|     set_row(nriga,"@126g%12s",_tg_riba.string("."));
 | |
|   if (_tg_altri != 0)
 | |
|     set_row(nriga,"@138g%12s",_tg_altri.string("."));
 | |
|   nriga++;
 | |
|   set_row(nriga++,"");                           
 | |
|   if (month_changed)
 | |
|   {
 | |
|     set_row(nriga,"** TOTALI DI %s",itom(_cur_data.month()));
 | |
|     if (_tm_imp_scad != 0)
 | |
|       set_row(nriga,"@90g%12s",_tm_imp_scad.string("."));
 | |
|     if (_tm_imp_pag != 0)
 | |
|       set_row(nriga,"@102g%12s",_tm_imp_pag.string("."));
 | |
|     if (_tm_rim_dir != 0)
 | |
|       set_row(nriga,"@114g%12s",_tm_rim_dir.string("."));
 | |
|     if (_tm_riba != 0)
 | |
|       set_row(nriga,"@126g%12s",_tm_riba.string("."));
 | |
|     if (_tm_altri != 0)
 | |
|       set_row(nriga,"@138g%12s",_tm_altri.string("."));
 | |
|     nriga++;
 | |
|     set_row(nriga++,"");  
 | |
|     print_riepilogo(nriga,FALSE);                           
 | |
|   }  
 | |
|   if (ended)
 | |
|   {
 | |
|     set_row(nriga++,"");
 | |
|     set_row(nriga,"** TOTALI PERIODO");
 | |
|     if (_tp_imp_scad != 0)
 | |
|       set_row(nriga,"@90g%12s",_tp_imp_scad.string("."));
 | |
|     if (_tp_imp_pag != 0)
 | |
|       set_row(nriga,"@102g%12s",_tp_imp_pag.string("."));
 | |
|     if (_tp_rim_dir != 0)
 | |
|       set_row(nriga,"@114g%12s",_tp_rim_dir.string("."));
 | |
|     if (_tp_riba != 0)
 | |
|       set_row(nriga,"@126g%12s",_tp_riba.string("."));
 | |
|     if (_tp_altri != 0)
 | |
|       set_row(nriga,"@138g%12s",_tp_altri.string("."));
 | |
|     nriga++;
 | |
|     set_row(nriga++,"");               
 | |
|     print_riepilogo(nriga,TRUE);
 | |
|   }
 | |
| }
 | |
| 
 | |
| void TStampaScadenzario::print_totali_clifo(int &nriga, bool month_changed, bool ended)
 | |
| // Setta le righe per stampare i totali (giorno e mese) delle scadenze clienti/fornitori
 | |
| // Ordinamento primario per data!
 | |
| {
 | |
|   set_row(nriga,"@36g** TOTALI DEL @51g%s",_cur_data.string(brief));
 | |
|   if (_tg_imp_scad != 0)
 | |
|     set_row(nriga,"@129g%12s",_tg_imp_scad.string("."));
 | |
|   if (_tg_imp_pag != 0)
 | |
|     set_row(nriga,"@141g%12s",_tg_imp_pag.string("."));
 | |
|   if (_tg_rim_dir != 0)
 | |
|     set_row(nriga,"@153g%12s",_tg_rim_dir.string("."));
 | |
|   if (_tg_riba != 0)
 | |
|     set_row(nriga,"@166g%12s",_tg_riba.string("."));
 | |
|   if (_tg_altri != 0)                  
 | |
|     set_row(nriga,"@178g%12s",_tg_altri.string("."));
 | |
|   nriga++;
 | |
|   set_row(nriga++,"");
 | |
|   if (month_changed)
 | |
|   {
 | |
|     set_row(nriga,"@36g** TOTALI DI @51g%s",itom(_cur_data.month()));
 | |
|     if (_tm_imp_scad != 0)
 | |
|       set_row(nriga,"@129g%12s",_tm_imp_scad.string("."));
 | |
|     if (_tm_imp_pag != 0)
 | |
|       set_row(nriga,"@141g%12s",_tm_imp_pag.string("."));
 | |
|     if (_tm_rim_dir != 0)
 | |
|       set_row(nriga,"@153g%12s",_tm_rim_dir.string("."));
 | |
|     if (_tm_riba != 0)
 | |
|       set_row(nriga,"@166g%12s",_tm_riba.string("."));
 | |
|     if (_tm_altri != 0)
 | |
|       set_row(nriga,"@1789g%12s",_tm_altri.string("."));
 | |
|     nriga++;
 | |
|     set_row(nriga++,"");
 | |
|     print_riepilogo(nriga,FALSE);                           
 | |
|   }  
 | |
|   if (ended)
 | |
|   {
 | |
|     set_row(nriga++,"");
 | |
|     set_row(nriga,"@36g** TOTALI PERIODO");
 | |
|     if (_tp_imp_scad != 0)
 | |
|       set_row(nriga,"@129g%12s",_tp_imp_scad.string("."));
 | |
|     if (_tp_imp_pag != 0)
 | |
|       set_row(nriga,"@141g%12s",_tp_imp_pag.string("."));
 | |
|     if (_tp_rim_dir != 0)
 | |
|       set_row(nriga,"@153g%12s",_tp_rim_dir.string("."));
 | |
|     if (_tp_riba != 0)
 | |
|       set_row(nriga,"@166g%12s",_tp_riba.string("."));
 | |
|     if (_tp_altri != 0)       
 | |
|       set_row(nriga,"@178g%12s",_tp_altri.string("."));
 | |
|     nriga++;
 | |
|     set_row(nriga++,"");               
 | |
|     print_riepilogo(nriga,TRUE);
 | |
|   }
 | |
| }
 | |
| 
 | |
| void TStampaScadenzario::print_totali_pcon(int &nriga, bool month_changed, bool ended)
 | |
| // Setta le righe per stampare i totali (giorno e mese) delle scadenze degli altri conti
 | |
| // Ordinamento primario per data!
 | |
| {
 | |
|   set_row(nriga,"@41g** TOTALI DEL @56g%s",_cur_data.string(brief));
 | |
|   if (_tg_imp_scad != 0)
 | |
|     set_row(nriga,"@129g%12s",_tg_imp_scad.string("."));
 | |
|   if (_tg_imp_pag != 0)
 | |
|     set_row(nriga,"@141g%12s",_tg_imp_pag.string("."));
 | |
|   if (_tg_rim_dir != 0)
 | |
|     set_row(nriga,"@153g%12s",_tg_rim_dir.string("."));
 | |
|   if (_tg_riba != 0)
 | |
|     set_row(nriga,"@166g%12s",_tg_riba.string("."));
 | |
|   if (_tg_altri != 0)
 | |
|     set_row(nriga,"@178g%12s",_tg_altri.string("."));
 | |
|   nriga++;
 | |
|   set_row(nriga++,"");
 | |
|   if (month_changed)
 | |
|   {
 | |
|     set_row(nriga,"@41g** TOTALI DI @56g%s",itom(_cur_data.month()));
 | |
|     if (_tm_imp_scad != 0)
 | |
|       set_row(nriga,"@129g%12s",_tm_imp_scad.string("."));
 | |
|     if (_tm_imp_pag != 0)
 | |
|       set_row(nriga,"@141g%12s",_tm_imp_pag.string("."));
 | |
|     if (_tm_rim_dir != 0)
 | |
|       set_row(nriga,"@153g%12s",_tm_rim_dir.string("."));
 | |
|     if (_tm_riba != 0)
 | |
|       set_row(nriga,"@166g%12s",_tm_riba.string("."));
 | |
|     if (_tm_altri != 0)
 | |
|       set_row(nriga,"@178g%12s",_tm_altri.string("."));
 | |
|     nriga++;
 | |
|     set_row(nriga++,"");
 | |
|     print_riepilogo(nriga,FALSE);
 | |
|   }  
 | |
|   if (ended)
 | |
|   {
 | |
|     set_row(nriga++,"");
 | |
|     set_row(nriga,"@41g** TOTALI PERIODO");
 | |
|     if (_tp_imp_scad != 0)
 | |
|       set_row(nriga,"@129g%12s",_tp_imp_scad.string("."));
 | |
|     if (_tp_imp_pag != 0)
 | |
|       set_row(nriga,"@141g%12s",_tp_imp_pag.string("."));
 | |
|     if (_tp_rim_dir != 0)
 | |
|       set_row(nriga,"@153g%12s",_tp_rim_dir.string("."));
 | |
|     if (_tp_riba != 0)
 | |
|       set_row(nriga,"@166g%12s",_tp_riba.string("."));
 | |
|     if (_tp_altri != 0)    
 | |
|       set_row(nriga,"@178g%12s",_tp_altri.string("."));
 | |
|     nriga++;
 | |
|     set_row(nriga++,"");               
 | |
|     print_riepilogo(nriga,TRUE);
 | |
|   }
 | |
| }
 | |
| 
 | |
| void TStampaScadenzario::print_riepilogo_c(int &nriga, bool type)
 | |
| // Setta le righe di stampa per lo schema riepilogativo con ordinamento primario non per data
 | |
| // Con type == 1 stampa il riepilogo del periodo; viceversa quello del cli/fo/conto
 | |
| {                 
 | |
|   TString s(56);       
 | |
|   real totale;
 | |
|   
 | |
|   s.fill('-');                                   
 | |
|   set_row(nriga++,"%s",(const char *)s);
 | |
|   if (!type)
 | |
|   {
 | |
|     if (_tm_rim_dir != 0)
 | |
|       set_row(nriga++,"@0g!@4gRimesse dirette@34g!@40g%12s@55g!",_tm_rim_dir.string("."));
 | |
|     if (_tm_riba != 0)
 | |
|       set_row(nriga++,"@0g!@4gRicevute bancarie@34g!@40g%12s@55g!",_tm_riba.string("."));
 | |
|     if (_tm_altri != 0)
 | |
|       set_row(nriga++,"@0g!@4gAltri tipi di pag.@34g!@40g%12s@55g!",_tm_altri.string("."));
 | |
|     set_row(nriga++,"%s",(const char *)s);
 | |
|     totale = _tm_rim_dir + _tm_riba + _tm_altri;
 | |
|     set_row(nriga++,"!@40g%12s@55g!",totale.string("."));
 | |
|   } else
 | |
|     {
 | |
|       set_row(nriga,"!@5gTotali dal %s al ",_datai.string(brief));
 | |
|       set_row(nriga++,"%s@55g!",_dataf.string(brief));
 | |
|       set_row(nriga++,"%s",(const char *)s);
 | |
|       if (_tp_rim_dir != 0)
 | |
|         set_row(nriga++,"!@11g!@14gRimesse dirette@34g!@40g%12s@55g!",_tp_rim_dir.string("."));
 | |
|       if (_tp_riba != 0)
 | |
|         set_row(nriga++,"!@11g!@14gRicevute bancarie@34g!@40g%12s@55g!",_tp_riba.string("."));
 | |
|       if (_tp_altri != 0)
 | |
|         set_row(nriga++,"!@11g!@14gAltri tipi di pag.@34g!@40g%12s@55g!",_tp_altri.string("."));
 | |
|       set_row(nriga++,"%s",(const char *)s);   
 | |
|       totale = _tp_rim_dir + _tp_riba + _tp_altri;
 | |
|       set_row(nriga++,"!@40g%12s@55g!",totale.string("."));
 | |
|     }
 | |
|   set_row(nriga++,"%s",(const char *)s);   
 | |
|   set_row(nriga++,"");
 | |
| }
 | |
| 
 | |
| void TStampaScadenzario::print_totali_clifo_c(int &nriga, bool ended)
 | |
| // Setta le righe per stampare i totali delle scadenze clienti/fornitori
 | |
| // Ordinamento primario per codice o ragione sociale!
 | |
| {
 | |
|   if (_tipost==clienti)
 | |
|     set_row(nriga,"@80g** TOTALE CLIENTE");
 | |
|   else
 | |
|     set_row(nriga,"@80g** TOTALE FORNITORE"); 
 | |
|   if (!_tp_imp_scad.is_zero())
 | |
|     set_row(nriga,"@129g%12s",_tp_imp_scad.string("."));
 | |
|   if (!_tp_imp_pag.is_zero())
 | |
|     set_row(nriga,"@141g%12s",_tp_imp_pag.string("."));
 | |
|   if (!_tp_rim_dir.is_zero())
 | |
|     set_row(nriga,"@153g%12s",_tp_rim_dir.string("."));
 | |
|   if (!_tp_riba.is_zero())
 | |
|     set_row(nriga,"@166g%12s",_tp_riba.string("."));
 | |
|   if (!_tp_altri.is_zero())
 | |
|     set_row(nriga,"@178g%12s",_tp_altri.string("."));
 | |
|   nriga++;
 | |
|   set_row(nriga++,"");
 | |
|   print_riepilogo_c(nriga,FALSE);                           
 | |
|   if (ended)
 | |
|   {
 | |
|     set_row(nriga,"@80g** TOTALE GENERALE");
 | |
|     if (!_tg_imp_scad.is_zero())
 | |
|       set_row(nriga,"@129g%12s",_tg_imp_scad.string("."));
 | |
|     if (!_tg_imp_pag.is_zero())
 | |
|       set_row(nriga,"@141g%12s",_tg_imp_pag.string("."));
 | |
|     if (!_tg_rim_dir.is_zero())
 | |
|       set_row(nriga,"@153g%12s",_tg_rim_dir.string("."));
 | |
|     if (!_tg_riba.is_zero())
 | |
|       set_row(nriga,"@166g%12s",_tg_riba.string("."));
 | |
|     if (!_tg_altri.is_zero())
 | |
|       set_row(nriga,"@178g%12s",_tg_altri.string("."));
 | |
|     nriga++;
 | |
|     set_row(nriga++,"");
 | |
|     print_riepilogo_c(nriga,TRUE);
 | |
|   }
 | |
| }
 | |
| 
 | |
| void TStampaScadenzario::print_totali_pcon_c(int &nriga, bool ended)
 | |
| // Setta le righe per stampare i totali delle scadenze degli altri conti
 | |
| // Ordinamento primario per codice o descrizione!
 | |
| {  
 | |
|   set_row(nriga,"@80g** TOTALE CONTO");
 | |
|   if (!_tp_imp_scad.is_zero())
 | |
|     set_row(nriga,"@129g%12s",_tp_imp_scad.string("."));
 | |
|   if (!_tp_imp_pag.is_zero())
 | |
|     set_row(nriga,"@141g%12s",_tp_imp_pag.string("."));
 | |
|   if (!_tp_rim_dir.is_zero())
 | |
|     set_row(nriga,"@153g%12s",_tp_rim_dir.string("."));
 | |
|   if (!_tp_riba.is_zero())
 | |
|     set_row(nriga,"@166g%12s",_tp_riba.string("."));
 | |
|   if (!_tp_altri.is_zero())
 | |
|     set_row(nriga,"@178g%12s",_tp_altri.string("."));
 | |
|   nriga++;  
 | |
|   set_row(nriga++,"");
 | |
|   print_riepilogo_c(nriga,FALSE);
 | |
|   if (ended)
 | |
|   {
 | |
|     set_row(nriga,"@80g** TOTALE GENERALE");
 | |
|     if (!_tg_imp_scad.is_zero())
 | |
|       set_row(nriga,"@129g%12s",_tg_imp_scad.string("."));
 | |
|     if (!_tg_imp_pag.is_zero())
 | |
|       set_row(nriga,"@141g%12s",_tg_imp_pag.string("."));
 | |
|     if (!_tg_rim_dir.is_zero())
 | |
|       set_row(nriga,"@153g%12s",_tg_rim_dir.string("."));
 | |
|     if (!_tg_riba.is_zero())
 | |
|       set_row(nriga,"@166g%12s",_tg_riba.string("."));
 | |
|     if (!_tg_altri.is_zero())
 | |
|       set_row(nriga,"@178g%12s",_tg_altri.string("."));
 | |
|     nriga++;
 | |
|     set_row(nriga++,"");
 | |
|     print_riepilogo_c(nriga,TRUE);
 | |
|   }
 | |
| }
 | |
| 
 | |
| TStampaScadenzario::TStampaScadenzario()
 | |
| {
 | |
|   _rel1=_rel2=_rel3=NULL;
 | |
|   _r=NULL; 
 | |
|   _c=NULL;
 | |
|   _cs=NULL;     
 | |
|   _tipostpr=nessuno;
 | |
| }
 | |
| 
 | |
| int sc2200(int argc, char** argv)
 | |
| {
 | |
|   TStampaScadenzario app;
 | |
|   app.run(argc, argv, "Stampa Scadenzario");    
 | |
|   return 0;
 | |
| }
 |