corretto errori MI3457, MI3460, MI3461
git-svn-id: svn://10.65.10.50/trunk@4176 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
64e54ed45e
commit
0f6c4a57cb
352
cg/cg6902.cpp
352
cg/cg6902.cpp
@ -505,6 +505,12 @@ bool TInv_cont::invio_tab_cau()
|
|||||||
int tipomov = _tcaus->get_int(CAU_TIPOMOV);
|
int tipomov = _tcaus->get_int(CAU_TIPOMOV);
|
||||||
str.format("%d", tipomov);
|
str.format("%d", tipomov);
|
||||||
record.overwrite(str,208); //Tipo movimento del saldaconto
|
record.overwrite(str,208); //Tipo movimento del saldaconto
|
||||||
|
|
||||||
|
bool movval = _tcaus->get_bool(CAU_MOVVAL);
|
||||||
|
if (movval)
|
||||||
|
record.overwrite("X",214);
|
||||||
|
else //Flag movimento in valuta
|
||||||
|
record.overwrite(" ",214);
|
||||||
|
|
||||||
int num = 0;
|
int num = 0;
|
||||||
int pos_gcs = 41;
|
int pos_gcs = 41;
|
||||||
@ -1746,177 +1752,183 @@ bool TInv_cont::invio_mov_SC()
|
|||||||
TString numpart = _tpart->get (PART_NUMPART);
|
TString numpart = _tpart->get (PART_NUMPART);
|
||||||
int nriga = _tpart->get_int (PART_NRIGA);
|
int nriga = _tpart->get_int (PART_NRIGA);
|
||||||
int tipomov = _tpart->get_int (PART_TIPOMOV);
|
int tipomov = _tpart->get_int (PART_TIPOMOV);
|
||||||
|
|
||||||
if (tipomov == 1)
|
|
||||||
{
|
|
||||||
_tscad->zero();
|
|
||||||
_tscad->put(SCAD_TIPOCF, tipo);
|
|
||||||
if (gruppo != 0)
|
|
||||||
_tscad->put(SCAD_GRUPPO, gruppo);
|
|
||||||
if (conto != 0)
|
|
||||||
_tscad->put(SCAD_CONTO, conto);
|
|
||||||
if (sottoc != 0)
|
|
||||||
_tscad->put(SCAD_SOTTOCONTO, sottoc);
|
|
||||||
_tscad->put(SCAD_ANNO, anno);
|
|
||||||
_tscad->put(SCAD_NUMPART, numpart);
|
|
||||||
_tscad->put(SCAD_NRIGA, nriga);
|
|
||||||
|
|
||||||
TRectype scad (_tscad->curr());
|
|
||||||
|
|
||||||
TString rec,file,str,codpag,ultclass,datascad,numero,codag,impvalstr,numpart;
|
|
||||||
|
|
||||||
for (_tscad->read(_isgteq); !_tscad->eof(); _tscad->next())
|
|
||||||
{
|
|
||||||
rec = scad.get(SCAD_NUMPART);
|
|
||||||
file = _tscad->get(SCAD_NUMPART);
|
|
||||||
|
|
||||||
if (_tscad->curr() != scad || file != rec) break;
|
|
||||||
|
|
||||||
partita2trasfer(record);
|
|
||||||
|
|
||||||
int nrata = _tscad->get_int(SCAD_NRATA);
|
|
||||||
str.format("%02d", nrata);
|
|
||||||
record.overwrite(str,35); //Numero di rata
|
|
||||||
|
|
||||||
char tipo = _tscad->get_char(SCAD_TIPOCF);
|
|
||||||
int g = _tscad->get_int (SCAD_GRUPPO);
|
|
||||||
int c = _tscad->get_int (SCAD_CONTO);
|
|
||||||
long s = _tscad->get_long(SCAD_SOTTOCONTO);
|
|
||||||
int anno = _tscad->get_int (SCAD_ANNO);
|
|
||||||
numpart = _tscad->get(SCAD_NUMPART);
|
|
||||||
aggiorna_array_rate(tipo,g,c,s,anno,numpart,nrata);
|
|
||||||
|
|
||||||
codpag = _tscad->get(SCAD_CODPAG);
|
|
||||||
str.format("%-2s", (const char*) codpag);
|
|
||||||
record.overwrite(str,112); //Codice di pagamento
|
|
||||||
|
|
||||||
int tipopag = _tscad->get_int(SCAD_TIPOPAG);
|
|
||||||
str.format("%d", tipopag);
|
|
||||||
record.overwrite(str,114); //Tipo pagamento
|
|
||||||
|
|
||||||
ultclass = _tscad->get(SCAD_ULTCLASS);
|
|
||||||
str.format("%s", (const char*) ultclass);
|
|
||||||
record.overwrite(str,115); //Ulteriore classificazione
|
|
||||||
|
|
||||||
real importo (_tscad->get_real(SCAD_IMPORTO));
|
|
||||||
numero = importo.string();
|
|
||||||
if (importo.sign() < 0)
|
|
||||||
negPC2negAS(numero);
|
|
||||||
str.format("%011s", (const char*) numero);
|
|
||||||
record.overwrite(str,116); //Importo in lire rata partita
|
|
||||||
|
|
||||||
real importoval (_tscad->get_real(SCAD_IMPORTOVAL));
|
|
||||||
dec2integer(importoval,1000);
|
|
||||||
impvalstr = importoval.string();
|
|
||||||
if (importoval.sign() < 0)
|
|
||||||
negPC2negAS(impvalstr);
|
|
||||||
str.format("%013s", (const char*) impvalstr);
|
|
||||||
record.overwrite(str,127); //Importo in valuta rata partita
|
|
||||||
|
|
||||||
datascad = _tscad->get_date(SCAD_DATASCAD);
|
|
||||||
str = riconverti(datascad,FALSE);
|
|
||||||
str.format("%06s", (const char*) str);
|
|
||||||
record.overwrite(str,140); //Data scadenza
|
|
||||||
|
|
||||||
codag = _tscad->get(SCAD_CODAG);
|
|
||||||
str.format("%-6s", (const char*) codag);
|
|
||||||
record.overwrite(str,172); //Codice agente
|
|
||||||
|
|
||||||
_tras_file.write_control_rec(record,size);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_tpagsca->zero();
|
|
||||||
_tpagsca->put(PAGSCA_TIPOC, tipo);
|
|
||||||
if (gruppo != 0)
|
|
||||||
_tpagsca->put(PAGSCA_GRUPPO, gruppo);
|
|
||||||
if (conto != 0)
|
|
||||||
_tpagsca->put(PAGSCA_CONTO, conto);
|
|
||||||
if (sottoc != 0)
|
|
||||||
_tpagsca->put(PAGSCA_SOTTOCONTO, sottoc);
|
|
||||||
_tpagsca->put(PAGSCA_ANNO, anno);
|
|
||||||
_tpagsca->put(PAGSCA_NUMPART, numpart);
|
|
||||||
|
|
||||||
TRectype pagsca (_tpagsca->curr());
|
|
||||||
|
|
||||||
TString str,rec,file;
|
|
||||||
|
|
||||||
for (_tpagsca->read(_isgteq); !_tpagsca->eof(); _tpagsca->next())
|
|
||||||
{
|
|
||||||
int nrigp = _tpagsca->get_int(PAGSCA_NRIGP);
|
|
||||||
|
|
||||||
rec = pagsca.get(PAGSCA_NUMPART);
|
|
||||||
file = _tpagsca->get(PAGSCA_NUMPART);
|
|
||||||
|
|
||||||
if (_tpagsca->curr() != pagsca || file != rec) break;
|
|
||||||
|
|
||||||
if (nriga != nrigp) continue;
|
|
||||||
|
|
||||||
partita2trasfer(record);
|
|
||||||
|
|
||||||
real importo (_tpagsca->get_real(PAGSCA_IMPORTO));
|
|
||||||
real importoval (_tpagsca->get_real(PAGSCA_IMPORTOVAL));
|
|
||||||
pagsca2trasfer(record,importo,importoval);
|
|
||||||
|
|
||||||
real abbuoni (_tpagsca->get_real(PAGSCA_ABBUONI));
|
if (tipo == 'C' || tipo == 'F')
|
||||||
if (abbuoni != ZERO)
|
{
|
||||||
{
|
if (tipomov == 1)
|
||||||
char sezabb;
|
{
|
||||||
char passat = _tpagsca->get_char(PAGSCA_PASSATT);
|
_tscad->zero();
|
||||||
char sez = _tpart->get_char(PART_SEZ);
|
_tscad->put(SCAD_TIPOCF, tipo);
|
||||||
if (passat == 'A')
|
if (gruppo != 0)
|
||||||
sezabb = 'D';
|
_tscad->put(SCAD_GRUPPO, gruppo);
|
||||||
else
|
if (conto != 0)
|
||||||
if (passat == 'P')
|
_tscad->put(SCAD_CONTO, conto);
|
||||||
sezabb = 'A';
|
if (sottoc != 0)
|
||||||
if (sezabb != sez)
|
_tscad->put(SCAD_SOTTOCONTO, sottoc);
|
||||||
abbuoni = abbuoni * -1;
|
_tscad->put(SCAD_ANNO, anno);
|
||||||
real abblire = ZERO;
|
_tscad->put(SCAD_NUMPART, numpart);
|
||||||
partita2trasfer(record,FALSE);
|
_tscad->put(SCAD_NRIGA, nriga);
|
||||||
if (_codval.not_empty())
|
|
||||||
{
|
TRectype scad (_tscad->curr());
|
||||||
abblire = abbuoni * _cambio;
|
|
||||||
abblire.round();
|
TString rec,file,str,codpag,ultclass,datascad,numero,codag,impvalstr,numpart;
|
||||||
}
|
|
||||||
str.format("%d", 4);
|
for (_tscad->read(_isgteq); !_tscad->eof(); _tscad->next())
|
||||||
record.overwrite(str,37);
|
{
|
||||||
str.format("%c", sezabb);
|
rec = scad.get(SCAD_NUMPART);
|
||||||
record.overwrite(str,152);
|
file = _tscad->get(SCAD_NUMPART);
|
||||||
pagsca2trasfer(record,abblire,abbuoni);
|
|
||||||
}
|
if (_tscad->curr() != scad || file != rec) break;
|
||||||
|
|
||||||
real diffcam (_tpagsca->get_real(PAGSCA_DIFFCAM));
|
partita2trasfer(record);
|
||||||
if (diffcam != ZERO)
|
|
||||||
{
|
int nrata = _tscad->get_int(SCAD_NRATA);
|
||||||
real imp = ZERO;
|
str.format("%02d", nrata);
|
||||||
partita2trasfer(record,FALSE);
|
record.overwrite(str,35); //Numero di rata
|
||||||
char sez = _tpart->get_char(PART_SEZ);
|
|
||||||
if (diffcam < ZERO)
|
char tipo = _tscad->get_char(SCAD_TIPOCF);
|
||||||
{
|
int g = _tscad->get_int (SCAD_GRUPPO);
|
||||||
diffcam = diffcam * -1;
|
int c = _tscad->get_int (SCAD_CONTO);
|
||||||
if (sez == 'D')
|
long s = _tscad->get_long(SCAD_SOTTOCONTO);
|
||||||
sez = 'A';
|
int anno = _tscad->get_int (SCAD_ANNO);
|
||||||
else
|
numpart = _tscad->get(SCAD_NUMPART);
|
||||||
if (sez == 'A')
|
aggiorna_array_rate(tipo,g,c,s,anno,numpart,nrata);
|
||||||
sez = 'D';
|
|
||||||
}
|
codpag = _tscad->get(SCAD_CODPAG);
|
||||||
str.format("%d", 4);
|
str.format("%-2s", (const char*) codpag);
|
||||||
record.overwrite(str,37);
|
record.overwrite(str,112); //Codice di pagamento
|
||||||
str.format("%c", sez);
|
|
||||||
record.overwrite(str,152);
|
int tipopag = _tscad->get_int(SCAD_TIPOPAG);
|
||||||
pagsca2trasfer(record,diffcam,imp);
|
str.format("%d", tipopag);
|
||||||
}
|
record.overwrite(str,114); //Tipo pagamento
|
||||||
|
|
||||||
real ritenute (_tpagsca->get_real(PAGSCA_RITENUTE));
|
ultclass = _tscad->get(SCAD_ULTCLASS);
|
||||||
if (ritenute != ZERO)
|
str.format("%s", (const char*) ultclass);
|
||||||
{
|
record.overwrite(str,115); //Ulteriore classificazione
|
||||||
real imp = ZERO;
|
|
||||||
partita2trasfer(record,FALSE);
|
real importo (_tscad->get_real(SCAD_IMPORTO));
|
||||||
pagsca2trasfer(record,ritenute,imp);
|
numero = importo.string();
|
||||||
}
|
if (importo.sign() < 0)
|
||||||
}
|
negPC2negAS(numero);
|
||||||
}
|
str.format("%011s", (const char*) numero);
|
||||||
|
record.overwrite(str,116); //Importo in lire rata partita
|
||||||
|
|
||||||
|
real importoval (_tscad->get_real(SCAD_IMPORTOVAL));
|
||||||
|
dec2integer(importoval,1000);
|
||||||
|
impvalstr = importoval.string();
|
||||||
|
if (importoval.sign() < 0)
|
||||||
|
negPC2negAS(impvalstr);
|
||||||
|
str.format("%013s", (const char*) impvalstr);
|
||||||
|
record.overwrite(str,127); //Importo in valuta rata partita
|
||||||
|
|
||||||
|
datascad = _tscad->get_date(SCAD_DATASCAD);
|
||||||
|
str = riconverti(datascad,FALSE);
|
||||||
|
str.format("%06s", (const char*) str);
|
||||||
|
record.overwrite(str,140); //Data scadenza
|
||||||
|
|
||||||
|
codag = _tscad->get(SCAD_CODAG);
|
||||||
|
str.format("%-6s", (const char*) codag);
|
||||||
|
record.overwrite(str,172); //Codice agente
|
||||||
|
|
||||||
|
_tras_file.write_control_rec(record,size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_tpagsca->zero();
|
||||||
|
_tpagsca->put(PAGSCA_TIPOC, tipo);
|
||||||
|
if (gruppo != 0)
|
||||||
|
_tpagsca->put(PAGSCA_GRUPPO, gruppo);
|
||||||
|
if (conto != 0)
|
||||||
|
_tpagsca->put(PAGSCA_CONTO, conto);
|
||||||
|
if (sottoc != 0)
|
||||||
|
_tpagsca->put(PAGSCA_SOTTOCONTO, sottoc);
|
||||||
|
_tpagsca->put(PAGSCA_ANNO, anno);
|
||||||
|
_tpagsca->put(PAGSCA_NUMPART, numpart);
|
||||||
|
|
||||||
|
TRectype pagsca (_tpagsca->curr());
|
||||||
|
|
||||||
|
TString str,rec,file;
|
||||||
|
|
||||||
|
for (_tpagsca->read(_isgteq); !_tpagsca->eof(); _tpagsca->next())
|
||||||
|
{
|
||||||
|
int nrigp = _tpagsca->get_int(PAGSCA_NRIGP);
|
||||||
|
|
||||||
|
rec = pagsca.get(PAGSCA_NUMPART);
|
||||||
|
file = _tpagsca->get(PAGSCA_NUMPART);
|
||||||
|
|
||||||
|
if (_tpagsca->curr() != pagsca || file != rec) break;
|
||||||
|
|
||||||
|
if (nriga != nrigp) continue;
|
||||||
|
|
||||||
|
partita2trasfer(record);
|
||||||
|
|
||||||
|
real importo (_tpagsca->get_real(PAGSCA_IMPORTO));
|
||||||
|
real importoval (_tpagsca->get_real(PAGSCA_IMPORTOVAL));
|
||||||
|
pagsca2trasfer(record,importo,importoval);
|
||||||
|
|
||||||
|
real abbuoni (_tpagsca->get_real(PAGSCA_ABBUONI));
|
||||||
|
if (abbuoni != ZERO)
|
||||||
|
{
|
||||||
|
char sezabb;
|
||||||
|
char passat = _tpagsca->get_char(PAGSCA_PASSATT);
|
||||||
|
char sez = _tpart->get_char(PART_SEZ);
|
||||||
|
if (passat == 'A')
|
||||||
|
sezabb = 'D';
|
||||||
|
else
|
||||||
|
if (passat == 'P')
|
||||||
|
sezabb = 'A';
|
||||||
|
if (sezabb != sez)
|
||||||
|
abbuoni = abbuoni * -1;
|
||||||
|
real abblire = ZERO;
|
||||||
|
partita2trasfer(record,FALSE);
|
||||||
|
if (_codval.not_empty())
|
||||||
|
{
|
||||||
|
abblire = abbuoni * _cambio;
|
||||||
|
abblire.round();
|
||||||
|
}
|
||||||
|
str.format("%d", 4);
|
||||||
|
record.overwrite(str,37);
|
||||||
|
str.format("%c", sezabb);
|
||||||
|
record.overwrite(str,152);
|
||||||
|
if (_codval.not_empty())
|
||||||
|
pagsca2trasfer(record,abblire,abbuoni);
|
||||||
|
else
|
||||||
|
pagsca2trasfer(record,abbuoni,abblire);
|
||||||
|
}
|
||||||
|
|
||||||
|
real diffcam (_tpagsca->get_real(PAGSCA_DIFFCAM));
|
||||||
|
if (diffcam != ZERO)
|
||||||
|
{
|
||||||
|
real imp = ZERO;
|
||||||
|
partita2trasfer(record,FALSE);
|
||||||
|
char sez = _tpart->get_char(PART_SEZ);
|
||||||
|
if (diffcam < ZERO)
|
||||||
|
{
|
||||||
|
diffcam = diffcam * -1;
|
||||||
|
if (sez == 'D')
|
||||||
|
sez = 'A';
|
||||||
|
else
|
||||||
|
if (sez == 'A')
|
||||||
|
sez = 'D';
|
||||||
|
}
|
||||||
|
str.format("%d", 4);
|
||||||
|
record.overwrite(str,37);
|
||||||
|
str.format("%c", sez);
|
||||||
|
record.overwrite(str,152);
|
||||||
|
pagsca2trasfer(record,diffcam,imp);
|
||||||
|
}
|
||||||
|
|
||||||
|
real ritenute (_tpagsca->get_real(PAGSCA_RITENUTE));
|
||||||
|
if (ritenute != ZERO)
|
||||||
|
{
|
||||||
|
real imp = ZERO;
|
||||||
|
partita2trasfer(record,FALSE);
|
||||||
|
pagsca2trasfer(record,ritenute,imp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
delete _prog;
|
delete _prog;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user