Corretta gestione rate in modifica e corretto calcolo Abbuoni
git-svn-id: svn://10.65.10.50/trunk@2353 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									10f904dd5a
								
							
						
					
					
						commit
						0da41d73fc
					
				@ -23,7 +23,6 @@ typedef enum { no_descr, acquisto, vendita, incasso_pagamento,
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  TRelation* _rel;           // Relazione principale
 | 
					  TRelation* _rel;           // Relazione principale
 | 
				
			||||||
  TLocalisamfile * _rcaus;
 | 
					  TLocalisamfile * _rcaus;
 | 
				
			||||||
  TTable  * _dpn;
 | 
					 | 
				
			||||||
  TMask* _msk;               // Maschera principale
 | 
					  TMask* _msk;               // Maschera principale
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
@ -55,7 +54,7 @@ protected:
 | 
				
			|||||||
  static bool sezione_hndl (TMask_field& f, KEY k);
 | 
					  static bool sezione_hndl (TMask_field& f, KEY k);
 | 
				
			||||||
  static bool conto_hndl (TMask_field& f, KEY k);
 | 
					  static bool conto_hndl (TMask_field& f, KEY k);
 | 
				
			||||||
  static bool sottoconto_hndl (TMask_field& f, KEY k);
 | 
					  static bool sottoconto_hndl (TMask_field& f, KEY k);
 | 
				
			||||||
  static bool codcausim_hndl (TMask_field& f, KEY k);
 | 
					//  static bool codcausim_hndl (TMask_field& f, KEY k);
 | 
				
			||||||
  static bool m770_hndl (TMask_field& f, KEY k);
 | 
					  static bool m770_hndl (TMask_field& f, KEY k);
 | 
				
			||||||
  static bool ss_notify (TSheet_field& s, int r, KEY k);
 | 
					  static bool ss_notify (TSheet_field& s, int r, KEY k);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -379,6 +378,7 @@ bool TCaus_app::tipomov_hndl (TMask_field& f, KEY k)
 | 
				
			|||||||
  return TRUE;
 | 
					  return TRUE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/*
 | 
				
			||||||
// Il codice causale per incasso immediato, se specificato, deve
 | 
					// Il codice causale per incasso immediato, se specificato, deve
 | 
				
			||||||
// essere puramente contabile (= codreg vuoto e tpm = Nessuno
 | 
					// essere puramente contabile (= codreg vuoto e tpm = Nessuno
 | 
				
			||||||
bool TCaus_app::codcausim_hndl (TMask_field& f, KEY k)
 | 
					bool TCaus_app::codcausim_hndl (TMask_field& f, KEY k)
 | 
				
			||||||
@ -393,15 +393,14 @@ bool TCaus_app::codcausim_hndl (TMask_field& f, KEY k)
 | 
				
			|||||||
    caus.put(CAU_CODCAUS, causim);
 | 
					    caus.put(CAU_CODCAUS, causim);
 | 
				
			||||||
    if (caus.read() == NOERR)
 | 
					    if (caus.read() == NOERR)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
//      const int tpm = caus.get_int(CAU_TIPOMOV);
 | 
					 | 
				
			||||||
      const TString& codreg = caus.get(CAU_REG);
 | 
					      const TString& codreg = caus.get(CAU_REG);
 | 
				
			||||||
      if (codreg.not_empty() /* || tpm != 0 */)
 | 
					      if (codreg.not_empty())
 | 
				
			||||||
        return f.warning_box("La causale per l'incasso/pagamento immediato deve essere puramente contabile"); 
 | 
					        return f.warning_box("La causale per l'incasso/pagamento immediato deve essere puramente contabile"); 
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  return TRUE;
 | 
					  return TRUE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					*/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool TCaus_app::mostra_campi()
 | 
					bool TCaus_app::mostra_campi()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@ -703,10 +702,11 @@ void TCaus_app::add_riga(int numrig, char sz, TConto& tc, const TString& d, cons
 | 
				
			|||||||
void TCaus_app::load_rcaus(TMask& m)
 | 
					void TCaus_app::load_rcaus(TMask& m)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  const TString16 cod(_rel->lfile().get(RCA_CODCAUS));
 | 
					  const TString16 cod(_rel->lfile().get(RCA_CODCAUS));
 | 
				
			||||||
  TString16 d;
 | 
					  TString d, da(50); 
 | 
				
			||||||
  TString80 da; 
 | 
					 | 
				
			||||||
  const int last = _rcaus_rec->last_row();
 | 
					 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
 | 
					  TTable dpn("%DPN");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const int last = _rcaus_rec->last_row();
 | 
				
			||||||
  for (int i = 1; i <= last; i++)
 | 
					  for (int i = 1; i <= last; i++)
 | 
				
			||||||
  {         
 | 
					  {         
 | 
				
			||||||
    TRectype & r = _rcaus_rec->row(i, TRUE);
 | 
					    TRectype & r = _rcaus_rec->row(i, TRUE);
 | 
				
			||||||
@ -716,17 +716,16 @@ void TCaus_app::load_rcaus(TMask& m)
 | 
				
			|||||||
    const int c   = r.get_int(RCA_CONTO);
 | 
					    const int c   = r.get_int(RCA_CONTO);
 | 
				
			||||||
    const long s  = r.get_long(RCA_SOTTOCONTO);
 | 
					    const long s  = r.get_long(RCA_SOTTOCONTO);
 | 
				
			||||||
    d = r.get(RCA_CODDESC);
 | 
					    d = r.get(RCA_CODDESC);
 | 
				
			||||||
    
 | 
					    da.cut(0);
 | 
				
			||||||
    if (d.not_empty())
 | 
					    if (d.not_empty())
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      _dpn->put("CODTAB", d);
 | 
					      dpn.put("CODTAB", d);
 | 
				
			||||||
      _dpn->read() ;
 | 
					      if (dpn.read() == NOERR)
 | 
				
			||||||
      da = _dpn->get("S0");
 | 
					        da = dpn.get("S0");
 | 
				
			||||||
    } else da.cut(0);  
 | 
					    } 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    TConto tc(g,c,s,cf);
 | 
					    TConto tc(g,c,s,cf);
 | 
				
			||||||
    add_riga(i-1, sz, tc, d, da);
 | 
					    add_riga(i-1, sz, tc, d, da);
 | 
				
			||||||
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -864,7 +863,6 @@ bool TCaus_app::user_create()
 | 
				
			|||||||
  _rel = new TRelation (LF_CAUSALI);
 | 
					  _rel = new TRelation (LF_CAUSALI);
 | 
				
			||||||
  //  _rel->add(LF_RCAUSALI, "CODCAUS=CODCAUS");
 | 
					  //  _rel->add(LF_RCAUSALI, "CODCAUS=CODCAUS");
 | 
				
			||||||
  _rcaus = new TLocalisamfile(LF_RCAUSALI);
 | 
					  _rcaus = new TLocalisamfile(LF_RCAUSALI);
 | 
				
			||||||
  _dpn = new TTable("%DPN");
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  _rcaus_rec = new TRecord_array(LF_RCAUSALI, RCA_NRIGA);
 | 
					  _rcaus_rec = new TRecord_array(LF_RCAUSALI, RCA_NRIGA);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -873,8 +871,8 @@ bool TCaus_app::user_create()
 | 
				
			|||||||
  
 | 
					  
 | 
				
			||||||
  _msk->set_handler(F_TIPO_DOC, tipodoc_hndl);
 | 
					  _msk->set_handler(F_TIPO_DOC, tipodoc_hndl);
 | 
				
			||||||
  _msk->set_handler(F_COD_REG, cod_reg_hndl);
 | 
					  _msk->set_handler(F_COD_REG, cod_reg_hndl);
 | 
				
			||||||
  _msk->set_handler(F_COD_CAUS_IM, codcausim_hndl);
 | 
					 | 
				
			||||||
  _msk->set_handler(F_M_770, m770_hndl);
 | 
					  _msk->set_handler(F_M_770, m770_hndl);
 | 
				
			||||||
 | 
					//  _msk->set_handler(F_COD_CAUS_IM, codcausim_hndl);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  TSheet_field& cs = ss();
 | 
					  TSheet_field& cs = ss();
 | 
				
			||||||
  cs.set_notify(ss_notify);
 | 
					  cs.set_notify(ss_notify);
 | 
				
			||||||
@ -892,16 +890,11 @@ bool TCaus_app::user_destroy()
 | 
				
			|||||||
  delete _msk;
 | 
					  delete _msk;
 | 
				
			||||||
  delete _rel;
 | 
					  delete _rel;
 | 
				
			||||||
  delete _rcaus;    
 | 
					  delete _rcaus;    
 | 
				
			||||||
  delete _dpn;
 | 
					 | 
				
			||||||
  delete _rcaus_rec;
 | 
					  delete _rcaus_rec;
 | 
				
			||||||
  return TRUE;
 | 
					  return TRUE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef MAIN
 | 
					 | 
				
			||||||
int main(int argc, char** argv)
 | 
					 | 
				
			||||||
#else                                 
 | 
					 | 
				
			||||||
int cg0500(int argc, char* argv[])
 | 
					int cg0500(int argc, char* argv[])
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  TCaus_app a;
 | 
					  TCaus_app a;
 | 
				
			||||||
  a.run(argc, argv, "Tabella causali");
 | 
					  a.run(argc, argv, "Tabella causali");
 | 
				
			||||||
 | 
				
			|||||||
@ -186,8 +186,8 @@ SPREADSHEET F_SHEET_GCS
 | 
				
			|||||||
BEGIN
 | 
					BEGIN
 | 
				
			||||||
  PROMPT 0 7 ""
 | 
					  PROMPT 0 7 ""
 | 
				
			||||||
  ITEM "Tipo conto@21F"
 | 
					  ITEM "Tipo conto@21F"
 | 
				
			||||||
  ITEM "D/A"
 | 
					  ITEM "D/A@1"
 | 
				
			||||||
  ITEM "C/F"
 | 
					  ITEM "C/F@1"
 | 
				
			||||||
  ITEM "Gr."
 | 
					  ITEM "Gr."
 | 
				
			||||||
  ITEM "Co."
 | 
					  ITEM "Co."
 | 
				
			||||||
  ITEM "Sottoc.@6"
 | 
					  ITEM "Sottoc.@6"
 | 
				
			||||||
 | 
				
			|||||||
@ -135,7 +135,7 @@ BEGIN
 | 
				
			|||||||
  GROUP 1
 | 
					  GROUP 1
 | 
				
			||||||
END
 | 
					END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LISTBOX SS_SEZIONE 5
 | 
					LISTBOX SS_SEZIONE 1 5
 | 
				
			||||||
BEGIN
 | 
					BEGIN
 | 
				
			||||||
  PROMPT 51 3 "Sezione "
 | 
					  PROMPT 51 3 "Sezione "
 | 
				
			||||||
  HELP "Indicare la sezione del conto"
 | 
					  HELP "Indicare la sezione del conto"
 | 
				
			||||||
 | 
				
			|||||||
@ -98,8 +98,6 @@ TMask* TPrimanota_application::load_mask(int n)
 | 
				
			|||||||
      m->set_handler(F_SOLAIVA, solaiva_handler);
 | 
					      m->set_handler(F_SOLAIVA, solaiva_handler);
 | 
				
			||||||
      m->set_handler(F_SHEETIVA, iva_handler);
 | 
					      m->set_handler(F_SHEETIVA, iva_handler);
 | 
				
			||||||
      m->set_handler(F_CODPAG, codpag_handler);
 | 
					      m->set_handler(F_CODPAG, codpag_handler);
 | 
				
			||||||
      m->set_handler(SK_VALUTA, valuta_handler);
 | 
					 | 
				
			||||||
      m->set_handler(SK_CAMBIO, cambio_handler);
 | 
					 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
      TSheet_field& is = (TSheet_field&)m->field(F_SHEETIVA);
 | 
					      TSheet_field& is = (TSheet_field&)m->field(F_SHEETIVA);
 | 
				
			||||||
      is.set_notify(iva_notify);
 | 
					      is.set_notify(iva_notify);
 | 
				
			||||||
@ -140,8 +138,10 @@ TMask* TPrimanota_application::load_mask(int n)
 | 
				
			|||||||
      m->set_handler(F_DESCR, descr_handler);
 | 
					      m->set_handler(F_DESCR, descr_handler);
 | 
				
			||||||
      m->set_handler(F_CODCAUS, caus_modify_handler);
 | 
					      m->set_handler(F_CODCAUS, caus_modify_handler);
 | 
				
			||||||
      m->set_handler(F_TOTALE, totdoc_handler);
 | 
					      m->set_handler(F_TOTALE, totdoc_handler);
 | 
				
			||||||
      m->set_handler(SK_TOTDOCVAL, totdocval_handler);
 | 
					 | 
				
			||||||
      m->set_handler(F_SHEETCG, cg_handler);
 | 
					      m->set_handler(F_SHEETCG, cg_handler);
 | 
				
			||||||
 | 
					      m->set_handler(SK_VALUTA, valuta_handler);
 | 
				
			||||||
 | 
					      m->set_handler(SK_CAMBIO, cambio_handler);
 | 
				
			||||||
 | 
					      m->set_handler(SK_TOTDOCVAL, totdocval_handler);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      TSheet_field& cg = (TSheet_field&)m->field(F_SHEETCG);                                                      
 | 
					      TSheet_field& cg = (TSheet_field&)m->field(F_SHEETCG);                                                      
 | 
				
			||||||
      cg.set_notify(cg_notify);
 | 
					      cg.set_notify(cg_notify);
 | 
				
			||||||
@ -708,9 +708,6 @@ int TPrimanota_application::read(TMask& m)
 | 
				
			|||||||
  partite().destroy();
 | 
					  partite().destroy();
 | 
				
			||||||
  if (is_fattura())                      // Ci sono scadenze
 | 
					  if (is_fattura())                      // Ci sono scadenze
 | 
				
			||||||
  {                           
 | 
					  {                           
 | 
				
			||||||
    const TString16 cp(m.get(F_CODPAG));
 | 
					 | 
				
			||||||
    const TString16 dt(m.get(F_DATADOC));
 | 
					 | 
				
			||||||
    set_pagamento(cp, dt);   
 | 
					 | 
				
			||||||
    if (!read_scadenze(m))
 | 
					    if (!read_scadenze(m))
 | 
				
			||||||
      set_scadenze(m);
 | 
					      set_scadenze(m);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
				
			|||||||
@ -193,7 +193,7 @@ BEGIN
 | 
				
			|||||||
  OUTPUT SK_VALUTA CODTAB
 | 
					  OUTPUT SK_VALUTA CODTAB
 | 
				
			||||||
  CHECKTYPE NORMAL
 | 
					  CHECKTYPE NORMAL
 | 
				
			||||||
  MESSAGE EMPTY CLEAR,SK_CAMBIO|CLEAR,SK_TOTDOCVAL
 | 
					  MESSAGE EMPTY CLEAR,SK_CAMBIO|CLEAR,SK_TOTDOCVAL
 | 
				
			||||||
  MESSAGE ENABLE,SK_CAMBIO|ENABLE,SK_TOTDOCVAL
 | 
					  MESSAGE ENABLE,SK_CAMBIO|ENABLE,SK_TOTDOCVAL|DIRTY,SK_DATACAMBIO|K_TAB,SK_DATACAMBIO
 | 
				
			||||||
END
 | 
					END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
DATE SK_DATACAMBIO
 | 
					DATE SK_DATACAMBIO
 | 
				
			||||||
@ -206,12 +206,11 @@ BEGIN
 | 
				
			|||||||
  INPUT CODTAB[4,11] SK_DATACAMBIO
 | 
					  INPUT CODTAB[4,11] SK_DATACAMBIO
 | 
				
			||||||
  DISPLAY "Valuta" CODTAB[1,3]
 | 
					  DISPLAY "Valuta" CODTAB[1,3]
 | 
				
			||||||
  DISPLAY "Data@10" D0
 | 
					  DISPLAY "Data@10" D0
 | 
				
			||||||
  DISPLAY "Cambio@18" R10   
 | 
					  DISPLAY "Cambio@15" R10   
 | 
				
			||||||
  OUTPUT SK_VALUTA CODTAB[1,3]
 | 
					 | 
				
			||||||
  OUTPUT SK_DATACAMBIO D0
 | 
					  OUTPUT SK_DATACAMBIO D0
 | 
				
			||||||
  OUTPUT SK_CAMBIO R10
 | 
					  OUTPUT SK_CAMBIO R10
 | 
				
			||||||
  GROUP 3 5
 | 
					  GROUP 3 5
 | 
				
			||||||
  CHECKTYPE NORMAL
 | 
					  CHECKTYPE SEARCH
 | 
				
			||||||
END
 | 
					END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
NUMBER SK_CAMBIO 15 5
 | 
					NUMBER SK_CAMBIO 15 5
 | 
				
			||||||
 | 
				
			|||||||
@ -176,6 +176,7 @@ BEGIN
 | 
				
			|||||||
  DISPLAY "Descrizione@50" S0
 | 
					  DISPLAY "Descrizione@50" S0
 | 
				
			||||||
  OUTPUT F_DESCAGG CODTAB
 | 
					  OUTPUT F_DESCAGG CODTAB
 | 
				
			||||||
  OUTPUT F_DESCR S0
 | 
					  OUTPUT F_DESCR S0
 | 
				
			||||||
 | 
					  CHECKTYPE NORMAL
 | 
				
			||||||
END
 | 
					END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
STRING F_DESCR 50
 | 
					STRING F_DESCR 50
 | 
				
			||||||
 | 
				
			|||||||
@ -564,14 +564,17 @@ bool TPrimanota_application::cg_handler(TMask_field& f, KEY k)
 | 
				
			|||||||
    
 | 
					    
 | 
				
			||||||
    if (paga)
 | 
					    if (paga)
 | 
				
			||||||
    {              
 | 
					    {              
 | 
				
			||||||
      const real totdoc(f.mask().get(F_TOTALE));
 | 
					      const char s(app().causale().sezione(2));
 | 
				
			||||||
      const real valore = saldaconto.normalize().valore();
 | 
					      const real t(f.mask().get(F_TOTALE));
 | 
				
			||||||
      if (totdoc != valore)
 | 
					      const TImporto totdoc(s, t);
 | 
				
			||||||
 | 
					      if (totdoc != saldaconto)
 | 
				
			||||||
      {                                         
 | 
					      {                                         
 | 
				
			||||||
        const TString td(totdoc.string("."));
 | 
					        const TString st(totdoc.valore().string("."));
 | 
				
			||||||
        const char* ss = valore.string(".");
 | 
					        const TString ss(saldaconto.valore().string("."));
 | 
				
			||||||
        return f.error_box("Il totale documento inserito e' %s mentre\n"
 | 
					        return f.error_box("Il totale documento inserito e' %s %c mentre\n"
 | 
				
			||||||
                           "i pagamenti e le spese ammontano a  %s", (const char*)td, ss);
 | 
					                           "i pagamenti e le spese ammontano a %s %c", 
 | 
				
			||||||
 | 
					                           (const char*)st, totdoc.sezione(), 
 | 
				
			||||||
 | 
					                           (const char*)ss, saldaconto.sezione());
 | 
				
			||||||
      }  
 | 
					      }  
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
@ -745,7 +748,6 @@ bool TPrimanota_application::cg_notify(TSheet_field& cg, int r, KEY k)
 | 
				
			|||||||
          app().crea_somma_spese(growth);
 | 
					          app().crea_somma_spese(growth);
 | 
				
			||||||
        else
 | 
					        else
 | 
				
			||||||
          app().sub_cgs_imp(s, growth);
 | 
					          app().sub_cgs_imp(s, growth);
 | 
				
			||||||
        app().calcola_saldo();  
 | 
					 | 
				
			||||||
      }    
 | 
					      }    
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
@ -1005,14 +1007,16 @@ real TPrimanota_application::calcola_imp() const
 | 
				
			|||||||
    imposte += real(row.get(3));
 | 
					    imposte += real(row.get(3));
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  curr_mask().set(F_IMPONIBILI, imponibili);
 | 
					  TMask& m = curr_mask();
 | 
				
			||||||
  curr_mask().set(F_IMPOSTE, imposte);
 | 
					  m.set(F_IMPONIBILI, imponibili);
 | 
				
			||||||
 | 
					  m.set(F_IMPOSTE, imposte);
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  // Se e' attiva la terza pagina allora riporta i totali in testata
 | 
					  // Se e' attiva la terza pagina allora riporta i totali in testata
 | 
				
			||||||
  if (is_fattura())
 | 
					  if (is_fattura())
 | 
				
			||||||
  {                              
 | 
					  {                              
 | 
				
			||||||
    curr_mask().set(FS_IMPONIBILI, imponibili);
 | 
					    real tot(m.get(F_TOTALE)); tot -= imposte;
 | 
				
			||||||
    curr_mask().set(FS_IMPOSTE, imposte);
 | 
					    m.set(FS_IMPONIBILI, tot);
 | 
				
			||||||
 | 
					    m.set(FS_IMPOSTE, imposte);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  return imponibili+imposte;
 | 
					  return imponibili+imposte;
 | 
				
			||||||
@ -1191,7 +1195,6 @@ else
 | 
				
			|||||||
        app().reset_cgs_row(newposiva);             // ... cancellala
 | 
					        app().reset_cgs_row(newposiva);             // ... cancellala
 | 
				
			||||||
        newposiva = -1;
 | 
					        newposiva = -1;
 | 
				
			||||||
      }  
 | 
					      }  
 | 
				
			||||||
  
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    oldiva = imposta;                      
 | 
					    oldiva = imposta;                      
 | 
				
			||||||
@ -1199,10 +1202,17 @@ else
 | 
				
			|||||||
  
 | 
					  
 | 
				
			||||||
    TMask& m = app().curr_mask();                                   
 | 
					    TMask& m = app().curr_mask();                                   
 | 
				
			||||||
    if (r == 0)                             // Se cambio la prima riga ...
 | 
					    if (r == 0)                             // Se cambio la prima riga ...
 | 
				
			||||||
      app().add_cgs_tot(m);                 // ... ricalcola conti
 | 
					    {
 | 
				
			||||||
 | 
					      app().add_cgs_tot(m);                 // ... ricalcola conti e imponibili
 | 
				
			||||||
 | 
					    }  
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					    {                                                                 
 | 
				
			||||||
 | 
					      app().calcola_saldo();                // Calcola sbilancio
 | 
				
			||||||
 | 
					      app().calcola_imp();                  // Calcola imponibili
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (app().is_fattura() && m.insert_mode()) 
 | 
					    if (app().is_fattura() && m.insert_mode()) 
 | 
				
			||||||
      app().set_scadenze(m);                // Aggiorna rate
 | 
					      app().set_scadenze(m);                // Ricalcola rate
 | 
				
			||||||
  }                                                         
 | 
					  }                                                         
 | 
				
			||||||
  return TRUE;
 | 
					  return TRUE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -1215,9 +1225,9 @@ bool TPrimanota_application::iva_handler(TMask_field& f, KEY k)
 | 
				
			|||||||
  if ((k == K_TAB && !f.mask().is_running()) || k == K_ENTER)
 | 
					  if ((k == K_TAB && !f.mask().is_running()) || k == K_ENTER)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    const real imp = app().calcola_imp();
 | 
					    const real imp = app().calcola_imp();
 | 
				
			||||||
    const real tot = app().totale_documento();
 | 
					 | 
				
			||||||
    if (k == K_ENTER)
 | 
					    if (k == K_ENTER)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					      const real tot = app().totale_documento();
 | 
				
			||||||
      if (imp != tot)
 | 
					      if (imp != tot)
 | 
				
			||||||
      {
 | 
					      {
 | 
				
			||||||
        const TString t(tot.string("."));
 | 
					        const TString t(tot.string("."));
 | 
				
			||||||
@ -1862,29 +1872,29 @@ bool TPrimanota_application::main_codiva_handler(TMask_field& f, KEY key)
 | 
				
			|||||||
void TPrimanota_application::gioca_cambi(int force)
 | 
					void TPrimanota_application::gioca_cambi(int force)
 | 
				
			||||||
{               
 | 
					{               
 | 
				
			||||||
  TMask& m = curr_mask();
 | 
					  TMask& m = curr_mask();
 | 
				
			||||||
  real totale = m.get(F_TOTALE);
 | 
					  const real totale = m.get(F_TOTALE);
 | 
				
			||||||
  real totval = m.get(SK_TOTDOCVAL);
 | 
					  const real totval = m.get(SK_TOTDOCVAL);
 | 
				
			||||||
  real cambio = m.get(SK_CAMBIO);
 | 
					  const real cambio = m.get(SK_CAMBIO);
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  if ( (force == 0x1 || totale.is_zero()) && !(totval.is_zero() || cambio.is_zero()) )
 | 
					  if ( (force == 0x1 || totale.is_zero()) && !(totval.is_zero() || cambio.is_zero()) )
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    totale = totval * cambio;
 | 
					    const real new_totale = totval * cambio;
 | 
				
			||||||
    m.set(F_TOTALE, totale, TRUE);
 | 
					    if (new_totale != totale)
 | 
				
			||||||
    return;
 | 
					      m.set(F_TOTALE, new_totale, TRUE);
 | 
				
			||||||
  } 
 | 
					  } 
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  if ( (force == 0x2 || totval.is_zero()) && !(totale.is_zero() || cambio.is_zero()))
 | 
					  if ( (force == 0x2 || totval.is_zero()) && !(totale.is_zero() || cambio.is_zero()))
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    totval = totale / cambio;
 | 
					    const real new_totval = totale / cambio;
 | 
				
			||||||
    m.set(SK_TOTDOCVAL, totval);
 | 
					    if (new_totval != totval)
 | 
				
			||||||
    return;
 | 
					      m.set(SK_TOTDOCVAL, new_totval, TRUE);
 | 
				
			||||||
  } 
 | 
					  } 
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  if ( (force == 0x4 || cambio.is_zero()) && !(totale.is_zero() || totval.is_zero()))
 | 
					  if ( (force == 0x4 || cambio.is_zero()) && !(totale.is_zero() || totval.is_zero()))
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    cambio = totale / totval;
 | 
					    const real new_cambio = totale / totval;
 | 
				
			||||||
    m.set(SK_CAMBIO, cambio);
 | 
					    if (new_cambio != cambio)
 | 
				
			||||||
    return;
 | 
					      m.set(SK_CAMBIO, new_cambio, TRUE);
 | 
				
			||||||
  } 
 | 
					  } 
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1939,7 +1949,8 @@ bool TPrimanota_application::totdocval_handler(TMask_field& f, KEY key)
 | 
				
			|||||||
  {  
 | 
					  {  
 | 
				
			||||||
    app().gioca_cambi(0x1);
 | 
					    app().gioca_cambi(0x1);
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (app().is_fattura())                  // Se e' una vera fattura
 | 
					    const TMask& m = f.mask();
 | 
				
			||||||
 | 
					    if (app().is_fattura() && m.insert_mode())     // Se e' una vera fattura
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
      TPagamento& pag = app().pagamento();
 | 
					      TPagamento& pag = app().pagamento();
 | 
				
			||||||
      const real totval(f.get());
 | 
					      const real totval(f.get());
 | 
				
			||||||
@ -1973,7 +1984,11 @@ void TPrimanota_application::add_cgs_rit(bool fiscali)
 | 
				
			|||||||
    else
 | 
					    else
 | 
				
			||||||
      set_cgs_imp(pos, real2imp(imp, tipo));
 | 
					      set_cgs_imp(pos, real2imp(imp, tipo));
 | 
				
			||||||
  }  
 | 
					  }  
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					  if (m.insert_mode())
 | 
				
			||||||
    m.field(F_CODIVA).on_hit();
 | 
					    m.field(F_CODIVA).on_hit();
 | 
				
			||||||
 | 
					  else
 | 
				
			||||||
 | 
					    app().calcola_saldo();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Handler of the F_PROTIVA
 | 
					// Handler of the F_PROTIVA
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										160
									
								
								cg/cg2104.cpp
									
									
									
									
									
								
							
							
						
						
									
										160
									
								
								cg/cg2104.cpp
									
									
									
									
									
								
							@ -11,6 +11,7 @@
 | 
				
			|||||||
#include "cg21sld.h"
 | 
					#include "cg21sld.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <clifo.h>
 | 
					#include <clifo.h>
 | 
				
			||||||
 | 
					#include <mov.h>
 | 
				
			||||||
#include <partite.h>
 | 
					#include <partite.h>
 | 
				
			||||||
#include <scadenze.h>   
 | 
					#include <scadenze.h>   
 | 
				
			||||||
#include <pagsca.h>   
 | 
					#include <pagsca.h>   
 | 
				
			||||||
@ -173,8 +174,33 @@ bool TPrimanota_application::pag_sheet_handler(TMask_field& f, KEY key)
 | 
				
			|||||||
    {
 | 
					    {
 | 
				
			||||||
      TString s(256);
 | 
					      TString s(256);
 | 
				
			||||||
      pag.strerr(err, s);
 | 
					      pag.strerr(err, s);
 | 
				
			||||||
      error_box(s); 
 | 
					      ok = error_box(s);   
 | 
				
			||||||
      ok = FALSE;
 | 
					    }  
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    TMask& m = f.mask();
 | 
				
			||||||
 | 
					    if (key == K_ENTER && m.edit_mode())
 | 
				
			||||||
 | 
					    {      
 | 
				
			||||||
 | 
					      const bool valuta = m.get(SK_CAMBIO).not_empty();
 | 
				
			||||||
 | 
					      const real tot = m.get(valuta ? SK_TOTDOCVAL : F_TOTALE);
 | 
				
			||||||
 | 
					      real imp;
 | 
				
			||||||
 | 
					      for (int r = pag.n_rate()-1; r >= 0; r--)
 | 
				
			||||||
 | 
					        imp += pag.tpay_rata(r);                                 
 | 
				
			||||||
 | 
					      if (imp != tot)  
 | 
				
			||||||
 | 
					      {                     
 | 
				
			||||||
 | 
					        const char* const pic = valuta ? ".3" : ".";                
 | 
				
			||||||
 | 
					        const TString is(imp.string(pic));
 | 
				
			||||||
 | 
					        const TString ts(tot.string(pic));
 | 
				
			||||||
 | 
					        const bool recalc = yesno_box("Il totale delle rate e' %s mentre\n"
 | 
				
			||||||
 | 
					                                      "il totale del documento e' %s.\n"
 | 
				
			||||||
 | 
					                                      "Si desidera ricalcolare le rate e poi\n"
 | 
				
			||||||
 | 
					                                      "registrare in un secondo momento?",
 | 
				
			||||||
 | 
					                                      (const char*)is, (const char*)ts);
 | 
				
			||||||
 | 
					        if (recalc)                              
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          app().set_scadenze(m);
 | 
				
			||||||
 | 
					          ok = FALSE;              // Permette di guardare il risultato prima di registrare
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  return ok;
 | 
					  return ok;
 | 
				
			||||||
@ -295,12 +321,14 @@ bool TPrimanota_application::valuta_handler(TMask_field& f, KEY key)
 | 
				
			|||||||
    TEdit_field& dc = m.efield(SK_DATACAMBIO);
 | 
					    TEdit_field& dc = m.efield(SK_DATACAMBIO);
 | 
				
			||||||
    if (dc.get().empty())                        // Inizializza data cambio se assente
 | 
					    if (dc.get().empty())                        // Inizializza data cambio se assente
 | 
				
			||||||
      m.set(SK_DATACAMBIO, m.get(F_DATADOC), TRUE);
 | 
					      m.set(SK_DATACAMBIO, m.get(F_DATADOC), TRUE);
 | 
				
			||||||
    
 | 
					/*    
 | 
				
			||||||
    const TDate datacam(dc.get());
 | 
					    const TDate datacam(dc.get());
 | 
				
			||||||
    const TRectype& rec = dc.browse()->cursor()->curr();  
 | 
					    const TRectype& rec = dc.browse()->cursor()->curr();  
 | 
				
			||||||
    const TDate curcam(rec.get("CODTAB"));
 | 
					    const TString& cur = rec.get("CODTAB");
 | 
				
			||||||
    if (datacam != curcam)                       // Se non esiste cambio per la nuova valuta
 | 
					    TString16 key; key << f.get() << datacam.string(ANSI);
 | 
				
			||||||
 | 
					    if (cur != key)                              // Se non esiste cambio per la nuova valuta
 | 
				
			||||||
      m.set(SK_CAMBIO, "", TRUE);
 | 
					      m.set(SK_CAMBIO, "", TRUE);
 | 
				
			||||||
 | 
					*/      
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  return TRUE;
 | 
					  return TRUE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -436,20 +464,24 @@ void TPrimanota_application::set_pagamento(const char* c, const char* d)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void TPrimanota_application::set_scadenze(TMask& m)
 | 
					void TPrimanota_application::set_scadenze(TMask& m)
 | 
				
			||||||
{                                                                  
 | 
					{                                                                  
 | 
				
			||||||
 | 
					  const TString16 cp(m.get(F_CODPAG));
 | 
				
			||||||
 | 
					  const TString16 dt(m.get(F_DATADOC));
 | 
				
			||||||
 | 
					  set_pagamento(cp, dt);   
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  real imponibile, imposta;
 | 
					  real imponibile, imposta;
 | 
				
			||||||
  const real spese(0.0);        
 | 
					  const real spese(0.0);        
 | 
				
			||||||
  const real cambio(m.get(SK_CAMBIO));
 | 
					  const real cambio(m.get(SK_CAMBIO));
 | 
				
			||||||
  TPagamento& pag = pagamento();        
 | 
					 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
 | 
					  TPagamento& pag = pagamento();        
 | 
				
			||||||
  if (cambio <= 1.0)
 | 
					  if (cambio <= 1.0)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    imponibile = real(m.get(F_IMPONIBILI));   
 | 
					    imposta = m.get_real(F_IMPOSTE);   
 | 
				
			||||||
    imposta = real(m.get(F_IMPOSTE));   
 | 
					    imponibile = m.get_real(F_TOTALE) - imposta;   
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  else
 | 
					  else
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    pag.set_cambio(cambio);
 | 
					    pag.set_cambio(cambio);
 | 
				
			||||||
    imponibile = real(m.get(SK_TOTDOCVAL));   
 | 
					    imponibile = m.get_real(SK_TOTDOCVAL);   
 | 
				
			||||||
    imposta = ZERO;   
 | 
					    imposta = ZERO;   
 | 
				
			||||||
  }  
 | 
					  }  
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -473,85 +505,76 @@ void TPrimanota_application::set_scadenze(TMask& m)
 | 
				
			|||||||
bool TPrimanota_application::read_scadenze(TMask& m)
 | 
					bool TPrimanota_application::read_scadenze(TMask& m)
 | 
				
			||||||
{                                                                  
 | 
					{                                                                  
 | 
				
			||||||
  const TRectype& testa = _rel->curr();    
 | 
					  const TRectype& testa = _rel->curr();    
 | 
				
			||||||
  const long nreg = testa.get_long("NUMREG");
 | 
					  const long nreg = testa.get_long(MOV_NUMREG);
 | 
				
			||||||
  const TString16 ndoc(testa.get("NUMDOC"));
 | 
					  const TDate datadoc = testa.get_date(MOV_DATADOC);
 | 
				
			||||||
  const int tmov = testa.get_int("TIPOMOV");
 | 
					 | 
				
			||||||
  const TDate ddoc(testa.get_date("DATADOC"));
 | 
					 | 
				
			||||||
  const TDate dreg(testa.get_date("DATAREG"));                                    
 | 
					 | 
				
			||||||
  const TString16 reg (testa.get("REG")); 
 | 
					 | 
				
			||||||
  const long protiva = testa.get_long("PROTIVA"); 
 | 
					 | 
				
			||||||
  const TString16 codcaus(testa.get("CODCAUS")); 
 | 
					 | 
				
			||||||
  const TString16 codval (testa.get("CODVAL")); 
 | 
					 | 
				
			||||||
  const real cambio(testa.get("CAMBIO")); 
 | 
					 | 
				
			||||||
  TSheet_field& ps = (TSheet_field&)m.field(FS_RATESHEET);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  real imponibile, imposta;
 | 
					 | 
				
			||||||
  const real spese(0.0);        
 | 
					 | 
				
			||||||
  
 | 
					 | 
				
			||||||
  TPagamento& pag = pagamento();        
 | 
					 | 
				
			||||||
  bool in_valuta = FALSE;
 | 
					 | 
				
			||||||
  if (cambio.sign() > 0)
 | 
					 | 
				
			||||||
  {
 | 
					 | 
				
			||||||
    in_valuta = TRUE;
 | 
					 | 
				
			||||||
    pag.set_cambio(cambio);
 | 
					 | 
				
			||||||
    imponibile = real(m.get(SK_TOTDOCVAL));   
 | 
					 | 
				
			||||||
    imposta = ZERO;      
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
  else
 | 
					 | 
				
			||||||
  {
 | 
					 | 
				
			||||||
    imponibile = real(m.get(F_IMPONIBILI));   
 | 
					 | 
				
			||||||
    imposta = real(m.get(F_IMPOSTE));   
 | 
					 | 
				
			||||||
  }  
 | 
					 | 
				
			||||||
  pag.set_total(imponibile, imposta, spese);                              
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const TRectype& prima = _rel->cg(0);
 | 
					  const TRectype& prima = _rel->cg(0);
 | 
				
			||||||
  const char sezione    = prima.get_char("SEZIONE"); // Dare/Avere
 | 
					//  const char sezione    = prima.get_char("SEZIONE"); // Dare/Avere
 | 
				
			||||||
  const int  nriga      = 1;
 | 
					//  const int  nriga      = 1;
 | 
				
			||||||
  const int  numrig     = 1;
 | 
					//  const int  numrig     = 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  TBill clifo; clifo.get(prima);          
 | 
					  TBill clifo; clifo.get(prima);          
 | 
				
			||||||
  const int anno = m.get_int(F_ANNORIF);
 | 
					  const int anno = m.get_int(F_ANNORIF);
 | 
				
			||||||
  const TString16 numpart(m.get(F_NUMRIF));
 | 
					  const TString16 numpart(m.get(F_NUMRIF));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  partite().destroy();
 | 
					  partite().destroy();
 | 
				
			||||||
  const TPartita& part = partite().partita(clifo, anno, numpart);
 | 
					  const TPartita& part = partite().partita(clifo, anno, numpart);
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  int npart = part.prima_fattura(nreg);
 | 
					  int npart = part.prima_fattura(nreg);
 | 
				
			||||||
  bool fromscratch = FALSE;
 | 
					  if (npart <= 0)  // la gh'e' no!
 | 
				
			||||||
 | 
					    return FALSE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (npart > 0)  // la gh'e'
 | 
					 | 
				
			||||||
  {    
 | 
					 | 
				
			||||||
  const TRiga_partite&  partita = part.riga(npart);                   
 | 
					  const TRiga_partite&  partita = part.riga(npart);                   
 | 
				
			||||||
 | 
					  TString codpag = testa.get(MOV_CODPAG);
 | 
				
			||||||
 | 
					  if (partita.rate() > 0)
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
    const TRiga_scadenze& primarata = partita.rata(1);
 | 
					    const TRiga_scadenze& primarata = partita.rata(1);
 | 
				
			||||||
 | 
					    codpag = primarata.get(SCAD_CODPAG);
 | 
				
			||||||
 | 
					  }  
 | 
				
			||||||
 | 
					  set_pagamento(codpag, datadoc.string());
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
    // se si e' specificato un codice pagamento diverso si rifa' da capo 
 | 
					  real imponibile, imposta;
 | 
				
			||||||
    // la follia e' che e' sulle SCADENZE, non sulle partite, naturalmente
 | 
					  const real spese(0.0);        
 | 
				
			||||||
    // uguale per tutte      
 | 
					 | 
				
			||||||
    if (pag.code() != primarata.get(SCAD_CODPAG))
 | 
					 | 
				
			||||||
      fromscratch = TRUE;                    
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // se invece la maschera contiene importi diversi da quelli
 | 
					  const real cambio(partita.get(PART_CAMBIO)); 
 | 
				
			||||||
    // registrati si passa la palla al culano/a                                            
 | 
					  const bool in_valuta = cambio > 1.0;
 | 
				
			||||||
    // TBC controllo se imponibile deve contenere le spese
 | 
					  if (in_valuta)
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					    imponibile = m.get_real(SK_TOTDOCVAL);   
 | 
				
			||||||
 | 
					    imposta = m.get_real(F_IMPOSTE); imposta /= cambio; imposta.round(3);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
  else
 | 
					  else
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
      if ((imponibile + imposta) != partita.get_real(in_valuta ? PART_IMPORTOVAL : PART_IMPORTO) || 
 | 
					    imposta = m.get_real(F_IMPOSTE);   
 | 
				
			||||||
 | 
					    imponibile = m.get_real(F_TOTALE) - imposta;   
 | 
				
			||||||
 | 
					  }  
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // se la maschera contiene importi diversi da quelli
 | 
				
			||||||
 | 
					  // registrati si passa la palla al culano/a                                            
 | 
				
			||||||
 | 
					  // TBC controllo se imponibile deve contenere le spese
 | 
				
			||||||
 | 
					  if ((imponibile + imposta) != partita.importo(in_valuta).valore() || 
 | 
				
			||||||
       imposta               != partita.get_real(PART_IMPOSTA) ||
 | 
					       imposta               != partita.get_real(PART_IMPOSTA) ||
 | 
				
			||||||
       spese                 != partita.get_real(PART_SPESE))  
 | 
					       spese                 != partita.get_real(PART_SPESE))  
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
        fromscratch = !yesno_box("Gli importi totali delle scadenze sono stati modificati rispetto"
 | 
					    warning_box("Gli importi delle scadenze non corrispondono al totale documento");
 | 
				
			||||||
                                 " all'ultima registrazione. Si desidera mantenere"
 | 
					 | 
				
			||||||
                                 " comunque la rateazione precedente");
 | 
					 | 
				
			||||||
        // nel qual caso, of course, si disabilitano gli automatismi
 | 
					 | 
				
			||||||
        m.set(FS_RECALC, fromscratch ? "X" : "", TRUE);
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    if (fromscratch)
 | 
					  if (in_valuta)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
      pag.set_rate_auto();
 | 
					    imposta    = partita.get_real(PART_IMPOSTA); imposta /= cambio; imposta.round(3);
 | 
				
			||||||
 | 
					    imponibile = partita.importo(TRUE).valore() - imposta;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  else
 | 
					  else
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
 | 
					    imposta = partita.get_real(PART_IMPOSTA);
 | 
				
			||||||
 | 
					    imponibile = partita.importo(FALSE).valore() - imposta;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  TPagamento& pag = pagamento();        
 | 
				
			||||||
 | 
					  pag.set_total(imponibile, imposta, spese);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  TSheet_field& ps = (TSheet_field&)m.field(FS_RATESHEET);
 | 
				
			||||||
 | 
					      
 | 
				
			||||||
  pag.zap_rate();
 | 
					  pag.zap_rate();
 | 
				
			||||||
  for (int i = 1; i <= partita.rate(); i++)
 | 
					  for (int i = 1; i <= partita.rate(); i++)
 | 
				
			||||||
  { 
 | 
					  { 
 | 
				
			||||||
@ -589,18 +612,10 @@ bool TPrimanota_application::read_scadenze(TMask& m)
 | 
				
			|||||||
  m.set(FS_MCOMM,   pag.mese_commerciale() ? "X" : "", TRUE);
 | 
					  m.set(FS_MCOMM,   pag.mese_commerciale() ? "X" : "", TRUE);
 | 
				
			||||||
  m.set(FS_RECALC,  m.insert_mode() ? "X" : "", TRUE);
 | 
					  m.set(FS_RECALC,  m.insert_mode() ? "X" : "", TRUE);
 | 
				
			||||||
  m.set(FS_NRATE,   pag.n_rate());
 | 
					  m.set(FS_NRATE,   pag.n_rate());
 | 
				
			||||||
    } //else
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
  else
 | 
					 | 
				
			||||||
    return FALSE;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  pag.set_sheet(ps);
 | 
					  pag.set_sheet(ps);
 | 
				
			||||||
  _pag_rows = ps.rows_array();
 | 
					  _pag_rows = ps.rows_array();
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  // se la prima rata e' fissa non si tocca
 | 
					 | 
				
			||||||
  if (pag.tipo_prima_rata() > 3)
 | 
					 | 
				
			||||||
    ps.disable_cell(0,-1);
 | 
					 | 
				
			||||||
  
 | 
					 | 
				
			||||||
  return TRUE;
 | 
					  return TRUE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -625,6 +640,7 @@ void TPrimanota_application::write_scadenze(const TMask& m)
 | 
				
			|||||||
    const TDate   dreg(m.get(F_DATAREG));                                    
 | 
					    const TDate   dreg(m.get(F_DATAREG));                                    
 | 
				
			||||||
    const TString reg (causale().reg().name());       
 | 
					    const TString reg (causale().reg().name());       
 | 
				
			||||||
    const TString desc(m.get(F_DESCR));
 | 
					    const TString desc(m.get(F_DESCR));
 | 
				
			||||||
 | 
					    const TString codpag(m.get(F_CODPAG));
 | 
				
			||||||
    const long protiva = m.get_long(F_PROTIVA); 
 | 
					    const long protiva = m.get_long(F_PROTIVA); 
 | 
				
			||||||
    const TString codcaus(causale().codice()); 
 | 
					    const TString codcaus(causale().codice()); 
 | 
				
			||||||
    const TString codval (m.get(SK_VALUTA)); 
 | 
					    const TString codval (m.get(SK_VALUTA)); 
 | 
				
			||||||
@ -656,7 +672,7 @@ void TPrimanota_application::write_scadenze(const TMask& m)
 | 
				
			|||||||
    
 | 
					    
 | 
				
			||||||
    if (partita.in_valuta())    
 | 
					    if (partita.in_valuta())    
 | 
				
			||||||
    {                                              
 | 
					    {                                              
 | 
				
			||||||
      partita.put(PART_IMPORTO, m.get(F_IMPONIBILI));
 | 
					      partita.put(PART_IMPORTO, m.get(F_TOTALE));
 | 
				
			||||||
      partita.put(PART_IMPORTOVAL, pag.imponibile());
 | 
					      partita.put(PART_IMPORTOVAL, pag.imponibile());
 | 
				
			||||||
      partita.zero(PART_IMPOSTA);
 | 
					      partita.zero(PART_IMPOSTA);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -675,7 +691,7 @@ void TPrimanota_application::write_scadenze(const TMask& m)
 | 
				
			|||||||
      TToken_string& row = ps.row(i);
 | 
					      TToken_string& row = ps.row(i);
 | 
				
			||||||
      
 | 
					      
 | 
				
			||||||
      TRiga_scadenze& scadenza = partita.new_row(); 
 | 
					      TRiga_scadenze& scadenza = partita.new_row(); 
 | 
				
			||||||
      scadenza.put(SCAD_CODPAG,   pag.code());
 | 
					      scadenza.put(SCAD_CODPAG,   codpag);
 | 
				
			||||||
      scadenza.put(SCAD_TIPOPAG,  pag.tipo_rata(i));
 | 
					      scadenza.put(SCAD_TIPOPAG,  pag.tipo_rata(i));
 | 
				
			||||||
      scadenza.put(SCAD_ULTCLASS, pag.ulc_rata(i));
 | 
					      scadenza.put(SCAD_ULTCLASS, pag.ulc_rata(i));
 | 
				
			||||||
      if (partita.in_valuta())    
 | 
					      if (partita.in_valuta())    
 | 
				
			||||||
 | 
				
			|||||||
@ -23,6 +23,7 @@ class TPay_mask : public TMask
 | 
				
			|||||||
  
 | 
					  
 | 
				
			||||||
protected:
 | 
					protected:
 | 
				
			||||||
  static bool importo_handler(TMask_field& f, KEY k);
 | 
					  static bool importo_handler(TMask_field& f, KEY k);
 | 
				
			||||||
 | 
					  static bool importolire_handler(TMask_field& f, KEY k);
 | 
				
			||||||
  static bool cambio_handler(TMask_field& f, KEY k);
 | 
					  static bool cambio_handler(TMask_field& f, KEY k);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public:
 | 
					public:
 | 
				
			||||||
@ -78,7 +79,13 @@ void TPay_mask::set_pag(const TRectype& oldpag, const TRiga_scadenze& scad,
 | 
				
			|||||||
  if (get(S_SALDOACC)[0] != 'S')
 | 
					  if (get(S_SALDOACC)[0] != 'S')
 | 
				
			||||||
    res.set(_da_pagare.string());
 | 
					    res.set(_da_pagare.string());
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  set_handler(in_valuta ? S_IMPORTOVAL : S_IMPORTO, importo_handler); 
 | 
					  if (in_valuta)
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					    set_handler(S_IMPORTOVAL, importo_handler); 
 | 
				
			||||||
 | 
					    set_handler(S_IMPORTO, importolire_handler); 
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  else  
 | 
				
			||||||
 | 
					    set_handler(S_IMPORTO, importo_handler); 
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  real oldimp = oldpag.get_real(in_valuta ? PAGSCA_IMPORTOVAL : PAGSCA_IMPORTO);   
 | 
					  real oldimp = oldpag.get_real(in_valuta ? PAGSCA_IMPORTOVAL : PAGSCA_IMPORTO);   
 | 
				
			||||||
  if (!in_valuta)
 | 
					  if (!in_valuta)
 | 
				
			||||||
@ -191,7 +198,7 @@ bool TPay_mask::importo_handler(TMask_field& f, KEY k)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if (f.dlg() == S_IMPORTOVAL)
 | 
					    if (f.dlg() == S_IMPORTOVAL)
 | 
				
			||||||
    {                                            
 | 
					    {                                            
 | 
				
			||||||
      TValuta val; val.get(m, S_VALUTA, S_DATACAMBIO, S_CAMBIO);
 | 
					      const TValuta val(m, 0, 0, S_CAMBIO);
 | 
				
			||||||
      val.val2lit(i);
 | 
					      val.val2lit(i);
 | 
				
			||||||
      m.set(S_IMPORTO, i);
 | 
					      m.set(S_IMPORTO, i);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -200,6 +207,22 @@ bool TPay_mask::importo_handler(TMask_field& f, KEY k)
 | 
				
			|||||||
  return TRUE;
 | 
					  return TRUE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					bool TPay_mask::importolire_handler(TMask_field& f, KEY k)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  if (f.to_check(k))
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					    TPay_mask& m = (TPay_mask&)f.mask();         
 | 
				
			||||||
 | 
					    const real implit(f.get());
 | 
				
			||||||
 | 
					    if (!implit.is_zero() && m.get(S_IMPORTOVAL).empty())
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      const TValuta val(m, 0, 0, S_CAMBIO);
 | 
				
			||||||
 | 
					      const real impval = val.lit2val(implit);
 | 
				
			||||||
 | 
					      m.set(S_IMPORTOVAL, impval);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  return TRUE;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool TPay_mask::cambio_handler(TMask_field& f, KEY k)
 | 
					bool TPay_mask::cambio_handler(TMask_field& f, KEY k)
 | 
				
			||||||
{             
 | 
					{             
 | 
				
			||||||
  if (k == K_TAB && f.focusdirty())
 | 
					  if (k == K_TAB && f.focusdirty())
 | 
				
			||||||
@ -376,7 +399,7 @@ bool TGame_mask::cambio_handler(TMask_field& f, KEY k)
 | 
				
			|||||||
      yesno_box("Aggiornare gli importi dei pagamenti?"))
 | 
					      yesno_box("Aggiornare gli importi dei pagamenti?"))
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    TGame_mask& gm = (TGame_mask&)f.mask();
 | 
					    TGame_mask& gm = (TGame_mask&)f.mask();
 | 
				
			||||||
    TValuta val; val.get(gm, P_VALUTA, P_DATACAMBIO, P_CAMBIO);
 | 
					    const TValuta val(gm, P_VALUTA, P_DATACAMBIO, P_CAMBIO);
 | 
				
			||||||
    gm.aggiorna_valuta(val);
 | 
					    gm.aggiorna_valuta(val);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  return TRUE;
 | 
					  return TRUE;
 | 
				
			||||||
@ -590,7 +613,6 @@ bool TGame_mask::partite_notify(TSheet_field& partite, int r, KEY k)
 | 
				
			|||||||
            }  
 | 
					            }  
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
              imp.valore() += pag.get_real(PAGSCA_RITENUTE);
 | 
					 | 
				
			||||||
              gm.add_importo(row, imp);
 | 
					              gm.add_importo(row, imp);
 | 
				
			||||||
              row.add("");
 | 
					              row.add("");
 | 
				
			||||||
            }  
 | 
					            }  
 | 
				
			||||||
@ -601,11 +623,22 @@ bool TGame_mask::partite_notify(TSheet_field& partite, int r, KEY k)
 | 
				
			|||||||
            row.add(pa);
 | 
					            row.add(pa);
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
          
 | 
					          
 | 
				
			||||||
 | 
					          const TImporto rit(scad.importo_pagato(FALSE, 0x8));
 | 
				
			||||||
 | 
					          if (!rit.is_zero())   
 | 
				
			||||||
 | 
					          {
 | 
				
			||||||
 | 
					            TToken_string& rrit = scadenze.row(scadenze.add(""));
 | 
				
			||||||
 | 
					            rrit.add("Ritenute professionali", 4); 
 | 
				
			||||||
 | 
					            gm.add_importo(rrit, rit, FALSE);
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
          TImporto abb(scad.importo_pagato(TRUE, 0x2));
 | 
					          TImporto abb(scad.importo_pagato(TRUE, 0x2));
 | 
				
			||||||
          if (!abb.is_zero())
 | 
					          if (!abb.is_zero())
 | 
				
			||||||
          {
 | 
					          {
 | 
				
			||||||
            TToken_string& rabb = scadenze.row(scadenze.add(""));
 | 
					            TToken_string& rabb = scadenze.row(scadenze.add(""));
 | 
				
			||||||
            rabb.add("Abbuoni rata ", 4); rabb << ra;
 | 
					            rabb.add("Abbuoni ", 4); 
 | 
				
			||||||
 | 
					            abb.normalize();
 | 
				
			||||||
 | 
					            rabb << (abb.sezione() == 'D' ? "attivi" : "passivi");
 | 
				
			||||||
 | 
					            
 | 
				
			||||||
            if (in_valuta)
 | 
					            if (in_valuta)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
              gm.add_importo(rabb, scad.importo_pagato(FALSE, 0x2), FALSE);
 | 
					              gm.add_importo(rabb, scad.importo_pagato(FALSE, 0x2), FALSE);
 | 
				
			||||||
@ -624,7 +657,7 @@ bool TGame_mask::partite_notify(TSheet_field& partite, int r, KEY k)
 | 
				
			|||||||
            if (!diff.is_zero())
 | 
					            if (!diff.is_zero())
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
              TToken_string& rdiff = scadenze.row(scadenze.add(""));
 | 
					              TToken_string& rdiff = scadenze.row(scadenze.add(""));
 | 
				
			||||||
              rdiff.add("Differ. cambio rata ", 4); rdiff << ra;
 | 
					              rdiff.add("Differenza cambio", 4);
 | 
				
			||||||
              gm.add_importo(rdiff, diff);
 | 
					              gm.add_importo(rdiff, diff);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
 | 
				
			|||||||
@ -22,8 +22,10 @@ END
 | 
				
			|||||||
NUMBER 103 15 2
 | 
					NUMBER 103 15 2
 | 
				
			||||||
BEGIN
 | 
					BEGIN
 | 
				
			||||||
  PROMPT 1 4 "Importo valuta "
 | 
					  PROMPT 1 4 "Importo valuta "
 | 
				
			||||||
 | 
					  FLAGS "D"
 | 
				
			||||||
  PICTURE ".3"
 | 
					  PICTURE ".3"
 | 
				
			||||||
  VALIDATE REQIF_FUNC 1 102
 | 
					  VALIDATE REQIF_FUNC 1 102
 | 
				
			||||||
 | 
					  WARNING "E' necessario specificare anche un importo in valuta"
 | 
				
			||||||
END
 | 
					END
 | 
				
			||||||
 | 
					
 | 
				
			||||||
NUMBER 104 6 2
 | 
					NUMBER 104 6 2
 | 
				
			||||||
 | 
				
			|||||||
@ -585,10 +585,7 @@ void TPagamento::strerr(word err, TString& s)
 | 
				
			|||||||
  if (err & P_SCAD)
 | 
					  if (err & P_SCAD)
 | 
				
			||||||
    s << "Le scadenze non sono consecutive\n";
 | 
					    s << "Le scadenze non sono consecutive\n";
 | 
				
			||||||
  if (err & P_INIZIO)
 | 
					  if (err & P_INIZIO)
 | 
				
			||||||
  {
 | 
					    s << "La prima rata e' antecedente alla data del documento (" << _inizio << ")\n";
 | 
				
			||||||
    s << "La prima rata (" << data_rata(0) << ") e' antecedente";
 | 
					 | 
				
			||||||
    s << " alla data del documento (" << _inizio << ")\n";
 | 
					 | 
				
			||||||
  }  
 | 
					 | 
				
			||||||
  if (err & P_NEG)
 | 
					  if (err & P_NEG)
 | 
				
			||||||
    s << "L'importo dato e' inferiore al minimo possibile\n";
 | 
					    s << "L'importo dato e' inferiore al minimo possibile\n";
 | 
				
			||||||
  if (err & P_TROP)
 | 
					  if (err & P_TROP)
 | 
				
			||||||
@ -1190,8 +1187,8 @@ bool TPagamento::read(TTable* t, TTable* r)
 | 
				
			|||||||
  // set everything 
 | 
					  // set everything 
 | 
				
			||||||
  _rdiff   = t->get_bool("B1");
 | 
					  _rdiff   = t->get_bool("B1");
 | 
				
			||||||
  _mcomm   = t->get_bool("B0");
 | 
					  _mcomm   = t->get_bool("B0");
 | 
				
			||||||
  _tpr     = atoi(t->get("S3"));
 | 
					  _tpr     = t->get_int("S3");
 | 
				
			||||||
  _inscad  = *((const char*)(t->get("S1")));
 | 
					  _inscad  = t->get_char("S1");
 | 
				
			||||||
  _code    = t->get("CODTAB");
 | 
					  _code    = t->get("CODTAB");
 | 
				
			||||||
  _name    = t->get("S0");
 | 
					  _name    = t->get("S0");
 | 
				
			||||||
  _fixd[0] = t->get_int("I0");
 | 
					  _fixd[0] = t->get_int("I0");
 | 
				
			||||||
@ -1434,7 +1431,7 @@ void TPagamento::set_sheet(TSheet_field& sf, int sscad)
 | 
				
			|||||||
  
 | 
					  
 | 
				
			||||||
  if (_inited)
 | 
					  if (_inited)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    const bool in_valuta = _cambio != 1.0;
 | 
					    const bool in_valuta = _cambio > 1.0;
 | 
				
			||||||
                       
 | 
					                       
 | 
				
			||||||
    // si istanzia uno sheet di primanota
 | 
					    // si istanzia uno sheet di primanota
 | 
				
			||||||
    for (int i = 0; i < n_rate(); i++)
 | 
					    for (int i = 0; i < n_rate(); i++)
 | 
				
			||||||
 | 
				
			|||||||
@ -134,16 +134,18 @@ TValuta::TValuta() : _cod(""), _dat(TODAY), _cam(1.0)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void TValuta::adjust()
 | 
					void TValuta::adjust()
 | 
				
			||||||
{ 
 | 
					{ 
 | 
				
			||||||
  _cod.upper();
 | 
					  if (_cam <= 1.0) 
 | 
				
			||||||
  if (_cod.empty() || _cod == "LIT" || _cam.is_zero()) 
 | 
					  {
 | 
				
			||||||
 | 
					    _cod = "";
 | 
				
			||||||
 | 
					    _dat = TDate(TODAY);
 | 
				
			||||||
    _cam = 1.0; 
 | 
					    _cam = 1.0; 
 | 
				
			||||||
  }  
 | 
					  }  
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int TValuta::compare(const TSortable& s) const
 | 
					int TValuta::compare(const TSortable& s) const
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  const TValuta& v = (const TValuta&)s;
 | 
					  const TValuta& v = (const TValuta&)s;
 | 
				
			||||||
  real c(_cam); c -= v._cam;
 | 
					  return stricmp(_cod, v._cod);
 | 
				
			||||||
  return c.sign();
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TValuta::get(const TRectype& rec)
 | 
					void TValuta::get(const TRectype& rec)
 | 
				
			||||||
@ -188,12 +190,19 @@ void TValuta::set(TMask& m, short v, short d, short c) const
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void TValuta::get(const TMask& m, short v, short d, short c)
 | 
					void TValuta::get(const TMask& m, short v, short d, short c)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  _cod = m.get(v);
 | 
					  if (v > 0) _cod = m.get(v);
 | 
				
			||||||
  _dat = m.get(d);
 | 
					  if (d > 0) _dat = m.get(d);
 | 
				
			||||||
  _cam = real(m.get(c));
 | 
					  _cam = real(m.get(c));
 | 
				
			||||||
  adjust();
 | 
					  adjust();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void TValuta::set(const TValuta& v)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  _cod = v._cod;
 | 
				
			||||||
 | 
					  _dat = v._dat;
 | 
				
			||||||
 | 
					  _cam = v._cam;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
real TValuta::lit2val(const real& lit) const
 | 
					real TValuta::lit2val(const real& lit) const
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  real val(lit);
 | 
					  real val(lit);
 | 
				
			||||||
@ -385,7 +394,7 @@ char TRiga_scadenze::calcola_abbuono(int p, TImporto& abbuono, bool update)
 | 
				
			|||||||
    {                                
 | 
					    {                                
 | 
				
			||||||
      abbuono = importo(TRUE);
 | 
					      abbuono = importo(TRUE);
 | 
				
			||||||
      pag.zero(PAGSCA_ABBUONI);
 | 
					      pag.zero(PAGSCA_ABBUONI);
 | 
				
			||||||
      abbuono += importo_pagato(TRUE, 0x3);          // Conta anche altri abbuoni
 | 
					      abbuono += importo_pagato(TRUE, 0x0B);  // Somma di importi, abbuoni e ritenute
 | 
				
			||||||
      abbuono.swap_section();
 | 
					      abbuono.swap_section();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      const int sign = abbuono.valore().sign();
 | 
					      const int sign = abbuono.valore().sign();
 | 
				
			||||||
 | 
				
			|||||||
@ -70,12 +70,13 @@ class TValuta : public TSortable
 | 
				
			|||||||
  TDate _dat;
 | 
					  TDate _dat;
 | 
				
			||||||
  real _cam;
 | 
					  real _cam;
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
protected:
 | 
					 | 
				
			||||||
  void adjust();     // Controlla il cambio per le lire
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
protected:           // TSortable
 | 
					protected:           // TSortable
 | 
				
			||||||
  virtual int compare(const TSortable& s) const;
 | 
					  virtual int compare(const TSortable& s) const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					protected:
 | 
				
			||||||
 | 
					  void adjust();     // Controlla il cambio per le lire
 | 
				
			||||||
 | 
					  void set(const TValuta& v);
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
public:                
 | 
					public:                
 | 
				
			||||||
  const TString& codice() const { return _cod; }
 | 
					  const TString& codice() const { return _cod; }
 | 
				
			||||||
  const TDate& data() const { return _dat; }
 | 
					  const TDate& data() const { return _dat; }
 | 
				
			||||||
@ -94,10 +95,13 @@ public:
 | 
				
			|||||||
  void set(TMask& m, short v, short d, short c) const;
 | 
					  void set(TMask& m, short v, short d, short c) const;
 | 
				
			||||||
  void get(const TMask& m, short v, short d, short c); 
 | 
					  void get(const TMask& m, short v, short d, short c); 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const TValuta& operator =(const TValuta& v) { set(v); return *this; }
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
  TValuta();
 | 
					  TValuta();
 | 
				
			||||||
  TValuta(const char* cod, const TDate& dat, const real& cam);
 | 
					  TValuta(const char* cod, const TDate& dat, const real& cam);
 | 
				
			||||||
  TValuta(const TRectype& rec) { get(rec); }
 | 
					  TValuta(const TRectype& rec) { get(rec); }
 | 
				
			||||||
  TValuta(const TMask& m, short v, short d, short c) { get(m, v, d, c); }
 | 
					  TValuta(const TMask& m, short v, short d, short c) { get(m, v, d, c); }
 | 
				
			||||||
 | 
					  TValuta(const TValuta& v) { set(v); }
 | 
				
			||||||
  virtual ~TValuta() {}
 | 
					  virtual ~TValuta() {}
 | 
				
			||||||
};    
 | 
					};    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user