Patch level : 10.0 748

Files correlati     : lv2.exe
Ricompilazione Demo : [ ]
Commento

Implementata la copia opzionale dei dati per 02

Corretto il calcolo 02. Ora considera anche le quantita a 1


git-svn-id: svn://10.65.10.50/trunk@20495 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2010-05-25 21:48:34 +00:00
parent 38b6f6b3df
commit f3fed7093b
3 changed files with 89 additions and 3 deletions

View File

@ -49,6 +49,8 @@ protected:
void genera_bolle_nolo(TAssoc_array& cliela, TFatturazione_lavanderie& elab, int& numdocgen);
bool controlli_preliminari();
bool copy_file(const TFilename& src, const TFilename& dst) const;
bool copy_tree(const char* src_study, const char* dst_study) const;
};
TFatturazione_lav_app & app() { return (TFatturazione_lav_app &) main_app();}
@ -1082,7 +1084,8 @@ void TFatturazione_lavanderie::post_process(TLista_documenti& doc_out, TLista_do
ppconf = 1;
const char lvtype = rdoc.get_char("LVTYPE");
bool row_has_02 = (tipoforf == 0) && (real_qta / ppconf > UNO) && (lvtype == 'C');
// bool row_has_02 = (tipoforf == 0) && (real_qta / ppconf > UNO || redditivita >= CENTO) && (lvtype == 'C');
bool row_has_02 = (tipoforf == 0) && (lvtype == 'C');
// 0 forfait = NESSUN FORFAIT SI
// 1 forfait = A VALORE FISSO NO
@ -1861,6 +1864,77 @@ bool TFatturazione_lav_app::controlli_preliminari()
return corretto;
}
bool TFatturazione_lav_app::copy_file(const TFilename& src, const TFilename& dst) const
{
// Crea la cartella di destinazione se necessario
const char* dstdir = dst.path();
if (*dstdir && !xvt_fsys_mkdir(dstdir))
return error_box(FR("Impossibile creare la cartella %s"), dst.path());
// Copia veramente il file
return ::fcopy(src, dst);
}
bool TFatturazione_lav_app::copy_tree(const char* src_study, const char* dst_study) const
{
xvt_fsys_save_dir();
TFilename mask(src_study); mask.add("*.");
SLIST dlist = xvt_fsys_list_files(DIR_TYPE, mask, TRUE);
xvt_fsys_restore_dir();
TProgind pd(xvt_slist_count(dlist), TR("Copia cartelle"), true, true);
TString msg; // Messaggio di progresso
bool go_on = true;
for (SLIST_ELT d = xvt_slist_get_first(dlist); d && go_on; d = xvt_slist_get_next(dlist, d))
{
if (!pd.addstatus(1))
{
go_on = false;
break;
}
const TFilename dir = xvt_slist_get(dlist, d, NULL);
TString name = dir.name(); name.lower();
if (name == "cesp") // Ignora la vetusta cartella Cespiti in FoxPro
continue;
msg.cut(0) << TR("Copia di ") << name;
pd.set_text(msg);
mask = dir; mask.add("*.*");
TString_array files; list_files(mask, files);
TProgind pi(files.items(), "Copia file", true, true);
TFilename dst;
FOR_EACH_ARRAY_ROW(files, i, f)
{
if (!pi.addstatus(1))
{
go_on = false;
break;
}
TFilename src(*f);
TString16 ext(src.ext()); ext.lower();
if (ext != "zip" && ext != "rar" && ext != "mdb" && ext != "inf")
{
msg.cut(0) << TR("Copia di ") << src;
pi.set_text(msg);
dst = dst_study;
dst.add(name);
dst.add(src.name());
copy_file(src, dst);
}
}
}
xvt_slist_destroy(dlist);
return go_on;
}
void TFatturazione_lav_app::main_loop()
{
bool prova = false;
@ -1874,8 +1948,7 @@ void TFatturazione_lav_app::main_loop()
//instanzio la maschera
_msk = new TFatturazione_msk();
if (lv_is_02_active())
_msk->field(F_COD_ELAB).set_prompt("@BTipo Fatturazione ");
_msk->show(F_SAVEDATA, lv_is_02_active());
//instanzio i localisamfile che mi servono
@ -1893,6 +1966,13 @@ void TFatturazione_lav_app::main_loop()
return;
}
if (_msk->get_bool(F_SAVEDATA))
{
TFilename src = firm2dir(-1);
TFilename dst = ini_get_string(CONFIG_DITTA, "lv", "Backup");
copy_tree(src, dst);
}
//leggo i dati di primo interesse
const TString4 mskzona = _msk->get(F_CODZONA);
const TString4 mskcat = _msk->get(F_CODCATC);

View File

@ -10,6 +10,7 @@
#define F_PERFAT 110
#define F_CODCATC 111
#define F_CODZONA 112
#define F_SAVEDATA 113

View File

@ -148,6 +148,11 @@ BEGIN
ITEM "0|Giornaliera"
END
BOOLEAN F_SAVEDATA
BEGIN
PROMPT 2 12 "Salvataggio dati"
END
ENDPAGE
ENDMASK