Patch level : 10.0
Files correlati : cg4.exe Ricompilazione Demo : [ ] Commento : 0001001: Stampa libro iva provvisorio - ripilogo Stampando l'iva acquisti della soc. Sailog (presente nella cartella Ilaria del FTP) per il mese di gennaio, il riepilogo provvisorio (quello definitivo va bene) espone come riepilogo del n.d. 9 2 volte il codice 24. Il totale quadra con la lista fatture con iva indetraibile, dove sono dettagliate 11 fatture con tale aliquota, la 12° ha iva diversa e come numerazione iva è superiore alle altre. Da nessuna delle due stampe riesco a capire la motivazione della spezzettatura del totale. git-svn-id: svn://10.65.10.50/trunk@17793 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									b9cd6aeb64
								
							
						
					
					
						commit
						1736b4644e
					
				@ -129,8 +129,8 @@ public:
 | 
				
			|||||||
  TPrintrow * get_fornitori () ;
 | 
					  TPrintrow * get_fornitori () ;
 | 
				
			||||||
  TPrintrow * get_record_fine_volume (bool) ;
 | 
					  TPrintrow * get_record_fine_volume (bool) ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  long cerca_codice_all(char tipo, long codcf) ;
 | 
					  long cerca_codice_all(char tipo, long codcf) const;
 | 
				
			||||||
  bool corrispettivo (const char * tipodoc);
 | 
					  bool corrispettivo (const char * tipodoc) const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  TStampa_allegati () {}
 | 
					  TStampa_allegati () {}
 | 
				
			||||||
  virtual ~TStampa_allegati () {}
 | 
					  virtual ~TStampa_allegati () {}
 | 
				
			||||||
@ -143,14 +143,14 @@ public:
 | 
				
			|||||||
//
 | 
					//
 | 
				
			||||||
// ----------------------------------------------------------------
 | 
					// ----------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const char* segno (const real& val) 
 | 
					static const char* segno (const real& val) 
 | 
				
			||||||
{ 
 | 
					{ 
 | 
				
			||||||
  if  (val < ZERO) 
 | 
					  if  (val < ZERO) 
 | 
				
			||||||
   return SEGNO_MENO;
 | 
					    return SEGNO_MENO;
 | 
				
			||||||
  return " ";
 | 
					  return " ";
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const char* filler (int size)
 | 
					static const char* filler (int size)
 | 
				
			||||||
{  
 | 
					{  
 | 
				
			||||||
  static TString_array _fill;
 | 
					  static TString_array _fill;
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
@ -158,37 +158,24 @@ const char* filler (int size)
 | 
				
			|||||||
  if (dep == NULL)
 | 
					  if (dep == NULL)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    dep = new TToken_string(size);
 | 
					    dep = new TToken_string(size);
 | 
				
			||||||
    dep->fill (' ');
 | 
					    dep->fill(' ', size);
 | 
				
			||||||
    _fill.add(dep, size);
 | 
					    _fill.add(dep, size);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  return *dep;
 | 
					  return *dep;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
long TStampa_allegati::cerca_codice_all(char tipo, long codcf) 
 | 
					long TStampa_allegati::cerca_codice_all(char tipo, long codcf) const 
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  TString16 key; 
 | 
					  TString8 key; key.format("%c|%ld", tipo, codcf);
 | 
				
			||||||
	
 | 
					  return atol(cache().get(LF_CLIFO, key, CLI_CODALLEG));
 | 
				
			||||||
	key.format("%c|%ld", tipo, codcf);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  const TRectype & clifo = cache().get(LF_CLIFO, key);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  if (!clifo.empty()) 
 | 
					 | 
				
			||||||
	  return clifo.get_long (CLI_CODALLEG);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  return 0L;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool TStampa_allegati::corrispettivo (const char * tipodoc)
 | 
					bool TStampa_allegati::corrispettivo (const char* tipodoc) const
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  TString natura_doc;
 | 
					  const TRectype& tpd = cache().get("%TPD", tipodoc);
 | 
				
			||||||
  bool    corrisp;
 | 
					  const int natura_doc = tpd.get_int("I0");
 | 
				
			||||||
 | 
					  const bool corrisp = tpd.get_bool ("B0");
 | 
				
			||||||
  const TRectype & tpd = cache().get("%TPD", tipodoc);
 | 
					  return corrisp && (natura_doc == 1 || natura_doc == 9);
 | 
				
			||||||
 | 
					 | 
				
			||||||
  natura_doc = tpd.get("I0");
 | 
					 | 
				
			||||||
  corrisp    = tpd.get_bool ("B0");
 | 
					 | 
				
			||||||
  
 | 
					 | 
				
			||||||
  return corrisp && (natura_doc == "1" || natura_doc == "9");
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// --------------------------------------------------------------------
 | 
					// --------------------------------------------------------------------
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										32
									
								
								cg/cg4.cpp
									
									
									
									
									
								
							
							
						
						
									
										32
									
								
								cg/cg4.cpp
									
									
									
									
									
								
							@ -6,31 +6,19 @@
 | 
				
			|||||||
int main(int argc,char** argv)
 | 
					int main(int argc,char** argv)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  const int n = argc > 1 ? argv[1][1]-'0' : 0; 
 | 
					  const int n = argc > 1 ? argv[1][1]-'0' : 0; 
 | 
				
			||||||
 | 
					 | 
				
			||||||
  switch (n)
 | 
					  switch (n)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
  case 1:
 | 
					  case  1: cg4200(argc,argv); break; // Copia archivi
 | 
				
			||||||
    cg4200(argc,argv); break; // Copia archivi
 | 
					  case  2: cg4300(argc,argv); break; // Calcolo liquidazione
 | 
				
			||||||
  case 2:
 | 
					  case  3: cg4400(argc,argv); break; // Stampa Registri IVA
 | 
				
			||||||
    cg4300(argc,argv); break; // Calcolo liquidazione
 | 
					  case  4: cg4500(argc,argv); break; // Apertura nuovo esercizio
 | 
				
			||||||
  case 3:
 | 
					  case  5: cg4600(argc,argv); break; // Chiusura /Apertura
 | 
				
			||||||
    cg4400(argc,argv); break; // Stampa Registri IVA
 | 
					  case  6: cg4700(argc,argv); break; // Gestione acconti
 | 
				
			||||||
  case 4:
 | 
					  case  7: cg4800(argc,argv); break; // Creazione versamenti per acconto
 | 
				
			||||||
    cg4500(argc,argv); break; // Apertura nuovo esercizio
 | 
					  case  8: cg4900(argc,argv); break; // Visualizzazione liquidazione acconti
 | 
				
			||||||
  case 5:
 | 
					  case  9: cg4a00(argc,argv); break; // Gestione Autotrasportatori
 | 
				
			||||||
    cg4600(argc,argv); break; // Chiusura /Apertura
 | 
					  default: cg4100(argc,argv); break; // Ricalcolo saldi
 | 
				
			||||||
  case 6:
 | 
					 | 
				
			||||||
    cg4700(argc,argv); break; // Gestione acconti
 | 
					 | 
				
			||||||
  case 7:
 | 
					 | 
				
			||||||
    cg4800(argc,argv); break; // Creazione versamenti per acconto
 | 
					 | 
				
			||||||
  case 8:
 | 
					 | 
				
			||||||
    cg4900(argc,argv); break; // Visualizzazione liquidazione acconti
 | 
					 | 
				
			||||||
  case 9:
 | 
					 | 
				
			||||||
    cg4a00(argc,argv); break; // Gestione Autotrasportatori
 | 
					 | 
				
			||||||
  default:
 | 
					 | 
				
			||||||
    cg4100(argc,argv); break; // Ricalcolo saldi
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  exit(0);
 | 
					 | 
				
			||||||
  return 0;
 | 
					  return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -3,7 +3,6 @@
 | 
				
			|||||||
// Part 1: interfaccia
 | 
					// Part 1: interfaccia
 | 
				
			||||||
// fv 21-1-94
 | 
					// fv 21-1-94
 | 
				
			||||||
// ------------------------------------------------------------
 | 
					// ------------------------------------------------------------
 | 
				
			||||||
 | 
					 | 
				
			||||||
                               
 | 
					                               
 | 
				
			||||||
#include "cg4300.h"
 | 
					#include "cg4300.h"
 | 
				
			||||||
#include "cg4300a.h"
 | 
					#include "cg4300a.h"
 | 
				
			||||||
@ -16,7 +15,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include <mov.h>
 | 
					#include <mov.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
// Methods of _Iva11Array
 | 
					// Methods of _Iva11Array
 | 
				
			||||||
bool _Iva11Array::add(const real& val, const char* fld_name, int num_file)
 | 
					bool _Iva11Array::add(const real& val, const char* fld_name, int num_file)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@ -25,8 +23,10 @@ bool _Iva11Array::add(const real& val, const char* fld_name, int num_file)
 | 
				
			|||||||
    TAssoc_array::add(fld_name,(_Iva11Item*)new _Iva11Item,is_key);
 | 
					    TAssoc_array::add(fld_name,(_Iva11Item*)new _Iva11Item,is_key);
 | 
				
			||||||
  _Iva11Item& bi = (_Iva11Item&)find(fld_name);
 | 
					  _Iva11Item& bi = (_Iva11Item&)find(fld_name);
 | 
				
			||||||
  bi.value() += val;
 | 
					  bi.value() += val;
 | 
				
			||||||
  if (num_file != LF_TAB1100A) bi.file() = num_file;
 | 
					  if (num_file != LF_TAB1100A) 
 | 
				
			||||||
  return TRUE;
 | 
					    bi.file() = num_file;
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					  return true;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool _Iva11Array::sub(const real& val, const char* fld_name, int num_file)
 | 
					bool _Iva11Array::sub(const real& val, const char* fld_name, int num_file)
 | 
				
			||||||
@ -42,7 +42,7 @@ void _Iva11Array::zero(const char* fld_name)
 | 
				
			|||||||
  if (!is_key)
 | 
					  if (!is_key)
 | 
				
			||||||
    TAssoc_array::add(fld_name,(_Iva11Item*) new _Iva11Item,is_key);
 | 
					    TAssoc_array::add(fld_name,(_Iva11Item*) new _Iva11Item,is_key);
 | 
				
			||||||
  _Iva11Item& bi = (_Iva11Item&)find(fld_name);
 | 
					  _Iva11Item& bi = (_Iva11Item&)find(fld_name);
 | 
				
			||||||
  bi.value() = 0.0;
 | 
					  bi.value() = ZERO;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Methods of _ProrataItem
 | 
					// Methods of _ProrataItem
 | 
				
			||||||
@ -52,7 +52,7 @@ void _Iva11Array::zero(const char* fld_name)
 | 
				
			|||||||
real _ProrataItem::calc_prorata(const real& acq, const char * year)
 | 
					real _ProrataItem::calc_prorata(const real& acq, const char * year)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  real perc = _percentuali.objptr(year) ? (real&) *_percentuali.objptr(year) : ZERO;
 | 
					  real perc = _percentuali.objptr(year) ? (real&) *_percentuali.objptr(year) : ZERO;
 | 
				
			||||||
  real prorata = (acq * perc) / 100.0;
 | 
					  real prorata = (acq * perc) / CENTO;
 | 
				
			||||||
  prorata.round(TCurrency::get_firm_dec());
 | 
					  prorata.round(TCurrency::get_firm_dec());
 | 
				
			||||||
  return prorata;
 | 
					  return prorata;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -67,9 +67,6 @@ real _ProrataItem::percentuale(const char * year)
 | 
				
			|||||||
  return perc;
 | 
					  return perc;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Methods of application!
 | 
					 | 
				
			||||||
real TLiquidazione_app::CENTO(100.0);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
inline TLiquidazione_app& app()
 | 
					inline TLiquidazione_app& app()
 | 
				
			||||||
{ return (TLiquidazione_app&)main_app(); }
 | 
					{ return (TLiquidazione_app&)main_app(); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -303,17 +303,13 @@ class TLiquidazione_app : public TPrint_application
 | 
				
			|||||||
                               // La cui chiave e' a sua volta sul nome campo
 | 
					                               // La cui chiave e' a sua volta sul nome campo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // totali vari per attivita'
 | 
					  // totali vari per attivita'
 | 
				
			||||||
  real       _p8, _p8b, _p9;   // totali plafond
 | 
					  real _p8, _p8b, _p9;         // totali plafond
 | 
				
			||||||
  _ProrataItem
 | 
					  _ProrataItem _prorata;       // Mini cazzetto per calcoli prorata
 | 
				
			||||||
             _prorata;         // Mini cazzetto per calcoli prorata
 | 
					 | 
				
			||||||
  long       __firm;           // ditta selezionata all'inizio
 | 
					  long       __firm;           // ditta selezionata all'inizio
 | 
				
			||||||
  bool       _is_interactive;  // lanciata da menu o da altro prog
 | 
					  bool       _is_interactive;  // lanciata da menu o da altro prog
 | 
				
			||||||
  bool       _is_visliq;       // lanciata da visualizzazione liquidazione
 | 
					  bool       _is_visliq;       // lanciata da visualizzazione liquidazione
 | 
				
			||||||
  
 | 
					 | 
				
			||||||
  int        _monthinatt;      // mese inizio attivita' (serve per differita)
 | 
					  int        _monthinatt;      // mese inizio attivita' (serve per differita)
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  static real CENTO;    
 | 
					 | 
				
			||||||
  
 | 
					 | 
				
			||||||
  // main cursor
 | 
					  // main cursor
 | 
				
			||||||
  TRelation* _rel;
 | 
					  TRelation* _rel;
 | 
				
			||||||
  TCursor*   _cur;
 | 
					  TCursor*   _cur;
 | 
				
			||||||
 | 
				
			|||||||
@ -2424,7 +2424,7 @@ void TLiquidazione_app::iva11_set_arr_phase_2(const TString& codatt)
 | 
				
			|||||||
// e' perche' alcune operazioni di calcolo (scorporo corrispettivi, ventilazione...) vengono effettuate
 | 
					// e' perche' alcune operazioni di calcolo (scorporo corrispettivi, ventilazione...) vengono effettuate
 | 
				
			||||||
// dopo la recalc_att(), punto in cui viene chiamata la phase_1.
 | 
					// dopo la recalc_att(), punto in cui viene chiamata la phase_1.
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  TString16 codiva, reg, tiva;
 | 
					  TString4 codiva, reg, tiva;
 | 
				
			||||||
  TString16 tpla, tvia;
 | 
					  TString16 tpla, tvia;
 | 
				
			||||||
  TString16 v11, a11;
 | 
					  TString16 v11, a11;
 | 
				
			||||||
  TToken_string tt("",'!');
 | 
					  TToken_string tt("",'!');
 | 
				
			||||||
 | 
				
			|||||||
@ -22,7 +22,6 @@
 | 
				
			|||||||
bool TLiquidazione_app::set_deleghe()
 | 
					bool TLiquidazione_app::set_deleghe()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  TMask m("cg4300b.msk");  
 | 
					  TMask m("cg4300b.msk");  
 | 
				
			||||||
  
 | 
					 | 
				
			||||||
  m.field(FLD_CGB_YEAR).set_handler(ch_year_handler);
 | 
					  m.field(FLD_CGB_YEAR).set_handler(ch_year_handler);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  m.field(FLD_CGB_YEAR).set(_year);    
 | 
					  m.field(FLD_CGB_YEAR).set(_year);    
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										107
									
								
								cg/cg4400.cpp
									
									
									
									
									
								
							
							
						
						
									
										107
									
								
								cg/cg4400.cpp
									
									
									
									
									
								
							@ -36,14 +36,15 @@ static enum tipo_sospensione { nessuna, normale, vol_affari,  liquidazione };
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
inline TStampa_registri_app& app() { return (TStampa_registri_app&)main_app(); }
 | 
					inline TStampa_registri_app& app() { return (TStampa_registri_app&)main_app(); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define RIGHE_FOOTER 3 // Righe da saltare nel footer per evitare di scrivere sulla perforazione
 | 
					// Righe da saltare nel footer per evitare di scrivere sulla perforazione
 | 
				
			||||||
 | 
					#define RIGHE_FOOTER 3 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool TStampa_registri_app::filter_func (const TRelation * r)
 | 
					bool TStampa_registri_app::filter_func (const TRelation * r)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  const TRectype& mov = r->curr(LF_MOV);
 | 
					  const TRectype& mov = r->curr(LF_MOV);
 | 
				
			||||||
  const TString4 codreg  = mov.get(MOV_REG);
 | 
					 | 
				
			||||||
  const int annoiva = mov.get_int(MOV_ANNOIVA);
 | 
					  const int annoiva = mov.get_int(MOV_ANNOIVA);
 | 
				
			||||||
 | 
					  const TString& codreg  = mov.get(MOV_REG);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (codreg != (app()._codreg) || annoiva != (app()._annoes)) 
 | 
					  if (codreg != (app()._codreg) || annoiva != (app()._annoes)) 
 | 
				
			||||||
    return FALSE;           
 | 
					    return FALSE;           
 | 
				
			||||||
@ -77,15 +78,8 @@ HIDDEN int compare_righeiva(const TObject** o1, const TObject** o2)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  const TRigaiva& r1 = *(const TRigaiva*)*o1;
 | 
					  const TRigaiva& r1 = *(const TRigaiva*)*o1;
 | 
				
			||||||
  const TRigaiva& r2 = *(const TRigaiva*)*o2;
 | 
					  const TRigaiva& r2 = *(const TRigaiva*)*o2;
 | 
				
			||||||
  /*
 | 
					 | 
				
			||||||
  TString8 campo1;
 | 
					 | 
				
			||||||
  TString8 campo2;
 | 
					 | 
				
			||||||
  campo1.format("%d%4s", r1->_tipodet, (const char*)r1->_codiva); 
 | 
					 | 
				
			||||||
  campo2.format("%d%4s", r2->_tipodet, (const char*)r2->_codiva); 
 | 
					 | 
				
			||||||
  return strcmp(campo1, campo2);
 | 
					 | 
				
			||||||
  */
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  int diff = r1._tipodet - r2._tipodet;   // Confronto il tipo indetraibilita'
 | 
					  int diff = r1._tipodet - r2._tipodet;    // Confronto il tipo indetraibilita'
 | 
				
			||||||
  if (diff == 0)                           // Se ho un uguale indetraibilita' ...
 | 
					  if (diff == 0)                           // Se ho un uguale indetraibilita' ...
 | 
				
			||||||
    diff = r1._codiva.compare(r2._codiva); // ... confronto il codice IVA
 | 
					    diff = r1._codiva.compare(r2._codiva); // ... confronto il codice IVA
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1114,20 +1108,44 @@ int TStampa_registri_app::riga_rmoviva()
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int TStampa_registri_app::setta_riga(int r, const TRigaiva& riga, real& tot1, 
 | 
					int TStampa_registri_app::setta_riga(int r, const TRigaiva& riga, real& tot1, 
 | 
				
			||||||
                                   real& tot2, real& tot3, real& tot4)
 | 
					                                     real& tot2, real& tot3, real& tot4)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  set_row(r, "%-4s", (const char*)riga._codiva);
 | 
					  set_row(r, riga._codiva);
 | 
				
			||||||
  const TString& descr = descr_iva(riga._codiva); 
 | 
					  
 | 
				
			||||||
  set_row(r, "@5g%-.23s",(const char*)descr);
 | 
					  TString descrizione = descr_iva(riga._codiva); 
 | 
				
			||||||
  if (riga._imponibile != ZERO)
 | 
					  if (riga._tipocr > 0)
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					    const char* cr = NULL;
 | 
				
			||||||
 | 
					    switch (riga._tipocr)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					    case  1: cr = TR("Beni per rivendita"); break;
 | 
				
			||||||
 | 
					    case  2: cr = TR("Beni ammortizzabili"); break;
 | 
				
			||||||
 | 
					    case  3: cr = TR("Beni ammortizzabili con detr. 6%"); break;
 | 
				
			||||||
 | 
					    case  4: cr = TR("Beni strumentali art. 17"); break;
 | 
				
			||||||
 | 
					    case  5: cr = TR("Beni per rivendita da non ventilare"); break;
 | 
				
			||||||
 | 
					    case  8: cr = TR("Altri beni strumentali in leasing"); break;
 | 
				
			||||||
 | 
					    case  9: cr = TR("Spese generali"); break;
 | 
				
			||||||
 | 
					    default: break;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    if (cr && *cr)
 | 
				
			||||||
 | 
					      descrizione << " (" << cr << ')';
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  if (descrizione.full())
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					    TParagraph_string descr(descrizione, 23);
 | 
				
			||||||
 | 
					    --r;
 | 
				
			||||||
 | 
					    FOR_EACH_TOKEN(descr, d)
 | 
				
			||||||
 | 
					      set_row(++r, "@5g%-.23s", d);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  if (!riga._imponibile.is_zero())
 | 
				
			||||||
    set_row(r, "@29g%r", &riga._imponibile);
 | 
					    set_row(r, "@29g%r", &riga._imponibile);
 | 
				
			||||||
  if (riga._imposta != ZERO)
 | 
					  if (!riga._imposta.is_zero())
 | 
				
			||||||
    set_row(r, "@45g%r", &riga._imposta);
 | 
					    set_row(r, "@45g%r", &riga._imposta);
 | 
				
			||||||
  if (_tipo_stampa != prova)
 | 
					  if (_tipo_stampa != prova)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    if (riga._imponibilep != ZERO)
 | 
					    if (!riga._imponibilep.is_zero())
 | 
				
			||||||
      set_row(r, "@81g%r", &riga._imponibilep);
 | 
					      set_row(r, "@81g%r", &riga._imponibilep);
 | 
				
			||||||
    if (riga._impostap != ZERO)
 | 
					    if (!riga._impostap.is_zero())
 | 
				
			||||||
      set_row(r, "@98g%r", &riga._impostap); 
 | 
					      set_row(r, "@98g%r", &riga._impostap); 
 | 
				
			||||||
  }       
 | 
					  }       
 | 
				
			||||||
  r++;   // Incrementa sempre: cazzone!
 | 
					  r++;   // Incrementa sempre: cazzone!
 | 
				
			||||||
@ -1136,20 +1154,19 @@ int TStampa_registri_app::setta_riga(int r, const TRigaiva& riga, real& tot1,
 | 
				
			|||||||
  tot2 += riga._imposta;
 | 
					  tot2 += riga._imposta;
 | 
				
			||||||
  tot3 += riga._imponibilep;
 | 
					  tot3 += riga._imponibilep;
 | 
				
			||||||
  tot4 += riga._impostap;
 | 
					  tot4 += riga._impostap;
 | 
				
			||||||
  
 | 
					
 | 
				
			||||||
  return r;
 | 
					  return r;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
messaggio TStampa_registri_app::controlla_liquidazione()
 | 
					messaggio TStampa_registri_app::controlla_liquidazione()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  TTable lim ("LIM");
 | 
					  TTable lim("LIM");
 | 
				
			||||||
  TString mesi_cal = "";
 | 
					  TString mesi_cal;
 | 
				
			||||||
  TString16 chiave = "";
 | 
					  TString8 chiave, ditta;
 | 
				
			||||||
  TString16 ditta  = "";
 | 
					  bool continua = false;
 | 
				
			||||||
  int i, mese;
 | 
					 | 
				
			||||||
  bool continua;
 | 
					 | 
				
			||||||
  ditta << get_firm();
 | 
					  ditta << get_firm();
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
 | 
					  int mese = 0;
 | 
				
			||||||
  if (_tipo_stampa == prova) //stampa di prova
 | 
					  if (_tipo_stampa == prova) //stampa di prova
 | 
				
			||||||
    mese = _data_a.month();
 | 
					    mese = _data_a.month();
 | 
				
			||||||
  else 
 | 
					  else 
 | 
				
			||||||
@ -1159,26 +1176,22 @@ messaggio TStampa_registri_app::controlla_liquidazione()
 | 
				
			|||||||
  {
 | 
					  {
 | 
				
			||||||
    if (_frequiva == 'T') //la LIM esiste solo per i mesi 3, 6, 9, 12
 | 
					    if (_frequiva == 'T') //la LIM esiste solo per i mesi 3, 6, 9, 12
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      for (i=3; i<=mese; i+=3)
 | 
					      for (int i=3; i<=mese; i+=3)
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        chiave = "";
 | 
					        chiave.format("%04d%02d", _annoes, i);
 | 
				
			||||||
        TString16 m; m.format("%02d", i);
 | 
					 | 
				
			||||||
        chiave << _annoes << m;
 | 
					 | 
				
			||||||
        lim.put("CODTAB", chiave);      
 | 
					        lim.put("CODTAB", chiave);      
 | 
				
			||||||
        if (lim.read() != NOERR || !lim.get_bool("B0"))
 | 
					        if (lim.read() != NOERR || !lim.get_bool("B0"))
 | 
				
			||||||
          mesi_cal << itom(i) << "\n";
 | 
					          mesi_cal << itom(i) << '\n';
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }                
 | 
					    } else               
 | 
				
			||||||
    if (_frequiva == 'M')
 | 
					    if (_frequiva == 'M')
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      for (i=1 ; i<=mese; i++)
 | 
					      for (int i=1; i<=mese; i++)
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        chiave = "";
 | 
					        chiave.format("%04d%02d", _annoes, i);
 | 
				
			||||||
        TString16 m; m.format("%02d", i);
 | 
					 | 
				
			||||||
        chiave << _annoes << m;
 | 
					 | 
				
			||||||
        lim.put("CODTAB", chiave);
 | 
					        lim.put("CODTAB", chiave);
 | 
				
			||||||
        if (lim.read() != NOERR || !lim.get_bool("B0"))
 | 
					        if (lim.read() != NOERR || !lim.get_bool("B0"))
 | 
				
			||||||
          mesi_cal << itom(i) << "\n"; 
 | 
					          mesi_cal << itom(i) << '\n'; 
 | 
				
			||||||
      } 
 | 
					      } 
 | 
				
			||||||
    }      
 | 
					    }      
 | 
				
			||||||
    if (mesi_cal.not_empty())
 | 
					    if (mesi_cal.not_empty())
 | 
				
			||||||
@ -1193,8 +1206,7 @@ messaggio TStampa_registri_app::controlla_liquidazione()
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
  else if (_tipo_riepilogativo == 'A')
 | 
					  else if (_tipo_riepilogativo == 'A')
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    chiave = "";
 | 
					    chiave.format("%04d%02d", _annoes, 13);
 | 
				
			||||||
    chiave << _annoes << 13;
 | 
					 | 
				
			||||||
    lim.put("CODTAB", chiave);
 | 
					    lim.put("CODTAB", chiave);
 | 
				
			||||||
    if (lim.read() != NOERR || !lim.get_bool("B0"))
 | 
					    if (lim.read() != NOERR || !lim.get_bool("B0"))
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
@ -1211,9 +1223,7 @@ messaggio TStampa_registri_app::controlla_liquidazione()
 | 
				
			|||||||
         if (_frequiva == 'M' ||
 | 
					         if (_frequiva == 'M' ||
 | 
				
			||||||
            (m==3 || m==6 || m==9 || m==12))
 | 
					            (m==3 || m==6 || m==9 || m==12))
 | 
				
			||||||
         {
 | 
					         {
 | 
				
			||||||
           chiave = "";
 | 
					           chiave.format("%04d%02d", _annoes, m);
 | 
				
			||||||
           TString16 m; m.format("%02d", m);
 | 
					 | 
				
			||||||
           chiave << _annoes << m;
 | 
					 | 
				
			||||||
           lim.put("CODTAB", chiave);
 | 
					           lim.put("CODTAB", chiave);
 | 
				
			||||||
           if (lim.read() != NOERR || !lim.get_bool("B0"))
 | 
					           if (lim.read() != NOERR || !lim.get_bool("B0"))
 | 
				
			||||||
           {
 | 
					           {
 | 
				
			||||||
@ -3697,7 +3707,7 @@ bool TStampa_registri_app::stampa_riepilogo(int m)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void TStampa_registri_app::stampa_prospetto_riepilogo(tiporeg tipo, const TString& codreg, const TString& codatt, const bool print_prec)
 | 
					void TStampa_registri_app::stampa_prospetto_riepilogo(tiporeg tipo, const TString& codreg, const TString& codatt, const bool print_prec)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  TString80 desc(desc_attivita(codatt));
 | 
					  const TString80 desc(desc_attivita(codatt));
 | 
				
			||||||
  TPrinter& pr = printer();
 | 
					  TPrinter& pr = printer();
 | 
				
			||||||
  TPrintrow row;
 | 
					  TPrintrow row;
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
@ -3706,18 +3716,16 @@ void TStampa_registri_app::stampa_prospetto_riepilogo(tiporeg tipo, const TStrin
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  if (!print_prec)
 | 
					  if (!print_prec)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    row.put(TR("Registro iva:"), 0);
 | 
					    row.put(TR("Registro IVA:"), 0);
 | 
				
			||||||
    row.put(codreg, 14); 
 | 
					    row.put(codreg, 14); 
 | 
				
			||||||
    row.put(format("%-.40s",(const char*)_tabreg->get("S0")), 18);
 | 
					    row.put(format("%-.40s",(const char*)_tabreg->get("S0")), 18);
 | 
				
			||||||
    row.put(TR("Attivita\'"), 60);
 | 
					    row.put(TR("Attivita\'"), 60);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (_annoes > 2007)
 | 
							if (_annoes > 2007)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			TString key;
 | 
								TString16 key;
 | 
				
			||||||
 | 
								key.format("%ld|%s", _ditta, (const char*)codatt);
 | 
				
			||||||
			key.format("%ld|%s", _ditta, (const char *)codatt);
 | 
								const TString& codateco = cache().get(LF_ATTIV, key, ATT_CODATECO);
 | 
				
			||||||
			const TString16 codateco = cache().get(LF_ATTIV, key, ATT_CODATECO);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			row.put(codateco, 70);
 | 
								row.put(codateco, 70);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
@ -3765,7 +3773,8 @@ void TStampa_registri_app::stampa_prospetto_riepilogo(tiporeg tipo, const TStrin
 | 
				
			|||||||
     row.put(TR("V E N D I T E"), 94); 
 | 
					     row.put(TR("V E N D I T E"), 94); 
 | 
				
			||||||
     row.put(TR("CORRISPETTIVI"), 118);           
 | 
					     row.put(TR("CORRISPETTIVI"), 118);           
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else row.put(TR("V E N D I T E"), 95);
 | 
					    else 
 | 
				
			||||||
 | 
					      row.put(TR("V E N D I T E"), 95);
 | 
				
			||||||
   }                   
 | 
					   }                   
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  pr.print(row);
 | 
					  pr.print(row);
 | 
				
			||||||
 | 
				
			|||||||
@ -194,13 +194,12 @@ END
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
GROUPBOX DLG_NULL 52 6
 | 
					GROUPBOX DLG_NULL 52 6
 | 
				
			||||||
BEGIN
 | 
					BEGIN
 | 
				
			||||||
  PROMPT 2 13 "Parametri addizionali"
 | 
					  PROMPT 2 13 "@bParametri addizionali"
 | 
				
			||||||
END
 | 
					END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
NUMBER ULTIMA_PAGINA 4
 | 
					NUMBER ULTIMA_PAGINA 4
 | 
				
			||||||
BEGIN
 | 
					BEGIN
 | 
				
			||||||
  PROMPT 3 14 "Ultimo nr. di pagina stampata libro unico  "
 | 
					  PROMPT 3 14 "Ultimo nr. di pagina stampata libro unico"
 | 
				
			||||||
  FLAGS "R"
 | 
					 | 
				
			||||||
  GROUP 5
 | 
					  GROUP 5
 | 
				
			||||||
END
 | 
					END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user