Patch level :4.0 624
Files correlati : Ricompilazione Demo : [ ] Commento :migliorata la stampa stima ricavi di competenza (commesse ordinate alfabeticamente, totali non impazziti) git-svn-id: svn://10.65.10.50/trunk@14905 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
bf940e2bde
commit
62ccd80780
@ -308,7 +308,6 @@ TAssoc_array& TPrint_bilancio_cms_recordset::get_row(TAssoc_array& cms, const ch
|
||||
return *riga_array;
|
||||
}
|
||||
|
||||
|
||||
static int righe_compare(const TObject** o1, const TObject** o2)
|
||||
{
|
||||
TAssoc_array& a1 = *(TAssoc_array*)*o1;
|
||||
|
@ -270,14 +270,52 @@ TAssoc_array& TPrint_stima_ricavi_recordset::get_row(TAssoc_array& cms, const ch
|
||||
riga_array->add("LEVEL", str_indice);
|
||||
riga_array->add("CODCMS", codcms);
|
||||
riga_array->add("DESCRIZ", descrizione);
|
||||
|
||||
//inizializza i campi importo sicuramente presenti (modifica DECISIVA)
|
||||
//senza questa inizializzazione, nel caso trovasse campi nulli (in realta' 0), il bastardo..
|
||||
//..anziche' considerarli 0 ci mette l'ultimo valore != che ha in memoria nella stessa posizione..
|
||||
//..facendo sballare tutti i conti!
|
||||
riga_array->add("COS_BDG", EMPTY_STRING);
|
||||
riga_array->add("COS_MAT", EMPTY_STRING);
|
||||
riga_array->add("RIC_BDG", EMPTY_STRING);
|
||||
riga_array->add("RIC_MAT", EMPTY_STRING);
|
||||
//aggiunge la riga all'array-ino
|
||||
cms.add(chiave, riga_array);
|
||||
}
|
||||
return *riga_array;
|
||||
}
|
||||
|
||||
static int righe_compare(const TObject** o1, const TObject** o2)
|
||||
{
|
||||
TAssoc_array& a1 = *(TAssoc_array*)*o1;
|
||||
TAssoc_array& a2 = *(TAssoc_array*)*o2;
|
||||
|
||||
int cmp = 0;
|
||||
|
||||
const int l1 = atoi(*(TString*)a1.objptr("LEVEL"));
|
||||
const int l2 = atoi(*(TString*)a2.objptr("LEVEL"));
|
||||
cmp = l1 - l2;
|
||||
if (cmp == 0)
|
||||
{
|
||||
const TString& c1 = *(TString*)a1.objptr("CODCMS");
|
||||
const TString& c2 = *(TString*)a2.objptr("CODCMS");
|
||||
cmp = c1.compare(c2);
|
||||
if (cmp == 0)
|
||||
{
|
||||
const TString& f1 = *(TString*)a1.objptr("FASE");
|
||||
const TString& f2 = *(TString*)a2.objptr("FASE");
|
||||
cmp = f1.compare(f2);
|
||||
}
|
||||
else
|
||||
{
|
||||
const int z1 = c1.starts_with("DETR_");
|
||||
const int z2 = c2.starts_with("DETR_");
|
||||
if (z1 || z2)
|
||||
cmp = z1 - z2;
|
||||
}
|
||||
}
|
||||
|
||||
return cmp;
|
||||
}
|
||||
|
||||
void TPrint_stima_ricavi_recordset::requery()
|
||||
{
|
||||
@ -382,6 +420,7 @@ void TPrint_stima_ricavi_recordset::requery()
|
||||
if (cazzo_cms != NULL)
|
||||
_righe.add(cazzo_cms);
|
||||
} //for(int...
|
||||
_righe.sort(righe_compare); //sorting delle commesse
|
||||
}
|
||||
|
||||
const TVariant& TPrint_stima_ricavi_recordset::get(unsigned int column) const
|
||||
|
Loading…
x
Reference in New Issue
Block a user