Patch level :4.0 nopatch
Files correlati : Ricompilazione Demo : [ ] Commento :terminata versione con killer dei movimenti P precedentemente presenti negli archivi git-svn-id: svn://10.65.10.50/trunk@14292 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
7e504bcb4e
commit
affcbc0d6b
@ -70,7 +70,16 @@ bool TBudget_Import_mask::on_field_event(TOperable_field& f, TField_event e, lon
|
|||||||
f.set(name);
|
f.set(name);
|
||||||
|
|
||||||
if (f.get() == get(F_LASTFILE))
|
if (f.get() == get(F_LASTFILE))
|
||||||
return error_box(TR("File gia' importato!\nNON e' consigliabile proseguire!"));
|
return error_box(FR("Questo file l'hai gia' importato!\nCaro %s ti consiglio di NON proseguire!"), (const char*)user());
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case F_KILLOLD:
|
||||||
|
if (e == fe_close)
|
||||||
|
{
|
||||||
|
if (f.get())
|
||||||
|
{
|
||||||
|
return yesno_box(FR("Ehi %s, hai scelto di eliminare tutti i record di tipo Preventivo\nnei files dei movimenti e dei saldi!\nSei sicuro di voler proseguire?"), (const char*)user());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -236,18 +245,36 @@ void TBudget_Import::transfer_movimento(const TRecord_text& curr) //, TError_log
|
|||||||
rec_rmovana.put(RMOVANA_DESCR, "Riga movimento di budget importato");
|
rec_rmovana.put(RMOVANA_DESCR, "Riga movimento di budget importato");
|
||||||
rec_rmovana.put(RMOVANA_IMPORTO, soldini);
|
rec_rmovana.put(RMOVANA_IMPORTO, soldini);
|
||||||
|
|
||||||
//scrive testata e riga
|
//scrive testata e riga e aggiorna i saldi (write() magggica!)
|
||||||
TLocalisamfile testate(LF_MOVANA);
|
TLocalisamfile testate(LF_MOVANA);
|
||||||
if (movana.write(testate) == NOERR)
|
movana.write(testate);
|
||||||
{
|
|
||||||
TLocalisamfile righe(LF_RMOVANA);
|
|
||||||
rec_rmovana.write(righe);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TBudget_Import::transfer()
|
bool TBudget_Import::transfer()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//azzeramento preventivo di movimenti, righe e saldi di tipo P
|
||||||
|
if (_msk->get(F_KILLOLD))
|
||||||
|
{
|
||||||
|
TRelation relmovana(LF_MOVANA);
|
||||||
|
TCursor curmovana(&relmovana, "TIPOMOV=='P'");
|
||||||
|
|
||||||
|
const TRectype& recmovana = relmovana.curr();
|
||||||
|
const long nrec = curmovana.items();
|
||||||
|
curmovana.freeze();
|
||||||
|
TProgind pi(nrec, "Eliminazione movimenti preventivi in corso...");
|
||||||
|
|
||||||
|
TLocalisamfile movana(LF_MOVANA); //questo serve alla remove()
|
||||||
|
|
||||||
|
for (curmovana = 0; curmovana.pos() < nrec; ++curmovana)
|
||||||
|
{
|
||||||
|
TAnal_mov anal_kill(curmovana.curr());
|
||||||
|
anal_kill.remove(movana); //la remove() accoppa anche le righe collegate
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//file da trasferire
|
//file da trasferire
|
||||||
//costruire il nome del file con path
|
//costruire il nome del file con path
|
||||||
TFilename file = _msk->get(F_PATH);
|
TFilename file = _msk->get(F_PATH);
|
||||||
@ -261,7 +288,7 @@ bool TBudget_Import::transfer()
|
|||||||
// log.set_header(TR("Importazione movimenti"));
|
// log.set_header(TR("Importazione movimenti"));
|
||||||
|
|
||||||
const long dimension = fsize(file);
|
const long dimension = fsize(file);
|
||||||
TProgind pi(dimension,TR("Importazione bolle in corso..."));
|
TProgind pi(dimension,TR("Importazione movimenti in corso..."));
|
||||||
|
|
||||||
int err = NOERR;
|
int err = NOERR;
|
||||||
TRecord_text curr;
|
TRecord_text curr;
|
||||||
|
@ -3,3 +3,4 @@
|
|||||||
#define F_PATH 101
|
#define F_PATH 101
|
||||||
#define F_NAMEFILE 102
|
#define F_NAMEFILE 102
|
||||||
#define F_LASTFILE 103
|
#define F_LASTFILE 103
|
||||||
|
#define F_KILLOLD 104
|
||||||
|
@ -45,5 +45,10 @@ BEGIN
|
|||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
BOOLEAN F_KILLOLD
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 7 "Elimina tutti i movimenti ed i saldi preventivi esistenti"
|
||||||
|
END
|
||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
ENDMASK
|
ENDMASK
|
||||||
|
Loading…
x
Reference in New Issue
Block a user