//In ab0 è stato modicata la gestione del piano dei conti:
//ab0 sono stati aggiunti dei commenti //ab0100.cpp è stato commentato tutto quello che riguarda il livello di struttura //in quanto questo campo non viene più utilizzato ed è stato aggiornato ab0200.h //la maschera è stata modificata: aggiunto il compo "conto sospeso" e tolto quello del //livello di struttura //AB1 esegue la stampa delle tabelle e del piano dei conti //sono state aggiunti i relativi file delle maschere git-svn-id: svn://10.65.10.50/trunk@5434 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									5b25e45971
								
							
						
					
					
						commit
						d0542d7ca9
					
				@ -12,9 +12,9 @@ int main(int argc,char** argv)
 | 
			
		||||
  switch (n)
 | 
			
		||||
  {
 | 
			
		||||
  case 0:
 | 
			
		||||
    ab0100(argc,argv); break;
 | 
			
		||||
    ab0100(argc,argv); break;   //Sintassi ab0 -0 tab_name -utente
 | 
			
		||||
  case 1:
 | 
			
		||||
    ab0200(argc,argv); break;
 | 
			
		||||
    ab0200(argc,argv); break;   //Sintassi ab0 -1 -utente
 | 
			
		||||
  case 2:
 | 
			
		||||
    //ab0300(argc,argv); break;
 | 
			
		||||
    //  case 3:
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,3 @@
 | 
			
		||||
 | 
			
		||||
#include <applicat.h>
 | 
			
		||||
#include <tabapp.h>  
 | 
			
		||||
#include <strings.h>
 | 
			
		||||
@ -9,6 +8,7 @@
 | 
			
		||||
#include <prefix.h>
 | 
			
		||||
 | 
			
		||||
#include "batbpdb.h"
 | 
			
		||||
#include "batbarb.h"
 | 
			
		||||
 | 
			
		||||
class Tabanabil_application : public Tab_application
 | 
			
		||||
{
 | 
			
		||||
@ -88,8 +88,9 @@ bool Tabanabil_application::user_create()
 | 
			
		||||
    _msk->set_handler(F_MESE_INI,    mese_handler);
 | 
			
		||||
    _msk->set_handler(F_GIORNO_FINE, giorno_handler);
 | 
			
		||||
    _msk->set_handler(F_MESE_FINE,   mese_handler);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  }                      
 | 
			
		||||
  if (_tabname == "%ARB") 
 | 
			
		||||
  		set_search_field(F_CODTAB_ESE);
 | 
			
		||||
  return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -19,7 +19,13 @@ class TPconAb : public TRelation_application
 | 
			
		||||
  
 | 
			
		||||
  TString      _codice;
 | 
			
		||||
  int          _indbil,_newindbil;               
 | 
			
		||||
  bool         _isparametri;
 | 
			
		||||
  bool         _isparametri; 
 | 
			
		||||
 | 
			
		||||
  static bool ContoSezBilOpp(TMask_field& f, KEY key);
 | 
			
		||||
  static bool IndBil        (TMask_field& f, KEY key);
 | 
			
		||||
//  static bool LivelloStrutt (TMask_field& f, KEY key);  
 | 
			
		||||
//  const char * extra_modules() const { return format("%d",CGAUT); }
 | 
			
		||||
  void   ScriviContoSezOpp  (const TString& codice, const TString& val);
 | 
			
		||||
  
 | 
			
		||||
protected:
 | 
			
		||||
  virtual bool user_create();
 | 
			
		||||
@ -35,14 +41,6 @@ protected:
 | 
			
		||||
  virtual void init_insert_mode (TMask&);    
 | 
			
		||||
  
 | 
			
		||||
public:                    
 | 
			
		||||
 | 
			
		||||
  static bool ContoSezBilOpp(TMask_field& f, KEY key);
 | 
			
		||||
  static bool IndBil        (TMask_field& f, KEY key);
 | 
			
		||||
  static bool LivelloStrutt (TMask_field& f, KEY key);  
 | 
			
		||||
  const char * extra_modules() const { return format("%d",CGAUT); }
 | 
			
		||||
  
 | 
			
		||||
  void   ScriviContoSezOpp  (const TString& codice, const TString& val);
 | 
			
		||||
  
 | 
			
		||||
  TPconAb() {} ;
 | 
			
		||||
};                    
 | 
			
		||||
/*
 | 
			
		||||
@ -111,7 +109,7 @@ bool TPconAb::IndBil(TMask_field& f, KEY k)
 | 
			
		||||
  
 | 
			
		||||
  return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
// Handler che controlla la validita' del campo "Livello di struttura":
 | 
			
		||||
// il suo valore deve essere >= 1 e <= 99.
 | 
			
		||||
 | 
			
		||||
@ -127,7 +125,7 @@ bool TPconAb::LivelloStrutt(TMask_field& f, KEY k)
 | 
			
		||||
  
 | 
			
		||||
  return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
*/
 | 
			
		||||
void TPconAb::init_query_mode(TMask&)
 | 
			
		||||
{
 | 
			
		||||
  if (_isparametri)
 | 
			
		||||
@ -222,7 +220,7 @@ bool TPconAb::user_create()
 | 
			
		||||
  
 | 
			
		||||
  _msk->set_handler(F_CODCONTR, ContoSezBilOpp);
 | 
			
		||||
  _msk->set_handler(F_INDBIL,   IndBil);
 | 
			
		||||
  _msk->set_handler(F_LIVELLO,  LivelloStrutt);                                                                    
 | 
			
		||||
 // _msk->set_handler(F_LIVELLO,  LivelloStrutt);                                                                    
 | 
			
		||||
  
 | 
			
		||||
  _isparametri = FALSE;                       
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										13
									
								
								ab/ab0200.h
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								ab/ab0200.h
									
									
									
									
									
								
							@ -1,11 +1,8 @@
 | 
			
		||||
// campi maschera ab0200a.uml
 | 
			
		||||
 | 
			
		||||
#define F_CODICE      101
 | 
			
		||||
#define F_DESCRIZ1    102
 | 
			
		||||
#define F_DESCRIZ2    103
 | 
			
		||||
#define F_LIVELLO     104
 | 
			
		||||
#define F_INDBIL      105
 | 
			
		||||
#define F_CODCONTR    106
 | 
			
		||||
#define F_DETTAGLIO   107   
 | 
			
		||||
#define F_DESCRCONTR1 108
 | 
			
		||||
#define F_DESCRCONTR2 109
 | 
			
		||||
#define F_DESCRIZ     102
 | 
			
		||||
#define F_INDBIL      103
 | 
			
		||||
#define F_CODCONTR    104
 | 
			
		||||
#define F_DETTAGLIO   105 
 | 
			
		||||
#define SOSPENDI      106  
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
#include "ab0200.h"
 | 
			
		||||
 | 
			
		||||
TOOLBAR "" 0 20 0 2
 | 
			
		||||
TOOLBAR "" 0 19 0 2
 | 
			
		||||
 | 
			
		||||
#include <toolbar.h>
 | 
			
		||||
 | 
			
		||||
@ -8,66 +8,51 @@ ENDPAGE
 | 
			
		||||
 | 
			
		||||
PAGE "Piano dei Conti" 0 -1 0 19
 | 
			
		||||
 | 
			
		||||
GROUPBOX DLG_NULL 76 5
 | 
			
		||||
GROUPBOX DLG_NULL 76 6
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 1 0 ""
 | 
			
		||||
  FLAGS "R"
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
NUMBER F_CODICE 10
 | 
			
		||||
NUMBER F_CODICE 12
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 2 1 "Codice tabella              "
 | 
			
		||||
  PROMPT 2 2 "Codice tabella              "
 | 
			
		||||
  HELP "Codice della tabella Piano dei Conti"
 | 
			
		||||
  FIELD LF_ABPCON->CODCBL
 | 
			
		||||
  KEY 1
 | 
			
		||||
  USE LF_ABPCON KEY 1
 | 
			
		||||
  INPUT CODCBL F_CODICE
 | 
			
		||||
  DISPLAY "Codice@11" CODCBL
 | 
			
		||||
  DISPLAY "Descrizione@40" DESCRIZ[1,40]
 | 
			
		||||
  DISPLAY "Codice@12" CODCBL
 | 
			
		||||
  DISPLAY "Descrizione@40" DESCRIZ
 | 
			
		||||
  DISPLAY "I.B." INDBIL
 | 
			
		||||
  DISPLAY "Codice opp.@11" CODCONTR
 | 
			
		||||
  DISPLAY "Codice opp.@12" CODCONTR
 | 
			
		||||
  DISPLAY "Sospeso@2" SOSPESO
 | 
			
		||||
  OUTPUT F_CODICE CODCBL
 | 
			
		||||
  OUTPUT F_DESCRIZ1 DESCRIZ[1,40]
 | 
			
		||||
  OUTPUT F_DESCRIZ2 DESCRIZ[41,]
 | 
			
		||||
  OUTPUT F_DESCRIZ DESCRIZ
 | 
			
		||||
  CHECKTYPE REQUIRED
 | 
			
		||||
  FLAGS "Z"
 | 
			
		||||
  FLAGS "ZRU"
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
STRING F_DESCRIZ1 40
 | 
			
		||||
STRING F_DESCRIZ 80 40
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 2 2 "I parte descrizione         "
 | 
			
		||||
  FIELD LF_ABPCON->DESCRIZ[1,40]
 | 
			
		||||
  PROMPT 2 4 "Descrizione                 "
 | 
			
		||||
  FIELD LF_ABPCON->DESCRIZ
 | 
			
		||||
  KEY 2
 | 
			
		||||
  USE LF_ABPCON KEY 2
 | 
			
		||||
  INPUT DESCRIZ[1,40] F_DESCRIZ1
 | 
			
		||||
  DISPLAY "Descrizione@40" DESCRIZ[1,40]
 | 
			
		||||
  DISPLAY "Codice@11" CODCBL
 | 
			
		||||
  INPUT DESCRIZ F_DESCRIZ
 | 
			
		||||
  DISPLAY "Descrizione@40" DESCRIZ
 | 
			
		||||
  DISPLAY "Codice@12" CODCBL
 | 
			
		||||
  DISPLAY "I.B." INDBIL
 | 
			
		||||
  DISPLAY "Codice opp.@11" CODCONTR
 | 
			
		||||
  DISPLAY "Codice opp.@12" CODCONTR
 | 
			
		||||
  DISPLAY "Sospeso@2" SOSPESO
 | 
			
		||||
  COPY OUTPUT F_CODICE
 | 
			
		||||
  HELP "Prima parte della descrizione"
 | 
			
		||||
  WARNING "Manca la descrizione"
 | 
			
		||||
  CHECKTYPE REQUIRED           // Guy: perche' non cosi'?
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
STRING F_DESCRIZ2 40
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 2 3 "II parte descrizione        "
 | 
			
		||||
  FIELD LF_ABPCON->DESCRIZ[41,]
 | 
			
		||||
  KEY 2
 | 
			
		||||
  HELP "Seconda parte della descrizione"
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
NUMBER F_LIVELLO 2
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 2 6 "Livello di struttura (1-99) "
 | 
			
		||||
  HELP "Inserire il livello di struttura: il valore deve essere compreso fra 1 e 99"
 | 
			
		||||
  FIELD LF_ABPCON->LIVELLO
 | 
			
		||||
  FLAGS "R"
 | 
			
		||||
  CHECKTYPE REQUIRED
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
LIST F_INDBIL 16
 | 
			
		||||
LIST F_INDBIL 15
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 2 8 "Indicatore di bilancio      "
 | 
			
		||||
  FIELD LF_ABPCON->INDBIL
 | 
			
		||||
@ -79,53 +64,38 @@ BEGIN
 | 
			
		||||
  ITEM "9|Varie"
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
NUMBER F_CODCONTR 10
 | 
			
		||||
NUMBER F_CODCONTR 12
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 2 10 "Conto di sez.bil.opposta    "
 | 
			
		||||
  HELP "Inserire il conto di sezione di bilancio opposta"
 | 
			
		||||
  FIELD LF_ABPCON->CODCONTR
 | 
			
		||||
  USE LF_ABPCON
 | 
			
		||||
  INPUT CODCBL F_CODCONTR
 | 
			
		||||
  DISPLAY "Codice@11" CODCBL
 | 
			
		||||
  DISPLAY "Descrizione@40" DESCRIZ[1,40]
 | 
			
		||||
  DISPLAY "Codice@12" CODCBL
 | 
			
		||||
  DISPLAY "Descrizione@40" DESCRIZ
 | 
			
		||||
  DISPLAY "I.B." INDBIL
 | 
			
		||||
  DISPLAY "Codice@11" CODCONTR
 | 
			
		||||
  DISPLAY "Codice@12" CODCONTR
 | 
			
		||||
  DISPLAY "Sospeso@2" SOSPESO
 | 
			
		||||
  OUTPUT F_CODCONTR CODCBL
 | 
			
		||||
  OUTPUT F_DESCRCONTR1 DESCRIZ[1,40]
 | 
			
		||||
  OUTPUT F_DESCRCONTR2 DESCRIZ[41,]
 | 
			
		||||
  CHECKTYPE NORMAL
 | 
			
		||||
  ADD RUN AB0 -1 #F_CODICE #F_INDBIL
 | 
			
		||||
  FLAGS "Z"
 | 
			
		||||
  FLAGS "ZRU"
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
STRING F_DESCRCONTR1 40
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 30 11 ""
 | 
			
		||||
  USE LF_ABPCON KEY 2
 | 
			
		||||
  INPUT DESCRIZ F_DESCRCONTR1
 | 
			
		||||
  DISPLAY "Descrizione@40" DESCRIZ[1,40]
 | 
			
		||||
  DISPLAY "Codice@11" CODCBL
 | 
			
		||||
  DISPLAY "I.B." INDBIL
 | 
			
		||||
  DISPLAY "Codice@11" CODCONTR
 | 
			
		||||
  OUTPUT F_CODCONTR CODCBL
 | 
			
		||||
  OUTPUT F_DESCRCONTR1 DESCRIZ[1,40]
 | 
			
		||||
  OUTPUT F_DESCRCONTR2 DESCRIZ[41,]
 | 
			
		||||
  ADD RUN AB0 -1 #F_CODICE #F_INDBIL
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
STRING F_DESCRCONTR2 40
 | 
			
		||||
LIST F_DETTAGLIO 15
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 30 12 ""
 | 
			
		||||
  FLAGS "D"
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
LIST F_DETTAGLIO 11
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 2 13 "Dettaglio/Movimenti         "
 | 
			
		||||
  PROMPT 2 14 "Dettaglio/Movimenti         "
 | 
			
		||||
  FIELD LF_ABPCON->DETT
 | 
			
		||||
  ITEM " |Nessuno"
 | 
			
		||||
  ITEM "D|Dettaglio"
 | 
			
		||||
  ITEM "M|Movimenti"
 | 
			
		||||
END         
 | 
			
		||||
 | 
			
		||||
BOOLEAN SOSPENDI
 | 
			
		||||
BEGIN
 | 
			
		||||
	PROMTP 2 16 " Conto sospeso"
 | 
			
		||||
	FIELD LF_ABPCON->SOSPESO
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
ENDPAGE
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										24
									
								
								ab/ab1.cpp
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										24
									
								
								ab/ab1.cpp
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,24 @@
 | 
			
		||||
#include <xvt.h>
 | 
			
		||||
#include <checks.h>
 | 
			
		||||
 | 
			
		||||
#include "ab1.h"
 | 
			
		||||
 | 
			
		||||
#define usage   "Error - usage : %s -{0|1|2|3|4|5|6|7|8|9}"
 | 
			
		||||
 | 
			
		||||
int main(int argc, char** argv)
 | 
			
		||||
{
 | 
			
		||||
  int rt = -1;
 | 
			
		||||
  const int r = (argc > 1) ? atoi(&argv[1][1]) : -1;
 | 
			
		||||
 | 
			
		||||
  switch (r)
 | 
			
		||||
  {
 | 
			
		||||
  case 0:
 | 
			
		||||
    rt = ab1100(argc,argv) ; break;
 | 
			
		||||
  case 1:
 | 
			
		||||
    rt = ab1200(argc,argv) ; break;
 | 
			
		||||
  default:
 | 
			
		||||
    error_box(usage, argv[0]) ; break;
 | 
			
		||||
  }
 | 
			
		||||
  exit(0);
 | 
			
		||||
  return rt ;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										7
									
								
								ab/ab1.h
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										7
									
								
								ab/ab1.h
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,7 @@
 | 
			
		||||
#ifndef __AB1_H
 | 
			
		||||
#define __AB1_H
 | 
			
		||||
 | 
			
		||||
int ab1100(int argc, char **argv);
 | 
			
		||||
int ab1200(int argc, char **argv);
 | 
			
		||||
 | 
			
		||||
#endif //__AB1_H
 | 
			
		||||
							
								
								
									
										458
									
								
								ab/ab1100.cpp
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										458
									
								
								ab/ab1100.cpp
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,458 @@
 | 
			
		||||
//	ab1100		Stampa tabelle
 | 
			
		||||
//
 | 
			
		||||
// legge un file con estenzione .rpt che descrive la stampa.
 | 
			
		||||
// Vedi file leggimi.txt per il formato del file
 | 
			
		||||
//
 | 
			
		||||
  
 | 
			
		||||
#include <mask.h>
 | 
			
		||||
#include <printapp.h>
 | 
			
		||||
#include <utility.h>
 | 
			
		||||
 | 
			
		||||
#include <nditte.h>
 | 
			
		||||
 | 
			
		||||
#include "AB1.h"
 | 
			
		||||
#include "ab1100.h"
 | 
			
		||||
 | 
			
		||||
#define FOOTER_LEN 4  // se non ridefinito nel .rpt
 | 
			
		||||
 | 
			
		||||
class AB1100_application : public TPrintapp
 | 
			
		||||
{
 | 
			
		||||
  TString       _tabname;
 | 
			
		||||
  TFilename     _rptname;
 | 
			
		||||
  TRelation*    _rel;
 | 
			
		||||
  TCursor      *_cur;
 | 
			
		||||
  TMask*        _msk;
 | 
			
		||||
  TString       _maskname;
 | 
			
		||||
  int           _logicnum;
 | 
			
		||||
  TString_array _string_roman, _string_compound; 
 | 
			
		||||
  TString_array _field_roman, _field_compound; 
 | 
			
		||||
  bool          _stampa_registri;
 | 
			
		||||
  bool          _stampa_ca7; //tabella causali 770
 | 
			
		||||
  bool          _tabella_comune;
 | 
			
		||||
  
 | 
			
		||||
public:
 | 
			
		||||
 | 
			
		||||
  virtual bool user_create() ;
 | 
			
		||||
  virtual bool user_destroy() ;
 | 
			
		||||
  virtual bool set_print(int) ;
 | 
			
		||||
 | 
			
		||||
  virtual void set_page(int, int);
 | 
			
		||||
  virtual bool preprocess_page (int, int);
 | 
			
		||||
  virtual bool preprocess_print(int file, int counter);
 | 
			
		||||
 | 
			
		||||
  void set_headers();
 | 
			
		||||
  void set_rows();
 | 
			
		||||
  void set_footers();
 | 
			
		||||
  void set_translations();
 | 
			
		||||
  void set_relations();
 | 
			
		||||
  AB1100_application() {}
 | 
			
		||||
  virtual ~AB1100_application() {}
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
bool AB1100_application::set_print(int)
 | 
			
		||||
{
 | 
			
		||||
  TRectype from(_rel->lfile().curr()); from.zero();
 | 
			
		||||
  TRectype to  (from);
 | 
			
		||||
  
 | 
			
		||||
  if (_msk->run() == K_ENTER)
 | 
			
		||||
  {
 | 
			
		||||
    const int campi_maschera = _msk->fields(); 
 | 
			
		||||
    for (int i = 0; i < campi_maschera; i++)
 | 
			
		||||
    {
 | 
			
		||||
      const TMask_field& campo_maschera = _msk->fld(i);
 | 
			
		||||
      const char* val = campo_maschera.get();
 | 
			
		||||
      if (*val)
 | 
			
		||||
      {
 | 
			
		||||
        const TFieldref* campo_ref = campo_maschera.field();  
 | 
			
		||||
 | 
			
		||||
        if (campo_ref != NULL && campo_ref->ok())
 | 
			
		||||
        {                                                   
 | 
			
		||||
          TDate d;    
 | 
			
		||||
          const bool is_date_field = campo_maschera.class_id() == CLASS_DATE_FIELD;
 | 
			
		||||
          if (is_date_field) 
 | 
			
		||||
            d=val;
 | 
			
		||||
          if (campo_maschera.in_group(1)) campo_ref->write(is_date_field ? d.string(ANSI) : val, from);
 | 
			
		||||
          else
 | 
			
		||||
            if (campo_maschera.in_group(2)) campo_ref->write(is_date_field ? d.string(ANSI) : val, to);
 | 
			
		||||
        }  
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    _cur->setregion (from, to);
 | 
			
		||||
 | 
			
		||||
    set_headers();
 | 
			
		||||
    return TRUE;
 | 
			
		||||
  }
 | 
			
		||||
  return FALSE;  
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void AB1100_application::set_page (int , int )
 | 
			
		||||
{
 | 
			
		||||
  _string_roman.destroy();
 | 
			
		||||
  _field_roman.destroy();
 | 
			
		||||
  _string_compound.destroy();
 | 
			
		||||
  _field_compound.destroy();
 | 
			
		||||
  set_rows();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool AB1100_application::preprocess_page(int , int)
 | 
			
		||||
{
 | 
			
		||||
  const int items = _field_roman.items();
 | 
			
		||||
 | 
			
		||||
  if (items > 0)
 | 
			
		||||
  {
 | 
			
		||||
    for (int i = 0; i < items; i++)
 | 
			
		||||
    {
 | 
			
		||||
      TString& fn = _field_roman.row(i);
 | 
			
		||||
      TFieldref fld(fn, 0);
 | 
			
		||||
      TString& s = _string_roman.row(i);
 | 
			
		||||
      
 | 
			
		||||
      const int n = atoi(fld.read(*_rel));
 | 
			
		||||
      s = itor(n);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
  const int compound = _field_compound.items();
 | 
			
		||||
  if (compound > 0)
 | 
			
		||||
    // Scorre le righe settate
 | 
			
		||||
    for (int i = 0; i < compound; i++)
 | 
			
		||||
    {
 | 
			
		||||
      TToken_string f(_field_compound.row(i),'+'); // campo composto
 | 
			
		||||
      TString& s = _string_compound.row(i); // riga da stampare
 | 
			
		||||
      s.cut(0); // Reset the row...
 | 
			
		||||
      bool compile_row = TRUE;
 | 
			
		||||
      const int cmp_items = f.items(); 
 | 
			
		||||
      // Scorre gli elementi della riga
 | 
			
		||||
      for (int j = 0; j < cmp_items; j++)
 | 
			
		||||
      {
 | 
			
		||||
        // compone la stringa totale
 | 
			
		||||
        TString xx(f.get(j));
 | 
			
		||||
        if (xx[0] != '"') // se non e' una costante stringa legge il valore
 | 
			
		||||
        {
 | 
			
		||||
          TFieldref fld(xx,0);
 | 
			
		||||
          xx = fld.read(*_rel);
 | 
			
		||||
          if (xx.empty()) compile_row = FALSE;
 | 
			
		||||
          else compile_row = TRUE;
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
          xx.ltrim(1);xx.rtrim(1);
 | 
			
		||||
        }
 | 
			
		||||
        if (compile_row)
 | 
			
		||||
          s << xx; // appende alla stringa il valore ricavato (se il campo e' vuoto non appende nemmeno la stringa fissa)
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  // Stampa tabella registri. Calcolo: pagine residue = pagine - stampate
 | 
			
		||||
  if (_stampa_registri)
 | 
			
		||||
  {
 | 
			
		||||
    const int pagine   = _cur->file().get_int("I2");
 | 
			
		||||
    const int stampate = _cur->file().get_int("I1");
 | 
			
		||||
    const int residue  = pagine - stampate;
 | 
			
		||||
    if (residue > 0)
 | 
			
		||||
      set_row(1, "@126g%4d", residue);
 | 
			
		||||
    else
 | 
			
		||||
      set_row(1, "@126g%4s", "    ");
 | 
			
		||||
  }
 | 
			
		||||
  return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void AB1100_application::set_headers()
 | 
			
		||||
{
 | 
			
		||||
  TString        NomeTabella, sep, formato_intesta, testo_intesta;
 | 
			
		||||
  int            LungRiga, riga_intesta=0, last_riga=1;
 | 
			
		||||
  TToken_string  line;
 | 
			
		||||
  TString256     riga;
 | 
			
		||||
  
 | 
			
		||||
  reset_header ();
 | 
			
		||||
 | 
			
		||||
  TScanner rpt(_rptname);
 | 
			
		||||
  rpt.paragraph("Headers");
 | 
			
		||||
 | 
			
		||||
  // Leggo la lunghezza della riga (usata per centrare l'intestazione)
 | 
			
		||||
  line = rpt.line();
 | 
			
		||||
  LungRiga    = line.get_int();
 | 
			
		||||
 | 
			
		||||
  riga.spaces(LungRiga);
 | 
			
		||||
  // Senno' nella stampa a 80 non ci sta ditta e data
 | 
			
		||||
 | 
			
		||||
  // Leggo il nome della tabella
 | 
			
		||||
  line = rpt.line();
 | 
			
		||||
  NomeTabella = line.get();
 | 
			
		||||
 | 
			
		||||
  // Sulla prima riga di intestazione metto la ditta, la data e la pagina
 | 
			
		||||
  if (!_tabella_comune)
 | 
			
		||||
  {
 | 
			
		||||
    const long     codditta = get_firm();
 | 
			
		||||
    TString80      ragsoc;
 | 
			
		||||
    TLocalisamfile nditte(LF_NDITTE);
 | 
			
		||||
 | 
			
		||||
    nditte.zero();
 | 
			
		||||
    nditte.put(NDT_CODDITTA, codditta);
 | 
			
		||||
    if (nditte.read() == NOERR)
 | 
			
		||||
    {
 | 
			
		||||
      ragsoc = nditte.get(NDT_RAGSOC);
 | 
			
		||||
      if (LungRiga < 100) ragsoc.cut(40);
 | 
			
		||||
    }
 | 
			
		||||
    riga.overwrite(format("Ditta %4ld %s", codditta,(const char *)ragsoc));
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
  if (_stampa_ca7) 
 | 
			
		||||
  {
 | 
			
		||||
    TDate d (_msk->get(F_DATASTAMPA));
 | 
			
		||||
    printer().setdate(d);
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
  riga.overwrite ("Data @< Pag. @#", riga.len()-22);
 | 
			
		||||
 | 
			
		||||
  set_header (last_riga++, "%s", (const char *)riga);
 | 
			
		||||
  
 | 
			
		||||
  // Centro il nome della tabella
 | 
			
		||||
  // Per la stampa registri non va centrato. 
 | 
			
		||||
  // Lo lascio anche per le altre stampe 
 | 
			
		||||
  //  if (_stampa_registri)
 | 
			
		||||
  NomeTabella.left_just (LungRiga);
 | 
			
		||||
  /*  else
 | 
			
		||||
      NomeTabella.center_just (LungRiga); */
 | 
			
		||||
  if (_stampa_ca7) 
 | 
			
		||||
    NomeTabella.center_just (LungRiga); 
 | 
			
		||||
 | 
			
		||||
  set_header (last_riga++, "@b%s", (const char *)NomeTabella);
 | 
			
		||||
 | 
			
		||||
  // Aggiungo una riga vuota per separare prima intestazione
 | 
			
		||||
  //sep.fill ('-', LungRiga);
 | 
			
		||||
  //set_header (last_riga, "%s", (const char *)sep);
 | 
			
		||||
 | 
			
		||||
  line = rpt.line();
 | 
			
		||||
  while ( (line != "") && (line[0] != '[') )
 | 
			
		||||
  {
 | 
			
		||||
    riga_intesta    = atoi (line.get());        
 | 
			
		||||
    formato_intesta = line.get();
 | 
			
		||||
    testo_intesta   = (const char *) line.get();
 | 
			
		||||
    if (riga_intesta)
 | 
			
		||||
      set_header (last_riga+riga_intesta, (const char *)formato_intesta, 
 | 
			
		||||
                  (const char *)testo_intesta);
 | 
			
		||||
    line = rpt.line();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (riga_intesta) last_riga += riga_intesta;
 | 
			
		||||
  last_riga++;
 | 
			
		||||
  
 | 
			
		||||
  //set_header (last_riga, (const char *)sep);
 | 
			
		||||
  sep.fill(' ');
 | 
			
		||||
  set_header (last_riga, (const char *)sep); 
 | 
			
		||||
  set_background(format("W2l{1,3,%d,3}l{1,%d,%d,%d}", LungRiga, last_riga, LungRiga, last_riga));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void AB1100_application::set_rows()
 | 
			
		||||
{
 | 
			
		||||
  TToken_string  line;
 | 
			
		||||
  TFieldref     campo;
 | 
			
		||||
  int           from, to, riga_record;
 | 
			
		||||
  TString       formato_campo, picture;
 | 
			
		||||
  const char *          name;
 | 
			
		||||
 | 
			
		||||
  TScanner rpt(_rptname);
 | 
			
		||||
  rpt.paragraph("Rows");
 | 
			
		||||
 | 
			
		||||
  line = rpt.line();
 | 
			
		||||
  while ( (line != "") && (line[0] != '[') )
 | 
			
		||||
  {
 | 
			
		||||
    riga_record = line.get_int();
 | 
			
		||||
 | 
			
		||||
    
 | 
			
		||||
    TString s(line.get());
 | 
			
		||||
    int logicnum = _logicnum;
 | 
			
		||||
    const bool is_compound = s.find('+') >= 0; // Controlla se e' una stringa composta (usare #t nel formato)
 | 
			
		||||
    if (!is_compound)
 | 
			
		||||
    {
 | 
			
		||||
      campo = s;
 | 
			
		||||
      from = campo.from();
 | 
			
		||||
      to = campo.to();
 | 
			
		||||
      name = campo.name();
 | 
			
		||||
      if (campo.file != 0)
 | 
			
		||||
        logicnum = campo.file();
 | 
			
		||||
    }
 | 
			
		||||
      
 | 
			
		||||
    formato_campo = line.get();
 | 
			
		||||
    formato_campo.trim();
 | 
			
		||||
    formato_campo.lower();
 | 
			
		||||
    const int p = formato_campo.find("@m");
 | 
			
		||||
      
 | 
			
		||||
    if (p != -1 && !is_compound)
 | 
			
		||||
    {
 | 
			
		||||
      formato_campo.cut(p);
 | 
			
		||||
      formato_campo << "#t";
 | 
			
		||||
      _string_roman.add("");
 | 
			
		||||
      _field_roman.add(s);
 | 
			
		||||
      const int last = _string_roman.items() - 1;
 | 
			
		||||
  
 | 
			
		||||
      set_row (riga_record, formato_campo, _string_roman.objptr(last));
 | 
			
		||||
    }
 | 
			
		||||
    else if (!is_compound)
 | 
			
		||||
    {
 | 
			
		||||
      if (formato_campo.find("@pn"))
 | 
			
		||||
        picture = line.get();
 | 
			
		||||
      else
 | 
			
		||||
        picture = "";
 | 
			
		||||
        
 | 
			
		||||
      if (to == -1)
 | 
			
		||||
        if (picture != "")
 | 
			
		||||
          set_row (riga_record, formato_campo, FLD(logicnum,name,picture) );
 | 
			
		||||
        else
 | 
			
		||||
          set_row (riga_record, formato_campo, FLD(logicnum,name) );
 | 
			
		||||
      else
 | 
			
		||||
        set_row (riga_record, formato_campo, FLD(logicnum,name,from,to) );
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
    {
 | 
			
		||||
      _string_compound.add("");
 | 
			
		||||
      _field_compound.add(s);
 | 
			
		||||
      const int last = _string_compound.items() - 1;
 | 
			
		||||
  
 | 
			
		||||
      set_row (riga_record, formato_campo, _string_compound.objptr(last));
 | 
			
		||||
    }
 | 
			
		||||
    line = (const char *) rpt.line();
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void AB1100_application::set_footers()
 | 
			
		||||
{
 | 
			
		||||
  TToken_string line;
 | 
			
		||||
  int     footer_len, riga;
 | 
			
		||||
  TString formato, testo;
 | 
			
		||||
 | 
			
		||||
  reset_footer();
 | 
			
		||||
 | 
			
		||||
  TScanner rpt(_rptname);
 | 
			
		||||
  rpt.paragraph("Footers");
 | 
			
		||||
 | 
			
		||||
  line = rpt.line();
 | 
			
		||||
  footer_len = line.get_int(); 
 | 
			
		||||
  if (footer_len != 0) 
 | 
			
		||||
  {
 | 
			
		||||
    printer().footerlen(footer_len);
 | 
			
		||||
    line = rpt.line();
 | 
			
		||||
  }  
 | 
			
		||||
  while ( (line != "") && (line[0] != '[') )
 | 
			
		||||
  {
 | 
			
		||||
    riga = line.get_int();
 | 
			
		||||
    formato = line.get();
 | 
			
		||||
    testo   = line.get();
 | 
			
		||||
    set_footer (riga, (const char *)formato, (const char*)testo);
 | 
			
		||||
    line = rpt.line();
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void AB1100_application::set_translations()
 | 
			
		||||
{
 | 
			
		||||
  TString campo, from, to;
 | 
			
		||||
  TToken_string line;
 | 
			
		||||
  int   logicnum;
 | 
			
		||||
 | 
			
		||||
  TScanner rpt(_rptname);
 | 
			
		||||
  rpt.paragraph("Translations");
 | 
			
		||||
 | 
			
		||||
  line = rpt.line();
 | 
			
		||||
  while ( (line != "") && (line[0] != '[') )
 | 
			
		||||
  {
 | 
			
		||||
    logicnum = line.get_int();
 | 
			
		||||
    campo    = line.get();
 | 
			
		||||
    from     = line.get();
 | 
			
		||||
    to       = line.get();
 | 
			
		||||
    set_translation (logicnum, (char*)(const char *)campo, (char*)(const char *)from, (char*)(const char *)to);
 | 
			
		||||
    line = rpt.line();
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void AB1100_application::set_relations()
 | 
			
		||||
{
 | 
			
		||||
  TToken_string line("", ';');
 | 
			
		||||
  TString tab(16), expr(40);
 | 
			
		||||
  int key, linkto, alias, logicnum;
 | 
			
		||||
 | 
			
		||||
  TScanner rpt(_rptname);
 | 
			
		||||
  rpt.paragraph("Relations");
 | 
			
		||||
 | 
			
		||||
  line = rpt.line();
 | 
			
		||||
  while ( (line != "") && (line[0] != '[') )
 | 
			
		||||
  {
 | 
			
		||||
    tab = line.get();
 | 
			
		||||
    logicnum = atoi(tab);
 | 
			
		||||
    expr = line.get();
 | 
			
		||||
    key = line.get_int();
 | 
			
		||||
    if (key == 0) key = 1;
 | 
			
		||||
    linkto = line.get_int();
 | 
			
		||||
    alias = line.get_int();
 | 
			
		||||
    if (logicnum > 0)
 | 
			
		||||
      _rel->add(logicnum, expr, key, linkto, alias);
 | 
			
		||||
    else
 | 
			
		||||
      _rel->add(tab, expr, key, linkto, alias);
 | 
			
		||||
    
 | 
			
		||||
    line = rpt.line();
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
bool AB1100_application::user_create()
 | 
			
		||||
{
 | 
			
		||||
  _tabname = argv(2);
 | 
			
		||||
 | 
			
		||||
  TString16 t(_tabname);
 | 
			
		||||
 | 
			
		||||
  _tabella_comune = (t[0] == '%');
 | 
			
		||||
  if (_tabella_comune)
 | 
			
		||||
    t.ltrim(1);
 | 
			
		||||
  
 | 
			
		||||
  _rptname  << "batb" << t << ".rpt" ;
 | 
			
		||||
  if (!fexist(_rptname)) 
 | 
			
		||||
    return error_box("Impossibile aprire il file '%s'", (const char*)_rptname);
 | 
			
		||||
 | 
			
		||||
  // Flag per la stampa tabella registri
 | 
			
		||||
  _tabname.upper();
 | 
			
		||||
  _stampa_registri = (_tabname == "REG");
 | 
			
		||||
  _stampa_ca7 = (_tabname == "%CA7");
 | 
			
		||||
  
 | 
			
		||||
  _rel = new TRelation (_tabname);
 | 
			
		||||
  _cur = new TCursor (_rel);
 | 
			
		||||
 | 
			
		||||
  _maskname << "bast" << t;
 | 
			
		||||
  _msk = new TMask (_maskname) ;
 | 
			
		||||
 | 
			
		||||
  add_cursor (_cur);
 | 
			
		||||
  add_file (_tabname);
 | 
			
		||||
 | 
			
		||||
  _logicnum = _cur->file().num();
 | 
			
		||||
 | 
			
		||||
  reset_print ();
 | 
			
		||||
 | 
			
		||||
  printer().footerlen (FOOTER_LEN);
 | 
			
		||||
  for (int i=1; i <= FOOTER_LEN; i++) set_footer(i, "%s", "  ");
 | 
			
		||||
 | 
			
		||||
#ifdef DBG1
 | 
			
		||||
  set_fillchar ('.');
 | 
			
		||||
#endif
 | 
			
		||||
  set_relations();
 | 
			
		||||
  return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool AB1100_application::preprocess_print(int file, int counter)
 | 
			
		||||
{
 | 
			
		||||
  set_headers();
 | 
			
		||||
  set_footers();
 | 
			
		||||
  set_translations();
 | 
			
		||||
  return TRUE;
 | 
			
		||||
}                            
 | 
			
		||||
 | 
			
		||||
bool AB1100_application::user_destroy() 
 | 
			
		||||
{
 | 
			
		||||
  delete _msk;
 | 
			
		||||
  delete _cur;
 | 
			
		||||
  delete _rel;
 | 
			
		||||
  return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int ab1100(int argc, char** argv)
 | 
			
		||||
{
 | 
			
		||||
  AB1100_application a;
 | 
			
		||||
  a.run(argc, argv, "Stampa tabella");
 | 
			
		||||
  return 0;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										36
									
								
								ab/ab1100.h
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										36
									
								
								ab/ab1100.h
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,36 @@
 | 
			
		||||
#ifndef __AB1100_H
 | 
			
		||||
#define __AB1100_H
 | 
			
		||||
 | 
			
		||||
#define F_INIZIO0 100
 | 
			
		||||
#define F_INIZIO1 101
 | 
			
		||||
#define F_INIZIO2 102
 | 
			
		||||
#define F_INIZIO3 103
 | 
			
		||||
#define F_INIZIO4 104
 | 
			
		||||
#define F_INIZIO5 105
 | 
			
		||||
#define F_INIZIO6 106
 | 
			
		||||
#define F_INIZIO7 107
 | 
			
		||||
#define F_INIZIO8 108
 | 
			
		||||
#define F_INIZIO9 109
 | 
			
		||||
#define F_INIZIO10 110
 | 
			
		||||
#define F_FINE1   201
 | 
			
		||||
#define F_FINE2   202
 | 
			
		||||
#define F_FINE3   203
 | 
			
		||||
#define F_FINE4   204
 | 
			
		||||
#define F_FINE5   205
 | 
			
		||||
#define F_FINE6   206
 | 
			
		||||
#define F_FINE7   207
 | 
			
		||||
#define F_FINE8   208
 | 
			
		||||
#define F_FINE9   209
 | 
			
		||||
#define F_FINE10   210
 | 
			
		||||
 | 
			
		||||
#define F_CODDITTA 211
 | 
			
		||||
#define F_RAGSOC   212
 | 
			
		||||
 | 
			
		||||
#define F_DATASTAMPA 213
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										74
									
								
								ab/ab1200.cpp
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										74
									
								
								ab/ab1200.cpp
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,74 @@
 | 
			
		||||
//	ab1200		Stampa Piano dei Conti
 | 
			
		||||
#include <mask.h>
 | 
			
		||||
#include <form.h>
 | 
			
		||||
#include <applicat.h>
 | 
			
		||||
#include <urldefid.h>		//Definisce BAR_ITEM(1)
 | 
			
		||||
 | 
			
		||||
#include "AB1.h"
 | 
			
		||||
#include "ab1200.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class AB1200_application : public TApplication
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
 | 
			
		||||
	virtual bool create() ;				//Crea la finestra principale
 | 
			
		||||
	virtual bool destroy() ;         //Distrugge la finestra principale
 | 
			
		||||
	virtual bool menu(MENU_TAG);		//Controlla il menu
 | 
			
		||||
 | 
			
		||||
	AB1200_application() {}				//Costruttore
 | 
			
		||||
	virtual ~AB1200_application() {} //Distruttore
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
bool AB1200_application::create()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
                                              
 | 
			
		||||
   dispatch_e_menu(BAR_ITEM(1)); 	//Simula la selezione di una voce di menu
 | 
			
		||||
	return TRUE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
bool AB1200_application::destroy() 
 | 
			
		||||
{  
 | 
			
		||||
	return TRUE;
 | 
			
		||||
}       
 | 
			
		||||
 | 
			
		||||
bool AB1200_application::menu(MENU_TAG)
 | 
			
		||||
{         
 | 
			
		||||
 	TForm f("AB1200"); 			//form: AB1200.frm
 | 
			
		||||
 	TMask m("AB1200");			//machera: AB1200.uml
 | 
			
		||||
 	while (m.run() != K_QUIT)	//Finchè non viene premuto un tasto di uscita
 | 
			
		||||
 	{                            
 | 
			
		||||
 		TString cod_from, cod_to;		//Dichiarazione
 | 
			
		||||
 		cod_from=m.get(F_INIZIO);		//Inizializzo con quello che preleva dal campo della maschera
 | 
			
		||||
 		cod_to=m.get(F_FINE);                               
 | 
			
		||||
 		//Dati validi:	(cod_from <= cod_to) and  (cod_to = "vuoto")
 | 
			
		||||
 		bool err = ((cod_from > cod_to) && (cod_to != "") );
 | 
			
		||||
 		if (err)
 | 
			
		||||
 			error_box("Il campo iniziale deve essere vuoto o minore del campo finale");
 | 
			
		||||
 		else
 | 
			
		||||
 		{
 | 
			
		||||
 			TCursor* cur = f.cursor();			//Ritorna il cursore corrente (oggetto)
 | 
			
		||||
 			TRectype rec_from(cur->curr());  //TRectype: classe per la definizione del tipo record
 | 
			
		||||
 													//rec_from è l'oggetto a cui associo l'indice corrente
 | 
			
		||||
 			rec_from.zero();      				//lo vuoto
 | 
			
		||||
 			rec_from.put("CODCBL",cod_from); //e lo riempio con il campo contenuto nel database all'indice iniziale
 | 
			
		||||
 			TRectype rec_to(cur->curr());		//creo un nuovo oggetto a cui associare l'indice
 | 
			
		||||
	 		rec_to.zero();                   //lo vuoto
 | 
			
		||||
 			if (cod_to.not_empty())				//se cod_to (letto dal campo della tabella) non è vuoto
 | 
			
		||||
 				rec_to.put("CODCBL",cod_to);  //gli inserisco l'indice finale letto
 | 
			
		||||
 		                                 //altrimenti va fino alla ifne del file
 | 
			
		||||
 			cur->setregion(rec_from,rec_to);	//all'indice associo la regine di stampa
 | 
			
		||||
	  		f.print();								//Stampa
 | 
			
		||||
	  	}
 | 
			
		||||
   }
 | 
			
		||||
	return FALSE;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int ab1200(int argc, char** argv)
 | 
			
		||||
{
 | 
			
		||||
	AB1200_application a;
 | 
			
		||||
	a.run(argc, argv, "Stampa Piano dei Conti");
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										11
									
								
								ab/ab1200.h
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										11
									
								
								ab/ab1200.h
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,11 @@
 | 
			
		||||
#ifndef __AB1200_H
 | 
			
		||||
#define __AB1200_H
 | 
			
		||||
 | 
			
		||||
#define F_INIZIO 100
 | 
			
		||||
#define F_FINE   101
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										47
									
								
								ab/ab1200.uml
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										47
									
								
								ab/ab1200.uml
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,47 @@
 | 
			
		||||
#include "ab1200.h"
 | 
			
		||||
 | 
			
		||||
PAGE "Stampa Piano dei Conti" -1 -1 50 8
 | 
			
		||||
 | 
			
		||||
NUMBER F_INIZIO 12
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 3 1 "Da codice "
 | 
			
		||||
  HELP "Codice da cui iniziare a stampare. Vuoto = inizio archivio"
 | 
			
		||||
  USE LF_ABPCON
 | 
			
		||||
  INPUT CODCBL F_INIZIO
 | 
			
		||||
  DISPLAY "Codice@12" CODCBL
 | 
			
		||||
  DISPLAY "Descrizione@40" DESCRIZ
 | 
			
		||||
  DISPLAY "I.B.@5" INDBIL
 | 
			
		||||
  DISPLAY "D/M@5" DETT
 | 
			
		||||
  DISPLAY "Con.C.@12" CODCONTR
 | 
			
		||||
  DISPALY "SOSP.@5" SOSPESO
 | 
			
		||||
  OUTPUT F_INIZIO CODCBL
 | 
			
		||||
  GROUP 1
 | 
			
		||||
  FIELD CODCBL
 | 
			
		||||
  FLAGS "ZRU"
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
NUMBER F_FINE 12
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 4 3 "A codice "
 | 
			
		||||
  HELP "Codice a cui terminare la stampa. Vuoto = fine archivio"
 | 
			
		||||
  COPY USE F_INIZIO
 | 
			
		||||
  INPUT CODCBL F_FINE
 | 
			
		||||
  COPY DISPLAY F_INIZIO
 | 
			
		||||
  OUTPUT F_FINE CODCBL
 | 
			
		||||
  GROUP 2
 | 
			
		||||
  FIELD CODCBL
 | 
			
		||||
  FLAGS "ZRU"
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
BUTTON DLG_OK 10 2
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT -12 -1 ""
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
BUTTON DLG_QUIT 10 2
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT -22 -1 ""
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
ENDPAGE
 | 
			
		||||
ENDMASK
 | 
			
		||||
							
								
								
									
										10
									
								
								ab/batbarb.h
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										10
									
								
								ab/batbarb.h
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,10 @@
 | 
			
		||||
// campi maschera batbarb.uml
 | 
			
		||||
                        
 | 
			
		||||
                        
 | 
			
		||||
#define F_CODTAB_DITTA 		101
 | 
			
		||||
#define F_CODTAB_ESE			102
 | 
			
		||||
#define F_CODTAB_PER			103 
 | 
			
		||||
#define F_CODTAB_TIPO		104     
 | 
			
		||||
#define F_SCEGLI				105
 | 
			
		||||
#define F_DI					106
 | 
			
		||||
#define F_DF					107
 | 
			
		||||
							
								
								
									
										117
									
								
								ab/batbarb.uml
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										117
									
								
								ab/batbarb.uml
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,117 @@
 | 
			
		||||
#include "batbarb.h"
 | 
			
		||||
 | 
			
		||||
TOOLBAR "" 0 19 0 2
 | 
			
		||||
 | 
			
		||||
#include <toolbar.h>
 | 
			
		||||
 | 
			
		||||
ENDPAGE
 | 
			
		||||
 | 
			
		||||
PAGE "Tabella archiviazione bilanci" 0 -1 0 19
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
GROUPBOX DLG_NULL 74 12
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 2 0 ""
 | 
			
		||||
  FLAGS "R"
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
STRING F_CODTAB_DITTA 5
 | 
			
		||||
BEGIN  
 | 
			
		||||
	PROMTP 4 3 "Codice ditta          "
 | 
			
		||||
	HELP "Inserire il codice della ditta"
 | 
			
		||||
	FIELD CODTAB[1,5]
 | 
			
		||||
	FLAG "RU"
 | 
			
		||||
	KEY 1
 | 
			
		||||
	USE LF_NDITTE KEY 1
 | 
			
		||||
	INPUT LF_NDITTE->CODDITTA F_CODTAB_DITTA  
 | 
			
		||||
	DISPLAY "Codice@5" LF_NDITTE->CODDITTA   
 | 
			
		||||
	DISPALY "Ragione sociale@45" LF_NDITTE->RAGSOC
 | 
			
		||||
	OUTPUT F_CODTAB_DITTA LF_NDITTE->CODDITTA
 | 
			
		||||
	CHECKTYPE REQUIRED
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
STRING F_CODTAB_ESE  4
 | 
			
		||||
BEGIN
 | 
			
		||||
	PROMTP 4 5 "Anno                  "
 | 
			
		||||
	HELP "Inserire l'anno di esercizio"
 | 
			
		||||
	FIELD CODTAB[6,9]      
 | 
			
		||||
	KEY 1
 | 
			
		||||
	USE %ARB KEY 1
 | 
			
		||||
	INPUT %ARB->CODTAB[6,9] F_CODTAB_ESE
 | 
			
		||||
	DISPLAY "Anno@4" CODTAB[6,9]
 | 
			
		||||
	DISPLAY "Codice@5" CODTAB[1,5]   
 | 
			
		||||
	DISPALY "Periodo@3" CODTAB[10,12]
 | 
			
		||||
	DISPLAY "Tipo@3" CODTAB[13,15]
 | 
			
		||||
	OUTPUT F_CODTAB_DITTA CODTAB[1,5]
 | 
			
		||||
	OUTPUT F_CODTAB_ESE CODTAB[6,9]
 | 
			
		||||
	OUTPUT F_CODTAB_PER CODTAB[10,12] 
 | 
			
		||||
	OUTPUT F_CODTAB_TIPO CODTAB[13,15]
 | 
			
		||||
	OUTPUT F_SCEGLI B0
 | 
			
		||||
	OUTPUT F_DI D0
 | 
			
		||||
	OUTPUT F_DF D1
 | 
			
		||||
	CHECKTYPE REQUIRED
 | 
			
		||||
END                        
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
STRING F_CODTAB_PER  3
 | 
			
		||||
BEGIN
 | 
			
		||||
	PROMTP 4 7 "Codice perido         "
 | 
			
		||||
	HELP "Inserire il codeice che identifica il tipo periodo"
 | 
			
		||||
	FIELD CODTAB[10,12]
 | 
			
		||||
	FLAG "RU"
 | 
			
		||||
	KEY 1
 | 
			
		||||
	USE %PDB KEY 1
 | 
			
		||||
	INPUT %PDB->CODTAB F_CODTAB_PER
 | 
			
		||||
	DISPLAY "Cod@3" %PDB->CODTAB
 | 
			
		||||
	DISPALY "Descrizione@35" %PDB->S0
 | 
			
		||||
	DISPLAY "Gi" %PDB->I0
 | 
			
		||||
	DISPLAY "Mi" %PDB->I1
 | 
			
		||||
	DISPLAY "Gf" %PDB->I2
 | 
			
		||||
	DISPLAY "Mf" %PDB->I3	
 | 
			
		||||
	DISPLAY "N.anni" %PDB->I4
 | 
			
		||||
	OUTPUT F_CODTAB_PER %PDB->CODTAB
 | 
			
		||||
	CHECKTYPE REQUIRED
 | 
			
		||||
END                        
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
STRING F_CODTAB_TIPO  3
 | 
			
		||||
BEGIN
 | 
			
		||||
	PROMTP 4 9 "Tipo di bilancio      "
 | 
			
		||||
	HELP "Inserire il codice che identifica il tipo" 
 | 
			
		||||
	FIELD CODTAB[13,15]    
 | 
			
		||||
	FLAG "RU"
 | 
			
		||||
	KEY 1
 | 
			
		||||
	USE %NTB KEY 1
 | 
			
		||||
	INPUT %NTB->CODTAB F_CODTAB_TIPO 
 | 
			
		||||
	DISPLAY "Cod@5" %NTB->CODTAB
 | 
			
		||||
	DISPLAY "Descrizione@40" %NTB->S0
 | 
			
		||||
	OUTPUT F_CODTAB_TIPO %NTB->CODTAB
 | 
			
		||||
	CHECKTYPE REQUIRED
 | 
			
		||||
END                        
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
BOOLEAN F_SCEGLI
 | 
			
		||||
BEGIN
 | 
			
		||||
	PROMPT 10 19 "Periodo chiuso"
 | 
			
		||||
	FIELD B0 
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
DATE F_DI       
 | 
			
		||||
BEGIN
 | 
			
		||||
	PROMPT 10 15 "Data di acrchiviazione  "
 | 
			
		||||
	FIELD D0
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
DATE F_DF
 | 
			
		||||
BEGIN
 | 
			
		||||
	PROMPT 10 17 "Data di ripristino      "
 | 
			
		||||
	FIELD D1
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
ENDPAGE
 | 
			
		||||
 | 
			
		||||
ENDMASK
 | 
			
		||||
							
								
								
									
										4
									
								
								ab/batbntb.h
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										4
									
								
								ab/batbntb.h
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,4 @@
 | 
			
		||||
// campi della maschera batbntb.uml
 | 
			
		||||
 | 
			
		||||
#define F_CODTAB		101
 | 
			
		||||
#define F_DESCR		102
 | 
			
		||||
							
								
								
									
										50
									
								
								ab/batbntb.uml
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										50
									
								
								ab/batbntb.uml
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,50 @@
 | 
			
		||||
#include "batbntb.h"
 | 
			
		||||
 | 
			
		||||
TOOLBAR "" 0 19 0 2
 | 
			
		||||
 | 
			
		||||
#include <toolbar.h>
 | 
			
		||||
 | 
			
		||||
ENDPAGE              
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
PAGE "Tabella tipi di bilancio" 0 -1 0 19  
 | 
			
		||||
  
 | 
			
		||||
GROUPBOX DLG_NULL 76 9
 | 
			
		||||
BEGIN
 | 
			
		||||
	PROMPT 2 0 ""
 | 
			
		||||
	FLAG "R"
 | 
			
		||||
END  
 | 
			
		||||
 | 
			
		||||
STRING F_CODTAB 2
 | 
			
		||||
BEGIN           
 | 
			
		||||
	PROMPT 4 3 "Codice di bilancio "
 | 
			
		||||
	HELP "Codice della tabella tipi di bilancio"
 | 
			
		||||
	FLAG "RU"
 | 
			
		||||
	FIELD CODTAB
 | 
			
		||||
	KEY 1 
 | 
			
		||||
	USE %NTB KEY 1
 | 
			
		||||
	INPUT CODTAB F_CODTAB
 | 
			
		||||
	DISPLAY "Codice@2" CODTAB
 | 
			
		||||
	DISPLAY "Descrizione@40" S0
 | 
			
		||||
	OUTPUT F_CODTAB CODTAB
 | 
			
		||||
	OUTPUT F_DESCR S0
 | 
			
		||||
	CHECKTYPE REQUIRED
 | 
			
		||||
END                 
 | 
			
		||||
 | 
			
		||||
STRING F_DESCR 70 40
 | 
			
		||||
BEGIN
 | 
			
		||||
	PROMPT 4 6 "Descrizione        "
 | 
			
		||||
	HELP "Descrizione del codice tabella tipi di bilancio"
 | 
			
		||||
	KEY 2
 | 
			
		||||
	USE %NTB KEY 2
 | 
			
		||||
	INPUT S0 F_DESCR
 | 
			
		||||
	DISPLAY "Descrizione@40" S0
 | 
			
		||||
	DISPLAY "Codice@2" CODTAB  
 | 
			
		||||
	COPY OUTPUT F_CODTAB 
 | 
			
		||||
	CHECKTYPE REQUIRED
 | 
			
		||||
	FIELD S0
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
ENDPAGE
 | 
			
		||||
 | 
			
		||||
ENDMASK
 | 
			
		||||
@ -7,3 +7,4 @@
 | 
			
		||||
#define F_GIORNO_FINE 105
 | 
			
		||||
#define F_MESE_FINE   106
 | 
			
		||||
#define F_DESCRAGG    107
 | 
			
		||||
#define NUM_ANNI		 108
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
#include "batbpdb.h"
 | 
			
		||||
 | 
			
		||||
TOOLBAR "" 0 20 0 2
 | 
			
		||||
TOOLBAR "" 0 19 0 2
 | 
			
		||||
 | 
			
		||||
#include <toolbar.h>
 | 
			
		||||
 | 
			
		||||
@ -8,99 +8,102 @@ ENDPAGE
 | 
			
		||||
 | 
			
		||||
PAGE "Tabella periodi di bilancio" 0 -1 0 19
 | 
			
		||||
 | 
			
		||||
GROUPBOX DLG_NULL 76 4
 | 
			
		||||
GROUPBOX DLG_NULL 76 6
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 1 0 ""
 | 
			
		||||
  FLAGS "R"
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
STRING F_CODTAB 2
 | 
			
		||||
STRING F_CODTAB 3
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 2 1 "Codice tabella "
 | 
			
		||||
  HELP "Codice della tabella periodi di bilancio"
 | 
			
		||||
  FLAS "U_"
 | 
			
		||||
  PROMPT 2 2 "Codice periodo "
 | 
			
		||||
  HELP "Inserire il codice identificativo del periodo prescelto"
 | 
			
		||||
  FLAS "RU"
 | 
			
		||||
  FIELD CODTAB
 | 
			
		||||
  KEY 1
 | 
			
		||||
  USE %PDB KEY 1 
 | 
			
		||||
  INPUT CODTAB F_CODTAB
 | 
			
		||||
  DISPLAY "Codice" CODTAB
 | 
			
		||||
  DISPLAY "Codice@3" CODTAB
 | 
			
		||||
  DISPLAY "Descrizione@40" S0
 | 
			
		||||
  DISPLAY "gg.inizio" I0
 | 
			
		||||
  DISPLAY "mm.inizio" I1
 | 
			
		||||
  DISPLAY "gg.fine" I2
 | 
			
		||||
  DISPLAY "mm.fine" I3
 | 
			
		||||
  DISPLAY "gg.inizio@3" I0
 | 
			
		||||
  DISPLAY "mm.inizio@3" I1
 | 
			
		||||
  DISPLAY "gg.fine@3" I2
 | 
			
		||||
  DISPLAY "mm.fine@3" I3
 | 
			
		||||
  DISPLAY "Numero anni@3" I4
 | 
			
		||||
  OUTPUT F_CODTAB CODTAB
 | 
			
		||||
  OUTPUT F_DESCR S0
 | 
			
		||||
  CHECKTYPE REQUIRED
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
STRING F_DESCR 50
 | 
			
		||||
STRING F_DESCR 70 40
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 2 2 "Descrizione    "
 | 
			
		||||
  PROMPT 2 4 "Descrizione    "
 | 
			
		||||
  HELP "Descrizione del codice tabella periodi di bilancio"
 | 
			
		||||
  FIELD S0
 | 
			
		||||
  KEY 2
 | 
			
		||||
  USE %PDB KEY 2
 | 
			
		||||
  INPUT S0 F_DESCR
 | 
			
		||||
  DISPLAY "Descrizione@40" S0
 | 
			
		||||
  DISPLAY "Codice" CODTAB
 | 
			
		||||
  DISPLAY "gg.inizio" I0
 | 
			
		||||
  DISPLAY "mm.inizio" I1
 | 
			
		||||
  DISPLAY "gg.fine" I2
 | 
			
		||||
  DISPLAY "mm.fine" I3
 | 
			
		||||
  DISPLAY "Codice@3" CODTAB
 | 
			
		||||
  DISPLAY "gg.inizio@3" I0
 | 
			
		||||
  DISPLAY "mm.inizio@3" I1
 | 
			
		||||
  DISPLAY "gg.fine@3" I2
 | 
			
		||||
  DISPLAY "mm.fine@3" I3  
 | 
			
		||||
  DISPLAY "Numero anni@3" I4
 | 
			
		||||
  COPY OUTPUT F_CODTAB
 | 
			
		||||
  CHECKTYPE REQUIRED
 | 
			
		||||
  FIELD S0
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
NUMBER F_GIORNO_INI 2
 | 
			
		||||
NUMBER F_GIORNO_INI 7
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 2 5 "Inizio periodo "
 | 
			
		||||
  PROMPT 2 8 "Inizio periodo:  gg "
 | 
			
		||||
  HELP "Inserire il giorno relativo al periodo di inizio"
 | 
			
		||||
  FIELD I0
 | 
			
		||||
  FLAGS "R"
 | 
			
		||||
  CHECKTYPE REQUIRED
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
NUMBER F_MESE_INI 2
 | 
			
		||||
NUMBER F_MESE_INI 7
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 21 5 ""
 | 
			
		||||
  PROMPT 32 8 "mm "
 | 
			
		||||
  HELP "Inserire il mese relativo al periodo di inizio"
 | 
			
		||||
  FIELD I1
 | 
			
		||||
  FLAGS "R"
 | 
			
		||||
  CHECKTYPE REQUIRED
 | 
			
		||||
END                       
 | 
			
		||||
 | 
			
		||||
TEXT DLG_NULL
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 25 5 "gg/mm"
 | 
			
		||||
END
 | 
			
		||||
                
 | 
			
		||||
NUMBER F_GIORNO_FINE 2
 | 
			
		||||
NUMBER F_GIORNO_FINE 7
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 2 7 "Fine periodo   "
 | 
			
		||||
  PROMPT 2 10 "Fine periodo:    gg "
 | 
			
		||||
  HELP "Inserire il giorno relativo alla fine del periodo"
 | 
			
		||||
  FIELD I2
 | 
			
		||||
  FLAGS "R"
 | 
			
		||||
  CHECKTYPE REQUIRED
 | 
			
		||||
END
 | 
			
		||||
                
 | 
			
		||||
NUMBER F_MESE_FINE 2
 | 
			
		||||
NUMBER F_MESE_FINE 7
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 21 7 ""
 | 
			
		||||
  PROMPT 32 10 "mm "
 | 
			
		||||
  HELP "Inserire il mese relativo alla fine del periodo"
 | 
			
		||||
  FIELD I3
 | 
			
		||||
  FLAGS "R"
 | 
			
		||||
  CHECKTYPE REQUIRED
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
TEXT DLG_NULL
 | 
			
		||||
NUMBER NUM_ANNI 7
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 25 7 "gg/mm"
 | 
			
		||||
  PROMPT 2 16 "Numero di anni                               "
 | 
			
		||||
  HELP "Inserire il numero di anni"
 | 
			
		||||
  FIELD I4
 | 
			
		||||
  FLAGS "R"
 | 
			
		||||
  CHECKTYPE REQUIRED
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
                
 | 
			
		||||
STRING F_DESCRAGG 15
 | 
			
		||||
STRING F_DESCRAGG 70 30
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 2 9 "Descrizione alternativa per stampa raffronti "
 | 
			
		||||
  PROMPT 2 18 "Descrizione alternativa per stampa raffronti "
 | 
			
		||||
  FIELD S1
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,3 @@
 | 
			
		||||
79
 | 
			
		||||
1
 | 
			
		||||
%absaldi|0|0|124|20|Saldi analisi di bilancio|||
 | 
			
		||||
%absaldi|0|0|120|20|Saldi analisi di bilancio|||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user