Files correlati : ve6.exe Ricompilazione Demo : [ ] Commento : Riportata la versione 3.1 patch 979 git-svn-id: svn://10.65.10.50/trunk@15623 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			148 lines
		
	
	
		
			3.2 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			148 lines
		
	
	
		
			3.2 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
| //********************************
 | |
| //* Aggiornamento Tipo Attivita' *
 | |
| //********************************
 | |
| #include "cg1.h"  
 | |
| #include "cg1301.h"
 | |
| #include "cg1302.h" 
 | |
| #include "cg1303.h" 
 | |
| #include "cg1304.h"
 | |
| #include "cg1305.h"
 | |
| #include "cg1306.h"
 | |
| #include "cg1307.h"
 | |
| #include "cg1308.h"
 | |
| #include "cg1309.h"
 | |
| #include "cglib01.h"
 | |
| 
 | |
| #include <applicat.h> 
 | |
| #include <mask.h>
 | |
| #include <progind.h>
 | |
| 
 | |
| #include <mov.h>  
 | |
| 
 | |
| 
 | |
| class TAgg_attiv : public TSkeleton_application
 | |
| {
 | |
| protected:        
 | |
|   virtual void main_loop();
 | |
|   
 | |
| public:        
 | |
|   void elabora_mov();
 | |
| };                                      
 | |
| 
 | |
| // HIDDEN TAgg_attiv& app() { return (TAgg_attiv&)main_app(); }
 | |
| 
 | |
| void TAgg_attiv::main_loop()
 | |
| {
 | |
|   TMask msk("cg1300a");
 | |
|   while (msk.run() == K_ENTER) 
 | |
|   {
 | |
|     elabora_mov();
 | |
|     message_box(TR("Aggiornamento completato"));
 | |
|   }
 | |
| }
 | |
| 
 | |
| void TAgg_attiv::elabora_mov()
 | |
| {
 | |
|   TRelation rel (LF_MOV);
 | |
|   rel.add(LF_RMOVIVA, "NUMREG=NUMREG",1);
 | |
|   TCursor cursor(&rel,"",1);
 | |
|   
 | |
|   TLocalisamfile& mov = rel.lfile();
 | |
|   TLocalisamfile& rmoviva = rel.lfile(LF_RMOVIVA);
 | |
|   
 | |
| //-  long ditta = get_firm();
 | |
|   cursor = 0L;
 | |
|   const long nitems = cursor.items();
 | |
|   
 | |
|   TProgind p(nitems ? nitems : 1, TR("Aggiornamento in corso...") , TRUE, TRUE, 70);
 | |
| 
 | |
|   for (; cursor.pos() < cursor.items(); ++cursor)
 | |
|   {
 | |
|     p.addstatus(1);
 | |
|     const TString16 reg(mov.get(MOV_REG));
 | |
|     if (reg.empty()) continue;
 | |
|     
 | |
|     const int annoiva = mov.get_int(MOV_ANNOIVA);
 | |
|     TRegistro registro(reg, annoiva);
 | |
|     const bool att_mista = registro.attivita_mista();
 | |
|     
 | |
|     if (att_mista)
 | |
|     {   
 | |
|       bool ok = rel.is_first_match(LF_RMOVIVA);
 | |
|       while (ok)
 | |
|       {
 | |
|         const char tipo = rmoviva.get_char("TIPOC");
 | |
|         if (tipo <= ' ')               
 | |
|         {
 | |
|           TBill c(rmoviva.get_int("GRUPPO"), rmoviva.get_int("CONTO"), rmoviva.get_long("SOTTOCONTO"));
 | |
|           int tipoatt = c.tipo_att();
 | |
|           rmoviva.put("TIPOATT", tipoatt); 
 | |
|           rmoviva.rewrite();      
 | |
|         }
 | |
|         ok = rel.next_match(LF_RMOVIVA);  
 | |
|       }
 | |
|     }  
 | |
|   } 
 | |
| }
 | |
| 
 | |
| int cg1300(int argc, char* argv[])
 | |
| {                                
 | |
|   switch (toupper(*argv[2]))
 | |
|   {
 | |
|   case 'A':
 | |
|     {
 | |
|       TAgg_attiv a;      
 | |
|       a.run(argc, argv, TR("Aggiornamento tipo attivita' su movimenti iva"));
 | |
|     }
 | |
|     break;
 | |
|   case 'C':
 | |
|     {   
 | |
|       TAgg_codatt a;       
 | |
|       a.run(argc, argv,TR("Aggiornamento codice attivita'"));
 | |
|     } 
 | |
|     break;
 | |
|   case 'D':
 | |
|     {   
 | |
|       TAgg_datacomp a;       
 | |
|       a.run(argc, argv,TR("Aggiornamento data competenza"));
 | |
|     } 
 | |
|     break;
 | |
|   case 'E':
 | |
|     {   
 | |
|       TAgg_codes a;       
 | |
|       a.run(argc, argv,TR("Aggiornamento codice esercizio"));
 | |
|     } 
 | |
|     break;
 | |
|   case 'I':
 | |
|     {
 | |
|       TAgg_opintra a;
 | |
|       a.run(argc, argv, TR("Aggiornamento flag op. intracomunitarie"));       
 | |
|     }
 | |
|     break;
 | |
|   case 'L':
 | |
|     controlla_PIVA(argc, argv);                             // cg1309
 | |
|     break;
 | |
|   case 'P':
 | |
|     {   
 | |
|       TAgg_nprot a;       
 | |
|       a.run(argc, argv,TR("Rinumerazione numero di protocollo"));
 | |
|     } 
 | |
|     break;
 | |
|   case 'T':
 | |
|     {
 | |
|       TAgg_tconto a;                      
 | |
|       a.run(argc, argv, TR("Aggiornamento tipo conto"));    // cg1302
 | |
|     }
 | |
|     break;
 | |
|   case 'Z':
 | |
|     elimina_zoppi(argc, argv);
 | |
|     break;
 | |
|   case 'M':
 | |
|     setta_meseliq(argc, argv);
 | |
|     break;
 | |
|   default:
 | |
|     break;
 | |
|   }
 | |
|   return 0;
 | |
| }
 |