Patch level :2.2 nopatch per ora

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :aggiunta cancellazione del recordset e del file temporaneo dalla memoria al termine della selezione di una commessa; invertite prima e seconda pagina della maschera; invertita la selezione sulla numerazione documenti (vanno selezionati quelli che NON si vogliono stampare)


git-svn-id: svn://10.65.10.50/trunk@13311 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2005-08-22 15:53:19 +00:00
parent e3da6f6378
commit 43f2aff4be
3 changed files with 129 additions and 152 deletions

View File

@ -73,6 +73,14 @@ bool TPrint_rendiconto_ca_mask::on_field_event(TOperable_field& o, TField_event
{ {
switch (o.dlg()) switch (o.dlg())
{ {
/* case F_RIGHE:
if (e == fe_init) //azzera le righe dello sheet con le commesse ad inizio programma
{ //esplicita e bizzarra richiesta del CRPA
TSheet_field& s = (TSheet_field&)o;
s.destroy();
s.force_update();
}
break;*/
case F_DATAINI: case F_DATAINI:
case F_DATAFIN: case F_DATAFIN:
if (e == fe_close) if (e == fe_close)
@ -266,7 +274,7 @@ TPrint_rendiconto_ca_mask::TPrint_rendiconto_ca_mask()
if (levels >= 2 && pref < levels && esistono_riclassificazioni()) if (levels >= 2 && pref < levels && esistono_riclassificazioni())
{ {
enable(F_PIANO); enable(F_PIANO);
ca_create_fields(*this, 0, LF_PCONANA, 2, 4, F_PRE1, F_PREDES1, 0x0, PCONANA_CODCONTO); ca_create_fields(*this, 1, LF_PCONANA, 2, 4, F_PRE1, F_PREDES1, 0x0, PCONANA_CODCONTO);
// Nascondi i campi che non fanno parte del prefisso // Nascondi i campi che non fanno parte del prefisso
for (int i = 0; i < levels; i++) for (int i = 0; i < levels; i++)
@ -294,8 +302,8 @@ TPrint_rendiconto_ca_mask::TPrint_rendiconto_ca_mask()
const short a_dlg = g == 5 ? F_PDC1_FIN : F_PAN1_FIN; const short a_dlg = g == 5 ? F_PDC1_FIN : F_PAN1_FIN;
const short a_des = g == 5 ? F_PDCDES1_FIN : F_PANDES1_FIN; const short a_des = g == 5 ? F_PDCDES1_FIN : F_PANDES1_FIN;
const int nfields = ca_create_fields(*this, 0, logicnum, 2, 9, da_dlg, da_des, 0x0, PCONANA_CODCONTO); const int nfields = ca_create_fields(*this, 1, logicnum, 2, 10, da_dlg, da_des, 0x0, PCONANA_CODCONTO);
ca_create_fields(*this, 0, logicnum, 2, 14, a_dlg, a_des, 0x0, PCONANA_CODCONTO); ca_create_fields(*this, 1, logicnum, 2, 16, a_dlg, a_des, 0x0, PCONANA_CODCONTO);
for (int i = 0; i < nfields; i++) for (int i = 0; i < nfields; i++)
{ {
@ -368,13 +376,15 @@ public:
virtual void set_filter(const TPrint_rendiconto_ca_mask& msk, int cms_row); virtual void set_filter(const TPrint_rendiconto_ca_mask& msk, int cms_row);
TPrint_rendiconto_ca_recordset(const TString& sql) : TISAM_recordset(sql), _riclassificato(false) { _tmp = NULL;} TPrint_rendiconto_ca_recordset(const TString& sql) : TISAM_recordset(sql), _riclassificato(false) { _tmp = NULL;}
~TPrint_rendiconto_ca_recordset() {} ~TPrint_rendiconto_ca_recordset();
}; };
static const TPrint_rendiconto_ca_recordset* myself = NULL; static TPrint_rendiconto_ca_recordset* myself = NULL;
TPrint_rendiconto_ca_recordset::~TPrint_rendiconto_ca_recordset()
{ }
TPrint_rendiconto_ca_recordset* rendiconto_recordset() { return (TPrint_rendiconto_ca_recordset* ) myself;}
void TPrint_rendiconto_ca_recordset::set_custom_filter(TCursor& cur) const void TPrint_rendiconto_ca_recordset::set_custom_filter(TCursor& cur) const
{ {
@ -412,7 +422,7 @@ void TPrint_rendiconto_ca_recordset::set_custom_filter(TCursor& cur) const
cur.setregion(darec, arec); cur.setregion(darec, arec);
cur.setfilter(filtro); cur.setfilter(filtro);
myself = this; myself = (TPrint_rendiconto_ca_recordset*)this;
//cur.set_filterfunction(mov_filter, true); //cur.set_filterfunction(mov_filter, true);
} }
@ -488,7 +498,7 @@ const TVariant& TPrint_rendiconto_ca_recordset::get(const char* column_name) con
else else
conto = TISAM_recordset::get("CONTO").as_string(); conto = TISAM_recordset::get("CONTO").as_string();
var = rendiconto_recordset()->somma_budget(conto, "P"); var = myself->somma_budget(conto, "P");
return var; return var;
} }
if (strcmp(column_name, "#VARIAZIONE") == 0) if (strcmp(column_name, "#VARIAZIONE") == 0)
@ -500,7 +510,7 @@ const TVariant& TPrint_rendiconto_ca_recordset::get(const char* column_name) con
else else
conto = TISAM_recordset::get("CONTO").as_string(); conto = TISAM_recordset::get("CONTO").as_string();
var = rendiconto_recordset()->somma_budget(conto, "V"); var = myself->somma_budget(conto, "V");
return var; return var;
} }
} }
@ -848,25 +858,22 @@ void TPrint_rendiconto_ca_recordset::crea_righe_da_rdoc(const TPrint_rendiconto_
TContabilizzazione_analitica cont_anal; //oggetto necessario per contabilizzare il documento in osservazione TContabilizzazione_analitica cont_anal; //oggetto necessario per contabilizzare il documento in osservazione
//deve filtrare per i soli documenti con codnum presente nello sheet dei codnum //inizialmente il filtro di scansione delle righedoc coincide con quello sulle date
TString filtro = filtro_date;
//deve filtrare i soli documenti con codnum NON presente nello sheet dei codnum
TSheet_field& sheet = msk.sfield(F_RIGHE_NUM); TSheet_field& sheet = msk.sfield(F_RIGHE_NUM);
FOR_EACH_SHEET_ROW(sheet, r, row) FOR_EACH_SHEET_ROW(sheet, r, row)
{ {
const TString4 codnum(row->get(0)); //prende il codice numerazione sulla riga const TString4 codnum(row->get(0)); //prende il codice numerazione sulla riga
if (anno > 0) //se c'e' l'anno posso aggiungere codnum perchè è il campo successivo sulla chiave //aggiunge al filtro il codice numerazione:
{ //NON vanno prese le righe dei doc con codnum indicato nello sheet!!
dardoc.put(RDOC_CODNUM, codnum);
ardoc.put(RDOC_CODNUM, codnum);
}
//aggiunge il filtro per codice numerazione e stato documento
TString filtro = filtro_date;
if (filtro.not_empty()) if (filtro.not_empty())
filtro << "&&"; filtro << "&&";
filtro << "(CODNUM==\"" << codnum << "\")"; filtro << "(CODNUM!=\"" << codnum << "\")";
filtro << "&&(33->STATO>=\"" << row->get(2) << "\")"; } //FOR_EACH_SHEET_ROW
filtro << "&&(33->STATO<=\"" << row->get(3) << "\")";
//poi deve aggiungere il filtro per cdc/cms/fas //poi deve aggiungere il filtro per cdc/cms/fas
if (_codcosto.not_empty()) if (_codcosto.not_empty())
@ -889,15 +896,13 @@ void TPrint_rendiconto_ca_recordset::crea_righe_da_rdoc(const TPrint_rendiconto_
} }
//il filtro è completo;può eseguire la scansione //il filtro è completo;può eseguire la scansione
TCursor cur_rdoc(&rel_rdoc, filtro, 1, &dardoc, &ardoc); TCursor cur_rdoc(&rel_rdoc, filtro, 3, &dardoc, &ardoc);
const long rdoc_items = cur_rdoc.items(); const long rdoc_items = cur_rdoc.items();
cur_rdoc.freeze(); cur_rdoc.freeze();
if (rdoc_items > 0) if (rdoc_items > 0)
{ {
TString commento_progind; TProgind pi(rdoc_items, "Scansione righe documenti...");
commento_progind << "Scansione righe documenti " << codnum << "...";
TProgind pi(rdoc_items, commento_progind);
//memorizza l'ultimo doc per evitare doppioni in caso di doc con più righe (rielaborerebbe.. //memorizza l'ultimo doc per evitare doppioni in caso di doc con più righe (rielaborerebbe..
//..lo stesso documento tante volte quante sono le sue righe!) //..lo stesso documento tante volte quante sono le sue righe!)
@ -923,7 +928,6 @@ void TPrint_rendiconto_ca_recordset::crea_righe_da_rdoc(const TPrint_rendiconto_
} //for int j... } //for int j...
} //for cur_rdoc.. } //for cur_rdoc..
} //if rdoc_items } //if rdoc_items
} //FOR_EACH_SHEET_ROW
} }
@ -965,11 +969,12 @@ void TPrint_rendiconto_ca_recordset::set_filter(const TPrint_rendiconto_ca_mask&
//crea il file .trr in base ai parametri del metodo //crea il file .trr in base ai parametri del metodo
crea_trr(trr); crea_trr(trr);
//svuota la memoria dal vecchio file temporaneo
if (_tmp != NULL) if (_tmp != NULL)
delete _tmp; delete _tmp;
_tmp = new TExternisamfile(dbf, trr); _tmp = new TExternisamfile(dbf, trr);
_tmp->zap();
//prende un po' di dati dalla maschera... //prende un po' di dati dalla maschera...
_daconto, _aconto, _codcosto = _codcms = _codfas = ""; _daconto, _aconto, _codcosto = _codcms = _codfas = "";
@ -1030,8 +1035,8 @@ void TPrint_rendiconto_ca_recordset::set_filter(const TPrint_rendiconto_ca_mask&
} }
} }
} }
//metodo per riempire il file //metodi per riempire il file da cui generare il report
crea_righe_da_rmovana(); //crea_righe_da_rmovana();
crea_righe_da_rdoc(msk); crea_righe_da_rdoc(msk);
@ -1059,16 +1064,16 @@ bool TPrint_rendiconto_ca_rep::get_usr_val(const TString& name, TVariant& var) c
bool TPrint_rendiconto_ca_rep::set_recordset(const TString& sql) bool TPrint_rendiconto_ca_rep::set_recordset(const TString& sql)
{ {
TPrint_rendiconto_ca_recordset* rs = new TPrint_rendiconto_ca_recordset(sql); TPrint_rendiconto_ca_recordset* rs = new TPrint_rendiconto_ca_recordset(sql);
return TReport::set_recordset(rs); return TAnal_report::set_recordset(rs);
} }
void TPrint_rendiconto_ca_rep::set_filter(const TPrint_rendiconto_ca_mask& msk, int cms_row) void TPrint_rendiconto_ca_rep::set_filter(const TPrint_rendiconto_ca_mask& msk, int cms_row)
{ {
TPrint_rendiconto_ca_recordset* recset = NULL; TAnal_report::set_recordset(NULL); // Forza azzeramento file Rendy.dbf prima di ricostruirlo
const char* query ="USE 1000\nJOIN MOVANA INTO NUMREG==NUMRD\nJOIN RMOVANA INTO NUMREG==NUMRD NUMRIG==NRIGA"; const char* query ="USE 1000\nJOIN MOVANA INTO NUMREG==NUMRD\nJOIN RMOVANA INTO NUMREG==NUMRD NUMRIG==NRIGA";
recset = new TPrint_rendiconto_ca_recordset(query); TPrint_rendiconto_ca_recordset* recset = new TPrint_rendiconto_ca_recordset(query);
recset->set_filter(msk, cms_row); recset->set_filter(msk, cms_row);
TAnal_report::set_recordset(recset); TAnal_report::set_recordset(recset);

View File

@ -66,8 +66,6 @@
//elementi dello sheet dei documenti (pag.3) //elementi dello sheet dei documenti (pag.3)
#define SN_CODNUM 101 #define SN_CODNUM 101
#define SN_DESCR 102 #define SN_DESCR 102
#define SN_DASTATO 103
#define SN_ASTATO 104
#endif // __CA3700_H #endif // __CA3700_H

View File

@ -21,7 +21,7 @@ END
ENDPAGE ENDPAGE
PAGE "Conti / Date" -1 -1 78 20 PAGE "CdC/Cms/Fasi / Date" -1 -1 78 20
NUMBER F_CODDITTA 5 NUMBER F_CODDITTA 5
BEGIN BEGIN
@ -48,18 +48,9 @@ BEGIN
FLAGS "A" FLAGS "A"
END END
LIST F_PIANO 1 12
BEGIN
PROMPT 26 2 "Piano dei conti "
ITEM "A|Analitico"
MESSAGE HIDE,5@|SHOW,6@
ITEM "C|Contabile"
MESSAGE HIDE,6@|SHOW,5@
END
NUMBER F_ANNO 4 NUMBER F_ANNO 4
BEGIN BEGIN
PROMPT 60 2 "Esercizio " PROMPT 25 2 "Esercizio "
USE ESC USE ESC
INPUT CODTAB F_ANNO INPUT CODTAB F_ANNO
DISPLAY "Codice Esercizio" CODTAB DISPLAY "Codice Esercizio" CODTAB
@ -72,22 +63,21 @@ BEGIN
ADD NONE ADD NONE
END END
GROUPBOX F_PRE0 76 6 SPREADSHEET F_RIGHE -1 -4
BEGIN BEGIN
PROMPT 1 3 "@bPrefisso del piano dei conti analitico:" PROMPT 0 4 "Centro di Costo / Commessa / Fase"
GROUP 6 ITEM "Cdc1"
END ITEM "Cdc2"
ITEM "Cdc3"
GROUPBOX F_PDC0_INI 76 6 ITEM "Cdc4"
BEGIN ITEM "Cdc5"
PROMPT 1 8 "@bDa conto:" ITEM "Cdc6"
GROUP 4 ITEM "Cdc7"
END ITEM "Cdc8"
ITEM "Cdc9"
GROUPBOX F_PDC0_FIN 76 6 ITEM "Cdc10"
BEGIN ITEM "Cdc11"
PROMPT 1 13 "@bA conto:" ITEM "Cdc12"
GROUP 4
END END
DATE F_DATAINI DATE F_DATAINI
@ -109,23 +99,33 @@ END
ENDPAGE ENDPAGE
PAGE "CdC / Cms / Fasi" -1 -1 78 20 PAGE "Conti" -1 -1 78 20
SPREADSHEET F_RIGHE -1 -2 LIST F_PIANO 1 12
BEGIN BEGIN
PROMPT 0 2 "" PROMPT 1 1 "Piano dei conti "
ITEM "Cdc1" ITEM "A|Analitico"
ITEM "Cdc2" MESSAGE HIDE,5@|SHOW,6@
ITEM "Cdc3" ITEM "C|Contabile"
ITEM "Cdc4" MESSAGE HIDE,6@|SHOW,5@
ITEM "Cdc5" END
ITEM "Cdc6"
ITEM "Cdc7" GROUPBOX F_PRE0 76 6
ITEM "Cdc8" BEGIN
ITEM "Cdc9" PROMPT 1 3 "@bPrefisso del piano dei conti analitico:"
ITEM "Cdc10" GROUP 6
ITEM "Cdc11" END
ITEM "Cdc12"
GROUPBOX F_PDC0_INI 76 6
BEGIN
PROMPT 1 9 "@bDa conto:"
GROUP 4
END
GROUPBOX F_PDC0_FIN 76 6
BEGIN
PROMPT 1 15 "@bA conto:"
GROUP 4
END END
ENDPAGE ENDPAGE
@ -137,8 +137,6 @@ BEGIN
PROMPT 1 2 "" PROMPT 1 2 ""
ITEM "Numerazione" ITEM "Numerazione"
ITEM "Descrizione@50" ITEM "Descrizione@50"
ITEM "Da stato"
ITEM "A stato"
END END
ENDPAGE ENDPAGE
@ -289,30 +287,6 @@ BEGIN
COPY OUTPUT SN_CODNUM COPY OUTPUT SN_CODNUM
END END
STRING SN_DASTATO 1
BEGIN
PROMPT 1 3 "Da stato "
USE %STD
CHECKTYPE REQUIRED
INPUT CODTAB SN_DASTATO
DISPLAY "Codice" CODTAB
DISPLAY "Descrizione@50" S0
OUTPUT SN_DASTATO CODTAB
FLAGS "U"
END
STRING SN_ASTATO 1
BEGIN
PROMPT 1 4 "A stato "
USE %STD
CHECKTYPE REQUIRED
INPUT CODTAB SN_ASTATO
DISPLAY "Codice" CODTAB
DISPLAY "Descrizione@50" S0
OUTPUT SN_ASTATO CODTAB
FLAGS "U"
END
BUTTON DLG_OK 10 2 BUTTON DLG_OK 10 2
BEGIN BEGIN
PROMPT -13 -1 "" PROMPT -13 -1 ""