Korrette Kakkole Liquidazione (rimborso, fatture in ritardo)
git-svn-id: svn://10.65.10.50/trunk@1016 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									8154a7bea0
								
							
						
					
					
						commit
						4f7a66d5da
					
				@ -78,6 +78,8 @@ enum tbc     { precedente = 1, incorso = 2};
 | 
				
			|||||||
#define RIMBORSO   12  // prospetto rimborso infraannuale
 | 
					#define RIMBORSO   12  // prospetto rimborso infraannuale
 | 
				
			||||||
#define ACCONTO    13  // riga prospetto acconti
 | 
					#define ACCONTO    13  // riga prospetto acconti
 | 
				
			||||||
#define ACCHEAD    14  // header prospetto acconti
 | 
					#define ACCHEAD    14  // header prospetto acconti
 | 
				
			||||||
 | 
					#define RISDITTA   15  // riga tabulato deleghe
 | 
				
			||||||
 | 
					#define DELHEAD    16  // header tabulato deleghe
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ...............................................................
 | 
					// ...............................................................
 | 
				
			||||||
// support structs
 | 
					// support structs
 | 
				
			||||||
 | 
				
			|||||||
@ -149,7 +149,7 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
 | 
				
			|||||||
  _isricacq =    cnf1.get_bool("RicAcq");
 | 
					  _isricacq =    cnf1.get_bool("RicAcq");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // ricalcolo normale  
 | 
					  // ricalcolo normale  
 | 
				
			||||||
  // TBI lim c'e' solo per i trimestri
 | 
					  // lim c'e' solo per i trimestri
 | 
				
			||||||
  bool ok   = _lim->get_bool("B0");
 | 
					  bool ok   = _lim->get_bool("B0");
 | 
				
			||||||
  if (ok && !recalc) return TRUE; 
 | 
					  if (ok && !recalc) return TRUE; 
 | 
				
			||||||
  bool calc = (_recalc == ever || (_recalc == one && month == _month));
 | 
					  bool calc = (_recalc == ever || (_recalc == one && month == _month));
 | 
				
			||||||
@ -160,6 +160,9 @@ bool TLiquidazione_app::update_firm(int month, bool recalc)
 | 
				
			|||||||
  TToken_string atts;
 | 
					  TToken_string atts;
 | 
				
			||||||
  TToken_string cattivs;
 | 
					  TToken_string cattivs;
 | 
				
			||||||
                 
 | 
					                 
 | 
				
			||||||
 | 
					  // azzera rimborsi                
 | 
				
			||||||
 | 
					  zero_firm(month);
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
  _nditte->save_status();  
 | 
					  _nditte->save_status();  
 | 
				
			||||||
  if (_nditte->is_first_match(LF_ATTIV))
 | 
					  if (_nditte->is_first_match(LF_ATTIV))
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
@ -318,6 +321,21 @@ bool TLiquidazione_app::update_att(int month, const char* codatt,
 | 
				
			|||||||
  return ok || calc;  
 | 
					  return ok || calc;  
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
     
 | 
					     
 | 
				
			||||||
 | 
					void TLiquidazione_app::zero_firm(int month)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						for (_rmb->first(); !_rmb->eof(); _rmb->next())
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							if (atoi((const char*)(*_rmb_mese)) == month &&
 | 
				
			||||||
 | 
							    _year == (const char*)(*_rmb_anno))
 | 
				
			||||||
 | 
							{
 | 
				
			||||||
 | 
							  _rmb->put("R0","");
 | 
				
			||||||
 | 
							  _rmb->put("R1","");
 | 
				
			||||||
 | 
							  _rmb->put("R2","");  
 | 
				
			||||||
 | 
							  _rmb->rewrite();
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}    
 | 
				
			||||||
 | 
					     
 | 
				
			||||||
void TLiquidazione_app::zero_att(int month, const char* codatt)
 | 
					void TLiquidazione_app::zero_att(int month, const char* codatt)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  for (_pim->first(); !_pim->eof(); _pim->next())
 | 
					  for (_pim->first(); !_pim->eof(); _pim->next())
 | 
				
			||||||
@ -420,7 +438,7 @@ void TLiquidazione_app::recalc_att(int month, const char* codatt)
 | 
				
			|||||||
     * Fatture in ritardo vengono considerate solo in dichiarazione
 | 
					     * Fatture in ritardo vengono considerate solo in dichiarazione
 | 
				
			||||||
     * annuale
 | 
					     * annuale
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    if (month != 13 && rcs.get_bool("RITFATT")) 
 | 
					    if (_month != 13 && rcs.get_bool("RITFATT")) 
 | 
				
			||||||
      continue;
 | 
					      continue;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    /*
 | 
					    /*
 | 
				
			||||||
 | 
				
			|||||||
@ -422,13 +422,6 @@ _DescrItem* TLiquidazione_app::recalc_rimborso(int month, const char* codatts)
 | 
				
			|||||||
  alv = ivav/vtot;  alv.round(2);
 | 
					  alv = ivav/vtot;  alv.round(2);
 | 
				
			||||||
  ala = ivaa/atot;  ala.round(2);
 | 
					  ala = ivaa/atot;  ala.round(2);
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  TString alvs = alv.string();
 | 
					 | 
				
			||||||
  TString alas = ala.string();
 | 
					 | 
				
			||||||
  TString vtots = vtot.string();
 | 
					 | 
				
			||||||
  TString atots = atot.string();
 | 
					 | 
				
			||||||
  TString ivavs = ivav.string();
 | 
					 | 
				
			||||||
  TString ivaas = ivaa.string();
 | 
					 | 
				
			||||||
  
 | 
					 | 
				
			||||||
  if (ala > alv)
 | 
					  if (ala > alv)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    rimborsami = TRUE;
 | 
					    rimborsami = TRUE;
 | 
				
			||||||
 | 
				
			|||||||
@ -62,6 +62,8 @@ bool TLiquidazione_app::set_deleghe()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
bool TLiquidazione_app::extract_deleghe()
 | 
					bool TLiquidazione_app::extract_deleghe()
 | 
				
			||||||
{               
 | 
					{               
 | 
				
			||||||
 | 
					  bool onemade = FALSE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  char buf[256];
 | 
					  char buf[256];
 | 
				
			||||||
  _prind = new TProgind(_calcall ? _n_ditte : _selected.ones(),
 | 
					  _prind = new TProgind(_calcall ? _n_ditte : _selected.ones(),
 | 
				
			||||||
                        "         Estrazione deleghe        \n"
 | 
					                        "         Estrazione deleghe        \n"
 | 
				
			||||||
@ -101,7 +103,16 @@ bool TLiquidazione_app::extract_deleghe()
 | 
				
			|||||||
                     (_month == 13 && (mens || _isbenzinaro));
 | 
					                     (_month == 13 && (mens || _isbenzinaro));
 | 
				
			||||||
      _isriepilogo = _month == 13;
 | 
					      _isriepilogo = _month == 13;
 | 
				
			||||||
      _isendliq = _isannual || _isriepilogo;
 | 
					      _isendliq = _isannual || _isriepilogo;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//      if (onemade == FALSE && _isprint)
 | 
				
			||||||
 | 
					//      {
 | 
				
			||||||
 | 
					//        _DescrItem* d = new _DescrItem(DELHEAD);
 | 
				
			||||||
 | 
					        // condire qui
 | 
				
			||||||
 | 
					//        _descr_arr.add(d);
 | 
				
			||||||
 | 
					//      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      extract_delega(_month);
 | 
					      extract_delega(_month);
 | 
				
			||||||
 | 
					      onemade = TRUE;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    _prind->addstatus(1);
 | 
					    _prind->addstatus(1);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@ -119,6 +130,17 @@ bool TLiquidazione_app::extract_delega(int month)
 | 
				
			|||||||
    real topay = result_liq(month);
 | 
					    real topay = result_liq(month);
 | 
				
			||||||
    real intr  = _lim->get_real("R14");
 | 
					    real intr  = _lim->get_real("R14");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    // per questa volta lasciamo perdere la describe_delega
 | 
				
			||||||
 | 
					//    if (_isprint)
 | 
				
			||||||
 | 
					//    {
 | 
				
			||||||
 | 
					//      _DescrItem* d = new _DescrItem(RISDITTA);
 | 
				
			||||||
 | 
					//      d->_r0 = topay;
 | 
				
			||||||
 | 
					//      d->_r1 = intr;
 | 
				
			||||||
 | 
					//      d->_s0 = _nditte->curr().get("CODDITTA");
 | 
				
			||||||
 | 
					//      d->_s1 = _nditte->curr().get("RAGSOC");
 | 
				
			||||||
 | 
					//      _descr_arr.add(d);
 | 
				
			||||||
 | 
					//    }  
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
    if (topay.sign() <= 0) 
 | 
					    if (topay.sign() <= 0) 
 | 
				
			||||||
      return TRUE;
 | 
					      return TRUE;
 | 
				
			||||||
    if (topay.sign() > 0)
 | 
					    if (topay.sign() > 0)
 | 
				
			||||||
@ -235,7 +257,7 @@ bool TLiquidazione_app::recalc_acconto()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  if (_basecalc == incorso)
 | 
					  if (_basecalc == incorso)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    // that's pazzesc but it turns out there's no better way
 | 
					    // that's pazzesc but as it turns out there's no better way
 | 
				
			||||||
    _comp_acconto = TRUE;
 | 
					    _comp_acconto = TRUE;
 | 
				
			||||||
    // force recalc of current month
 | 
					    // force recalc of current month
 | 
				
			||||||
    _recalc       = one;               
 | 
					    _recalc       = one;               
 | 
				
			||||||
@ -300,4 +322,3 @@ bool TLiquidazione_app::recalc_acconto()
 | 
				
			|||||||
  }  
 | 
					  }  
 | 
				
			||||||
  return TRUE;
 | 
					  return TRUE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user