cglib02.h Aggiunta classe base e distruttore all'oggetto TSaldo
cglib04.cpp Corretto trasferimento righe iva da PC cgprassi.men Aggiunta eliminazione zoppi MI3692 cgsaldac.cpp Implementato metodo TPartita::elimina_pagamento cgsaldac.h Aggiunto metodo TPartita::elimina_pagamento git-svn-id: svn://10.65.10.50/trunk@6365 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
69a6fa10f6
commit
11285fc803
@ -62,7 +62,7 @@ public:
|
|||||||
enum tipobil { DataLimite=1, UltimaImmissione };
|
enum tipobil { DataLimite=1, UltimaImmissione };
|
||||||
enum tiposal { normale, apertura, chiusura };
|
enum tiposal { normale, apertura, chiusura };
|
||||||
|
|
||||||
class TSaldo
|
class TSaldo : public TObject
|
||||||
{
|
{
|
||||||
TLocalisamfile _saldi;
|
TLocalisamfile _saldi;
|
||||||
|
|
||||||
@ -127,6 +127,7 @@ public:
|
|||||||
// bool prg_mov_eliminati(int i,TConto& c,int d, real& p1, real& p2);
|
// bool prg_mov_eliminati(int i,TConto& c,int d, real& p1, real& p2);
|
||||||
|
|
||||||
TSaldo();
|
TSaldo();
|
||||||
|
virtual ~TSaldo() { }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
203
cg/cglib04.cpp
203
cg/cglib04.cpp
@ -495,23 +495,22 @@ void TTransfer_file::remove_all(bool file_ditta)
|
|||||||
|
|
||||||
bool TTransfer_file::read_control_rec()
|
bool TTransfer_file::read_control_rec()
|
||||||
{
|
{
|
||||||
TString16 tmp;
|
TString16 tmp;
|
||||||
|
|
||||||
if (!exist()) return FALSE;
|
if (!exist()) return FALSE;
|
||||||
|
|
||||||
_control_rec->spaces();
|
_control_rec->spaces();
|
||||||
|
|
||||||
// va all'inizio del file
|
// va all'inizio del file
|
||||||
fseek (_trasfer, 0L, SEEK_SET);
|
fseek(_trasfer, 0L, SEEK_SET);
|
||||||
|
|
||||||
// const word letti = fread((char*)(const char*)_control_rec,sizeof(char),sizeH,_trasfer);
|
// const word letti = fread((char*)(const char*)_control_rec,sizeof(char),sizeH,_trasfer);
|
||||||
const word letti = fread(__dep, sizeof(char), sizeH, _trasfer);
|
const word letti = fread(__dep, sizeof(char), sizeH, _trasfer);
|
||||||
|
|
||||||
_control_rec->cut(sizeH);
|
_control_rec->cut(sizeH);
|
||||||
|
|
||||||
#ifdef DBG
|
if (_control_rec->len() > sizeH)
|
||||||
if (_control_rec->len() > sizeH) error_box("Non e' possibile allocare una stringa di %d in una stringa fissa di %d caratteri", _control_rec->len(),sizeH);
|
NFCHECK("Non e' possibile allocare una stringa di %d in una stringa fissa di %d caratteri", _control_rec->len(),sizeH);
|
||||||
#endif
|
|
||||||
|
|
||||||
_tiporec = _control_rec->sub(0,2);
|
_tiporec = _control_rec->sub(0,2);
|
||||||
|
|
||||||
@ -1305,7 +1304,7 @@ void TTransfer_file::write_tmp_tabelle(TString& record, bool create)
|
|||||||
//Quando ricevo la IV direttiva del piano dei conti per evitare che nell'archivio,
|
//Quando ricevo la IV direttiva del piano dei conti per evitare che nell'archivio,
|
||||||
//in caso di numero romano vuoto, venga memorizzato la stringa letta sul trasfer ("000"),
|
//in caso di numero romano vuoto, venga memorizzato la stringa letta sul trasfer ("000"),
|
||||||
//vuoto la stringa prima di fare la put.
|
//vuoto la stringa prima di fare la put.
|
||||||
if (sigla == "P2" || sigla == "P3" || sigla == "P1")
|
if (sigla == "P1" || sigla == "P2" || sigla == "P3")
|
||||||
{
|
{
|
||||||
if (fname == "GRUPPO")
|
if (fname == "GRUPPO")
|
||||||
{
|
{
|
||||||
@ -1344,6 +1343,11 @@ void TTransfer_file::write_tmp_tabelle(TString& record, bool create)
|
|||||||
if (field == " ")
|
if (field == " ")
|
||||||
field = "0";
|
field = "0";
|
||||||
}
|
}
|
||||||
|
if (fname == "IVACOMP") // MI3695
|
||||||
|
{
|
||||||
|
if (field == "00")
|
||||||
|
field = "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dep->put(fname, (const char*)field);
|
dep->put(fname, (const char*)field);
|
||||||
@ -3373,6 +3377,7 @@ void TTransfer_file::scrivi_clifo(long nrec)
|
|||||||
delete _prog;
|
delete _prog;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Scrive piano dei conti da SISTEMA
|
||||||
void TTransfer_file::scrivi_pcon(long nrec)
|
void TTransfer_file::scrivi_pcon(long nrec)
|
||||||
{
|
{
|
||||||
const word size = 256;
|
const word size = 256;
|
||||||
@ -4457,107 +4462,121 @@ void TTransfer_file::write_righe_contabili(TString& record)
|
|||||||
_prog->addstatus(1);
|
_prog->addstatus(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Scrive righe iva per ricezione PC
|
||||||
void TTransfer_file::write_righe_IVA(TString& record)
|
void TTransfer_file::write_righe_IVA(TString& record)
|
||||||
{
|
{
|
||||||
TString sigla,key;
|
TString sigla,key;
|
||||||
int numfield = 1;
|
int numfield = 1;
|
||||||
TMappa_trc& trc = mappa();
|
TMappa_trc& trc = mappa();
|
||||||
int gruppo;
|
int gruppo;
|
||||||
|
|
||||||
|
long nreg = 0;
|
||||||
|
int nriga = 1;
|
||||||
|
|
||||||
|
_depriva->zero();
|
||||||
|
|
||||||
sigla = record.mid(0,2);
|
sigla = record.mid(0,2);
|
||||||
key.format("%2s%d", (const char*)sigla,numfield);
|
key.format("%2s%d", (const char*)sigla,numfield);
|
||||||
|
|
||||||
_depriva->zero();
|
while (trc.is_key(key))
|
||||||
|
{
|
||||||
if (trc.is_key((const char *) key))
|
int from = trc.from(key);
|
||||||
{
|
int to = trc.to(key);
|
||||||
do
|
int logic = trc.logicnum(key);
|
||||||
{
|
TString fname = trc.field_name(key);
|
||||||
int from = trc.from(key);
|
TString field = record.sub(from-1,to);
|
||||||
int to = trc.to(key);
|
int flag = trc.flag(key);
|
||||||
TString fname = trc.field_name(key);
|
int dec = trc.flag_bis(key);
|
||||||
TString field = record.sub(from-1,to);
|
|
||||||
int flag = trc.flag(key);
|
if (logic == LF_RMOVIVA && _depriva->type(fname) == _realfld)
|
||||||
int dec = trc.flag_bis(key);
|
{
|
||||||
|
TString sign,importo;
|
||||||
TRecfield campo (*_depriva,fname);
|
|
||||||
if (campo.type() == _realfld)
|
|
||||||
{
|
|
||||||
TString sign,importo;
|
|
||||||
|
|
||||||
importo = field;
|
importo = field;
|
||||||
strip_zero(importo);
|
strip_zero(importo);
|
||||||
if (importo.not_empty())
|
if (importo.not_empty())
|
||||||
|
{
|
||||||
|
if (fname == RMI_IMPONIBILE)
|
||||||
{
|
{
|
||||||
if (fname == RMI_IMPONIBILE)
|
sign = record.sub(64,65);
|
||||||
{
|
if (sign == "-")
|
||||||
sign = record.sub(64,65);
|
field = sign << importo;
|
||||||
if (sign == "-")
|
else
|
||||||
field = sign << importo;
|
field = importo;
|
||||||
else
|
}
|
||||||
field = importo;
|
if (fname == RMI_IMPOSTA)
|
||||||
}
|
{
|
||||||
if (fname == RMI_IMPOSTA)
|
sign = record.sub(79,80);
|
||||||
{
|
if (sign == "-")
|
||||||
sign = record.sub(79,80);
|
field = sign << importo;
|
||||||
if (sign == "-")
|
else
|
||||||
field = sign << importo;
|
field = importo;
|
||||||
else
|
|
||||||
field = importo;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
field = importo;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (flag == 3)
|
|
||||||
{
|
|
||||||
if (dec > 0)
|
|
||||||
decimali(field,dec);
|
|
||||||
|
|
||||||
real appoggio (field);
|
|
||||||
field = appoggio.string();
|
|
||||||
}
|
|
||||||
if (fname == RMI_NUMRIG)
|
|
||||||
{
|
|
||||||
int nriga = atoi(field);
|
|
||||||
field.format("%3d", nriga);
|
|
||||||
}
|
|
||||||
if (fname == RMI_GRUPPO)
|
|
||||||
{
|
|
||||||
gruppo = atoi(field);
|
|
||||||
field.format("%3d", gruppo);
|
|
||||||
}
|
|
||||||
if (fname == RMI_CONTO)
|
|
||||||
{
|
|
||||||
int conto = atoi(field);
|
|
||||||
field.format("%3d", conto);
|
|
||||||
char tipo = TipoConto(gruppo,conto);
|
|
||||||
_depriva->put(RMI_TIPOC, tipo);
|
|
||||||
}
|
|
||||||
if (fname == RMI_SOTTOCONTO)
|
|
||||||
{
|
|
||||||
long sottoc = atol(field);
|
|
||||||
field.format("%6ld", sottoc);
|
|
||||||
}
|
|
||||||
if (fname == RMI_TIPODET || fname == RMI_TIPOCR || fname == RMI_TIPOATT)
|
|
||||||
if (field == "0")
|
|
||||||
field = "";
|
|
||||||
|
|
||||||
if (fname == RMI_NUMREG)
|
|
||||||
{
|
|
||||||
long nreg = atol(field);
|
|
||||||
field.format("%7ld", nreg);
|
|
||||||
_depriva->put(RMI_ANNOES, _annoes);
|
|
||||||
_depriva->put(RMI_NUMREG, field);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_depriva->put(fname, field);
|
field = importo;
|
||||||
|
}
|
||||||
numfield++;
|
|
||||||
key.format("%2s%d", (const char*) sigla,numfield);
|
if (flag == 3)
|
||||||
|
{
|
||||||
|
if (dec > 0)
|
||||||
|
decimali(field,dec);
|
||||||
|
|
||||||
|
real appoggio (field);
|
||||||
|
field = appoggio.string();
|
||||||
|
}
|
||||||
|
if (fname == RMI_NUMRIG)
|
||||||
|
{
|
||||||
|
nriga = atoi(field);
|
||||||
|
field.format("%3d", nriga);
|
||||||
|
}
|
||||||
|
if (fname == RMI_GRUPPO)
|
||||||
|
{
|
||||||
|
gruppo = atoi(field);
|
||||||
|
field.format("%3d", gruppo);
|
||||||
|
}
|
||||||
|
if (fname == RMI_CONTO)
|
||||||
|
{
|
||||||
|
int conto = atoi(field);
|
||||||
|
field.format("%3d", conto);
|
||||||
|
char tipo = TipoConto(gruppo,conto);
|
||||||
|
_depriva->put(RMI_TIPOC, tipo);
|
||||||
}
|
}
|
||||||
while (trc.is_key((const char*) key));
|
if (fname == RMI_SOTTOCONTO)
|
||||||
|
{
|
||||||
|
long sottoc = atol(field);
|
||||||
|
field.format("%6ld", sottoc);
|
||||||
|
}
|
||||||
|
if (fname == RMI_TIPODET || fname == RMI_TIPOCR || fname == RMI_TIPOATT)
|
||||||
|
if (field == "0")
|
||||||
|
field = "";
|
||||||
|
|
||||||
|
if (fname == RMI_NUMREG)
|
||||||
|
{
|
||||||
|
nreg = atol(field);
|
||||||
|
field.format("%7ld", nreg);
|
||||||
|
_depriva->put(RMI_ANNOES, _annoes);
|
||||||
|
_depriva->put(RMI_NUMREG, field);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (logic == LF_RMOVIVA)
|
||||||
|
_depriva->put(fname, field);
|
||||||
|
|
||||||
|
// Devo trasferire un campo che in realta' e in testata
|
||||||
|
if (logic == LF_RMOV && nriga == 1 && field.not_empty())
|
||||||
|
{
|
||||||
|
_tmov->put(MOV_NUMREG, nreg);
|
||||||
|
if (_tmov->read() == NOERR)
|
||||||
|
{
|
||||||
|
_tmov->put(fname, field);
|
||||||
|
_tmov->rewrite();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
numfield++;
|
||||||
|
key.format("%2s%d", (const char*) sigla,numfield);
|
||||||
}
|
}
|
||||||
|
|
||||||
_triva->zero();
|
_triva->zero();
|
||||||
|
@ -169,10 +169,11 @@ Item_02 = "Ripristino stampa registri", "cg5 -4", "F"
|
|||||||
Item_03 = "Aggiornamento Tipo Conto", "cg1 -2 T", "FP"
|
Item_03 = "Aggiornamento Tipo Conto", "cg1 -2 T", "FP"
|
||||||
Item_04 = "Aggiornamento Tipo Att. su mov.IVA", "cg1 -2 A", "FP"
|
Item_04 = "Aggiornamento Tipo Att. su mov.IVA", "cg1 -2 A", "FP"
|
||||||
Item_05 = "Aggiornamento flag op.Intrac.", "cg1 -2 I", "FP"
|
Item_05 = "Aggiornamento flag op.Intrac.", "cg1 -2 I", "FP"
|
||||||
Item_06 = "Rinumerazione n° Protocollo", "cg1 -2 P", "FP"
|
Item_06 = "Rinumerazione n. Protocollo", "cg1 -2 P", "FP"
|
||||||
Item_07 = "Aggiornamento Codice Attivita'", "cg1 -2 C", "FP"
|
Item_07 = "Aggiornamento Codice Attivita'", "cg1 -2 C", "FP"
|
||||||
Item_08 = "Riorganizzazione codici esercizio", "cg1 -2 E", "FP"
|
Item_08 = "Riorganizzazione codici esercizio", "cg1 -2 E", "FP"
|
||||||
Item_09 = "Collegamento bilanci", [PRASSICG_025]
|
Item_09 = "Ricerca righe prima nota errate", "cg1 -2 Z", "FP"
|
||||||
|
Item_10 = "Collegamento bilanci", [PRASSICG_025]
|
||||||
|
|
||||||
[PRASSICG_019]
|
[PRASSICG_019]
|
||||||
Caption = "Invio"
|
Caption = "Invio"
|
||||||
|
@ -1245,6 +1245,30 @@ bool TPartita::esiste(int nriga, int nrata, int nrigp) const
|
|||||||
return scad.exist(nrigp); // Cerca pagamento vero e proprio
|
return scad.exist(nrigp); // Cerca pagamento vero e proprio
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TPartita::elimina_pagamento(int nriga, int nrata, int nrigp)
|
||||||
|
{
|
||||||
|
const bool ok = esiste(nriga, nrata, nrigp);
|
||||||
|
if (ok)
|
||||||
|
{
|
||||||
|
if (nriga == UNASSIGNED)
|
||||||
|
{
|
||||||
|
TRectype old_pag(_unassigned.row(nrigp));
|
||||||
|
old_pag.put(PAGSCA_ACCSAL, "A");
|
||||||
|
old_pag.zero(PAGSCA_IMPORTO);
|
||||||
|
old_pag.zero(PAGSCA_IMPORTOVAL);
|
||||||
|
old_pag.zero(PAGSCA_RITENUTE);
|
||||||
|
const TValuta val;
|
||||||
|
modifica_pagamento(old_pag, val, TRUE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TRiga_scadenze& scad = rata(nriga, nrata);
|
||||||
|
scad.elimina_pagamento(nrigp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
// Ritorna l'importo in lire speso su di una riga contabile
|
// Ritorna l'importo in lire speso su di una riga contabile
|
||||||
TImporto TPartita::importo_speso(long nreg, int numrig, bool valuta, int mode) const
|
TImporto TPartita::importo_speso(long nreg, int numrig, bool valuta, int mode) const
|
||||||
{
|
{
|
||||||
@ -1769,7 +1793,6 @@ void TPartita::sposta_riga(int from_row, TPartita& part, int to_row)
|
|||||||
void TPartita::scollega_pagamenti(int r, int s)
|
void TPartita::scollega_pagamenti(int r, int s)
|
||||||
{
|
{
|
||||||
CHECKD(s > 0, "Impossibile scollegare la rata ", s);
|
CHECKD(s > 0, "Impossibile scollegare la rata ", s);
|
||||||
|
|
||||||
const TRiga_partite& row = riga(r);
|
const TRiga_partite& row = riga(r);
|
||||||
for (int i = row.rate(); i >= s; i--)
|
for (int i = row.rate(); i >= s; i--)
|
||||||
{
|
{
|
||||||
|
@ -287,6 +287,7 @@ public:
|
|||||||
char& new_ap, TImporto& new_abb, TImporto& new_diffcam,
|
char& new_ap, TImporto& new_abb, TImporto& new_diffcam,
|
||||||
bool update);
|
bool update);
|
||||||
bool modifica_pagamento(const TRectype& new_pag, const TValuta& valuta, bool update);
|
bool modifica_pagamento(const TRectype& new_pag, const TValuta& valuta, bool update);
|
||||||
|
bool elimina_pagamento(int nriga, int nrata, int nrigp);
|
||||||
|
|
||||||
static void carica_allineamento();
|
static void carica_allineamento();
|
||||||
static char allineamento_richiesto(char tipocf);
|
static char allineamento_richiesto(char tipocf);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user