cg2100.cpp Spostato controllo prorata dopo controllo as400
cg2102.cpp Corretto calcolo tipo costo/ricavo cg3200.cpp Corretta chiamata a saldofin_esepre cg6*.* Corretto invio e ricezione movimenti di prima nota cglib04.cpp Corretto calcolo saldo finale in TSaldo_agg cgtrcpc.ini Aggiunto flag di provvisorio sul tracciato dei trasferimenti git-svn-id: svn://10.65.10.50/trunk@4919 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
c50f740fee
commit
a56158e24f
@ -672,24 +672,6 @@ void TPrimanota_application::init_modify_mode(TMask& m)
|
|||||||
|
|
||||||
TSheet_field& cg = cgs();
|
TSheet_field& cg = cgs();
|
||||||
|
|
||||||
if (iva() == iva_acquisti && // Se iva acquisti e ...
|
|
||||||
cg.shown() && // ... se non e' sola iva ...
|
|
||||||
!test_prorata()) // ... allora controlla prorata
|
|
||||||
{
|
|
||||||
m.show(F_ADJUST_PRORATA);
|
|
||||||
m.set_handler(F_ADJUST_PRORATA, prorata_handler);
|
|
||||||
|
|
||||||
warning_box("Questo movimento e' stato registrato con una percentuale\n"
|
|
||||||
"prorata non compatibile con quella corrente:\n"
|
|
||||||
"Premere il bottone di correzione automatica delle righe.");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
if (iva() == iva_vendite)
|
|
||||||
{
|
|
||||||
m.set_handler(F_ADJUST_PRORATA, NULL);
|
|
||||||
m.hide(F_ADJUST_PRORATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Determina se il movimento e' stato trasferito da AS/400:
|
// Determina se il movimento e' stato trasferito da AS/400:
|
||||||
// praticamente controlla che non ci sia nessun tipo movimento sulle righe contabili.
|
// praticamente controlla che non ci sia nessun tipo movimento sulle righe contabili.
|
||||||
_as400 = FALSE;
|
_as400 = FALSE;
|
||||||
@ -711,6 +693,32 @@ void TPrimanota_application::init_modify_mode(TMask& m)
|
|||||||
m.set(SK_TIPORIGA, "A"); // Forza il tipo riga normale
|
m.set(SK_TIPORIGA, "A"); // Forza il tipo riga normale
|
||||||
m.disable(SK_TIPORIGA); // Disabilita la sua modifica
|
m.disable(SK_TIPORIGA); // Disabilita la sua modifica
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Non controllare il prorata durante la cancellazione automatica
|
||||||
|
if (autodeleting() != 0x3)
|
||||||
|
{
|
||||||
|
if (iva() == iva_acquisti && // Se iva acquisti e ...
|
||||||
|
cg.shown() && // ... se non e' sola iva ...
|
||||||
|
!test_prorata()) // ... allora controlla prorata
|
||||||
|
{
|
||||||
|
m.show(F_ADJUST_PRORATA);
|
||||||
|
m.set_handler(F_ADJUST_PRORATA, prorata_handler);
|
||||||
|
|
||||||
|
warning_box("Questo movimento e' stato registrato con una percentuale\n"
|
||||||
|
"prorata non compatibile con quella corrente:\n"
|
||||||
|
"Premere il bottone di correzione automatica delle righe.");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Nascondi il bottone del prorata se esiste
|
||||||
|
if (m.id2pos(F_ADJUST_PRORATA) >= 0)
|
||||||
|
{
|
||||||
|
m.set_handler(F_ADJUST_PRORATA, NULL);
|
||||||
|
m.hide(F_ADJUST_PRORATA);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Controlla sulla causale se il segno del totale documento (ritsoc=FALSE)
|
// Controlla sulla causale se il segno del totale documento (ritsoc=FALSE)
|
||||||
@ -750,13 +758,14 @@ int TPrimanota_application::read(TMask& m)
|
|||||||
}
|
}
|
||||||
|
|
||||||
_saldi.reset(); // Azzera saldi
|
_saldi.reset(); // Azzera saldi
|
||||||
_saldi.set_movprovv(_rel->lfile().get_char("PROVVIS") > ' ');
|
_saldi.set_movprovv(_rel->lfile().get_char(MOV_PROVVIS) > ' ');
|
||||||
tiposal tsal = causale().apertura() ? apertura :
|
tiposal tsal = causale().apertura() ? apertura :
|
||||||
(causale().chiusura() ? chiusura : normale);
|
(causale().chiusura() ? chiusura : normale);
|
||||||
_saldi.set_tipo_saldo(tsal);
|
_saldi.set_tipo_saldo(tsal);
|
||||||
_saldi.set_anno_es(m.get_int(F_ANNOES));
|
_saldi.set_anno_es(m.get_int(F_ANNOES));
|
||||||
_saldi.set_num_ulmov(numreg);
|
_saldi.set_num_ulmov(numreg);
|
||||||
_saldi.set_data_ulmov((TDate)m.get(F_DATAREG));
|
_saldi.set_data_ulmov((TDate)m.get(F_DATAREG));
|
||||||
|
_saldi.set_movimentato(TRUE);
|
||||||
|
|
||||||
for (int i = 0; i < _rel->cg_items(); i++)
|
for (int i = 0; i < _rel->cg_items(); i++)
|
||||||
{
|
{
|
||||||
@ -776,9 +785,9 @@ int TPrimanota_application::read(TMask& m)
|
|||||||
|
|
||||||
conto.get(r, TRUE);
|
conto.get(r, TRUE);
|
||||||
riga.add(conto.string(0x3)); // Contropartita 110-114
|
riga.add(conto.string(0x3)); // Contropartita 110-114
|
||||||
riga.add(r.get("NUMGIO"));
|
riga.add(r.get("NUMGIO")); // Centro di costo 115
|
||||||
const char tipo = r.get_char("ROWTYPE");
|
const char tipo = r.get_char("ROWTYPE");
|
||||||
riga.add(tipo); // Tipo di riga 115
|
riga.add(tipo); // Tipo di riga 116
|
||||||
|
|
||||||
disable_cgs_cells(i, tipo);
|
disable_cgs_cells(i, tipo);
|
||||||
}
|
}
|
||||||
@ -857,6 +866,7 @@ void TPrimanota_application::mask2rel(const TMask& m)
|
|||||||
_saldi.set_anno_es(annoes);
|
_saldi.set_anno_es(annoes);
|
||||||
_saldi.set_num_ulmov(numreg);
|
_saldi.set_num_ulmov(numreg);
|
||||||
_saldi.set_data_ulmov((TDate)m.get(F_DATAREG));
|
_saldi.set_data_ulmov((TDate)m.get(F_DATAREG));
|
||||||
|
_saldi.set_movimentato(TRUE);
|
||||||
|
|
||||||
const int tm = causale().tipomov();
|
const int tm = causale().tipomov();
|
||||||
char s[2];
|
char s[2];
|
||||||
|
@ -1049,13 +1049,16 @@ TSheet_field& TPrimanota_application::ivas() const
|
|||||||
|
|
||||||
TBill& TPrimanota_application::ivas_bill(TBill& c)
|
TBill& TPrimanota_application::ivas_bill(TBill& c)
|
||||||
{
|
{
|
||||||
|
if (iva() == iva_vendite)
|
||||||
|
{
|
||||||
const int spric = c.tipo_cr();
|
const int spric = c.tipo_cr();
|
||||||
if (spric == 2 || spric == 3)
|
if (spric == 2 || spric == 3)
|
||||||
{
|
{
|
||||||
const TString& td = causale().tipo_doc();
|
const TString& td = causale().tipo_doc();
|
||||||
if (td == "FV" || td == "NC")
|
if (td == "FV" || td == "NC" || td == "ND")
|
||||||
c.tipo_cr(4);
|
c.tipo_cr(4);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3241,7 +3241,7 @@ void TMastrini_application::calcola_progressivi()
|
|||||||
const TRecnotype pos = saldi.recno();
|
const TRecnotype pos = saldi.recno();
|
||||||
// W96SALDI del 18-07-96 saldofin_esprec usa il flag TRUE xche' deve
|
// W96SALDI del 18-07-96 saldofin_esprec usa il flag TRUE xche' deve
|
||||||
// considerare anche il saldo finale
|
// considerare anche il saldo finale
|
||||||
saldo = _sld->saldofin_esprec(_anno_corrente,_gruppo,_conto,_sottoc,TRUE,FALSE);
|
saldo = _sld->saldofin_esprec(_anno_corrente,_gruppo,_conto,_sottoc,TRUE);
|
||||||
saldi.readat(pos);
|
saldi.readat(pos);
|
||||||
|
|
||||||
if (saldo> ZERO)
|
if (saldo> ZERO)
|
||||||
|
@ -1026,7 +1026,8 @@ void TRic_tab::ricevi_movPN(TString& key, char uselab)
|
|||||||
_prog->addstatus(1);
|
_prog->addstatus(1);
|
||||||
|
|
||||||
long nreg = _tmov->get_long(MOV_NUMREG);
|
long nreg = _tmov->get_long(MOV_NUMREG);
|
||||||
long nuova_reg = _tmov->get_long("TNUMREG" );
|
long nuova_reg = _tmov->get_long("TNUMREG");
|
||||||
|
bool provvis = _tmov->get_char(MOV_PROVVIS) > ' ';
|
||||||
|
|
||||||
if (nuova_reg == 0)
|
if (nuova_reg == 0)
|
||||||
{
|
{
|
||||||
@ -1070,7 +1071,7 @@ void TRic_tab::ricevi_movPN(TString& key, char uselab)
|
|||||||
aggiorna_reg(anno,codreg,ulnum); // Aggiorna il registro
|
aggiorna_reg(anno,codreg,ulnum); // Aggiorna il registro
|
||||||
|
|
||||||
_sld.set_anno_es(annoes);
|
_sld.set_anno_es(annoes);
|
||||||
_sld.set_movprovv(FALSE);
|
_sld.set_movprovv(provvis);
|
||||||
_sld.set_num_ulmov(_nreg);
|
_sld.set_num_ulmov(_nreg);
|
||||||
_sld.set_data_ulmov(datareg);
|
_sld.set_data_ulmov(datareg);
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
class TVar_mov : public TApplication
|
class TVar_mov : public TApplication
|
||||||
{
|
{
|
||||||
TIsamtempfile* _tmov, *_trmov, *_tiva, *_toccas;
|
TIsamtempfile* _tmov, *_trmov, *_tiva, *_toccas;
|
||||||
TLocalisamfile* _pcon, *_clifo, *_mov, *_rmov, *_rmoviva, *_occas;
|
TLocalisamfile* _pcon, *_clifo, *_mov, *_rmov, *_rmoviva, *_occas, *_causali, *_comuni;
|
||||||
TTable* _tab_reg;
|
TTable* _tab_reg;
|
||||||
TRectype* _rec_mov,* _rec_rmov,* _rec_riva;
|
TRectype* _rec_mov,* _rec_rmov,* _rec_riva;
|
||||||
TTransfer_file _tras_file;
|
TTransfer_file _tras_file;
|
||||||
@ -73,7 +73,7 @@ public:
|
|||||||
void setta_campi_maschera(TMask& m);
|
void setta_campi_maschera(TMask& m);
|
||||||
bool setta_campi_maschera_iva(TMask& m);
|
bool setta_campi_maschera_iva(TMask& m);
|
||||||
|
|
||||||
void registra_file_temp_mov(int,long,const TDate&,const TDate&,const TDate&,const TString&,TString&,long,long,const TString&,TString&);
|
void registra_file_temp_mov(int,long,const TDate&,const TDate&,const TDate&,const TString&,TString&,long,long,const TString&,TString&,char);
|
||||||
void registra_file_temp_rmov(long,int,int,int,long,char,const TString&,int,int,long,const real&);
|
void registra_file_temp_rmov(long,int,int,int,long,char,const TString&,int,int,long,const real&);
|
||||||
void registra_file_temp_riva(long,int,const real&,const TString&,const real&,int,int,int,int,long);
|
void registra_file_temp_riva(long,int,const real&,const TString&,const real&,int,int,int,int,long);
|
||||||
|
|
||||||
@ -160,6 +160,8 @@ bool TVar_mov::create()
|
|||||||
_rmov = new TLocalisamfile (LF_RMOV);
|
_rmov = new TLocalisamfile (LF_RMOV);
|
||||||
_rmoviva = new TLocalisamfile (LF_RMOVIVA);
|
_rmoviva = new TLocalisamfile (LF_RMOVIVA);
|
||||||
_occas = new TLocalisamfile (LF_OCCAS);
|
_occas = new TLocalisamfile (LF_OCCAS);
|
||||||
|
_causali = new TLocalisamfile (LF_CAUSALI);
|
||||||
|
_comuni = new TLocalisamfile (LF_COMUNI);
|
||||||
_tab_reg = new TTable ("REG");
|
_tab_reg = new TTable ("REG");
|
||||||
|
|
||||||
_rec_rmov = new TRectype (LF_RMOV);
|
_rec_rmov = new TRectype (LF_RMOV);
|
||||||
@ -181,6 +183,8 @@ bool TVar_mov::destroy()
|
|||||||
delete _rmov;
|
delete _rmov;
|
||||||
delete _rmoviva;
|
delete _rmoviva;
|
||||||
delete _occas;
|
delete _occas;
|
||||||
|
delete _causali;
|
||||||
|
delete _comuni;
|
||||||
delete _tab_reg;
|
delete _tab_reg;
|
||||||
delete _rec_rmov;
|
delete _rec_rmov;
|
||||||
delete _rec_riva;
|
delete _rec_riva;
|
||||||
@ -348,7 +352,7 @@ bool TVar_mov::video_PN()
|
|||||||
|
|
||||||
void TVar_mov::ricerca_codcaus(const TString& codcaus)
|
void TVar_mov::ricerca_codcaus(const TString& codcaus)
|
||||||
{
|
{
|
||||||
TLocalisamfile cau (LF_CAUSALI);
|
TLocalisamfile& cau = *_causali;
|
||||||
TString tipodoc;
|
TString tipodoc;
|
||||||
|
|
||||||
cau.setkey(1);
|
cau.setkey(1);
|
||||||
@ -550,6 +554,7 @@ void TVar_mov::setta_campi_maschera(TMask& m)
|
|||||||
regiva.trim();
|
regiva.trim();
|
||||||
long protiva = _rec_mov->get_long(MOV_PROTIVA);
|
long protiva = _rec_mov->get_long(MOV_PROTIVA);
|
||||||
long nuprotiva = _rec_mov->get_long(MOV_UPROTIVA);
|
long nuprotiva = _rec_mov->get_long(MOV_UPROTIVA);
|
||||||
|
char provvis = _rec_mov->get_char(MOV_PROVVIS);
|
||||||
TString codcaus = _rec_mov->get (MOV_CODCAUS);
|
TString codcaus = _rec_mov->get (MOV_CODCAUS);
|
||||||
TString codpag = _rec_mov->get (MOV_CODPAG);
|
TString codpag = _rec_mov->get (MOV_CODPAG);
|
||||||
codpag.trim();
|
codpag.trim();
|
||||||
@ -566,6 +571,7 @@ void TVar_mov::setta_campi_maschera(TMask& m)
|
|||||||
m.set(F_NUPROTIVA, nuprotiva);
|
m.set(F_NUPROTIVA, nuprotiva);
|
||||||
m.set(F_CODCAUS, codcaus);
|
m.set(F_CODCAUS, codcaus);
|
||||||
m.set(F_CODPAG, codpag);
|
m.set(F_CODPAG, codpag);
|
||||||
|
m.set(F_PROVV, provvis);
|
||||||
|
|
||||||
m.disable(F_NUMREG);
|
m.disable(F_NUMREG);
|
||||||
m.disable(F_NUMRIG);
|
m.disable(F_NUMRIG);
|
||||||
@ -581,6 +587,7 @@ void TVar_mov::setta_campi_maschera(TMask& m)
|
|||||||
m.enable(F_NUPROTIVA);
|
m.enable(F_NUPROTIVA);
|
||||||
m.enable(F_CODCAUS);
|
m.enable(F_CODCAUS);
|
||||||
m.enable(F_CODPAG);
|
m.enable(F_CODPAG);
|
||||||
|
m.enable(F_PROVV);
|
||||||
m.disable(F_GRUPPO);
|
m.disable(F_GRUPPO);
|
||||||
m.disable(F_CONTO);
|
m.disable(F_CONTO);
|
||||||
m.disable(F_SOTTOCONTO);
|
m.disable(F_SOTTOCONTO);
|
||||||
@ -592,7 +599,6 @@ void TVar_mov::setta_campi_maschera(TMask& m)
|
|||||||
m.disable(F_SOTTOC);
|
m.disable(F_SOTTOC);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (_righe)
|
|
||||||
{
|
{
|
||||||
int gruppo = _trmov->get_int (RMV_GRUPPO);
|
int gruppo = _trmov->get_int (RMV_GRUPPO);
|
||||||
int conto = _trmov->get_int (RMV_CONTO);
|
int conto = _trmov->get_int (RMV_CONTO);
|
||||||
@ -623,6 +629,7 @@ void TVar_mov::setta_campi_maschera(TMask& m)
|
|||||||
m.disable(F_NUPROTIVA);
|
m.disable(F_NUPROTIVA);
|
||||||
m.disable(F_CODCAUS);
|
m.disable(F_CODCAUS);
|
||||||
m.disable(F_CODPAG);
|
m.disable(F_CODPAG);
|
||||||
|
m.disable(F_PROVV);
|
||||||
|
|
||||||
m.enable(F_GRUPPO);
|
m.enable(F_GRUPPO);
|
||||||
m.enable(F_CONTO);
|
m.enable(F_CONTO);
|
||||||
@ -645,6 +652,7 @@ bool TVar_mov::setta_campi_maschera_iva(TMask& m)
|
|||||||
TString codcaus = _rec_mov->get (MOV_CODCAUS);
|
TString codcaus = _rec_mov->get (MOV_CODCAUS);
|
||||||
long codcf = _rec_mov->get_long(MOV_CODCF);
|
long codcf = _rec_mov->get_long(MOV_CODCF);
|
||||||
TString ocfpi = _rec_mov->get (MOV_OCFPI);
|
TString ocfpi = _rec_mov->get (MOV_OCFPI);
|
||||||
|
char provvis = _rec_mov->get_char(MOV_PROVVIS);
|
||||||
|
|
||||||
/*****************************************************
|
/*****************************************************
|
||||||
***** CLIENTI OCCASIONALI *****
|
***** CLIENTI OCCASIONALI *****
|
||||||
@ -665,7 +673,7 @@ bool TVar_mov::setta_campi_maschera_iva(TMask& m)
|
|||||||
com = _toccas->get(OCC_COM);
|
com = _toccas->get(OCC_COM);
|
||||||
cap = _toccas->get(OCC_CAP);
|
cap = _toccas->get(OCC_CAP);
|
||||||
|
|
||||||
TLocalisamfile comuni (LF_COMUNI);
|
TLocalisamfile& comuni = *_comuni;
|
||||||
|
|
||||||
comuni.setkey(1);
|
comuni.setkey(1);
|
||||||
comuni.zero();
|
comuni.zero();
|
||||||
@ -708,6 +716,7 @@ bool TVar_mov::setta_campi_maschera_iva(TMask& m)
|
|||||||
m.set(F_PROVOCC, prov);
|
m.set(F_PROVOCC, prov);
|
||||||
m.set(F_COMOCC, com);
|
m.set(F_COMOCC, com);
|
||||||
m.set(F_CFPI, ocfpi);
|
m.set(F_CFPI, ocfpi);
|
||||||
|
m.set(F_PROVV, provvis);
|
||||||
|
|
||||||
m.disable(F_NUMREG);
|
m.disable(F_NUMREG);
|
||||||
m.disable(F_NUMRIG);
|
m.disable(F_NUMRIG);
|
||||||
@ -722,6 +731,7 @@ bool TVar_mov::setta_campi_maschera_iva(TMask& m)
|
|||||||
m.enable(F_LOCALITA);
|
m.enable(F_LOCALITA);
|
||||||
m.enable(F_CAPOCC);
|
m.enable(F_CAPOCC);
|
||||||
m.enable(F_PROVOCC);
|
m.enable(F_PROVOCC);
|
||||||
|
m.enable(F_PROVV);
|
||||||
m.disable(F_IMPONIBILE);
|
m.disable(F_IMPONIBILE);
|
||||||
m.disable(F_CODIVA);
|
m.disable(F_CODIVA);
|
||||||
m.disable(F_IMPOSTA);
|
m.disable(F_IMPOSTA);
|
||||||
@ -732,7 +742,6 @@ bool TVar_mov::setta_campi_maschera_iva(TMask& m)
|
|||||||
m.disable(F_SOTTOCONTO);
|
m.disable(F_SOTTOCONTO);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (_righe)
|
|
||||||
{
|
{
|
||||||
TString tipodoc(_rec_mov->get(MOV_TIPODOC));
|
TString tipodoc(_rec_mov->get(MOV_TIPODOC));
|
||||||
real imponibile (_tiva->get_real(RMI_IMPONIBILE));
|
real imponibile (_tiva->get_real(RMI_IMPONIBILE));
|
||||||
@ -767,7 +776,7 @@ bool TVar_mov::setta_campi_maschera_iva(TMask& m)
|
|||||||
m.disable(F_LOCALITA);
|
m.disable(F_LOCALITA);
|
||||||
m.disable(F_CAPOCC);
|
m.disable(F_CAPOCC);
|
||||||
m.disable(F_PROVOCC);
|
m.disable(F_PROVOCC);
|
||||||
|
m.disable(F_PROVV);
|
||||||
m.enable(F_IMPONIBILE);
|
m.enable(F_IMPONIBILE);
|
||||||
m.enable(F_CODIVA);
|
m.enable(F_CODIVA);
|
||||||
m.enable(F_IMPOSTA);
|
m.enable(F_IMPOSTA);
|
||||||
@ -828,7 +837,7 @@ bool TVar_mov::codice_causale_hnd(TMask_field& f, KEY k)
|
|||||||
return warning_box("Il codice registro IVA e' significativo: deve essere significativo anche il codice causale");
|
return warning_box("Il codice registro IVA e' significativo: deve essere significativo anche il codice causale");
|
||||||
}
|
}
|
||||||
|
|
||||||
TLocalisamfile cau (LF_CAUSALI);
|
TLocalisamfile& cau = *app()._causali;
|
||||||
cau.setkey(1);
|
cau.setkey(1);
|
||||||
cau.zero();
|
cau.zero();
|
||||||
cau.put("CODCAUS", codcau);
|
cau.put("CODCAUS", codcau);
|
||||||
@ -1254,7 +1263,7 @@ void TVar_mov::datacompetenza(int anno, TString& datacomp)
|
|||||||
|
|
||||||
void TVar_mov::ricerca_localita(TString& codcom, TString& den, TString& cap, TString& prov)
|
void TVar_mov::ricerca_localita(TString& codcom, TString& den, TString& cap, TString& prov)
|
||||||
{
|
{
|
||||||
TLocalisamfile com (LF_COMUNI);
|
TLocalisamfile& com = *_comuni;
|
||||||
|
|
||||||
com.setkey(1);
|
com.setkey(1);
|
||||||
com.zero();
|
com.zero();
|
||||||
@ -1286,13 +1295,12 @@ void TVar_mov::registra_PN(TMask& m)
|
|||||||
TString regiva = m.get (F_REGIVA);
|
TString regiva = m.get (F_REGIVA);
|
||||||
long protiva = m.get_long(F_PROTIVA);
|
long protiva = m.get_long(F_PROTIVA);
|
||||||
long nuprotiva = m.get_long(F_NUPROTIVA);
|
long nuprotiva = m.get_long(F_NUPROTIVA);
|
||||||
TString codcaus = m.get (F_CODCAUS);
|
TString codcaus = m.get(F_CODCAUS);
|
||||||
TString codpag = m.get (F_CODPAG);
|
TString codpag = m.get(F_CODPAG);
|
||||||
|
char provvis = m.get(F_PROVV)[0];
|
||||||
registra_file_temp_mov(anno,numreg,datareg,datacomp,datadoc,numdoc,regiva,protiva,nuprotiva,codcaus,codpag);
|
registra_file_temp_mov(anno,numreg,datareg,datacomp,datadoc,numdoc,regiva,protiva,nuprotiva,codcaus,codpag,provvis);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (_righe)
|
|
||||||
{
|
{
|
||||||
long numreg = m.get_long(F_NUMREG);
|
long numreg = m.get_long(F_NUMREG);
|
||||||
int numrig = m.get_int (F_NUMRIG);
|
int numrig = m.get_int (F_NUMRIG);
|
||||||
@ -1310,8 +1318,12 @@ void TVar_mov::registra_PN(TMask& m)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TVar_mov::registra_file_temp_mov(int ae,long nr,const TDate& dr,const TDate& dc,const TDate& dd,
|
void TVar_mov::registra_file_temp_mov(int ae,long nr,
|
||||||
const TString& nd,TString& ri,long pi,long upi,const TString& cc,TString& cp)
|
const TDate& dr,const TDate& dc,const TDate& dd,
|
||||||
|
const TString& nd,TString& ri,
|
||||||
|
long pi,long upi,
|
||||||
|
const TString& cc, TString& cp,
|
||||||
|
char pr)
|
||||||
{
|
{
|
||||||
_tmov->setkey(1);
|
_tmov->setkey(1);
|
||||||
_tmov->zero();
|
_tmov->zero();
|
||||||
@ -1329,9 +1341,8 @@ void TVar_mov::registra_file_temp_mov(int ae,long nr,const TDate& dr,const TDate
|
|||||||
_tmov->put(MOV_UPROTIVA, upi);
|
_tmov->put(MOV_UPROTIVA, upi);
|
||||||
_tmov->put(MOV_CODCAUS, cc);
|
_tmov->put(MOV_CODCAUS, cc);
|
||||||
_tmov->put(MOV_CODPAG, cp);
|
_tmov->put(MOV_CODPAG, cp);
|
||||||
int ai = dr.year();
|
_tmov->put(MOV_ANNOIVA, dr.year());
|
||||||
_tmov->put(MOV_ANNOIVA, ai);
|
_tmov->put(MOV_PROVVIS, pr);
|
||||||
|
|
||||||
_tmov->rewrite();
|
_tmov->rewrite();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#define F_DESCRPARTITA 124
|
#define F_DESCRPARTITA 124
|
||||||
#define F_DESCRCPARTITA 125
|
#define F_DESCRCPARTITA 125
|
||||||
#define F_DATACOMP 126
|
#define F_DATACOMP 126
|
||||||
|
#define F_PROVV 127
|
||||||
|
|
||||||
// Campi maschera cg2800c.uml
|
// Campi maschera cg2800c.uml
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ END
|
|||||||
|
|
||||||
ENDPAGE
|
ENDPAGE
|
||||||
|
|
||||||
PAGE "" -1 -1 78 18
|
PAGE "Movimento" -1 -1 78 18
|
||||||
|
|
||||||
NUMBER F_NUMREG 6
|
NUMBER F_NUMREG 6
|
||||||
BEGIN
|
BEGIN
|
||||||
@ -114,6 +114,14 @@ BEGIN
|
|||||||
FLAGS "D"
|
FLAGS "D"
|
||||||
END
|
END
|
||||||
|
|
||||||
|
LIST F_PROVV 1 16
|
||||||
|
BEGIN
|
||||||
|
PROMPT 1 10 "Movimento provvisorio "
|
||||||
|
ITEM " |No (Definitivo)"
|
||||||
|
ITEM "C|Cespiti"
|
||||||
|
ITEM "P|Contabile"
|
||||||
|
END
|
||||||
|
|
||||||
NUMBER F_GRUPPO 3
|
NUMBER F_GRUPPO 3
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 11 "Sottoconto partita "
|
PROMPT 1 11 "Sottoconto partita "
|
||||||
|
@ -57,6 +57,14 @@ BEGIN
|
|||||||
PROMPT 1 4 "Data reg. 74TER "
|
PROMPT 1 4 "Data reg. 74TER "
|
||||||
END
|
END
|
||||||
|
|
||||||
|
LIST F_PROVV 1 16
|
||||||
|
BEGIN
|
||||||
|
PROMPT 36 4 "Movimento provvisorio "
|
||||||
|
ITEM " |No (Definitivo)"
|
||||||
|
ITEM "C|Cespiti"
|
||||||
|
ITEM "P|Contabile"
|
||||||
|
END
|
||||||
|
|
||||||
GROUPBOX DLG_NULL 78 5
|
GROUPBOX DLG_NULL 78 5
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 0 6 "Cliente occasionale"
|
PROMPT 0 6 "Cliente occasionale"
|
||||||
|
@ -398,6 +398,7 @@ bool TInv_cont::create()
|
|||||||
_part = new TLocalisamfile (LF_PARTITE);
|
_part = new TLocalisamfile (LF_PARTITE);
|
||||||
_scad = new TLocalisamfile (LF_SCADENZE);
|
_scad = new TLocalisamfile (LF_SCADENZE);
|
||||||
_pagsca = new TLocalisamfile (LF_PAGSCA);
|
_pagsca = new TLocalisamfile (LF_PAGSCA);
|
||||||
|
_comuni = new TLocalisamfile (LF_COMUNI);
|
||||||
|
|
||||||
dispatch_e_menu (BAR_ITEM(1));
|
dispatch_e_menu (BAR_ITEM(1));
|
||||||
|
|
||||||
@ -417,6 +418,7 @@ bool TInv_cont::destroy()
|
|||||||
delete _part;
|
delete _part;
|
||||||
delete _scad;
|
delete _scad;
|
||||||
delete _pagsca;
|
delete _pagsca;
|
||||||
|
delete _comuni;
|
||||||
|
|
||||||
return TApplication::destroy();
|
return TApplication::destroy();
|
||||||
}
|
}
|
||||||
@ -871,7 +873,7 @@ void TInv_cont::crea_marker(TMask& m)
|
|||||||
{
|
{
|
||||||
if (_scelta == 'S')
|
if (_scelta == 'S')
|
||||||
{
|
{
|
||||||
str = format("%-10s", (const char*) _nome_simbolico);
|
str.format("%-10s", (const char*)_nome_simbolico);
|
||||||
buffer.overwrite(str,0);
|
buffer.overwrite(str,0);
|
||||||
long ditta = m.get_long(F_DITTAINV);
|
long ditta = m.get_long(F_DITTAINV);
|
||||||
if (ditta > 9999)
|
if (ditta > 9999)
|
||||||
@ -1406,7 +1408,7 @@ void TInv_cont::pcon2tempfile(TString& key, TMask& m)
|
|||||||
}
|
}
|
||||||
|
|
||||||
leggi_record_controllo();
|
leggi_record_controllo();
|
||||||
TString chiave;
|
TString16 chiave;
|
||||||
chiave.format("%3d%3d%6ld", g, c, s);
|
chiave.format("%3d%3d%6ld", g, c, s);
|
||||||
TString sigla (format("%c", 'P'));
|
TString sigla (format("%c", 'P'));
|
||||||
_control_rec.overwrite(sigla,240);
|
_control_rec.overwrite(sigla,240);
|
||||||
|
@ -58,6 +58,7 @@ class TInv_cont : public TApplication
|
|||||||
TLocalisamfile* _part;
|
TLocalisamfile* _part;
|
||||||
TLocalisamfile* _scad;
|
TLocalisamfile* _scad;
|
||||||
TLocalisamfile* _pagsca;
|
TLocalisamfile* _pagsca;
|
||||||
|
TLocalisamfile* _comuni;
|
||||||
TIsamtempfile* _tcaus;
|
TIsamtempfile* _tcaus;
|
||||||
TIsamtempfile* _trcaus;
|
TIsamtempfile* _trcaus;
|
||||||
TIsamtempfile* _tclifo;
|
TIsamtempfile* _tclifo;
|
||||||
@ -73,7 +74,6 @@ class TInv_cont : public TApplication
|
|||||||
TAssoc_array _riga_interna, _ultima_rata;
|
TAssoc_array _riga_interna, _ultima_rata;
|
||||||
TArray _tab_cau; // tabella di corrispondenza causali per invio saldaconto extracontabile a sistema
|
TArray _tab_cau; // tabella di corrispondenza causali per invio saldaconto extracontabile a sistema
|
||||||
|
|
||||||
|
|
||||||
char _scelta;
|
char _scelta;
|
||||||
|
|
||||||
TString _control_rec, _header, _trasf, _std, _stato, _marker, _nome_simbolico;
|
TString _control_rec, _header, _trasf, _std, _stato, _marker, _nome_simbolico;
|
||||||
@ -86,6 +86,7 @@ class TInv_cont : public TApplication
|
|||||||
int _num,_annoes;
|
int _num,_annoes;
|
||||||
TDate _data, _datadoc, _data74ter,_datalimsk,_dataregiva,_datareg;
|
TDate _data, _datadoc, _data74ter,_datalimsk,_dataregiva,_datareg;
|
||||||
real _corrlire, _cambioi, _corrval,_cambio;
|
real _corrlire, _cambioi, _corrval,_cambio;
|
||||||
|
char _provvis;
|
||||||
long _ultima_nreg;
|
long _ultima_nreg;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -971,6 +971,7 @@ void TInv_cont::testata_mov_PN()
|
|||||||
_protiva = _tmov->get_long(MOV_PROTIVA);
|
_protiva = _tmov->get_long(MOV_PROTIVA);
|
||||||
_uprotiva = _tmov->get_long(MOV_UPROTIVA);
|
_uprotiva = _tmov->get_long(MOV_UPROTIVA);
|
||||||
_inviato = _tmov->get_bool(MOV_INVIATO);
|
_inviato = _tmov->get_bool(MOV_INVIATO);
|
||||||
|
_provvis = _tmov->get_char(MOV_PROVVIS);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TInv_cont::testata_trasfer(long nreg, int nrig, TString& record)
|
void TInv_cont::testata_trasfer(long nreg, int nrig, TString& record)
|
||||||
@ -1225,6 +1226,7 @@ bool TInv_cont::testata_mov_IVA(long numreg)
|
|||||||
_dataregiva = _tmov->get_date(MOV_DATAREG);
|
_dataregiva = _tmov->get_date(MOV_DATAREG);
|
||||||
_inviato = _tmov->get_bool(MOV_INVIVA);
|
_inviato = _tmov->get_bool(MOV_INVIVA);
|
||||||
_tipodoc = _tmov->get (MOV_TIPODOC);
|
_tipodoc = _tmov->get (MOV_TIPODOC);
|
||||||
|
_provvis = _tmov->get_char(MOV_PROVVIS);
|
||||||
if (_ocfpi.not_empty())
|
if (_ocfpi.not_empty())
|
||||||
cerca_occasionale();
|
cerca_occasionale();
|
||||||
}
|
}
|
||||||
|
@ -670,7 +670,7 @@ void TInv_cont::invio_testata_movimenti()
|
|||||||
|
|
||||||
for (_tmov->first(); !_tmov->eof(); _tmov->next())
|
for (_tmov->first(); !_tmov->eof(); _tmov->next())
|
||||||
{
|
{
|
||||||
TString str;
|
TString str(80);
|
||||||
|
|
||||||
_prog->addstatus(1);
|
_prog->addstatus(1);
|
||||||
|
|
||||||
@ -700,7 +700,7 @@ void TInv_cont::invio_testata_movimenti()
|
|||||||
TString data74ter = _tmov->get(MOV_DATA74TER);
|
TString data74ter = _tmov->get(MOV_DATA74TER);
|
||||||
datastr = riconverti(data74ter,TRUE);
|
datastr = riconverti(data74ter,TRUE);
|
||||||
str.format("%08s", (const char*) datastr);
|
str.format("%08s", (const char*) datastr);
|
||||||
record.overwrite(str,84); //Data di registrazione
|
record.overwrite(str,84); //Data di 74 ter
|
||||||
|
|
||||||
TString numdoc = _tmov->get(MOV_NUMDOC);
|
TString numdoc = _tmov->get(MOV_NUMDOC);
|
||||||
str.format("%-7s", (const char*) numdoc);
|
str.format("%-7s", (const char*) numdoc);
|
||||||
@ -828,6 +828,9 @@ void TInv_cont::invio_testata_movimenti()
|
|||||||
str.format("%-16s", (const char*) ocfpi);
|
str.format("%-16s", (const char*) ocfpi);
|
||||||
record.overwrite(str,274);
|
record.overwrite(str,274);
|
||||||
|
|
||||||
|
TString16 provvis = _tmov->get(MOV_PROVVIS);
|
||||||
|
record.overwrite(provvis, 523);
|
||||||
|
|
||||||
if (ocfpi.not_empty())
|
if (ocfpi.not_empty())
|
||||||
invio_occasionali(record,ocfpi);
|
invio_occasionali(record,ocfpi);
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
#include <causali.h>
|
#include <causali.h>
|
||||||
#include <mov.h>
|
#include <mov.h>
|
||||||
|
#include <pconti.h>
|
||||||
#include <rmov.h>
|
#include <rmov.h>
|
||||||
#include <saldi.h>
|
#include <saldi.h>
|
||||||
|
|
||||||
@ -92,7 +93,7 @@ TSaldo::TSaldo() : _saldi(LF_SALDI), _saldoiniziale(ZERO), _saldo_iniziale(ZERO)
|
|||||||
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
real TSaldo::saldofin_esprec(int annoes, int g, int c, long s, bool saldo_chiusura, bool mov_prec)
|
real TSaldo::saldofin_esprec(int annoes, int g, int c, long s, bool saldo_chiusura)
|
||||||
{
|
{
|
||||||
const int annoesprec = EsePre(annoes);
|
const int annoesprec = EsePre(annoes);
|
||||||
_significativo = FALSE;
|
_significativo = FALSE;
|
||||||
@ -532,7 +533,7 @@ class TContoExt : public TConto
|
|||||||
{
|
{
|
||||||
bool _scaricato;
|
bool _scaricato;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
bool scaricato() const { return _scaricato; }
|
bool scaricato() const { return _scaricato; }
|
||||||
|
|
||||||
@ -713,9 +714,10 @@ void TSaldo_agg::registra()
|
|||||||
THash_object* hobj = _tab_conti.get_hashobj();
|
THash_object* hobj = _tab_conti.get_hashobj();
|
||||||
TContoExt& tcon = (TContoExt&)hobj->obj();
|
TContoExt& tcon = (TContoExt&)hobj->obj();
|
||||||
CHECK(tcon.ok(), "Tentativo di saldare un conto incompleto");
|
CHECK(tcon.ok(), "Tentativo di saldare un conto incompleto");
|
||||||
|
const int annoes = atoi(hobj->key().left(4));
|
||||||
|
|
||||||
saldi.zero();
|
saldi.zero();
|
||||||
saldi.put(SLD_ANNOES, atoi(hobj->key().left(4)) );
|
saldi.put(SLD_ANNOES, annoes);
|
||||||
saldi.put(SLD_GRUPPO, tcon.gruppo());
|
saldi.put(SLD_GRUPPO, tcon.gruppo());
|
||||||
saldi.put(SLD_CONTO, tcon.conto());
|
saldi.put(SLD_CONTO, tcon.conto());
|
||||||
saldi.put(SLD_SOTTOCONTO, tcon.sottoconto());
|
saldi.put(SLD_SOTTOCONTO, tcon.sottoconto());
|
||||||
@ -816,6 +818,29 @@ void TSaldo_agg::registra()
|
|||||||
err, tcon.gruppo(), tcon.conto(), tcon.sottoconto());
|
err, tcon.gruppo(), tcon.conto(), tcon.sottoconto());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Calcolo saldo finale per controllo segno in prima nota
|
||||||
|
if (si.is_zero())
|
||||||
|
{
|
||||||
|
TLocalisamfile pcon(LF_PCON);
|
||||||
|
TRectype& curr = pcon.curr();
|
||||||
|
curr.put(PCN_GRUPPO, tcon.gruppo());
|
||||||
|
curr.put(PCN_CONTO, tcon.conto());
|
||||||
|
const int err = pcon.read();
|
||||||
|
CHECK(err == NOERR, "Impossibile stabilire indicatore di bilancio");
|
||||||
|
const int indbil = curr.get_int(PCN_INDBIL);
|
||||||
|
if (indbil == 1 || indbil == 2 || indbil == 5)
|
||||||
|
{
|
||||||
|
TSaldo saldo;
|
||||||
|
si = saldo.saldofin_esprec(annoes, tcon.gruppo(), tcon.conto(), tcon.sottoconto());
|
||||||
|
if (si < ZERO)
|
||||||
|
{
|
||||||
|
flag_salini = 'A'; si = -si;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
flag_salini = 'D';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TImporto sf(flag_salini, si);
|
TImporto sf(flag_salini, si);
|
||||||
const TImporto dare('D', saldi.get_real(SLD_PDARE));
|
const TImporto dare('D', saldi.get_real(SLD_PDARE));
|
||||||
const TImporto avere('A', saldi.get_real(SLD_PAVERE));
|
const TImporto avere('A', saldi.get_real(SLD_PAVERE));
|
||||||
|
@ -106,7 +106,7 @@ public:
|
|||||||
|
|
||||||
bool ricerca_progr_prec(int, int, int, long);
|
bool ricerca_progr_prec(int, int, int, long);
|
||||||
|
|
||||||
real saldofin_esprec(int,int,int,long,bool saldo_chiusura = FALSE,bool mov_prec = FALSE);
|
real saldofin_esprec(int,int,int,long,bool saldo_chiusura = FALSE);
|
||||||
bool prg_attuali(int i,TConto& c, real& p1, real& p2)
|
bool prg_attuali(int i,TConto& c, real& p1, real& p2)
|
||||||
{ return prg_saldo(i, c, p1, p2, FALSE); }
|
{ return prg_saldo(i, c, p1, p2, FALSE); }
|
||||||
bool prg_mov_eliminati(int i, TConto& c, real& p1, real& p2)
|
bool prg_mov_eliminati(int i, TConto& c, real& p1, real& p2)
|
||||||
|
@ -31,7 +31,7 @@ int fremove(const char* path)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
//ritorna falso se la causale non e' significativa
|
//ritorna falso se la causale non e' significativa
|
||||||
bool look_causale (const char* codcaus)
|
HIDDEN bool look_causale (const char* codcaus)
|
||||||
{
|
{
|
||||||
TString16 caus = codcaus;
|
TString16 caus = codcaus;
|
||||||
if (caus == "000")
|
if (caus == "000")
|
||||||
@ -4215,6 +4215,7 @@ void TTransfer_file::write_testata_movimenti(TString& record)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fname == MOV_OCFPI)
|
if (fname == MOV_OCFPI)
|
||||||
|
{
|
||||||
if (field.trim().empty())
|
if (field.trim().empty())
|
||||||
{
|
{
|
||||||
TString rags = record.sub(290,340);
|
TString rags = record.sub(290,340);
|
||||||
@ -4227,6 +4228,7 @@ void TTransfer_file::write_testata_movimenti(TString& record)
|
|||||||
else
|
else
|
||||||
occas = FALSE;
|
occas = FALSE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (flag == 2)
|
if (flag == 2)
|
||||||
{
|
{
|
||||||
|
@ -166,6 +166,7 @@ Z1|29|454|458|18|CAP|4||
|
|||||||
Z1|30|459|466|18|DNASC|4||
|
Z1|30|459|466|18|DNASC|4||
|
||||||
Z1|31|467|469|18|STATONASC|4||
|
Z1|31|467|469|18|STATONASC|4||
|
||||||
Z1|32|470|473|18|COMNASC|4||
|
Z1|32|470|473|18|COMNASC|4||
|
||||||
|
Z1|33|524|524|23|PROVVIS|||
|
||||||
Z2|1|3|9|24|NUMREG|||
|
Z2|1|3|9|24|NUMREG|||
|
||||||
Z2|2|10|12|24|NUMRIG|||
|
Z2|2|10|12|24|NUMRIG|||
|
||||||
Z2|3|61|61|24|SEZIONE|||
|
Z2|3|61|61|24|SEZIONE|||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user