Correzione errore MI2232, relativo al cambio di segno sugli importi
delle note di credito nel caso la lista controllo movimenti venga lanciata un numero pari di volte. git-svn-id: svn://10.65.10.50/trunk@3900 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
98aaa44159
commit
6f72a76dcc
@ -2695,8 +2695,6 @@ void TRic_ListaMov::aggiorna_mov()
|
|||||||
if (mov.get(MOV_TIPOMOV).empty())
|
if (mov.get(MOV_TIPOMOV).empty())
|
||||||
mov.put(MOV_TIPOMOV, _tipom_cau);
|
mov.put(MOV_TIPOMOV, _tipom_cau);
|
||||||
mov.put(MOV_CODPAG, _codpag_scad);
|
mov.put(MOV_CODPAG, _codpag_scad);
|
||||||
if (_tipodoc == "NC" || _tipodoc == "ST")
|
|
||||||
_tot_doc = _tot_doc * -1;
|
|
||||||
mov.put(MOV_TOTDOC, _tot_doc);
|
mov.put(MOV_TOTDOC, _tot_doc);
|
||||||
if (_is_salda)
|
if (_is_salda)
|
||||||
{
|
{
|
||||||
@ -2732,13 +2730,6 @@ void TRic_ListaMov::aggiorna_iva(char tipo)
|
|||||||
if (_anno == 0)
|
if (_anno == 0)
|
||||||
riva.put(RMI_ANNOES, _annoese);
|
riva.put(RMI_ANNOES, _annoese);
|
||||||
|
|
||||||
if (_tipodoc == "NC" || _tipodoc == "ST")
|
|
||||||
{
|
|
||||||
_impo = _impo * -1;
|
|
||||||
_impos = _impos * -1;
|
|
||||||
}
|
|
||||||
riva.put(RMI_IMPONIBILE, _impo);
|
|
||||||
riva.put(RMI_IMPOSTA, _impos);
|
|
||||||
riva.put(RMI_TIPOC, tipo);
|
riva.put(RMI_TIPOC, tipo);
|
||||||
|
|
||||||
riva.rewrite();
|
riva.rewrite();
|
||||||
|
@ -1727,21 +1727,18 @@ void TTransfer_file::write_tmp_movPN(TString& record,bool create)
|
|||||||
|
|
||||||
int TTransfer_file::trasfer_data_mov(TIsamtempfile& file, TRectype& dep)
|
int TTransfer_file::trasfer_data_mov(TIsamtempfile& file, TRectype& dep)
|
||||||
{
|
{
|
||||||
|
const int ln = file.num();
|
||||||
file.zero();
|
file.zero();
|
||||||
file.curr() = dep;
|
file.curr() = dep;
|
||||||
|
|
||||||
if (file.read() == NOERR)
|
const bool ok = file.read() == NOERR;
|
||||||
{
|
file.zero();
|
||||||
file.zero();
|
file.curr() = dep;
|
||||||
file.curr() = dep;
|
|
||||||
|
if (ok)
|
||||||
file.rewrite();
|
file.rewrite();
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
file.zero();
|
|
||||||
file.curr() = dep;
|
|
||||||
file.write();
|
file.write();
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1871,7 +1868,7 @@ void TTransfer_file::write_tmp_movIVA(TString& record, bool create)
|
|||||||
{
|
{
|
||||||
if (logicnum_p)
|
if (logicnum_p)
|
||||||
{
|
{
|
||||||
trasfer_data_moviva(*file, *dep, logicnum_p);
|
trasfer_data_moviva(*file, *dep, logicnum_p, tipodoc);
|
||||||
delete file;
|
delete file;
|
||||||
delete dep;
|
delete dep;
|
||||||
}
|
}
|
||||||
@ -1962,21 +1959,39 @@ void TTransfer_file::write_tmp_movIVA(TString& record, bool create)
|
|||||||
while (trc.is_key((const char*) key));
|
while (trc.is_key((const char*) key));
|
||||||
|
|
||||||
_prog->addstatus(1);
|
_prog->addstatus(1);
|
||||||
trasfer_data_moviva(*file, *dep, logicnum_p);
|
trasfer_data_moviva(*file, *dep, logicnum_p, tipodoc);
|
||||||
|
|
||||||
delete file;
|
delete file;
|
||||||
delete dep;
|
delete dep;
|
||||||
} // if (trc.is_key((const char*) key))
|
} // if (trc.is_key((const char*) key))
|
||||||
}
|
}
|
||||||
|
|
||||||
int TTransfer_file::trasfer_data_moviva(TIsamtempfile& file, TRectype& dep, int ln)
|
int TTransfer_file::trasfer_data_moviva(TIsamtempfile& file, TRectype& dep, int ln, TString& tipodoc)
|
||||||
{
|
{
|
||||||
file.zero();
|
file.zero();
|
||||||
file.curr() = dep;
|
file.curr() = dep;
|
||||||
|
|
||||||
if (file.read() == NOERR)
|
const bool ok = file.read() == NOERR;
|
||||||
|
if (ln != LF_MOV)
|
||||||
{
|
{
|
||||||
if (ln == LF_MOV)
|
file.zero();
|
||||||
|
file.curr() = dep;
|
||||||
|
|
||||||
|
if (tipodoc == "NC" || tipodoc == "ST")
|
||||||
|
{
|
||||||
|
real imp = file.get_real(RMI_IMPONIBILE);
|
||||||
|
real iva = file.get_real(RMI_IMPOSTA);
|
||||||
|
imp = imp * -1;
|
||||||
|
iva = iva * -1;
|
||||||
|
file.put(RMI_IMPONIBILE,imp);
|
||||||
|
file.put(RMI_IMPOSTA,iva);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ok) file.rewrite();
|
||||||
|
else file.write();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (ok)
|
||||||
{
|
{
|
||||||
TDate data74ter (dep.get_date(MOV_DATA74TER));
|
TDate data74ter (dep.get_date(MOV_DATA74TER));
|
||||||
TString codval (dep.get (MOV_CODVALI));
|
TString codval (dep.get (MOV_CODVALI));
|
||||||
@ -1996,20 +2011,6 @@ int TTransfer_file::trasfer_data_moviva(TIsamtempfile& file, TRectype& dep, int
|
|||||||
|
|
||||||
file.rewrite();
|
file.rewrite();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
file.zero();
|
|
||||||
file.curr() = dep;
|
|
||||||
file.rewrite();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
file.zero();
|
|
||||||
file.curr() = dep;
|
|
||||||
file.write();
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@ private:
|
|||||||
void write_tmp_movPN(TString& record, bool create);
|
void write_tmp_movPN(TString& record, bool create);
|
||||||
int trasfer_data_mov(TIsamtempfile& file, TRectype& dep);
|
int trasfer_data_mov(TIsamtempfile& file, TRectype& dep);
|
||||||
void write_tmp_movIVA(TString& record, bool create);
|
void write_tmp_movIVA(TString& record, bool create);
|
||||||
int trasfer_data_moviva(TIsamtempfile& file, TRectype& dep, int ln);
|
int trasfer_data_moviva(TIsamtempfile& file, TRectype& dep, int ln, TString& tipodoc);
|
||||||
// Funzioni per la ricezione del Saldaconto da Sistema
|
// Funzioni per la ricezione del Saldaconto da Sistema
|
||||||
void write_tmp_movSC(TString& record, bool create);
|
void write_tmp_movSC(TString& record, bool create);
|
||||||
void new_key(TString& key, int tipo, TString& buffer);
|
void new_key(TString& key, int tipo, TString& buffer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user