Files correlati : tc2.exe Ricompilazione Demo : [ ] Commento : Trasferimento IPSOA git-svn-id: svn://10.65.10.50/branches/R_10_00@21148 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			126 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			126 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			C++
		
	
	
		
			Executable File
		
	
	
	
	
| #include <confapp.h>
 | |
| #include <msksheet.h>
 | |
| #include <progind.h>
 | |
| #include <recset.h>
 | |
| #include <recarray.h>
 | |
| #include <relation.h>
 | |
| 
 | |
| #include "../include/attiv.h"
 | |
| #include "../include/mov.h"
 | |
| #include "../cg/cglib01.h"
 | |
| #include "ipconf.h"
 | |
| 
 | |
| class TIP_confditta : public TConfig_application
 | |
| {
 | |
|   char _current;
 | |
| 
 | |
|   static bool check_fields(TMask_field& f, KEY k);
 | |
|   // @cmember:(INTERNAL) Salva i parametri dalla maschera
 | |
|   virtual void save_mask(bool tosave);
 | |
|   virtual void load_mask();
 | |
| public:
 | |
|   // @cmember Disabilita la verifica del modulo in chiave
 | |
|   virtual bool check_autorization() const  { return FALSE; }
 | |
| 
 | |
|   virtual bool preprocess_config (TMask& mask, TConfig& config);
 | |
|   virtual bool postprocess_config (TMask& mask, TConfig& config);
 | |
|   virtual bool user_create( );
 | |
|   virtual bool user_destroy( );
 | |
| 
 | |
|   TIP_confditta() : TConfig_application( CONFIG_DITTA ){ }
 | |
|   virtual ~TIP_confditta( ){ }
 | |
| };
 | |
| 
 | |
| bool TIP_confditta::check_fields(TMask_field& f, KEY k)
 | |
| {
 | |
|   return true;
 | |
| }
 | |
| 
 | |
| void TIP_confditta::load_mask()
 | |
| {
 | |
|   TMask* mask = get_mask();
 | |
|   
 | |
| 	if (mask != NULL)
 | |
| 	{
 | |
| 		TConfig_application::load_mask();
 | |
| 	}
 | |
| }
 | |
| 
 | |
| void TIP_confditta::save_mask(bool tosave)
 | |
| {
 | |
| 	if (tosave)
 | |
| 	{
 | |
| 		const TMask & m = *get_mask();
 | |
| 
 | |
| 		if (m.get_bool(F_RIPRISTINO))
 | |
| 		{
 | |
| 			const TDate from(m.get(F_ULTINVIO));
 | |
| 			TEsercizi_contabili esc;
 | |
| 			const TEsercizio & e = esc.esercizio(esc.date2esc(from));
 | |
| 			const TDate to(e.fine());
 | |
| 
 | |
| 			TString query = "USE MOV KEY 2 SELECT INVIATO==\"X\"";           
 | |
| 
 | |
| 			query << "\nFROM DATAREG=#DATA_DA";      
 | |
| 			query << "\nTO DATAREG=#DATA_AL";      
 | |
| 	
 | |
| 			TISAM_recordset mov(query);
 | |
| 			
 | |
| 			mov.set_var("#DATA_DA", TVariant(from));
 | |
| 			mov.set_var("#DATA_AL", TVariant(to));
 | |
| 
 | |
| 	    if (mov.items() >0L)
 | |
| 			{
 | |
| 				TProgind pi(mov.items(), TR("Ripristino movimenti"), true, true);
 | |
| 				TLocalisamfile cgmov(LF_MOV);
 | |
| 			
 | |
| 				for (bool ok = mov.move_first(); ok; ok = mov.move_next())
 | |
| 				{
 | |
| 					if (!pi.addstatus(1))
 | |
| 						break;
 | |
| 					const long numreg = mov.get(MOV_NUMREG).as_int();
 | |
| 
 | |
| 					cgmov.put(MOV_NUMREG, numreg);
 | |
| 					if (cgmov.read(_isequal, _lock) == NOERR)
 | |
| 					{
 | |
| 						cgmov.zero(MOV_INVIATO);
 | |
| 						cgmov.rewrite();
 | |
| 					}
 | |
| 				}
 | |
| 			}
 | |
| 		}
 | |
| 	}
 | |
| 	TConfig_application::save_mask(tosave);
 | |
| }
 | |
| 
 | |
| bool TIP_confditta::preprocess_config (TMask& mask, TConfig& config)
 | |
| {
 | |
|   return true;
 | |
| }
 | |
| 
 | |
| bool TIP_confditta::postprocess_config (TMask& mask, TConfig& config)
 | |
| {
 | |
|   return true;
 | |
| }
 | |
| 
 | |
| 
 | |
| bool TIP_confditta::user_create( )
 | |
| {
 | |
| 	TConfig conf(CONFIG_DITTA);
 | |
| 
 | |
|   conf.set( "EdMask", "tc2300a", "tc");
 | |
|   return true;
 | |
| }
 | |
| 
 | |
| bool TIP_confditta::user_destroy( )
 | |
| {
 | |
|   return true;
 | |
| }
 | |
| 
 | |
| int tc2300(int argc, char* argv[])
 | |
| {
 | |
|   TIP_confditta appc;
 | |
|   appc.run(argc, argv, TR("Parametri ditta IPSOA"));
 | |
|   return 0;
 | |
| }
 |