Files correlati : Ricompilazione Demo : [ ] Commento : Riportata la versione 3.2 patch 1092 git-svn-id: svn://10.65.10.50/trunk@16297 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			101 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			101 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
| #include <mask.h>  
 | |
| #include <prefix.h>  
 | |
| 
 | |
| #include "cg6903.h"
 | |
| #include "cg6900a.h"        
 | |
| 
 | |
| #include <mov.h>  
 | |
| #include <partite.h>
 | |
| 
 | |
| bool TRip_flag::create()
 | |
| {
 | |
|   _mov   = new TLocalisamfile (LF_MOV); 
 | |
|   _part  = new TLocalisamfile (LF_PARTITE);
 | |
|   
 | |
|   return TSkeleton_application::create();
 | |
| }
 | |
| 
 | |
| bool TRip_flag::destroy()
 | |
| {
 | |
|   delete _mov;                          
 | |
|   delete _part;
 | |
|   
 | |
|   return TSkeleton_application::destroy();
 | |
| }
 | |
| 
 | |
| void TRip_flag::main_loop()
 | |
| {              
 | |
|   TMask msk("cg6903a");
 | |
|   KEY k = msk.run();
 | |
|   if (k == K_ENTER)
 | |
|   {
 | |
|     long ditta  = msk.get_long(F_DITTAINV);
 | |
|     TDate datalim  = msk.get(F_DATA);
 | |
|     bool rippn  = msk.get_bool(F_RIPPN);
 | |
|     bool ripiva = msk.get_bool(F_RIPIVA);
 | |
|     bool ripsc  = msk.get_bool(F_RIPSC);
 | |
| 
 | |
|     if (!prefix().exist(ditta))
 | |
|     {
 | |
|       error_box("Libreria archivi ditta non presente su disco");
 | |
|       return;
 | |
|     }
 | |
| 
 | |
|     if (!rippn && !ripiva && !ripsc)
 | |
|     {
 | |
|       return; // Se non flaggo nessuno dei tre non ha
 | |
|     }         // senso scorrere l'archivio.
 | |
|                                          
 | |
|     set_firm(ditta);
 | |
|     
 | |
|     if (rippn || ripiva)
 | |
|     {
 | |
|       long cicli = _mov->items();
 | |
|       _prog = new TProgind(cicli, TR("Ripristino movimenti in corso"), FALSE);
 | |
| 
 | |
|       _mov->setkey(1);
 | |
|       _mov->zero();
 | |
| 
 | |
|       for (_mov->first();!_mov->eof();_mov->next())
 | |
|       { 
 | |
|         TDate datareg (_mov->get_date(MOV_DATAREG));
 | |
|       
 | |
|         _prog->addstatus(1);
 | |
|       
 | |
|         if (datareg < datalim) continue;
 | |
|       
 | |
|         if (rippn)                      
 | |
|           _mov->zero(MOV_INVIATO);
 | |
|         if (ripiva)  
 | |
|           _mov->zero(MOV_INVIVA);
 | |
| 
 | |
|         _mov->rewrite();
 | |
|       }
 | |
|       delete _prog;
 | |
|     }
 | |
|     if (ripsc)
 | |
|     {
 | |
|       long cicli = _part->items();
 | |
|       _prog = new TProgind(cicli,"Ripristino movimenti saldaconto in corso... Prego attendere.",FALSE);
 | |
| 
 | |
|       _part->setkey(1);
 | |
|       _part->zero();
 | |
| 
 | |
|       for (_part->first();!_part->eof();_part->next())
 | |
|       { 
 | |
|         TDate datareg (_part->get_date(PART_DATAREG));
 | |
|       
 | |
|         _prog->addstatus(1);
 | |
|       
 | |
|         if (datareg < datalim) continue;
 | |
|       
 | |
|         _part->zero(PART_INVIATA);
 | |
| 
 | |
|         _part->rewrite();
 | |
|       }
 | |
|       delete _prog;
 | |
|     }
 | |
|   }
 | |
| }
 | |
| 
 |