Migliorat gestione descrizioni su due righe

git-svn-id: svn://10.65.10.50/branches/R_10_00@22740 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2012-10-26 08:31:41 +00:00
parent aaeeb54314
commit 02a750c7b1

View File

@ -726,7 +726,7 @@ bool TRiba_form::validate(TForm_item &cf, TToken_string &s)
{
if (condition)
{
real importo(dati.get(2));
const real importo(dati.get(2));
cf.set(importo.string());
}
}
@ -1213,17 +1213,19 @@ void TRiba_file::validate(TCursor& cur,TRecord_text &rec, TToken_string &s, TStr
else
{
TToken_string dati; effetto.altridati_fatt(num, dati);
int elem = dati.items();
TString16 str;
const int elem = dati.items();
for (int i = 0; i < elem; i += 3)
{
if (i!=0)
descfatt << "/";
str = dati.get(i); str.trim(); // codnum
if (str.not_empty()) descfatt << str << ' ';
TString16 str = dati.get(i); str.trim(); // codnum
if (str.full())
descfatt << str << ' ';
str = dati.get(); str.trim(); // numdoc
if (str.not_empty()) descfatt << str;
if (str.full())
descfatt << str;
str = dati.get(); // anno (2 cifre)
str.trim();
@ -1234,34 +1236,33 @@ void TRiba_file::validate(TCursor& cur,TRecord_text &rec, TToken_string &s, TStr
if (main_app().has_module(CUAUT))
{
const TString &cup = effetto.get(EFF_CUP);
if (cup.full())
descfatt << " CUP:" << cup;
else
{
const TString &cig = effetto.get(EFF_CIG);
const TString &cig = effetto.get(EFF_CIG);
if (cig.full())
descfatt << " CIG:" << cig;
}
}
const int l = descfatt.len();
TString in(s.get());
const TFixed_string in = s.get();
if (in[0]=='!')
{
in.ltrim(1);
if (in == "1")
TParagraph_string p(descfatt, 40);
// Provo a fare una spezzatura "leggibile" in due righe
if (p.items() <= 2)
{
valore = p.get(in[1]-'1');
}
else
{
// Spezzatura brutale a 40 caratteri
if (in[1] == '1')
valore = descfatt.left(40);
valore.trim();
else
valore = descfatt.mid(40);
}
if (in == "2")
{
valore = descfatt.mid(40, l);
valore.trim();
}
}
}
else if (code == "_IMPORTO")
{
// gestione di campi degli importi degli effetti nel flusso
@ -1269,7 +1270,7 @@ void TRiba_file::validate(TCursor& cur,TRecord_text &rec, TToken_string &s, TStr
// dove: <macro> è uno delle macro seguenti:
// "!ADD" aggiunge l'importo dell'effetto corrente al totale
// "!TOT" emette il totale
const TString in(s.get());
const TFixed_string in = s.get();
CHECK(in[0]=='!',"Macro _IMPORTO senza carattere '!'");
if (in=="!ADD")
{
@ -1283,7 +1284,7 @@ void TRiba_file::validate(TCursor& cur,TRecord_text &rec, TToken_string &s, TStr
}
else if (in=="!TOT")
{
const real& importo = tot_importi();
const real importo = tot_importi();
valore = importo.string("##############@");
set_tot_importi(ZERO);
}
@ -1292,8 +1293,7 @@ void TRiba_file::validate(TCursor& cur,TRecord_text &rec, TToken_string &s, TStr
}
else if (code == "_CODSIA")
{
TConfig cnf(CONFIG_DITTA, "ef");
valore = cnf.get("CODSIA");
valore = ini_get_string(CONFIG_DITTA, "ef", "CODSIA");
}
else if (code == "_CODMON")
{