Patch level :2.2 nopatch
Files correlati : Ricompilazione Demo : [ ] Commento :aggiunti alcuni files e commenti al file 149 git-svn-id: svn://10.65.10.50/trunk@12656 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									ee8d54e739
								
							
						
					
					
						commit
						88a5ab4f4e
					
				@ -7,7 +7,7 @@ int main(int argc, char** argv)
 | 
			
		||||
  const int r = (argc > 1) ? argv[1][1] - '0' : 0;
 | 
			
		||||
  switch (r)
 | 
			
		||||
  {
 | 
			
		||||
  case  1: break;
 | 
			
		||||
  case  1: ca2200(argc, argv); break; //ribaltamenti movimenti analitica
 | 
			
		||||
  default: ca2100(argc,argv); break; // gestione movimenti
 | 
			
		||||
  }
 | 
			
		||||
  exit(0);
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								ca/ca2.h
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								ca/ca2.h
									
									
									
									
									
								
							@ -1,2 +1,2 @@
 | 
			
		||||
int ca2100(int argc, char* argv[]);
 | 
			
		||||
 | 
			
		||||
int ca2200(int argc, char* argv[]);
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										173
									
								
								ca/ca2200.cpp
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										173
									
								
								ca/ca2200.cpp
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,173 @@
 | 
			
		||||
#include <applicat.h>
 | 
			
		||||
#include <automask.h>
 | 
			
		||||
#include <progind.h>
 | 
			
		||||
#include <recarray.h>
 | 
			
		||||
#include <relation.h>
 | 
			
		||||
 | 
			
		||||
#include "calib01.h"
 | 
			
		||||
#include "ca2.h"
 | 
			
		||||
#include "ca2200a.h"
 | 
			
		||||
 | 
			
		||||
#include "movana.h"
 | 
			
		||||
#include "rmovana.h"
 | 
			
		||||
#include "rip.h"
 | 
			
		||||
#include "rrip.h"
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------
 | 
			
		||||
//  MASCHERA
 | 
			
		||||
//--------------------------------------------------------------------
 | 
			
		||||
class TRib_movanal_msk : public TAutomask
 | 
			
		||||
{
 | 
			
		||||
protected:
 | 
			
		||||
  virtual bool on_field_event(TOperable_field& o, TField_event fe, long jolly);
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
  TRib_movanal_msk();  
 | 
			
		||||
  virtual ~TRib_movanal_msk(){};
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
TRib_movanal_msk::TRib_movanal_msk() :TAutomask ("ca2200a") { }  
 | 
			
		||||
  
 | 
			
		||||
bool TRib_movanal_msk::on_field_event(TOperable_field& o, TField_event e, long jolly)
 | 
			
		||||
{ 
 | 
			
		||||
/*  switch (o.dlg())
 | 
			
		||||
  {
 | 
			
		||||
  case :
 | 
			
		||||
    break;
 | 
			
		||||
  default: break;
 | 
			
		||||
  }*/  
 | 
			
		||||
  return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------
 | 
			
		||||
//  CLASSE PER RIPARTIZIONI RIGHE E TESTATE
 | 
			
		||||
//--------------------------------------------------------------------
 | 
			
		||||
/*class TRipartizione : public TMultiple_rectype
 | 
			
		||||
{
 | 
			
		||||
  public:
 | 
			
		||||
  TRipartizione(long numreg = 0);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
TRipartizione::TRipartizione(long numreg) : TMultiple_rectype(LF_RIP)
 | 
			
		||||
{
 | 
			
		||||
  add_file(LF_RMOVANA, "NUMRIG");
 | 
			
		||||
  if (numreg > 0)
 | 
			
		||||
    read(numreg);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------
 | 
			
		||||
//  CLASSE PER RIPARTIZIONI RIGHE
 | 
			
		||||
//--------------------------------------------------------------------
 | 
			
		||||
class TCache_ripartizioni : public TCache
 | 
			
		||||
{
 | 
			
		||||
  TLocalisamfile _rip;  //testate delle ripartizioni
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
  virtual TObject* key2obj(const char* key);
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
  TRecord_array& righe(const char* costo);
 | 
			
		||||
  TCache_ripartizioni() : _rip(LF_RIP) {_rip.setkey(4);}
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
TObject* TCache_ripartizioni::key2obj(const char* key)
 | 
			
		||||
{
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  TRecord_array* rows = new TRecord_array(LF_RRIP, RRIP_NRIGA);
 | 
			
		||||
  TRectype* chiave = new TRectype(LF_RRIP);
 | 
			
		||||
  chiave.put(RRIP_TIPO, "B");
 | 
			
		||||
  chiave.put(RRIP_CODICE, codice);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
TRecord_array& TCache_ripartizioni::righe(const char* costo)
 | 
			
		||||
{
 | 
			
		||||
}*/
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------
 | 
			
		||||
//  APPLICAZIONE
 | 
			
		||||
//--------------------------------------------------------------------
 | 
			
		||||
class TRib_movanal_app : public TSkeleton_application
 | 
			
		||||
{
 | 
			
		||||
  TRib_movanal_msk * _mask;
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
  virtual bool create();
 | 
			
		||||
  virtual bool destroy();
 | 
			
		||||
  virtual void main_loop();
 | 
			
		||||
 | 
			
		||||
  static bool cappotta_movimento(const TRelation& rel, void* pJolly);
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
  TRib_movanal_app() {}
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
bool TRib_movanal_app::create()
 | 
			
		||||
{
 | 
			
		||||
  _mask = new TRib_movanal_msk;  
 | 
			
		||||
  return TSkeleton_application::create();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool TRib_movanal_app::destroy()
 | 
			
		||||
{
 | 
			
		||||
  delete _mask;
 | 
			
		||||
  return TSkeleton_application::destroy();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool TRib_movanal_app::cappotta_movimento(const TRelation& rel, void* pJolly)
 | 
			
		||||
{
 | 
			
		||||
  TRib_movanal_app* app = (TRib_movanal_app*)pJolly;
 | 
			
		||||
 | 
			
		||||
  TAnal_mov& anal_mov = (TAnal_mov&)rel.curr(); //movimento analitica
 | 
			
		||||
  TRecord_array& input_rows = anal_mov.body();  //record_array con le righe del mov_anal (INPUT)
 | 
			
		||||
  
 | 
			
		||||
  TRecord_array output_rows = input_rows; //crea il record_array di output come copia dell'INPUT..
 | 
			
		||||
  output_rows.destroy_rows();             //..e poi lo pulisce
 | 
			
		||||
 | 
			
		||||
  TToken_string key;  //tokenstring in cui parcheggiare la chiave del record
 | 
			
		||||
  for (int i = 1; i <= input_rows.rows(); i++)
 | 
			
		||||
  {
 | 
			
		||||
    const TRectype& rec = input_rows.row(i);
 | 
			
		||||
    key = "B";
 | 
			
		||||
    key.add(rec.get(RMOVANA_CODCCOSTO));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  }
 | 
			
		||||
  return true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void TRib_movanal_app::main_loop()
 | 
			
		||||
{
 | 
			
		||||
  while (_mask->run() == K_ENTER)
 | 
			
		||||
  { 
 | 
			
		||||
    //deve scandire il file MOVANA con chiave 2 (per data e numero di registrazione)
 | 
			
		||||
    TRelation rel_movana(LF_MOVANA);
 | 
			
		||||
    TRectype darec(LF_MOVANA), arec(LF_MOVANA);
 | 
			
		||||
    darec.put(MOVANA_DATAREG, _mask->get_date(F_DATAINI));
 | 
			
		||||
    arec.put(MOVANA_DATAREG, _mask->get_date(F_DATAFIN));
 | 
			
		||||
    TString filtro;
 | 
			
		||||
    filtro << "BLOCCATO==''";
 | 
			
		||||
 | 
			
		||||
    TCursor cur_movana(&rel_movana, filtro, 2, &darec, &arec);
 | 
			
		||||
    const long items = cur_movana.items();
 | 
			
		||||
    //usa la scan dei TCursor,quindi niente progind e for,x' gia' nel metodo
 | 
			
		||||
    if (items > 0)
 | 
			
		||||
    {
 | 
			
		||||
      cur_movana.scan(cappotta_movimento, this, "Ribaltamento movimenti...");
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
      message_box(TR("Non ci sono movimenti da ribaltare nel periodo selezionato"));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  } 
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int ca2200(int argc, char* argv[])
 | 
			
		||||
{
 | 
			
		||||
  TRib_movanal_app app;
 | 
			
		||||
  app.run(argc, argv, "Ribaltamento movimenti di analitica");
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										4
									
								
								ca/ca2200a.h
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										4
									
								
								ca/ca2200a.h
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,4 @@
 | 
			
		||||
// campi maschera ca2200a.uml
 | 
			
		||||
 | 
			
		||||
#define F_DATAINI     102
 | 
			
		||||
#define F_DATAFIN     103
 | 
			
		||||
							
								
								
									
										39
									
								
								ca/ca2200a.uml
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										39
									
								
								ca/ca2200a.uml
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,39 @@
 | 
			
		||||
#include "ca2200a.h"
 | 
			
		||||
 | 
			
		||||
TOOLBAR "" 0 -3 0 3
 | 
			
		||||
 | 
			
		||||
BUTTON DLG_OK 10 2
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT -12 -11 "~Elabora"
 | 
			
		||||
  PICTURE BMP_ELABORA
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
BUTTON DLG_QUIT 10 2
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT -22 -11 ""
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
ENDPAGE    
 | 
			
		||||
 | 
			
		||||
PAGE "Ribaltamento movimenti di contabilita' analitica" 0 0 64 12
 | 
			
		||||
 | 
			
		||||
GROUPBOX DLG_NULL 78 4
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 1 1 "@bIntervallo date"
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
DATA F_DATAINI
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 2 2 "Da data "
 | 
			
		||||
  CHECKTYPE REQUIRED
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
DATA F_DATAFIN
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 2 3 "A data  "
 | 
			
		||||
  CHECKTYPE REQUIRED
 | 
			
		||||
END 
 | 
			
		||||
 | 
			
		||||
ENDPAGE
 | 
			
		||||
 | 
			
		||||
ENDMASK
 | 
			
		||||
							
								
								
									
										18
									
								
								ca/f149.trr
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								ca/f149.trr
									
									
									
									
									
								
							@ -1,14 +1,14 @@
 | 
			
		||||
149
 | 
			
		||||
9
 | 
			
		||||
TIPO|1|1|0|
 | 
			
		||||
CODICE|1|8|0|
 | 
			
		||||
GRUPPO|2|3|0|
 | 
			
		||||
CONTO|2|3|0|
 | 
			
		||||
SOTTOCONTO|3|6|0|
 | 
			
		||||
CODCOSTO|1|20|0|
 | 
			
		||||
CODCMS|1|20|0|
 | 
			
		||||
DESCRIZ|1|50|0|
 | 
			
		||||
TIPORIP|1|1|0|
 | 
			
		||||
TIPO|1|1|0|Tipo Ripartizione (<I>nterattiva, <B>atch)
 | 
			
		||||
CODICE|1|8|0|Codice ripartizione
 | 
			
		||||
GRUPPO|2|3|0|Gruppo
 | 
			
		||||
CONTO|2|3|0|Conto
 | 
			
		||||
SOTTOCONTO|3|6|0|Sottoconto
 | 
			
		||||
CODCOSTO|1|20|0|Codice centro di costo
 | 
			
		||||
CODCMS|1|20|0|Codice commessa
 | 
			
		||||
DESCRIZ|1|50|0|Descrizione
 | 
			
		||||
TIPORIP|1|1|0|Tipo ripartizione
 | 
			
		||||
5
 | 
			
		||||
TIPO+CODICE| 
 | 
			
		||||
TIPO+DESCRIZ|X
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
150
 | 
			
		||||
8
 | 
			
		||||
TIPO|1|1|0|Tipo Ripartizione (<I>nterattiva, <B>atch)+
 | 
			
		||||
TIPO|1|1|0|Tipo Ripartizione (<I>nterattiva, <B>atch)
 | 
			
		||||
CODICE|1|8|0|Codice ripartizione
 | 
			
		||||
NRIGA|2|3|0|Numero riga
 | 
			
		||||
CODCOSTO|1|20|0|Codice centro di costo
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										14
									
								
								ca/rip.h
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										14
									
								
								ca/rip.h
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,14 @@
 | 
			
		||||
#ifndef __RIP_H
 | 
			
		||||
#define __RIP_H
 | 
			
		||||
 | 
			
		||||
#define RIP_TIPO        "TIPO"
 | 
			
		||||
#define RIP_CODICE      "CODICE"
 | 
			
		||||
#define RIP_GRUPPO      "GRUPPO"
 | 
			
		||||
#define RIP_CONTO       "CONTO"
 | 
			
		||||
#define RIP_SOTTOCONTO  "SOTTOCONTO"
 | 
			
		||||
#define RIP_CODCOSTO    "CODCOSTO"
 | 
			
		||||
#define RIP_CODCMS      "CODCMS"
 | 
			
		||||
#define RIP_DESCRIZ     "DESCRIZ"
 | 
			
		||||
#define RIP_TIPORIP     "TIPORIP"
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
							
								
								
									
										13
									
								
								ca/rrip.h
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										13
									
								
								ca/rrip.h
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,13 @@
 | 
			
		||||
#ifndef __RRIP_H
 | 
			
		||||
#define __RRIP_H
 | 
			
		||||
 | 
			
		||||
#define RRIP_TIPO        "TIPO"
 | 
			
		||||
#define RRIP_CODICE      "CODICE"
 | 
			
		||||
#define RRIP_NRIGA       "NRIGA"
 | 
			
		||||
#define RRIP_CODCOSTO    "CODCOSTO"
 | 
			
		||||
#define RRIP_CODCMS      "CODCMS"
 | 
			
		||||
#define RRIP_CODFASE     "CODFASE"
 | 
			
		||||
#define RRIP_CODCONTO    "CODCONTO"
 | 
			
		||||
#define RRIP_RIPARTO     "RIPARTO"
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user