diff --git a/ca/ca3700.cpp b/ca/ca3700.cpp index 11e240c99..800597c10 100755 --- a/ca/ca3700.cpp +++ b/ca/ca3700.cpp @@ -93,11 +93,11 @@ bool TPrint_rendiconto_ca_mask::on_field_event(TOperable_field& o, TField_event if (!data.empty() && esc.date2esc(data) != anno) return error_box(TR("La data deve appartenere all'anno selezionato")); } - else //se l'esercizio è vuoto le date diventano obbligatorie!! +/* else //se l'esercizio è vuoto le date diventano obbligatorie!! { if (o.empty()) return error_box(TR("La data è obbligatoria in quanto manca l'esercizio")); - } + }*/ } break; case F_REPORT: @@ -1001,6 +1001,7 @@ void TPrint_rendiconto_ca_recordset::set_filter(const TPrint_rendiconto_ca_mask& if (_tmp != NULL) delete _tmp; + //crea in memoria il nuovo file temporaneo e lo azzera (non si sa mai..) _tmp = new TExternisamfile(dbf, trr); _tmp->zap(); @@ -1018,7 +1019,7 @@ void TPrint_rendiconto_ca_recordset::set_filter(const TPrint_rendiconto_ca_mask& _codfas = rel.curr().get(RMOVANA_CODFASE); } - const char tc = msk.get(F_PIANO)[0]; // Contabile o Analitico? + const char tc = msk.get(F_PIANO)[0]; // Piano dei conti Contabile o Analitico? const short dlg_da = tc == 'C' ? F_PDC1_INI : F_PAN1_INI; const short dlg_al = tc == 'C' ? F_PDC1_FIN : F_PAN1_FIN; @@ -1139,25 +1140,25 @@ void TPrint_rendiconto_ca::main_loop() { while (_mask->run() == K_ENTER) { - //costruzione della query x il report in base ai parametri della maschera TSheet_field& sheet = _mask->sfield(F_RIGHE); const int n_righe_sheet = sheet.items(); //se lo sheet è vuoto aggiunge una riga vuota if (n_righe_sheet == 0) sheet.insert(); - //report e book - TReport_book book; //book dei report + //report e book dei report + TReport_book book; TString path = _mask->get(F_REPORT); if (path.empty()) path = "ca3700a"; TPrint_rendiconto_ca_rep rep; rep.load(path); - FOR_EACH_SHEET_ROW(sheet, r, row) + FOR_EACH_SHEET_ROW(sheet, r, row) //per ogni cdc/cms che appare nello sheet di pag.1 della msk.. { - rep.set_filter(*_mask, r); - book.add(rep); + rep.set_filter(*_mask, r); //..chiama il metodone globale che crea e compila il file.. + //..temporaneo i cui dati riempiranno il report + book.add(rep); //aggiunge il report relativo alla cdc/cms corrente al book } book.print_or_preview(); //stampa il book dei report