From e53ba72deb6587e58af38a02b37f266346afe499 Mon Sep 17 00:00:00 2001
From: cris <cris@c028cbd2-c16b-5b4b-a496-9718f37d4682>
Date: Wed, 7 Jan 2004 10:10:41 +0000
Subject: [PATCH] =?UTF-8?q?Patch=20level=20=20=20=20=20=20=20=20=20:=201.7?=
 =?UTF-8?q?=20at=20Files=20correlati=20=20=20=20=20:=20at0.exe=20at2.exe?=
 =?UTF-8?q?=20at2600a.msk=20Ricompilazione=20Demo=20:=20[=20]=20Commento?=
 =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20:=20In=20sblocco=20sospesi?=
 =?UTF-8?q?=20sistemato=20stampa=20*,=20in=20stampa=20iscritti/dimessi=20a?=
 =?UTF-8?q?ggiunta=20possibilit=C3=A0=20di=20stampare=20su=20file=20dbf?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

git-svn-id: svn://10.65.10.50/trunk@11688 c028cbd2-c16b-5b4b-a496-9718f37d4682
---
 at/at0700.cpp  | 10 +++++-----
 at/at2600.cpp  | 43 +++++++++++++++++++++++++++++++++++++++++--
 at/at2600a.h   |  1 +
 at/at2600a.uml | 18 ++++++++++++------
 4 files changed, 59 insertions(+), 13 deletions(-)

diff --git a/at/at0700.cpp b/at/at0700.cpp
index 07b094fbf..17263ee3a 100755
--- a/at/at0700.cpp
+++ b/at/at0700.cpp
@@ -370,7 +370,7 @@ void TSbloccoSospesi::set_page(int file, int cnt)
 	set_row(1,"@56g@S", FLD(LF_SOGGETTI,SOG_CODSEZ));
 	set_row(1,"@59g@S", FLD(LF_SOGGETTI,SOG_CODSOT));
 	set_row(1,"@62g#a", &_operazione);
-	set_row(1,"@100g@ld", FLD(LF_SOGGETTI,SOG_DATAPROSSI));
+	set_row(1,"@105g@ld", FLD(LF_SOGGETTI,SOG_DATAPROSSI));
 }
 
 bool TSbloccoSospesi::filter_func_sbloccosospesi(const TRelation* rel)
@@ -416,7 +416,7 @@ void TSbloccoSospesi::header_sezione(const TString16 codsez, const TString16 cod
 	{
 		const TString80 densez = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSEZ);
 		const TString80 densot = current_cursor()->curr(LF_SEZIONI).get(SEZ_DENSOT);
-		TString intestazione(100);
+		TString intestazione(115);
 		intestazione = "Sezione: ";
 		intestazione << codsez;
 		intestazione << "/";
@@ -480,7 +480,7 @@ void TSbloccoSospesi::crea_intestazione()
 {
 	reset_header();
 
-	TString sep(100);
+	TString sep(115);
 	if (_definitiva)
   	sep = "SBLOCCO DEFINITIVO SOSPESI ";
 	else  	
@@ -500,8 +500,8 @@ void TSbloccoSospesi::crea_intestazione()
   sep = "";
   sep.fill('-');
   set_header(3, (const char *) sep);
- 	set_header(4,"@0gCod.@9gC.@12gCognome e nome@38gNato il@49gTess.@56gSe/So@62gData sosp.@73gScadenza@84gDo Da A  Sogg.@100gData pr.SI");
- 	set_header(5,"@0g------@9g--@12g-------------------------@38g----------@49g------@56g-- --@62g----------@73g----------@84g---------------@100g----------");
+ 	set_header(4,"@0gCod.@9gC.@12gCognome e nome@38gNato il@49gTess.@56gSe/So@62gData sosp.@73gScadenza@84gDo Da A  Sogg.@105gData pr.SI");
+ 	set_header(5,"@0g------@9g--@12g-------------------------@38g----------@49g------@56g-- --@62g----------@73g----------@84g---------------------@105g----------");
  	printer().footerlen(3);
 }
 
diff --git a/at/at2600.cpp b/at/at2600.cpp
index 3a3f49be3..853859be8 100755
--- a/at/at2600.cpp
+++ b/at/at2600.cpp
@@ -9,12 +9,13 @@
 #include "at2.h"
 #include "at2600a.h"
 #include "atlib.h"
+#include <comuni.h>
 
 #define ALIAS_LCP	100		// localita' postali
 #define ALIAS_CTD	700		// categoria donatori
 
 #define ISCRITTI 'I'
-enum ts { undefined = 0, elenco = 1, etichette = 2 };
+enum ts { undefined = 0, elenco = 1, etichette = 2, stampasufile = 3 };
 
 // definizione form per etichette
 class TEti_iscritti_form : public TForm
@@ -35,6 +36,7 @@ class TStampaIscritti : public TPrintapp
   TRelation*					_rel;
   TMask*      				_msk;
   TEti_iscritti_form*	_form_eti;
+	TExternisamfile*  	_fileiscr;
   TAssoc_array				_categorie;
   TParagraph_string 	_cognome_nome;
   TDate 							_data_stampa;
@@ -177,9 +179,9 @@ bool TStampaIscritti::filter_func_iscritti(const TRelation * rel)
 
 bool TStampaIscritti::preprocess_page(int file, int counter)
 {
+	TRectype& recsog = current_cursor()->curr();
 	if (_tipostampa == elenco)
 	{
-		TRectype& recsog = current_cursor()->curr();
 		TString80 nome = recsog.get(SOG_COGNOME);
 		nome << " ";
 		nome << recsog.get(SOG_NOME);
@@ -200,6 +202,31 @@ bool TStampaIscritti::preprocess_page(int file, int counter)
 	if (_tipostampa==etichette)		
 		if (printer().rows_left() < _form_eti->get_body().height())
 			printer().formfeed();
+	if (_tipostampa==stampasufile)
+	{
+		_fileiscr->zero();
+		_fileiscr->put("COGNOME",recsog.get(SOG_COGNOME)); 
+		_fileiscr->put("NOME",recsog.get(SOG_NOME)); 
+		_fileiscr->put("INDIRIZZO",recsog.get(SOG_DOM_INDIR)); 
+		TString80 localita = "";
+		localita << recsog.get(SOG_DOM_CAP);
+		localita << ' ';
+		if (recsog.get(SOG_DOM_CODLOC).not_empty())
+			localita << current_cursor()->curr(-ALIAS_LCP).get("S0");
+		else
+			localita << current_cursor()->curr(LF_COMUNI).get(COM_DENCOM);
+		localita << ' ' << current_cursor()->curr(LF_COMUNI).get(COM_PROVCOM);
+		localita.trim();
+		_fileiscr->put("LOCALITA",localita); 
+		_fileiscr->put("TELABI",recsog.get(SOG_TELABI)); 
+		_fileiscr->put("TELLAV",recsog.get(SOG_TELLAV)); 
+		_fileiscr->put("TELALT",recsog.get(SOG_TELALT)); 
+		_fileiscr->put("DATAULTDON",recsog.get(SOG_DATAULTDON)); 
+		_fileiscr->put("TOTDON",recsog.get(SOG_TOTDON)); 
+		_fileiscr->put("CATDON",recsog.get(SOG_CATDON)); 
+		_fileiscr->write();	
+		do_events();	
+	}		
 	_contatore++;
 	_totale++;			
   return TRUE;
@@ -288,7 +315,13 @@ bool TStampaIscritti::set_print(int m)
   case F_ETICHETTE:
   	_tipostampa = (configura_stampante(p, "AT_ETICHETTE", "etichette")) ? etichette : undefined;
   break;
+  case F_FILE:
+  {
+  	_tipostampa = stampasufile;
+		_fileiscr->zap();
   }	
+  break;
+  }
 	if (_tipostampa != undefined)
   {
     reset_files(); 
@@ -382,11 +415,17 @@ bool TStampaIscritti::user_create()
   _etlarghezza = config.get_int("EtLarghezza");
   _etcolonne = config.get_int("EtColonne");
 	_form_eti = new TEti_iscritti_form(etformato);
+  TFilename iscrname = "iscritti";
+  iscrname.ext("dbf");
+	TFilename iscrtrr = "iscritti"; 
+	iscrtrr.ext("trr");
+  _fileiscr = new TExternisamfile(iscrname, iscrtrr);
   return TRUE;
 }
 
 bool TStampaIscritti::user_destroy()
 {
+  delete _fileiscr;
   delete _form_eti;
   delete _msk;
   delete _rel;
diff --git a/at/at2600a.h b/at/at2600a.h
index b110ecff1..d3d37b37d 100755
--- a/at/at2600a.h
+++ b/at/at2600a.h
@@ -31,3 +31,4 @@
 
 #define F_ELENCO    401
 #define F_ETICHETTE 402
+#define F_FILE      403
diff --git a/at/at2600a.uml b/at/at2600a.uml
index a9b1124dc..28e3e32e5 100755
--- a/at/at2600a.uml
+++ b/at/at2600a.uml
@@ -2,21 +2,27 @@
 
 TOOLBAR "" 0 20 0 2
 
-BUTTON F_ELENCO 9 2
+BUTTON F_ELENCO 10 2
 BEGIN
-        PROMPT -13 -11 "E~lenco"
+        PROMPT -14 -11 "E~lenco"
         MESSAGE EXIT,F_ELENCO
 END
 
-BUTTON F_ETICHETTE 9 2
+BUTTON F_ETICHETTE 10 2
 BEGIN
-        PROMPT -23 -11 "~Etichette"
+        PROMPT -24 -11 "~Etichette"
         MESSAGE EXIT,F_ETICHETTE
 END
 
-BUTTON DLG_QUIT 9 2
+BUTTON F_FILE 10 2
 BEGIN
-        PROMPT -33 -11 ""
+   PROMPT -34 -11 "~File"
+   MESSAGE EXIT,F_FILE
+END
+
+BUTTON DLG_QUIT 10 2
+BEGIN
+        PROMPT -44 -11 ""
 END
 
 ENDPAGE