Patch level :2.2 184

Files correlati     :ca3.exe ca3700a.rep
Ricompilazione Demo : [ ]
Commento            :
0000448
stampa mastrini analitica
Se lo sheet è vuoto deve stampare tutte le commesse separate come se fossero specificate ad una ad una.

Aumentata di 1 la dimensione del campo DOCORIG nel report del rendiconto.


git-svn-id: svn://10.65.10.50/trunk@13381 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
luca 2005-10-04 11:02:22 +00:00
parent 82fd157b66
commit 7b2538baa6
3 changed files with 61 additions and 18 deletions

View File

@ -552,6 +552,7 @@ protected:
bool destroy();
public:
const TMultilevel_code_info& get_first_level() const;
virtual void main_loop();
};
@ -567,29 +568,65 @@ bool TPrint_mastrini_ca::destroy()
return TSkeleton_application::destroy();
}
//metodo per accattarsi o' primo livello della configurazione CA
const TMultilevel_code_info& TPrint_mastrini_ca::get_first_level() const
{
TConfig& cfg = ca_config();
const TString& first_lev = cfg.get("Level(1)");
const int logic = first_lev == "CDC" ? LF_CDC : LF_COMMESSE;
return ca_multilevel_code_info(logic);
}
void TPrint_mastrini_ca::main_loop()
{
while (_mask->run() == K_ENTER)
TPrint_mastrini_ca_mask mask;
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
TString path = _mask->get(F_REPORT);
//report e book dei report
TReport_book book;
TString path = mask.get(F_REPORT);
if (path.empty())
path = "ca3200a";
TPrint_mastrini_ca_rep rep;
rep.load(path);
FOR_EACH_SHEET_ROW(sheet, r, row)
TSheet_field& sheet = mask.sfield(F_RIGHE);
TString video_string; //stringa che compare nella progind
if (sheet.empty()) //se non ci sono righe sullo sheet (selezione su tutte le cms/cdc)...
{
rep.set_filter(*_mask, r);
book.add(rep);
TToken_string& row = sheet.row(-1); //crea la prima riga dello sheet
const TMultilevel_code_info& liv1 = get_first_level(); //stabilisce quale è il primo livello (tra CDC e CMS)..
TISAM_recordset set(liv1.logic() == LF_CDC ? "USE CDC" : "USE COMMESSE"); //..e di conseguenza scrive la use giusta
TProgind pi(set.items(), "Scansione commessa/cdc...", true, true);
for (int i = 0; set.move_to(i); i++) //fighissimo metodo per scandire un file in 1 riga!
{
pi.addstatus(1);
if (pi.iscancelled())
break;
row = set.get((unsigned int)0).as_string(); //prende il valore del primo campo del file (CDC o CMS code)
video_string = TR("Scansione");
video_string << " " << row; //completa la stringa da visualizzare sulla progind
pi.set_text(video_string);
for (int l = liv1.levels()-2; l >= 0; l--) //se la struttura è a più livelli costruisce la tokenstring
row.insert("|", liv1.total_len(l));
rep.set_filter(mask, 0); //fa la set filter sulla prima riga (che è quella usata)
book.add(rep);
}
sheet.destroy(); //cancella le commesse aggiunte in automatico sullo sheet
}
else
{
FOR_EACH_SHEET_ROW(sheet, r, row)
{
rep.set_filter(*_mask, r);
book.add(rep);
}
}
book.print_or_preview(); //stampa il book dei report

View File

@ -1061,7 +1061,7 @@ public:
virtual void main_loop();
};
//metodo
//metodo per accattarsi o' primo livello della configurazione CA
const TMultilevel_code_info& TPrint_rendiconto_ca::get_first_level() const
{
TConfig& cfg = ca_config();
@ -1085,20 +1085,26 @@ void TPrint_rendiconto_ca::main_loop()
rep.load(path);
TSheet_field& sheet = mask.sfield(F_RIGHE);
TString video_string; //stringa che compare nella progind
if (sheet.empty()) //se non ci sono righe sullo sheet (selezione su tutte le cms/cdc)...
{
TToken_string& row = sheet.row(-1); //crea la prima riga dello sheet
const TMultilevel_code_info& liv1 = get_first_level(); //stabilisce quale è il primo livello (tra CDC e CMS)..
TISAM_recordset set(liv1.logic() == LF_CDC ? "USE CDC" : "USE COMMESSE"); //..e di conseguenza scrive la use giusta
TProgind pi(set.items(), "Scansione commessa...", true, true);
TProgind pi(set.items(), video_string, true, true);
for (int i = 0; set.move_to(i); i++) //fighissimo metodo per scandire un file in 1 riga!
{
pi.addstatus(1);
if (pi.iscancelled())
break;
row = set.get((unsigned int)0).as_string(); //prende il valore del primo campo del file (CDC o CMS code)
video_string = TR("Scansione");
video_string << " " << row; //completa la stringa da visualizzare sulla progind
pi.set_text(video_string);
for (int l = liv1.levels()-2; l >= 0; l--) //se la struttura è a più livelli costruisce la tokenstring
row.insert("|", liv1.total_len(l));

View File

@ -210,7 +210,7 @@ MESSAGE RESET,F2.103</prescript>
<field x="90" type="Stringa" dynamic_height="1" width="25" height="2" pattern="1">
<source>DESCRIGA</source>
</field>
<field x="116" type="Stringa" align="right" dynamic_height="1" width="14" height="2" pattern="1">
<field x="116" type="Stringa" align="right" width="15" pattern="1">
<source>DOCORIG</source>
</field>
<field x="132" type="Valuta" align="right" width="12" pattern="1" text="###.###.###,@@">