Patch level : 2.2 020
Files correlati : sv0.exe sv1.exe sv2.exe Ricompilazione Demo : [ ] Commento : Bug 0000138 Implementare la gestione multilingua E' stato anche velocizzato il programma di statistiche personalizzate. Andrebbe testato confrontando i rsultati con la 2.0 git-svn-id: svn://10.65.10.50/trunk@12343 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
8900dc2f07
commit
122306bc0e
@ -1,5 +1,6 @@
|
||||
#include <xvt.h>
|
||||
#include <checks.h>
|
||||
#include <diction.h>
|
||||
|
||||
#include "sv0.h"
|
||||
|
||||
@ -15,7 +16,7 @@ int main(int argc, char** argv)
|
||||
sv0400(argc, argv); // parametrizzazione modulo
|
||||
break;
|
||||
default:
|
||||
error_box("Invalid argument %s", argv[1]);
|
||||
error_box(FR("Invalid argument %s"), argv[1]);
|
||||
break;
|
||||
}
|
||||
exit(0);
|
||||
|
@ -81,8 +81,17 @@ void TPSV_tabapp::set_frequency()
|
||||
TList_field& multiplo = (TList_field&)m.field(FPSV_MULTIPLO);
|
||||
|
||||
TToken_string std_codes("G|S|Q|1|2|3|4|6|A");
|
||||
TToken_string std_descr("Giornaliera|Settimanale|Quindicinale|Mensile|"
|
||||
"Bimestrale|Trimestrale|Quadrimestrale|Semestrale|Annuale");
|
||||
TToken_string std_descr;
|
||||
|
||||
std_descr.add(TR("Giornaliera"));
|
||||
std_descr.add(TR("Settimanale"));
|
||||
std_descr.add(TR("Quindicinale"));
|
||||
std_descr.add(TR("Mensile"));
|
||||
std_descr.add(TR("Bimestrale"));
|
||||
std_descr.add(TR("Trimestrale"));
|
||||
std_descr.add(TR("Quadrimestrale"));
|
||||
std_descr.add(TR("Semestrale"));
|
||||
std_descr.add(TR("Annuale"));
|
||||
|
||||
TToken_string codes(8), descr(80);
|
||||
switch(_stats.frequency())
|
||||
@ -130,7 +139,7 @@ void TPSV_tabapp::fill_field_list(TMask& m)
|
||||
row = "A";
|
||||
if (l) row << l;
|
||||
|
||||
row.add("Codice articolo");
|
||||
row.add(TR("Codice articolo"));
|
||||
if (l) row << '[' << l << ']';
|
||||
|
||||
list.add(row);
|
||||
@ -148,23 +157,35 @@ void TPSV_tabapp::fill_field_list(TMask& m)
|
||||
row = "L";
|
||||
if (l) row << l;
|
||||
|
||||
row.add("Livello giacenza");
|
||||
row.add(TR("Livello giacenza"));
|
||||
if (l) row << '[' << l << ']';
|
||||
list.add(row);
|
||||
}
|
||||
if (is_articolo)
|
||||
{
|
||||
row = "B";
|
||||
row.add("Campo dell'anagrafica articoli");
|
||||
row.add(TR("Campo dell'anagrafica articoli"));
|
||||
list.add(row);
|
||||
}
|
||||
|
||||
list.add("D|Tipo documento");
|
||||
list.add("V|Categoria vendita");
|
||||
list.add("C|Codice cliente");
|
||||
list.add("Z|Codice zona");
|
||||
list.add("G|Codice agente");
|
||||
list.add("M|Codice magazzino");
|
||||
row = "D";
|
||||
row.add(TR("Tipo documento"));
|
||||
list.add(row);
|
||||
row = "V";
|
||||
row.add(TR("Categoria vendita"));
|
||||
list.add(row);
|
||||
row = "C";
|
||||
row.add(TR("Codice cliente"));
|
||||
list.add(row);
|
||||
row = "Z";
|
||||
row.add(TR("Codice zona"));
|
||||
list.add(row);
|
||||
row = "G";
|
||||
row.add(TR("Codice agente"));
|
||||
list.add(row);
|
||||
row = "M";
|
||||
row.add(TR("Codice magazzino"));
|
||||
list.add(row);
|
||||
}
|
||||
|
||||
bool TPSV_tabapp::user_create()
|
||||
@ -251,7 +272,7 @@ void TPSV_tabapp::mask2rec(const TMask& m)
|
||||
rec.put("S4", s4.left(20));
|
||||
rec.put("S5", s4.mid(20));
|
||||
if (excedeed)
|
||||
warning_box("Attenzione !! Sono stati definiti\ntroppi campi di anagrafica articoli.\nVerranno memorizzati solo i primi");
|
||||
warning_box(TR("Attenzione !! Sono stati definiti\ntroppi campi di anagrafica articoli.\nVerranno memorizzati solo i primi"));
|
||||
}
|
||||
|
||||
int TPSV_tabapp::write(const TMask& m)
|
||||
@ -317,23 +338,23 @@ bool TPSV_tabapp::chiave_handler(TMask_field& f, KEY k)
|
||||
{
|
||||
case 'C':
|
||||
if (!PSV_app()._stats.grp_cliente())
|
||||
ok = error_box("Le statistiche sono raggruppate per cliente");
|
||||
ok = error_box(TR("Le statistiche sono raggruppate per cliente"));
|
||||
break;
|
||||
case 'G':
|
||||
if (!PSV_app()._stats.grp_agente())
|
||||
ok = error_box("Le statistiche sono raggruppate per agente");
|
||||
ok = error_box(TR("Le statistiche sono raggruppate per agente"));
|
||||
break;
|
||||
case 'L':
|
||||
if (!PSV_app()._stats.grp_giacenza())
|
||||
ok = error_box("Le statistiche sono raggruppate per livello di giacenza");
|
||||
ok = error_box(TR("Le statistiche sono raggruppate per livello di giacenza"));
|
||||
break;
|
||||
case 'M':
|
||||
if (!PSV_app()._stats.grp_magazzino())
|
||||
ok = error_box("Le statistiche sono raggruppate per magazzino");
|
||||
ok = error_box(TR("Le statistiche sono raggruppate per magazzino"));
|
||||
break;
|
||||
case 'Z':
|
||||
if (!PSV_app()._stats.grp_zona())
|
||||
ok = error_box("Le statistiche sono raggruppate per zona");
|
||||
ok = error_box(TR("Le statistiche sono raggruppate per zona"));
|
||||
break;
|
||||
default : break;
|
||||
}
|
||||
@ -347,8 +368,7 @@ bool TPSV_tabapp::chiave_handler(TMask_field& f, KEY k)
|
||||
|
||||
if (campo[0] != 'B' && found )
|
||||
{
|
||||
ok = error_box("Il codice %s inserito alla riga %d e' gia'\n"
|
||||
"utilizzato in una riga precedente.",
|
||||
ok = error_box(FR("Il codice %s inserito alla riga %d e' gia'\nutilizzato in una riga precedente."),
|
||||
(const char*)campo, r+1);
|
||||
}
|
||||
else
|
||||
@ -381,14 +401,13 @@ bool TPSV_tabapp::artfld_handler(TMask_field& f, KEY k)
|
||||
case K_ENTER:
|
||||
if (!f.empty() && f.to_check(k))
|
||||
{
|
||||
TLocalisamfile anamag(LF_ANAMAG);
|
||||
const TRectype& rec = anamag.curr();
|
||||
const TRectype rec(LF_ANAMAG);
|
||||
TString16 field = f.get();
|
||||
int pos = field.find('[');
|
||||
if (pos > 0)
|
||||
field.cut(pos);
|
||||
if (!rec.exist(field))
|
||||
ok = f.error_box("Il campo '%s' non esiste.", (const char*)field);
|
||||
ok = f.error_box(FR("Il campo '%s' non esiste."), (const char*)field);
|
||||
}
|
||||
break;
|
||||
case K_F9:
|
||||
@ -422,10 +441,10 @@ int sv0100(int argc, char* argv[])
|
||||
app = new TPSV_tabapp;
|
||||
else
|
||||
app = new TSV_tabapp;
|
||||
app->run(argc, argv, "Tabella");
|
||||
app->run(argc, argv, TR("Tabella"));
|
||||
delete app; // Guy's humour
|
||||
}
|
||||
else
|
||||
error_box("Manca il nome della tabella");
|
||||
error_box(TR("Manca il nome della tabella"));
|
||||
return 0;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ bool TParametri_stat::user_destroy()
|
||||
const bool ok = TConfig_application::user_destroy();
|
||||
if (ok)
|
||||
{
|
||||
if (_recalc_needed && yesno_box("Si desidera ricalcolare le statistiche ora?"))
|
||||
if (_recalc_needed && yesno_box(TR("Si desidera ricalcolare le statistiche ora?")))
|
||||
{
|
||||
TExternal_app app("sv2 -0");
|
||||
app.run();
|
||||
@ -43,6 +43,6 @@ TParametri_stat::TParametri_stat()
|
||||
int sv0400(int argc, char* argv[])
|
||||
{
|
||||
TParametri_stat app;
|
||||
app.run(argc, argv, "Parametri statistiche");
|
||||
app.run(argc, argv, TR("Parametri statistiche"));
|
||||
return 0;
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ bool TSchede_mask::date_handler(TMask_field& f, KEY k)
|
||||
const TDate fd(m.get(F_FROMDATE));
|
||||
const TDate td(m.get(F_TODATE));
|
||||
if (td.ok() && td < fd)
|
||||
ok = f.error_box("La data finale deve seguire quella iniziale");
|
||||
ok = f.error_box(TR("La data finale deve seguire quella iniziale"));
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
@ -64,7 +64,7 @@ bool TSchede_mask::num_handler(TMask_field& f, KEY k)
|
||||
const TString& fn = m.get(F_FROMNUM);
|
||||
const TString& tn = m.get(F_TONUM);
|
||||
if (tn.not_empty() && tn < fn)
|
||||
ok = f.error_box("La numerazione finale deve seguire quella iniziale");
|
||||
ok = f.error_box(TR("La numerazione finale deve seguire quella iniziale"));
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
@ -159,7 +159,7 @@ bool TSchede_mask::realfield_handler(TMask_field& f, KEY k)
|
||||
m.set(S_IMPORTO, (decimals <= 3 && length >= 6)? "X" : "");
|
||||
}
|
||||
else
|
||||
return f.error_box("E' necessario selezionare un campo numerico.");
|
||||
return f.error_box(TR("E' necessario selezionare un campo numerico."));
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
@ -629,9 +629,9 @@ bool TStampa_schede::fill_rdoc(TRectype& tab, const TRiga_documento& rdoc, const
|
||||
|
||||
if (ageart)
|
||||
{
|
||||
descr << "*** Doc." << doc.numerazione();
|
||||
descr << TR("*** Doc.") << doc.numerazione();
|
||||
descr << '/' << doc.numero();
|
||||
descr << " del " << doc.data();
|
||||
descr << TR(" del ") << doc.data();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -720,9 +720,9 @@ void TStampa_schede::fill_totriga(TRectype& tab)
|
||||
ddoc.set_year(atoi(_lastkey.left(4)));
|
||||
ddoc.set_month(atoi(_lastkey.mid(4,2)));
|
||||
ddoc.set_day(atoi(_lastkey.mid(6,2)));
|
||||
descr << "Totale documento " << _lastkey.mid(8,4) ;
|
||||
descr << TR("Totale documento ") << _lastkey.mid(8,4) ;
|
||||
descr << ' ' << atoi(_lastkey.mid(12,4));
|
||||
descr << " del " << ddoc;
|
||||
descr << TR(" del ") << ddoc;
|
||||
}
|
||||
tab.put("S1", descr);
|
||||
tab.put("B8", TRUE); // Riga totale
|
||||
@ -776,7 +776,7 @@ void TStampa_schede::fill_codcli(TRectype& tab)
|
||||
const char t = s[0];
|
||||
const long c = atol(s.right(7));
|
||||
clifo.put("TIPOCF", t); clifo.put("CODCF", c);
|
||||
s = t=='C' ? "Cliente " : "Fornitore " ;
|
||||
s = t=='C' ? TR("Cliente ") : TR("Fornitore ") ;
|
||||
s << c << " ";
|
||||
if (clifo.read() == NOERR)
|
||||
s << clifo.get("RAGSOC");
|
||||
@ -791,7 +791,7 @@ void TStampa_schede::fill_tot(TRectype& tab)
|
||||
tab.put("COD", "PRN");
|
||||
tab.put("CODTAB", ++_progressivo);
|
||||
tab.put("S0", "yyyyyyyy"); // Si assicura che sia l'ultima prima dell'agente
|
||||
tab.put("S1", "Totale");
|
||||
tab.put("S1", TR("Totale"));
|
||||
tab.put("B8", TRUE); // Riga totale
|
||||
|
||||
for (int r = _totali.last(); r >= 0; r--)
|
||||
@ -806,7 +806,7 @@ bool TStampa_schede::write_tab(TLocalisamfile& tab) const
|
||||
{
|
||||
int err = tab.write();
|
||||
if (err != NOERR)
|
||||
error_box("Errore %d durante la scrittura sul file temporaneo", err);
|
||||
error_box(FR("Errore %d durante la scrittura sul file temporaneo"), err);
|
||||
return err == NOERR;
|
||||
}
|
||||
|
||||
@ -913,7 +913,7 @@ void TStampa_schede::fill_totage(TRectype& tab)
|
||||
tab.put("CODTAB", ++_progressivo);
|
||||
|
||||
TString80 descr;
|
||||
descr << "Totale Agente " << _curagente;
|
||||
descr << TR("Totale Agente ") << _curagente;
|
||||
descr.cut(50);
|
||||
|
||||
tab.put("S0", "zzzzzzzz"); // Mi assicuro che sia l'ultima riga
|
||||
@ -995,7 +995,7 @@ bool TStampa_schede::stampa_clifo(TCursor& cur, const TString& ragsoc, bool last
|
||||
if (items > 4)
|
||||
{
|
||||
TString header(160);
|
||||
header = "Preparazione file temporaneo di stampa ...";
|
||||
header = TR("Preparazione file temporaneo di stampa ...");
|
||||
if (ragsoc.not_empty())
|
||||
header << '\n' << ragsoc;
|
||||
pi = new TProgind(items, header, TRUE, TRUE);
|
||||
@ -1015,7 +1015,7 @@ bool TStampa_schede::stampa_clifo(TCursor& cur, const TString& ragsoc, bool last
|
||||
bool can_print = TRUE;
|
||||
|
||||
TForm_item& tit = _form->find_field('H',odd_page,FF_TITOLO);
|
||||
tit.set(stampa_clienti() ? "clienti" : "fornitori");
|
||||
tit.set(stampa_clienti() ? TR("clienti") : TR("fornitori"));
|
||||
|
||||
TForm_item& age = _form->find_field('H',odd_page,FF_AGENTE);
|
||||
if (stampa_per_agente())
|
||||
@ -1101,13 +1101,13 @@ bool TStampa_schede::stampa_clifo(TCursor& cur, const TString& ragsoc, bool last
|
||||
TForm_item& col2 = _form->find_field('B',odd_page,FF_SECONDCOLUMN);
|
||||
if (stampa_sintetica())
|
||||
{
|
||||
col1.set_col_head("Base sconto");
|
||||
col2.set_col_head("Totale");
|
||||
col1.set_col_head(TR("Base sconto"));
|
||||
col2.set_col_head(TR("Totale"));
|
||||
}
|
||||
else
|
||||
{
|
||||
col1.set_col_head("Netto scontato");
|
||||
col2.set_col_head("Lordo scontato");
|
||||
col1.set_col_head(TR("Netto scontato"));
|
||||
col2.set_col_head(TR("Lordo scontato"));
|
||||
}
|
||||
|
||||
_form->init_pictures(*_mask);
|
||||
@ -1148,10 +1148,10 @@ bool TStampa_schede::stampa_selezione(TCursor& clifocur, const TSheet& clifoshee
|
||||
if (stampa_per_ageart())
|
||||
{
|
||||
TForm_item& tit = _form->find_field('H',odd_page,FF_TITOLO);
|
||||
tit.set("agenti");
|
||||
tit.set(TR("agenti"));
|
||||
|
||||
TString header;
|
||||
header = "Preparazione file temporaneo di stampa per l'agente: ";
|
||||
header = TR("Preparazione file temporaneo di stampa per l'agente: ");
|
||||
header << _curagente;
|
||||
|
||||
pi = new TProgind(items, header, TRUE, TRUE);
|
||||
@ -1370,7 +1370,7 @@ void TStampa_schede::main_loop()
|
||||
const TRecnotype doc_items = cur.items();
|
||||
if (doc_items > 0)
|
||||
{
|
||||
TProgind pi(doc_items, "Selezione documenti", TRUE, TRUE);
|
||||
TProgind pi(doc_items, TR("Selezione documenti"), TRUE, TRUE);
|
||||
cur.freeze();
|
||||
for (cur = 0L; cur.pos() < doc_items; ++cur)
|
||||
{
|
||||
@ -1461,7 +1461,7 @@ bool TStampa_schede::destroy()
|
||||
int sv1100(int argc, char* argv[])
|
||||
{
|
||||
TStampa_schede app;
|
||||
app.run(argc, argv, "Stampa schede");
|
||||
app.run(argc, argv, TR("Stampa schede"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
438
sv/sv1200.cpp
438
sv/sv1200.cpp
@ -1,4 +1,5 @@
|
||||
#include <currency.h>
|
||||
#include <fraction.h>
|
||||
#include <mask.h>
|
||||
#include <msksheet.h>
|
||||
#include <printapp.h>
|
||||
@ -50,10 +51,6 @@
|
||||
#define COMP_AS_DIFF 'D'
|
||||
#define COMP_AS_PERC 'P'
|
||||
|
||||
//#define RIGA_MERCE "M"
|
||||
//#define RIGA_PRESTAZIONI "P"
|
||||
//#define RIGA_OMAGGI "O"
|
||||
|
||||
#define COLONNA_VALORE "V"
|
||||
#define COLONNA_QTA "Q"
|
||||
#define COLONNA_ENTRAMBI "E"
|
||||
@ -363,9 +360,7 @@ class TStampa_stat : public TPrint_application
|
||||
TFrequenza_colonne _freq;
|
||||
TCodart_livelli* _liv_art;
|
||||
TCodgiac_livelli* _liv_giac;
|
||||
TRecord_cache *_tipodoc,*_catven;
|
||||
TLocalisamfile * _umart,*_anamag,*_clifor,*_agenti;
|
||||
TTable *_spp, *_prs;
|
||||
TRecord_cache *_tipodoc,*_catven, *_umart;
|
||||
|
||||
TToken_string _key;
|
||||
TString _last_key;
|
||||
@ -413,8 +408,6 @@ private:
|
||||
|
||||
|
||||
void put_column(TRectype & statrec,int col, const TSVriep_record& curr);
|
||||
const real fc_um(const TRectype& statrec,const TSVriep_record& rieprec);
|
||||
void invalid_columns(TRectype & statrec);
|
||||
void standardize_um(TSVriep_record& rieprec, bool force=FALSE);
|
||||
|
||||
// generazione del file di output
|
||||
@ -621,7 +614,7 @@ bool TStampa_stat::preprocess_print(int file, int counter)
|
||||
void TStampa_stat::preprocess_footer()
|
||||
{
|
||||
set_filled_row('F',1,'_',0,_pagewidth);
|
||||
_wrk_row.format("Pagina @#",get_page_number()-_last_page*(_colpage-1));
|
||||
_wrk_row.format(FR("Pagina @#"),get_page_number()-_last_page*(_colpage-1));
|
||||
set_row_atpos('F',2,_wrk_row,(_colpage-1)*_pagewidth+(_pagewidth-9)/2);
|
||||
}
|
||||
|
||||
@ -634,21 +627,21 @@ void TStampa_stat::preprocess_header()
|
||||
set_header(++row,"");
|
||||
set_header(++row,"");
|
||||
if (selmask().get(F_DESCR).empty())
|
||||
set_row_atpos('H',++row,"@bStampa statistiche ",0);
|
||||
set_row_atpos('H',++row,FR("@bStampa statistiche "),0);
|
||||
else
|
||||
{
|
||||
_wrk_row.format("@b%s",(const char *)selmask().get(F_DESCR));
|
||||
set_row_atpos('H',++row,(const char *)_wrk_row,0);
|
||||
_wrk_row.format("dal %s al %s ",(const char *)selmask().get(F_DATAINI),(const char *)selmask().get(F_DATAFIN));
|
||||
_wrk_row.format(FR("dal %s al %s "),(const char *)selmask().get(F_DATAINI),(const char *)selmask().get(F_DATAFIN));
|
||||
set_row_atpos('H',row,(const char *)_wrk_row,51);
|
||||
if (printmask().get_bool(F_STRAFFRONTO ))
|
||||
{
|
||||
_wrk_row.format("confrontata con i corrispondenti periodi a partire dal %s",(const char *)selmask().get(F_DATARAF));
|
||||
_wrk_row.format(FR("confrontata con i corrispondenti periodi a partire dal %s"),(const char *)selmask().get(F_DATARAF));
|
||||
set_row_atpos('H',++row,(const char *)_wrk_row,0);
|
||||
}
|
||||
}
|
||||
set_header(++row,"");
|
||||
set_row_atpos('H',++row," Codice @23gDescrizione",0);
|
||||
set_row_atpos('H',++row,FR(" Codice @23gDescrizione"),0);
|
||||
lastrow=row;
|
||||
for (int c=0; c < _numcol; c++) // colonne
|
||||
{
|
||||
@ -668,9 +661,6 @@ void TStampa_stat::preprocess_header()
|
||||
const int l = col1.len();
|
||||
TParagraph_string s(col1, _largcol);
|
||||
|
||||
// const bool multiprint = (_st_val + _st_qta + _st_uni) > 1;
|
||||
// if (multiprint)
|
||||
// {
|
||||
col1 = s.get();
|
||||
col1.center_just(_largcol);
|
||||
set_row_atpos('H', row, col1, pos);
|
||||
@ -684,23 +674,20 @@ void TStampa_stat::preprocess_header()
|
||||
lastrow = row + 2;
|
||||
}
|
||||
|
||||
// if (multiprint)
|
||||
// {
|
||||
// lastrow = row+1;
|
||||
if (_st_val)
|
||||
{
|
||||
pos += _larg[0];
|
||||
set_row_atpos('H',lastrow,"Valore", pos - 7);
|
||||
set_row_atpos('H',lastrow,TR("Valore"), pos - 7);
|
||||
if (printmask().get_bool(F_STRAFFRONTO))
|
||||
{
|
||||
pos += _larg[1];
|
||||
switch (printmask().get(F_TIPORAFFRONTO)[0])
|
||||
{
|
||||
case COMP_AS_DIFF:
|
||||
set_row_atpos('H',lastrow,"Differenza", pos - 11);
|
||||
set_row_atpos('H',lastrow,TR("Differenza"), pos - 11);
|
||||
break;
|
||||
case COMP_AS_PERC:
|
||||
set_row_atpos('H',lastrow,"%%Diff", pos - 7);
|
||||
set_row_atpos('H',lastrow,TR("%%Diff"), pos - 7);
|
||||
break;
|
||||
case COMP_AS_VALUE:
|
||||
default:
|
||||
@ -709,24 +696,24 @@ void TStampa_stat::preprocess_header()
|
||||
}
|
||||
if (_st_totr)
|
||||
{
|
||||
set_row_atpos('H', lastrow, "Perc.", pos);
|
||||
set_row_atpos('H', lastrow, TR("Perc."), pos);
|
||||
pos += _larg[2];
|
||||
}
|
||||
}
|
||||
if (_st_qta)
|
||||
{
|
||||
pos += _larg[3];
|
||||
set_row_atpos('H',lastrow,"Quantita'",pos - 12);
|
||||
set_row_atpos('H',lastrow,TR("Quantita'"),pos - 12);
|
||||
if (printmask().get_bool(F_STRAFFRONTO))
|
||||
{
|
||||
pos += _larg[4];
|
||||
switch (printmask().get(F_TIPORAFFRONTO)[0])
|
||||
{
|
||||
case COMP_AS_DIFF:
|
||||
set_row_atpos('H',lastrow,"Differenza", pos - 13);
|
||||
set_row_atpos('H',lastrow,TR("Differenza"), pos - 13);
|
||||
break;
|
||||
case COMP_AS_PERC:
|
||||
set_row_atpos('H',lastrow,"%%Diff", pos - 7);
|
||||
set_row_atpos('H',lastrow,TR("%%Diff"), pos - 7);
|
||||
break;
|
||||
case COMP_AS_VALUE:
|
||||
default:
|
||||
@ -735,39 +722,14 @@ void TStampa_stat::preprocess_header()
|
||||
}
|
||||
if (_st_totr)
|
||||
{
|
||||
set_row_atpos('H', lastrow, "Perc.", pos);
|
||||
set_row_atpos('H', lastrow, TR("Perc."), pos);
|
||||
pos += _larg[5];
|
||||
}
|
||||
}
|
||||
if (_st_uni)
|
||||
set_row_atpos('H',lastrow,"Valore medio", pos + _larg[6] - 12);
|
||||
/* }
|
||||
else
|
||||
{
|
||||
if (col2.not_empty())
|
||||
{
|
||||
lastrow=row+1;
|
||||
}
|
||||
}
|
||||
*/
|
||||
set_row_atpos('H',lastrow,TR("Valore medio"), pos + _larg[6] - 12);
|
||||
col++;
|
||||
}
|
||||
/* if (_st_totr)
|
||||
{
|
||||
int pos = POS_PRIMACOL+c*_largcol;
|
||||
if (_st_val)
|
||||
{
|
||||
lastrow=row+1;
|
||||
pos += _larg[0] + _larg;
|
||||
pos += LARG_COLPERC;
|
||||
}
|
||||
if (_st_qta)
|
||||
{
|
||||
lastrow=row+1;
|
||||
pos += LARG_COLQTA;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
row=lastrow;
|
||||
set_header(++row,"");
|
||||
@ -807,7 +769,6 @@ const TString& TStampa_stat::nome_colonna1(int c, TString& s_park)
|
||||
{
|
||||
case fs_giornaliera:
|
||||
{
|
||||
// TDate d(period2date(din.year(), din.day()+c*numero, freq));
|
||||
TDate d = din; d += c*numero;
|
||||
s_park.format("%s",(const char*)itow(d.wday()));
|
||||
}
|
||||
@ -821,7 +782,7 @@ const TString& TStampa_stat::nome_colonna1(int c, TString& s_park)
|
||||
s_park.format("%d^%s",1+(start+c-1)%lastp,(const char *)char2freqname(code_freq));
|
||||
break;
|
||||
case fs_annuale:
|
||||
s_park.format("Anno %d",din.year()+start+c-1);
|
||||
s_park.format(FR("Anno %d"),din.year()+start+c-1);
|
||||
break;
|
||||
case fs_mensile:
|
||||
s_park.format("%s",itom(start+c) );
|
||||
@ -846,7 +807,7 @@ const TString& TStampa_stat::nome_colonna2(int c, TString& s_park)
|
||||
if (freq == maskfreq && numero > 1 && maskfreq==fs_giornaliera)
|
||||
{
|
||||
TDate dto(app()._freq.column_last_day(c));
|
||||
s_park.format("Al %s",(const char *)dto.string());
|
||||
s_park.format(FR("Al %s"),(const char *)dto.string());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -854,7 +815,6 @@ const TString& TStampa_stat::nome_colonna2(int c, TString& s_park)
|
||||
{
|
||||
case fs_giornaliera:
|
||||
{
|
||||
// TDate d(period2date(din.year(), din.day()+c*numero, freq));
|
||||
TDate d = din; d += c*numero;
|
||||
s_park.format("%s",(const char *)d.string());
|
||||
}
|
||||
@ -870,11 +830,10 @@ const TString& TStampa_stat::nome_colonna2(int c, TString& s_park)
|
||||
case fs_trimestrale:
|
||||
case fs_quadrimestrale:
|
||||
case fs_semestrale:
|
||||
s_park.format(" anno %d",din.year()+int((start+c-1)/lastp));
|
||||
s_park.format(FR(" anno %d"),din.year()+int((start+c-1)/lastp));
|
||||
break;
|
||||
}
|
||||
}
|
||||
// s_park.center_just(LARG_COLVAL);
|
||||
return s_park;
|
||||
}
|
||||
|
||||
@ -895,7 +854,7 @@ const TString& TStampa_stat::nome_totale(int c, TString& s_park)
|
||||
case fs_semestrale:
|
||||
case fs_annuale:
|
||||
default:
|
||||
s_park.format("Totale %d",c);
|
||||
s_park.format(FR("Totale %d"),c);
|
||||
}
|
||||
}
|
||||
return s_park;
|
||||
@ -1039,7 +998,7 @@ int TStampa_stat::set_rows_colonne(int row, const TRectype &strec)
|
||||
{
|
||||
for (col = 0; col < _numcol_dati; col++)
|
||||
{
|
||||
colname.format("%s%d", SVS_VALCOLNAME, col);
|
||||
colname.format("%c%d", SVS_VALCOLNAME, col);
|
||||
|
||||
const int idx = int(col/_col_anno);
|
||||
if (col%_col_anno == 0)
|
||||
@ -1047,7 +1006,7 @@ int TStampa_stat::set_rows_colonne(int row, const TRectype &strec)
|
||||
|
||||
_totval_riga[idx] += strec.get_real(colname);
|
||||
|
||||
colname.format("%s%d", SVS_QTACOLNAME, col);
|
||||
colname.format("%c%d", SVS_QTACOLNAME, col);
|
||||
_totqta_riga[idx] += strec.get_real(colname);
|
||||
}
|
||||
}
|
||||
@ -1094,19 +1053,18 @@ int TStampa_stat::set_rows_colonne(int row, const TRectype &strec)
|
||||
continue;
|
||||
|
||||
const real& tot_riga = t == 1 ? _totqta_riga[idx] : _totval_riga[idx];
|
||||
colname.format("%s%d", t == 1 ? SVS_QTACOLNAME : SVS_VALCOLNAME, c);
|
||||
colname.format("%c%d", t == 1 ? SVS_QTACOLNAME : SVS_VALCOLNAME, c);
|
||||
|
||||
const TString& PICT = pictures[t];
|
||||
|
||||
real colval = strec.get_real(colname);
|
||||
if (t == 2)
|
||||
{
|
||||
colname.format("%s%d", SVS_QTACOLNAME, c);
|
||||
const real qta = strec.get_real(colname);
|
||||
if (qta.is_zero())
|
||||
colval = ZERO;
|
||||
else
|
||||
colval /= qta;
|
||||
colname.format("%c%d", SVS_QTACOLNAME, c);
|
||||
|
||||
const fraction valun(colval, strec.get_real(colname));
|
||||
|
||||
colval = valun;
|
||||
}
|
||||
|
||||
int offset = (t - 1) * 3;
|
||||
@ -1181,18 +1139,10 @@ int TStampa_stat::set_rows_colonne(int row, const TRectype &strec)
|
||||
{
|
||||
col++;
|
||||
int position_a = position + _largcol;
|
||||
/* position = POS_PRIMACOL + col*_largcol;
|
||||
if (_st_val && _st_qta && t == 1)
|
||||
{
|
||||
position += LARG_COLVAL;
|
||||
if (_st_totr) position += LARG_COLPERC;
|
||||
}
|
||||
*/
|
||||
|
||||
set_row_atpos('R',row,(const char *)tot_riga.string(PICT),position_a);
|
||||
if (_st_totr && aggiungi_perc)
|
||||
{
|
||||
// position += t == 0 ? LARG_COLVAL : LARG_COLQTA;
|
||||
set_row_atpos('R',row,(const char *)real(100).string(PICTURE_PERCENT),position_a + _larg[offset]);
|
||||
}
|
||||
}
|
||||
@ -1287,7 +1237,7 @@ int TStampa_stat::handle_levchange(int row, const int level)
|
||||
set_filled_row('R',++row,'_',POS_PRIMACOL,_largcol * _numcol );
|
||||
|
||||
partkey_name(rec_grp1.get(SVS_LEVCODE), numlevels() - _last_lev_grp - 1, _wrk_row);
|
||||
_wrk_row.insert("@bTotale ", 0);
|
||||
_wrk_row.insert(FR("@bTotale "), 0);
|
||||
|
||||
_wrk_row << ' ' << rec_grp1.get(SVS_CODICE).mid(lencode);
|
||||
_wrk_row << ' ' << rec_grp1.get(SVS_DESCR).left(23);
|
||||
@ -1339,11 +1289,11 @@ bool TStampa_stat::user_create()
|
||||
// files: documenti e statistiche
|
||||
open_files(LF_RIGHEDOC, LF_CONDV, LF_RCONDV, LF_ANAMAG, LF_SCONTI, LF_UMART, LF_TAB, LF_TABCOM, LF_CLIFO,
|
||||
LF_CFVEN, LF_INDSP, LF_OCCAS, LF_MOVMAG, LF_RMOVMAG,LF_PROVV, 0);
|
||||
open_files(LF_SVRIEP,LF_SVSTAT,0);
|
||||
|
||||
open_files(LF_SVRIEP,LF_SVSTAT,LF_AGENTI, 0);
|
||||
|
||||
_stats.init();
|
||||
if (_stats.frequency()==fs_nulla)
|
||||
return error_box("E' necessario impostare la frequenza statistica per la ditta");
|
||||
return error_box(TR("E' necessario impostare la frequenza statistica per la ditta"));
|
||||
|
||||
// ************
|
||||
// maschere
|
||||
@ -1372,13 +1322,10 @@ bool TStampa_stat::user_create()
|
||||
|
||||
_tipodoc = new TRecord_cache("%TIP");
|
||||
_catven = new TRecord_cache("CVE");
|
||||
_umart = new TRecord_cache(LF_UMART, 2);
|
||||
|
||||
_umart = new TLocalisamfile(LF_UMART);
|
||||
_anamag = new TLocalisamfile(LF_ANAMAG);
|
||||
_clifor = new TLocalisamfile(LF_CLIFO);
|
||||
_agenti = new TLocalisamfile(LF_AGENTI);
|
||||
_spp = new TTable("SPP");
|
||||
_prs = new TTable("PRS");
|
||||
// _spp = new TTable("SPP");
|
||||
// _prs = new TTable("PRS");
|
||||
|
||||
// ************
|
||||
// cursore di stampa
|
||||
@ -1407,13 +1354,8 @@ bool TStampa_stat::user_destroy()
|
||||
// cancella le cache
|
||||
delete _tipodoc;
|
||||
delete _catven;
|
||||
delete _umart;
|
||||
// cancella i files
|
||||
delete _umart;
|
||||
delete _anamag;
|
||||
delete _clifor;
|
||||
delete _agenti;
|
||||
delete _spp;
|
||||
delete _prs;
|
||||
delete _last_data;
|
||||
|
||||
delete current_cursor()->relation();
|
||||
@ -1546,7 +1488,7 @@ void TStampa_stat::fill_field_list(TMask& m)
|
||||
row = STR_ARTICOLO;
|
||||
if (l) row << l;
|
||||
|
||||
row.add("Codice articolo");
|
||||
row.add(TR("Codice articolo"));
|
||||
if (l) row << '[' << l << ']';
|
||||
|
||||
list.add(row);
|
||||
@ -1554,7 +1496,7 @@ void TStampa_stat::fill_field_list(TMask& m)
|
||||
if (is_articolo)
|
||||
{
|
||||
row = STR_ARTFIELD;
|
||||
row.add("Campo dell'anagrafica articoli");
|
||||
row.add(TR("Campo dell'anagrafica articoli"));
|
||||
list.add(row);
|
||||
}
|
||||
TCodgiac_livelli& cgl = *_liv_giac;
|
||||
@ -1566,18 +1508,29 @@ void TStampa_stat::fill_field_list(TMask& m)
|
||||
row = STR_LIVGIAC;
|
||||
if (l) row << l;
|
||||
|
||||
row.add("Livello giacenza");
|
||||
row.add(TR("Livello giacenza"));
|
||||
if (l) row << '[' << l << ']';
|
||||
list.add(row);
|
||||
}
|
||||
|
||||
list.add("U|Unita' di misura");
|
||||
list.add("D|Tipo documento");
|
||||
list.add("V|Categoria vendita");
|
||||
list.add("C|Codice cliente");
|
||||
list.add("G|Codice agente");
|
||||
list.add("Z|Codice zona");
|
||||
list.add("M|Codice magazzino");
|
||||
row = "D";
|
||||
row.add(TR("Tipo documento"));
|
||||
list.add(row);
|
||||
row = "V";
|
||||
row.add(TR("Categoria vendita"));
|
||||
list.add(row);
|
||||
row = "C";
|
||||
row.add(TR("Codice cliente"));
|
||||
list.add(row);
|
||||
row = "Z";
|
||||
row.add(TR("Codice zona"));
|
||||
list.add(row);
|
||||
row = "G";
|
||||
row.add(TR("Codice agente"));
|
||||
list.add(row);
|
||||
row = "M";
|
||||
row.add(TR("Codice magazzino"));
|
||||
list.add(row);
|
||||
}
|
||||
|
||||
void TStampa_stat::set_frequency()
|
||||
@ -1725,35 +1678,60 @@ void TStampa_stat::put_column(TRectype & statrec,int col, const TSVriep_record&
|
||||
if (col < 0 || col > SVS_NUMCOLONNE)
|
||||
return;
|
||||
|
||||
real qta;
|
||||
if (_st_qta || _st_uni)
|
||||
TString16 colname;
|
||||
|
||||
if (_st_qta || _st_uni)
|
||||
{
|
||||
const TString& umqta = statrec.get(SVR_UMQTA);
|
||||
if (umqta.not_empty())
|
||||
const TString16 um(rieprec.get(SVR_UMQTA));
|
||||
if (um.not_empty())
|
||||
{
|
||||
const real fc = fc_um(statrec,rieprec);
|
||||
if (fc.is_zero())
|
||||
invalid_columns(statrec);
|
||||
else
|
||||
{
|
||||
TString16 colname; colname.format("%s%d", SVS_QTACOLNAME, col);
|
||||
real r = statrec.get_real(colname);
|
||||
qta = rieprec.get_real(SVR_QUANTITA) * fc;
|
||||
r += qta;
|
||||
statrec.put(colname, r);
|
||||
//statrec.put(SVS_TOTALERIGA,statrec.get_real(SVS_TOTALERIGA)+rieprec.get_real(SVR_QUANTITA)*fc);
|
||||
}
|
||||
const TString16 actual_um(statrec.get(SVS_UMQTA));
|
||||
real qta = rieprec.get_real(SVR_QUANTITA);
|
||||
|
||||
if (um != actual_um)
|
||||
{
|
||||
// converte in base alla UM di riferimento in tabella
|
||||
if (rieprec.get_char(SVR_TIPOART)==RIGA_MERCE)
|
||||
{
|
||||
// è un articolo (<M>erce)
|
||||
TArticolo & art = (TArticolo &)cached_articolo(rieprec.get(SVR_CODART));
|
||||
|
||||
if (art.find_um(um) > 0)
|
||||
qta = art.convert_to_um(qta, actual_um, um);
|
||||
else
|
||||
error_box(FR("L'articolo '%s' non ha l'unita' di misura %s\n"
|
||||
"ma esistono statistiche che la utilizzano ugualmente"),
|
||||
(const char*)rieprec.get(SVR_CODART), (const char*)um);
|
||||
}
|
||||
else
|
||||
{
|
||||
const TRectype& ums = cache().get("%UMS", um);
|
||||
|
||||
if (actual_um == ums.get("S7"))
|
||||
{
|
||||
fraction fc(ums.get_real("R10"), 1);
|
||||
if (!fc.is_zero())
|
||||
qta = qta * fc;
|
||||
}
|
||||
else
|
||||
error_box(FR("Il codice '%s' ha le unita' di misura %s e %s\n"
|
||||
"che non possono convertire tra loro"),
|
||||
(const char*)rieprec.get(SVR_CODART), (const char*)actual_um, (const char*)um);
|
||||
|
||||
}
|
||||
}
|
||||
TString4 qtacolname; qtacolname.format("%c%d", SVS_QTACOLNAME, col);
|
||||
|
||||
const real r = statrec.get_real(qtacolname) + qta;
|
||||
statrec.put(qtacolname, r);
|
||||
} // no UM ? no valid data!
|
||||
}
|
||||
|
||||
if (_st_val || _st_uni)
|
||||
{
|
||||
TString16 colname; colname.format("%s%d", SVS_VALCOLNAME, col);
|
||||
real r = statrec.get_real(colname);
|
||||
real val = rieprec.get_real(SVR_VALORE);
|
||||
r += val;
|
||||
statrec.put(colname, r);
|
||||
//statrec.put(SVS_TOTALERIGA, statrec.get_real(SVS_TOTALERIGA)+rieprec.get_real(SVR_VALORE));
|
||||
TString4 valcolname; valcolname.format("%c%d", SVS_VALCOLNAME, col);
|
||||
const real r = statrec.get_real(valcolname) + rieprec.get_real(SVR_VALORE);
|
||||
statrec.put(valcolname, r);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1762,98 +1740,55 @@ void TStampa_stat::standardize_um(TSVriep_record& rieprec, bool force)
|
||||
{
|
||||
if (force || _ragg_per_um)
|
||||
{
|
||||
TString16 um("N.");
|
||||
real fc;
|
||||
TString16 um;
|
||||
const TString16 actual_um(rieprec.get(SVS_UMQTA));
|
||||
|
||||
if (rieprec.get_char(SVR_TIPOART)==RIGA_MERCE)
|
||||
{
|
||||
// è un articolo (<M>erce); converto alla UM principale dell'art.
|
||||
_umart->setkey(1);
|
||||
_umart->put(UMART_CODART,rieprec.get(SVR_CODART));
|
||||
_umart->put(UMART_NRIGA,1);
|
||||
_umart->read();
|
||||
um=_umart->get(UMART_UM);
|
||||
fc=_umart->get_real(UMART_FC);
|
||||
TString80 key;
|
||||
|
||||
key.format("%s|1", (const char *) rieprec.get(SVR_CODART));
|
||||
|
||||
const TRectype & umart = cache().get(LF_UMART, key);
|
||||
|
||||
um = umart.get(UMART_UM);
|
||||
if (um != actual_um)
|
||||
{
|
||||
TArticolo & art = (TArticolo &) cached_articolo(rieprec.get(SVR_CODART));
|
||||
real qta = rieprec.get_real(SVR_QUANTITA);
|
||||
|
||||
qta = art.convert_to_um(qta, um, actual_um);
|
||||
rieprec.put(SVR_UMQTA, um);
|
||||
rieprec.put(SVR_QUANTITA, qta);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// non è un articolo: converte in base alla UM di riferimento in tabella
|
||||
const TRectype& ums = cache().get("%UMS", um);
|
||||
um = ums.get("S7");
|
||||
fc = ums.get_real("R10");
|
||||
}
|
||||
if (um != rieprec.get(SVS_UMQTA))
|
||||
{
|
||||
// conversione tra UM diverse
|
||||
fc *= rieprec.get_real(SVR_QUANTITA);
|
||||
rieprec.put(SVR_QUANTITA, fc);
|
||||
rieprec.put(SVR_UMQTA, um);
|
||||
if (actual_um.not_empty())
|
||||
{
|
||||
const TRectype& ums = cache().get("%UMS", actual_um);
|
||||
um = ums.get("S7");
|
||||
if (um.not_empty())
|
||||
{
|
||||
// conversione tra UM diverse
|
||||
fraction fc(ums.get_real("R10"), UNO);
|
||||
if (!fc.is_zero())
|
||||
{
|
||||
real qta = rieprec.get_real(SVR_QUANTITA);
|
||||
|
||||
qta = qta * fc;
|
||||
rieprec.put(SVR_UMQTA, um);
|
||||
rieprec.put(SVR_QUANTITA, qta);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// aggiunge al valore passat la quantità del record riep, correggendola con il fattore di conv. necessario
|
||||
const real TStampa_stat::fc_um(const TRectype& statrec,const TSVriep_record& rieprec)
|
||||
{
|
||||
TString16 um("N.");
|
||||
real fc(1.0);
|
||||
um=rieprec.get(SVR_UMQTA);
|
||||
if (um!=statrec.get(SVS_UMQTA))
|
||||
{
|
||||
// converte in base alla UM di riferimento in tabella
|
||||
if (rieprec.get_char(SVR_TIPOART)==RIGA_MERCE)
|
||||
{
|
||||
// è un articolo (<M>erce)
|
||||
_umart->setkey(2);
|
||||
_umart->put(UMART_CODART,rieprec.get(SVR_CODART));
|
||||
_umart->put(UMART_UM,rieprec.get(SVR_UMQTA));
|
||||
if (_umart->read()==NOERR)
|
||||
{
|
||||
fc=_umart->get_real(UMART_FC);
|
||||
_umart->put(UMART_UM,statrec.get(SVS_UMQTA));
|
||||
if (_umart->read()==NOERR)
|
||||
{
|
||||
// è una UM dell'articolo: uso i fc per convertirla
|
||||
um=_umart->get(UMART_UM);
|
||||
fc /= _umart->get_real(UMART_FC);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TString80 a = rieprec.get(SVR_CODART); a.trim();
|
||||
TString4 u = rieprec.get(SVR_UMQTA);
|
||||
error_box("L'articolo '%s' non ha l'unita' di misura %s\n"
|
||||
"ma esistono statistiche che la utilizzano ugualmente",
|
||||
(const char*)a, (const char*)u);
|
||||
}
|
||||
}
|
||||
if (um != statrec.get(SVS_UMQTA))
|
||||
{
|
||||
const TRectype& ums = cache().get("%UMS", um);
|
||||
um = ums.get("S7");
|
||||
fc = ums.get_real("R10");
|
||||
}
|
||||
if (um != statrec.get(SVS_UMQTA))
|
||||
{
|
||||
// impossibile associare al totale una unità di misura
|
||||
fc = ZERO;
|
||||
}
|
||||
}
|
||||
return fc;
|
||||
}
|
||||
|
||||
// rende non validi i valori delle colonne
|
||||
void TStampa_stat::invalid_columns(TRectype& statrec)
|
||||
{
|
||||
statrec.zero(SVS_UMQTA);
|
||||
TString16 colname;
|
||||
for (int col = 0; col < SVS_NUMCOLONNE; col++)
|
||||
{
|
||||
colname.format("%s%d", SVS_QTACOLNAME, col);
|
||||
statrec.zero(colname);
|
||||
}
|
||||
//statrec.put(SVS_TOTALERIGA,0);
|
||||
}
|
||||
|
||||
|
||||
// funzione di filtro del cursore
|
||||
bool TStampa_stat::filtro_chiavi(TSVriep_record &curr)
|
||||
@ -1931,7 +1866,7 @@ void TStampa_stat::genera_file(const char *outfn)
|
||||
|
||||
|
||||
// file di OUTPUT
|
||||
_svcache= new TStat_cache(new TIsamtempfile(LF_SVSTAT,outfn,TRUE,FALSE));
|
||||
_svcache = new TStat_cache(new TIsamtempfile(LF_SVSTAT,outfn,TRUE,FALSE));
|
||||
// file di INPUT
|
||||
TLocalisamfile riep(LF_SVRIEP);
|
||||
riep.set_curr(new TSVriep_record);
|
||||
@ -1954,7 +1889,7 @@ void TStampa_stat::genera_file(const char *outfn)
|
||||
const int periofin = _stats.date2period(datafin);
|
||||
|
||||
TProgind statusbar(period2long(datafin.year(), periofin,_stats.frequency())-start_status,
|
||||
"Creazione del file di output", FALSE, TRUE, 60);
|
||||
TR("Creazione del file di output"), FALSE, TRUE, 60);
|
||||
|
||||
int err = riep.read(_isgteq);
|
||||
_svcache->zap();
|
||||
@ -2038,7 +1973,7 @@ void TStampa_stat::set_printmask()
|
||||
if (f<nlivelli )
|
||||
{
|
||||
partkey_name(sc.cell(f,sc.cid2index(S_CAMPO)), f, nomeliv);
|
||||
nomeliv.insert("Stampa totale ", 0);
|
||||
nomeliv.insert(TR("Stampa totale "), 0);
|
||||
flfl.set_prompt(nomeliv);
|
||||
flfl.show();
|
||||
if (*sc.cell(f,sc.cid2index(S_TOTALE))!=' ')
|
||||
@ -2080,7 +2015,7 @@ const TString& TStampa_stat::partkey_name(const char *lev_code, int row, TString
|
||||
switch (*lev_code)
|
||||
{
|
||||
case CHR_TIPODOC: // tipo documento
|
||||
park="tipo documento";
|
||||
park=TR("tipo documento");
|
||||
break;
|
||||
case CHR_ARTICOLO: // articolo
|
||||
if (lev_code_num)
|
||||
@ -2093,28 +2028,28 @@ const TString& TStampa_stat::partkey_name(const char *lev_code, int row, TString
|
||||
park =_liv_giac->name(lev_code_num);
|
||||
break;
|
||||
case CHR_CATVEN: // cat. vendita
|
||||
park="cat. ven.";
|
||||
park=TR("cat. ven.");
|
||||
break;
|
||||
case CHR_CLI: // cliente
|
||||
park="cliente ";
|
||||
park=TR("cliente ");
|
||||
break;
|
||||
case CHR_FOR: // fornitore
|
||||
park="fornitore ";
|
||||
park=TR("fornitore ");
|
||||
break;
|
||||
case CHR_AGENTE: // agente
|
||||
park="agente ";
|
||||
park=TR("agente ");
|
||||
break;
|
||||
case CHR_MAGAZZ: // mag
|
||||
park="magazzino";
|
||||
park=TR("magazzino");
|
||||
break;
|
||||
case CHR_ZONA: // zona
|
||||
park="zona";
|
||||
park=TR("zona");
|
||||
break;
|
||||
case CHR_UMISURA: // unità di misura
|
||||
park="unita' di misura";
|
||||
park=TR("unita' di misura");
|
||||
break;
|
||||
case CHR_TOTGEN: // totale generale
|
||||
park="generale";
|
||||
park=TR("generale");
|
||||
break;
|
||||
case CHR_ARTFIELD: // campo anagrafica
|
||||
park=_des_fld.row(row);
|
||||
@ -2185,15 +2120,13 @@ const TString& TStampa_stat::get_part(TString & lev_code, TSVriep_record &riepre
|
||||
const char t = rieprec.get_char(SVR_TIPOART);
|
||||
TFieldref f;
|
||||
|
||||
f = fld;
|
||||
int l = f.len(_anamag->curr());
|
||||
f = fld;
|
||||
const TRectype anamag(LF_ANAMAG);
|
||||
int l = f.len(anamag);
|
||||
if (l > 25)
|
||||
l = 25;
|
||||
if (t == RIGA_MERCE || t == RIGA_OMAGGI)
|
||||
{
|
||||
// park=rieprec.get(SVR_CODART);
|
||||
// _anamag->put(ANAMAG_CODART, park);
|
||||
// if (_anamag->read() == NOERR)
|
||||
const TRectype & rec = cache().get(LF_ANAMAG, rieprec.get(SVR_CODART));
|
||||
park = f.read(rec);
|
||||
park.rpad(l);
|
||||
@ -2261,9 +2194,6 @@ const TString& TStampa_stat::get_descrpart(const char *lev_code, TSVriep_record
|
||||
case RIGA_OMAGGI:
|
||||
if (lev_code_num==0 || lev_code_num== _liv_art->last_level())
|
||||
{
|
||||
// _anamag->put(ANAMAG_CODART,rieprec.get(SVR_CODART));
|
||||
// _anamag->read();
|
||||
// return _anamag->get(ANAMAG_DESCR);
|
||||
const TRectype & rec = cache().get(LF_ANAMAG, rieprec.get(SVR_CODART));
|
||||
return rec.get(ANAMAG_DESCR);
|
||||
}
|
||||
@ -2273,16 +2203,10 @@ const TString& TStampa_stat::get_descrpart(const char *lev_code, TSVriep_record
|
||||
}
|
||||
break;
|
||||
case RIGA_PRESTAZIONI:
|
||||
_prs->setkey(1);
|
||||
_prs->put("CODTAB",rieprec.get(SVR_CODART));
|
||||
_prs->read();
|
||||
return _prs->get("S0");
|
||||
return cache().get("PRS", rieprec.get(SVR_CODART), "S0");
|
||||
break;
|
||||
case RIGA_SPESEDOC:
|
||||
_prs->setkey(1);
|
||||
_spp->put("CODTAB",rieprec.get(SVR_CODART));
|
||||
_spp->read();
|
||||
return _spp->get("S0");
|
||||
return cache().get("SPP", rieprec.get(SVR_CODART), "S0");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -2325,17 +2249,14 @@ const TString& TStampa_stat::get_descrpart(const char *lev_code, TSVriep_record
|
||||
case CHR_FOR: // fornitore
|
||||
case CHR_CLI: // cliente
|
||||
{
|
||||
_clifor->put(CLI_TIPOCF,rieprec.get_char(SVR_TIPOCF));
|
||||
_clifor->put(CLI_CODCF,rieprec.get_long(SVR_CODCF));
|
||||
if (_clifor->read() != NOERR)
|
||||
_clifor->zero();
|
||||
return _clifor->get(CLI_RAGSOC);
|
||||
TToken_string key;
|
||||
|
||||
key.add(rieprec.get_char(SVR_TIPOCF));
|
||||
key.add(rieprec.get_long(SVR_CODCF));
|
||||
return cache().get(LF_CLIFO, key, CLI_RAGSOC);
|
||||
}
|
||||
case CHR_AGENTE: // agente
|
||||
_agenti->put(AGE_CODAGE,rieprec.get(SVR_CODAG));
|
||||
if (_agenti->read() != NOERR)
|
||||
_agenti->zero();
|
||||
return _agenti->get(AGE_RAGSOC);
|
||||
return cache().get(LF_AGENTI, rieprec.get(SVR_CODAG), AGE_RAGSOC);
|
||||
case CHR_MAGAZZ: // mag
|
||||
return cache().get("MAG", rieprec.get(SVR_MAG), "S0");
|
||||
case CHR_ZONA: // zona
|
||||
@ -2561,10 +2482,10 @@ bool TStampa_stat::filename_handler(TMask_field& f, KEY k)
|
||||
TFilename path(fn.path());
|
||||
path.rtrim(1); // Toglie la slash dal path
|
||||
if (!path.exist())
|
||||
return f.error_box("Directory %s non trovato",(const char *)path);
|
||||
return f.error_box(FR("Directory %s non trovato"),(const char *)path);
|
||||
else
|
||||
if (fn.exist())
|
||||
return f.yesno_box("File %s esistente: sovrascrivo", (const char*)fn);
|
||||
return f.yesno_box(FR("File %s esistente: sovrascrivo"), (const char*)fn);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@ -2614,29 +2535,29 @@ bool TStampa_stat::test_field(const TString& cod, TMask_field& f) const
|
||||
{
|
||||
case CHR_ARTICOLO:
|
||||
if (cod[1] != '\0' && !_liv_art->enabled())
|
||||
ok = f.error_box("I livelli di codice articolo non sono abilitati");
|
||||
ok = f.error_box(TR("I livelli di codice articolo non sono abilitati"));
|
||||
break;
|
||||
case CHR_LIVGIAC:
|
||||
if (!_stats.grp_giacenza())
|
||||
ok = f.error_box("Le statistiche sono raggruppate per livello di giacenza");
|
||||
ok = f.error_box(TR("Le statistiche sono raggruppate per livello di giacenza"));
|
||||
else if (!_liv_giac->enabled())
|
||||
ok = f.error_box("I livelli di giacenza non sono abilitati");
|
||||
ok = f.error_box(TR("I livelli di giacenza non sono abilitati"));
|
||||
break;
|
||||
case CHR_CLIFOR:
|
||||
if (!_stats.grp_cliente())
|
||||
ok = f.error_box("Le statistiche sono raggruppate per cliente/fornitore");
|
||||
ok = f.error_box(TR("Le statistiche sono raggruppate per cliente/fornitore"));
|
||||
break;
|
||||
case CHR_AGENTE:
|
||||
if (!_stats.grp_agente())
|
||||
ok = f.error_box("Le statistiche sono raggruppate per agente");
|
||||
ok = f.error_box(TR("Le statistiche sono raggruppate per agente"));
|
||||
break;
|
||||
case CHR_MAGAZZ:
|
||||
if (!_stats.grp_magazzino())
|
||||
ok = f.error_box("Le statistiche sono raggruppate per magazzino");
|
||||
ok = f.error_box(TR("Le statistiche sono raggruppate per magazzino"));
|
||||
break;
|
||||
case CHR_ZONA:
|
||||
if (!_stats.grp_zona())
|
||||
ok = f.error_box("Le statistiche sono raggruppate per zona");
|
||||
ok = f.error_box(TR("Le statistiche sono raggruppate per zona"));
|
||||
break;
|
||||
default : break;
|
||||
}
|
||||
@ -2670,8 +2591,8 @@ bool TStampa_stat::chiave_handler(TMask_field& f, KEY k)
|
||||
|
||||
if (campo[0] != CHR_ARTFIELD && found)
|
||||
{
|
||||
ok = error_box("Il codice %s inserito alla riga %d e' gia'\n"
|
||||
"utilizzato in una riga precedente.",
|
||||
ok = error_box(FR("Il codice %s inserito alla riga %d e' gia'\n"
|
||||
"utilizzato in una riga precedente."),
|
||||
(const char*)campo, r+1);
|
||||
}
|
||||
else
|
||||
@ -2705,14 +2626,13 @@ bool TStampa_stat::artfld_handler(TMask_field& f, KEY k)
|
||||
case K_ENTER:
|
||||
if (!f.empty() && f.to_check(k))
|
||||
{
|
||||
TLocalisamfile anamag(LF_ANAMAG);
|
||||
const TRectype& rec = anamag.curr();
|
||||
const TRectype rec(LF_ANAMAG);
|
||||
TString16 field = f.get();
|
||||
int pos = field.find('[');
|
||||
if (pos > 0)
|
||||
field.cut(pos);
|
||||
if (!rec.exist(field))
|
||||
ok = f.error_box("Il campo '%s' non esiste.", (const char*)field);
|
||||
ok = f.error_box(FR("Il campo '%s' non esiste."), (const char*)field);
|
||||
}
|
||||
break;
|
||||
case K_F9:
|
||||
@ -2736,6 +2656,6 @@ bool TStampa_stat::artfld_handler(TMask_field& f, KEY k)
|
||||
int sv1200(int argc, char* argv[])
|
||||
{
|
||||
TStampa_stat mainapp;
|
||||
mainapp.run(argc, argv, "Stampa statistiche");
|
||||
mainapp.run(argc, argv, TR("Stampa statistiche"));
|
||||
return 0;
|
||||
}
|
@ -63,7 +63,7 @@ bool TRicalcolo_stats::kill_stats(const TDate& dfr, const TDate& dto)
|
||||
|
||||
TCursor cur(&rel, "", 1, &recfrom, &recto);
|
||||
const long items = cur.items();
|
||||
TProgind pi(items, "Azzeramento statistiche", FALSE, TRUE);
|
||||
TProgind pi(items, TR("Azzeramento statistiche"), FALSE, TRUE);
|
||||
cur.freeze();
|
||||
|
||||
for (cur = 0; cur.pos() < items; ++cur)
|
||||
@ -201,6 +201,6 @@ void TRicalcolo_stats::main_loop()
|
||||
int sv2100(int argc, char* argv[])
|
||||
{
|
||||
TRicalcolo_stats app;
|
||||
app.run(argc, argv, "Ricalcolo statistiche");
|
||||
app.run(argc, argv, TR("Ricalcolo statistiche"));
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <prefix.h>
|
||||
#include <diction.h>
|
||||
|
||||
#include "svlib01.h"
|
||||
#include "../ve/velib.h"
|
||||
@ -28,8 +29,16 @@ TString & char2freqname(char c)
|
||||
{
|
||||
static TString16 s;
|
||||
const TFixed_string list(FREQ_CODES);
|
||||
TToken_string std_descr("Giorno|Settimana|Quindicina|Mese|"
|
||||
"Bimestre|Trimestre|Quadrimestre|Semestre|Anno");
|
||||
TToken_string std_descr;
|
||||
std_descr.add(TR("Giorno"));
|
||||
std_descr.add(TR("Settimana"));
|
||||
std_descr.add(TR("Quindicina"));
|
||||
std_descr.add(TR("Mese"));
|
||||
std_descr.add(TR("Bimestre"));
|
||||
std_descr.add(TR("Trimestre"));
|
||||
std_descr.add(TR("Quadrimestre"));
|
||||
std_descr.add(TR("Semestre"));
|
||||
std_descr.add(TR("Anno"));
|
||||
s= std_descr.get(list.find(c)-1);
|
||||
return s;
|
||||
}
|
||||
@ -606,8 +615,8 @@ bool TStats_agg::update()
|
||||
case NOERR : saved = TRUE;
|
||||
break;
|
||||
case _isreinsert: break;
|
||||
default : saved = !yesno_box("Errore %d nell'aggiornamento statistiche:"
|
||||
"Si desidera ritentare?", err);
|
||||
default : saved = !yesno_box(FR("Errore %d nell'aggiornamento statistiche:"
|
||||
"Si desidera ritentare?"), err);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,6 @@
|
||||
#include <recarray.h>
|
||||
#include <diction.h>
|
||||
|
||||
#include "svlib09.h"
|
||||
|
||||
#define RWCACHE_SIZE 100
|
||||
@ -28,14 +30,14 @@ void TRWrecord_cache::discard(const TString & vittima)
|
||||
if (err!=NOERR)
|
||||
err=file().write();
|
||||
if (err!=NOERR)
|
||||
error_box("Errore nella riscrittura della cache");
|
||||
error_box(TR("Errore nella riscrittura della cache"));
|
||||
} else {
|
||||
err=file().write();
|
||||
if (err!=NOERR)
|
||||
if (err == _isreinsert)
|
||||
file().rewrite();
|
||||
else
|
||||
error_box("Errore nella scrittura della cache");
|
||||
error_box(TR("Errore nella scrittura della cache"));
|
||||
}
|
||||
_flags.remove(vittima);
|
||||
|
||||
@ -75,7 +77,7 @@ void TRWrecord_cache::put(const TRectype &r)
|
||||
}
|
||||
}
|
||||
else
|
||||
warning_box("adding an empty record");
|
||||
warning_box(TR("adding an empty record"));
|
||||
TObject* obj = _cache.objptr(cachekey);
|
||||
|
||||
if (obj != NULL)
|
||||
|
@ -46,6 +46,6 @@
|
||||
#define SVS_TOTALERIGA "R36"
|
||||
|
||||
#define SVS_NUMCOLONNE 36
|
||||
#define SVS_VALCOLNAME "R"
|
||||
#define SVS_QTACOLNAME "Q"
|
||||
#define SVS_VALCOLNAME 'R'
|
||||
#define SVS_QTACOLNAME 'Q'
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user