Correzioni a bilanci lista movimenti
git-svn-id: svn://10.65.10.50/trunk@1272 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
cc5dc6d872
commit
8abc9f2ba8
150
cg/cg1500.cpp
150
cg/cg1500.cpp
@ -65,11 +65,12 @@ class CG1500_application : public TPrintapp
|
||||
TCursor * _cur;
|
||||
TProgind * _prog;
|
||||
TSaldi_list* _listacf, * _lista;
|
||||
TLocalisamfile* _com, * _pcn, * _mov, * _rmov, * _clifo, * _saldi, * _nditte,* _anag;
|
||||
TLocalisamfile* _com, * _pcn, * _mov, * _rmov, * _clifo, * _saldi, * _nditte,* _anag,* _caus;
|
||||
TIsamtempfile * _tmp_saldi_att, * _tmp_saldi_pass, * _tmp_saldi_conti_uno;
|
||||
TIsamtempfile * _tmp_saldi_costi, * _tmp_saldi_ricavi,* _tmp_saldi_conti_due;
|
||||
TTable* _esc;
|
||||
|
||||
TParagraph_string* _d;
|
||||
|
||||
TString _cofi,_cap,_paiva,_ragsoc,_comunefis,_provfis,_viafis;
|
||||
TString _descr_dare, _descr_avere, _gc_corr_dare, _gc_corr_avere, _descr;
|
||||
TString _gc_prec_dare, _gc_prec_avere, _situazione, _descr_succ;
|
||||
@ -100,7 +101,7 @@ class CG1500_application : public TPrintapp
|
||||
bool _add_file_dare, _prima_volta, _seconda_volta, _totali, _codici, _saldo;
|
||||
bool _add_dare, _add_avere, _controlla, _salto_pagina, _flag, _stampato;
|
||||
bool _sottoc_dare, _sottoc_avere, _salto_pagina1, _livello_conto;
|
||||
bool _stampa_mov_prov;
|
||||
int _stampa_mov_prov;
|
||||
//TString _causale_ap, _causale_chi;
|
||||
TArray _clienti, _fornitori;
|
||||
|
||||
@ -138,7 +139,7 @@ public:
|
||||
const real&, const real&);
|
||||
void scrivi_record_gruppo(const real&,const real&,const real&,
|
||||
const real&, const real&);
|
||||
int stampa_record_conto(int,int,const char*,const real&,const real&,
|
||||
int stampa_record_conto(int,int,const TString&,const real&,const real&,
|
||||
const real&,const real&,const real&,const char);
|
||||
int stampa_intestazione_ditta();
|
||||
int cerca_indbil(int,int);
|
||||
@ -267,7 +268,7 @@ bool mask_anno(TMask_field& f, KEY k)
|
||||
{
|
||||
f.mask().show(F_DATADA);
|
||||
f.mask().show(F_DATAA);
|
||||
f.mask().show(F_STAMPAMPROV);
|
||||
//f.mask().show(F_STAMPAMPROV);
|
||||
f.mask().show(96);
|
||||
f.mask().show(97);
|
||||
f.mask().hide(98);
|
||||
@ -277,7 +278,7 @@ bool mask_anno(TMask_field& f, KEY k)
|
||||
{
|
||||
f.mask().show(F_DATADA);
|
||||
f.mask().show(F_DATAA);
|
||||
f.mask().show(F_STAMPAMPROV);
|
||||
//f.mask().show(F_STAMPAMPROV);
|
||||
f.mask().show(98);
|
||||
f.mask().show(99);
|
||||
f.mask().hide(96);
|
||||
@ -311,7 +312,7 @@ bool mask_bilancio(TMask_field& f, KEY k)
|
||||
{
|
||||
m.hide(F_DATADA);
|
||||
m.hide(F_DATAA);
|
||||
m.hide(F_STAMPAMPROV);
|
||||
//m.hide(F_STAMPAMPROV);
|
||||
m.hide(98);
|
||||
m.hide(99);
|
||||
m.hide(96);
|
||||
@ -324,7 +325,7 @@ else
|
||||
{
|
||||
m.show(F_DATADA);
|
||||
m.show(F_DATAA);
|
||||
m.show(F_STAMPAMPROV);
|
||||
//m.show(F_STAMPAMPROV);
|
||||
m.show(96);
|
||||
m.show(97);
|
||||
m.hide(98);
|
||||
@ -334,7 +335,7 @@ else
|
||||
{
|
||||
m.show(F_DATADA);
|
||||
m.show(F_DATAA);
|
||||
m.show(F_STAMPAMPROV);
|
||||
//m.show(F_STAMPAMPROV);
|
||||
m.show(98);
|
||||
m.show(99);
|
||||
m.hide(96);
|
||||
@ -470,7 +471,7 @@ bool my_handler (TMask_field& f, KEY k)
|
||||
f.mask().show (F_STAMPAV);
|
||||
f.mask().show (F_DATADA);
|
||||
f.mask().show (F_DATAA);
|
||||
f.mask().show (F_STAMPAMPROV);
|
||||
//f.mask().show (F_STAMPAMPROV);
|
||||
}
|
||||
if ( (tipo_stampa == 1) && (verifica == 3) )
|
||||
{
|
||||
@ -480,7 +481,7 @@ bool my_handler (TMask_field& f, KEY k)
|
||||
f.mask().show (F_DATADA);
|
||||
f.mask().show (F_DATAA);
|
||||
f.mask().hide (F_STAMPAV);
|
||||
f.mask().show (F_STAMPAMPROV);
|
||||
//f.mask().show (F_STAMPAMPROV);
|
||||
}
|
||||
if ( (tipo_stampa == 2) && ((verifica == 1)||(verifica == 2)) )
|
||||
{
|
||||
@ -489,7 +490,7 @@ bool my_handler (TMask_field& f, KEY k)
|
||||
f.mask().hide (F_ORDINAMENTO);
|
||||
f.mask().hide (F_DATADA);
|
||||
f.mask().hide (F_DATAA);
|
||||
f.mask().hide (F_STAMPAMPROV);
|
||||
//f.mask().hide (F_STAMPAMPROV);
|
||||
f.mask().show (F_STAMPAV);
|
||||
}
|
||||
if ( (tipo_stampa == 2) && (verifica == 3) )
|
||||
@ -499,7 +500,7 @@ bool my_handler (TMask_field& f, KEY k)
|
||||
f.mask().show (F_ORDINAMENTO);
|
||||
f.mask().hide (F_DATADA);
|
||||
f.mask().hide (F_DATAA);
|
||||
f.mask().hide (F_STAMPAMPROV);
|
||||
//f.mask().hide (F_STAMPAMPROV);
|
||||
f.mask().hide (F_STAMPAV);
|
||||
}
|
||||
}
|
||||
@ -778,7 +779,7 @@ bool CG1500_application::bil_sez_contr()
|
||||
bool esiste_conto=FALSE, esiste_sc = FALSE;
|
||||
bool movimentato = FALSE;
|
||||
|
||||
CHECK(_tmp_saldi_att == NULL, "La minchia che riapro cg01"); //Messaggio di Ferdinando, non mio!!!
|
||||
CHECK(_tmp_saldi_att == NULL, "Non posso riaprire cg01");
|
||||
_tmp_saldi_att = new TIsamtempfile(LF_SALDI, "cg01", 2);
|
||||
_prog->addstatus(1);
|
||||
_tmp_saldi_pass = new TIsamtempfile(LF_SALDI, "cg02", 2);
|
||||
@ -892,7 +893,7 @@ bool CG1500_application::bil_sez_contr()
|
||||
movimentato = sld.data_limite_bilancio(_bilancio,g,c,s,_dataini,_datalim,indbil_conto,_stampa_mov_prov);
|
||||
else
|
||||
if (_tipo_stampa == 2) //bil. a sez. contrapposte all'ultima immissione es. in corso
|
||||
movimentato = sld.ultima_immissione_bilancio(_annoes,g,c,s,indbil_conto);
|
||||
movimentato = sld.ultima_immissione_bilancio(_annoes,g,c,s,indbil_conto,_stampa_mov_prov);
|
||||
|
||||
if (!movimentato)
|
||||
if (!sld.esiste_saldo() || !sld.significativo())
|
||||
@ -1024,7 +1025,7 @@ bool CG1500_application::ricerca_sottoc_clifo(int g,int c, bool compensa, int in
|
||||
if (_tipo_stampa == 1) //bil. a sez. contrapposte per data limite
|
||||
movimentato = sld.data_limite_bilancio(_bilancio,g,c,s,_dataini,_datalim,indbil_conto,_stampa_mov_prov);
|
||||
else if (_tipo_stampa == 2) //bil. a sez. contrapposte all'ultima immissione es. in corso
|
||||
movimentato = sld.ultima_immissione_bilancio(_annoes,g,c,s,indbil_conto);
|
||||
movimentato = sld.ultima_immissione_bilancio(_annoes,g,c,s,indbil_conto,_stampa_mov_prov);
|
||||
|
||||
if (!movimentato)
|
||||
if (!sld.esiste_saldo() || !sld.significativo())
|
||||
@ -1121,7 +1122,7 @@ bool CG1500_application::bil_verifica()
|
||||
real mov_gruppo_dare, mov_gruppo_avere, prg_gruppo_dare, prg_gruppo_avere;
|
||||
bool esiste_conto = FALSE, esiste_sc = FALSE, movimentato = FALSE;
|
||||
|
||||
CHECK(_tmp_saldi_att == NULL, "La minchia che riapro cg01"); //Messaggio di Ferdinando, non mio!!!
|
||||
CHECK(_tmp_saldi_att == NULL, "Non posso riaprire cg01");
|
||||
_tmp_saldi_att = new TIsamtempfile(LF_SALDI, "cg01", 2);
|
||||
|
||||
_gp=-1;
|
||||
@ -1304,12 +1305,13 @@ bool CG1500_application::bil_verifica()
|
||||
//if (!sld.ultima_immissione_bilancio(_annoes,g,c,s,indbil_conto))
|
||||
// if (_stampav == 1)
|
||||
// continue;
|
||||
movimentato = sld.ultima_immissione_verifica(_annoes,g,c,s,indbil_conto);
|
||||
movimentato = sld.ultima_immissione_verifica(_annoes,g,c,s,indbil_conto,_stampa_mov_prov);
|
||||
|
||||
//modifica del 31/03/95
|
||||
if (!movimentato && _stampav!=1)
|
||||
if (indbil_conto == 1 || indbil_conto == 2 || indbil_conto == 5)
|
||||
saldo_iniziale = sld.saldofin_esprec(_annoes,g,c,s);
|
||||
if (_stampa_mov_prov != 3)
|
||||
if (!movimentato && _stampav!=1)
|
||||
if (indbil_conto == 1 || indbil_conto == 2 || indbil_conto == 5)
|
||||
saldo_iniziale = sld.saldofin_esprec(_annoes,g,c,s);
|
||||
|
||||
if (movimentato)
|
||||
saldo_iniziale = sld.saldoini();
|
||||
@ -1426,6 +1428,7 @@ bool CG1500_application::bil_verifica()
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//bilancio di verifica per data limite
|
||||
bool CG1500_application::calcola(int g, int c, long s)
|
||||
{
|
||||
char sezione, provvis;
|
||||
@ -1472,9 +1475,12 @@ bool CG1500_application::calcola(int g, int c, long s)
|
||||
provvis = mov.get_char(MOV_PROVVIS);
|
||||
datacomp = mov.get_date(MOV_DATACOMP);
|
||||
|
||||
if ( (!_stampa_mov_prov)&&(provvis == ' ') ) //se non richiesto
|
||||
continue; //stampa mov provv.
|
||||
if (_stampa_mov_prov == 1 && provvis != '\0') //bilancio normale (non comprende i provvisori)
|
||||
continue;
|
||||
|
||||
if (_stampa_mov_prov == 3 && provvis == '\0') //bilancio dei soli provvisori
|
||||
continue;
|
||||
|
||||
TString codcaus(mov.get(MOV_CODCAUS));
|
||||
|
||||
// if (codcaus.not_empty())
|
||||
@ -1611,7 +1617,7 @@ bool CG1500_application::ricerca_cf(int g,int c,char tipocf,int ib, real& saldo_
|
||||
{
|
||||
//Attenzione! Nel caso di "tutti i conti" devono scendere solo i cli/for movimentati!!!
|
||||
//modifica del 31/03/1995
|
||||
bool movimentato = sld.ultima_immissione_verifica(_annoes,g,c,s,_indbil);
|
||||
bool movimentato = sld.ultima_immissione_verifica(_annoes,g,c,s,_indbil,_stampa_mov_prov);
|
||||
|
||||
saldo_iniziale = sld.saldoini();
|
||||
|
||||
@ -1623,12 +1629,13 @@ bool CG1500_application::ricerca_cf(int g,int c,char tipocf,int ib, real& saldo_
|
||||
//se esiste tale record e almeno un valore e' significativo (indipendentemente dal valore
|
||||
//del saldo iniziale calcolato, allora metto a TRUE il flag movimentato
|
||||
//solo se e' un conto patrimoniale
|
||||
if (ib == 1 || ib == 2 || ib == 5)
|
||||
{
|
||||
saldo_iniziale = sld.saldofin_esprec(_annoes,g,c,s);
|
||||
//movimentato = sld.esiste_saldo_ep();
|
||||
movimentato = sld.significativo();
|
||||
}
|
||||
if (_stampa_mov_prov != 3)
|
||||
if (ib == 1 || ib == 2 || ib == 5)
|
||||
{
|
||||
saldo_iniziale = sld.saldofin_esprec(_annoes,g,c,s);
|
||||
//movimentato = sld.esiste_saldo_ep();
|
||||
movimentato = sld.significativo();
|
||||
}
|
||||
}
|
||||
|
||||
if (!movimentato)
|
||||
@ -1975,11 +1982,12 @@ void CG1500_application::crea_sort_clifo()
|
||||
//if (!sld.ultima_immissione_bilancio(_annoes,g,c,codcf,_indbil))
|
||||
// if (_stampac == 1)
|
||||
// continue;
|
||||
movimentato = sld.ultima_immissione_verifica(anno,g,c,codcf,_indbil);
|
||||
movimentato = sld.ultima_immissione_verifica(anno,g,c,codcf,_indbil,_stampa_mov_prov);
|
||||
|
||||
if (!movimentato && _stampac!=1)
|
||||
if (_indbil == 1 || _indbil == 2 || _indbil == 5)
|
||||
saldo_iniziale = sld.saldofin_esprec(anno,g,c,codcf);
|
||||
if (_stampa_mov_prov != 3)
|
||||
if (!movimentato && _stampac!=1)
|
||||
if (_indbil == 1 || _indbil == 2 || _indbil == 5)
|
||||
saldo_iniziale = sld.saldofin_esprec(anno,g,c,codcf);
|
||||
|
||||
if (movimentato)
|
||||
saldo_iniziale = sld.saldoini();
|
||||
@ -2457,11 +2465,12 @@ void CG1500_application::set_page(int file, int counter)
|
||||
TString udata = _ultima_data.string(2,'/');
|
||||
char app;
|
||||
int r = 1;
|
||||
|
||||
|
||||
if (_verifica == 3)
|
||||
{
|
||||
if (_buff != NULL)
|
||||
{
|
||||
*_d = (const char*) _descr;
|
||||
if (_saldofinale > 0)
|
||||
app = 'D';
|
||||
else if (_saldofinale < 0)
|
||||
@ -2481,22 +2490,28 @@ void CG1500_application::set_page(int file, int counter)
|
||||
{
|
||||
set_row(r,"@1g%6ld",(const char*)_sottoconto);
|
||||
set_row(r," %s",(const char*)udata);
|
||||
set_row(r,"@18g%s@49g!@50g%r@67g%r@82g!@83g%r@99g%r@114g!@115g%r %c",(const char*)_descr,&_saldo_dare,
|
||||
&_saldo_avere,&_mov_dare,&_mov_avere,&_saldofinale,app);
|
||||
set_row(r,"@18g#a@49g!@50g%r@67g%r@82g!@83g%r@99g%r@114g!@115g%r %c",_d,&_saldo_dare,
|
||||
&_saldo_avere,&_mov_dare,&_mov_avere,&_saldofinale,app);
|
||||
if (_descr.len() > 30)
|
||||
set_row(++r, "@49g!@82g!@114g!");
|
||||
}
|
||||
else if (app == 'D')
|
||||
{
|
||||
set_row(r,"@1g%6ld",(const char*)_sottoconto);
|
||||
set_row(r," %s",(const char*)udata);
|
||||
set_row(r,"@18g%s@49g!@50g%r@67g%r@82g!@83g%r@100g%r@115g!@116g%r@148g!",(const char*)_descr,
|
||||
set_row(r,"@18g#a@49g!@50g%r@67g%r@82g!@83g%r@100g%r@115g!@116g%r@148g!",_d,
|
||||
&_saldo_dare,&_saldo_avere,&_mov_dare,&_mov_avere,&_saldofinale);
|
||||
if (_descr.len() > 30)
|
||||
set_row(++r, "@49g!@82g!@115g!@148g!");
|
||||
}
|
||||
else
|
||||
{
|
||||
set_row(r,"@1g%6ld",(const char*)_sottoconto);
|
||||
set_row(r," %s",(const char*)udata);
|
||||
set_row(r,"@18g%s@49g!@50g%r@67g%r@82g!@83g%r@100g%r@115g!@132g%r@148g!",
|
||||
(const char*)_descr,&_saldo_dare,&_saldo_avere,&_mov_dare,&_mov_avere,&_saldofinale);
|
||||
set_row(r,"@18g#a@49g!@50g%r@67g%r@82g!@83g%r@100g%r@115g!@132g%r@148g!",
|
||||
_d,&_saldo_dare,&_saldo_avere,&_mov_dare,&_mov_avere,&_saldofinale);
|
||||
if (_descr.len() > 30)
|
||||
set_row(++r, "@49g!@82g!@115g!@148g!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2545,29 +2560,37 @@ void CG1500_application::set_page(int file, int counter)
|
||||
} // _verifica != 2
|
||||
else
|
||||
{
|
||||
*_d = (const char*) _descr_succ;
|
||||
|
||||
if (_stampa_width == 132)
|
||||
{
|
||||
set_row(r,"@1g%6ld",(const char*)_sottoconto_succ);
|
||||
set_row(r," %s",(const char*)udata);
|
||||
set_row(r,"@18g%s@49g!@50g%r@67g%r@82g!@83g%r@99g%r@114g!@115g%r %c",
|
||||
(const char*)_descr_succ,&_saldoini_dare_succ,&_saldoini_avere_succ,
|
||||
set_row(r,"@18g#a@49g!@50g%r@67g%r@82g!@83g%r@99g%r@114g!@115g%r %c",
|
||||
_d,&_saldoini_dare_succ,&_saldoini_avere_succ,
|
||||
&_mov_dare_succ,&_mov_avere_succ,&_saldofinale_succ,app);
|
||||
if (_descr_succ.len() > 30)
|
||||
set_row(++r, "@49g!@82g!@114g!");
|
||||
}
|
||||
else if (app == 'D')
|
||||
{
|
||||
set_row(r,"@1g%6ld",(const char*)_sottoconto_succ);
|
||||
set_row(r," %s",(const char*)udata);
|
||||
set_row(r,"@18g%s@49g!@50g%r@67g%r@82g!@83g%r@100g%r@115g!@116g%r@148g!",
|
||||
(const char*)_descr_succ,&_saldoini_dare_succ,&_saldoini_avere_succ,
|
||||
set_row(r,"@18g#a@49g!@50g%r@67g%r@82g!@83g%r@100g%r@115g!@116g%r@148g!",
|
||||
_d,&_saldoini_dare_succ,&_saldoini_avere_succ,
|
||||
&_mov_dare_succ,&_mov_avere_succ,&_saldofinale_succ);
|
||||
if (_descr_succ.len() > 30)
|
||||
set_row(++r, "@49g!@82g!@115g!@148g!");
|
||||
}
|
||||
else
|
||||
{
|
||||
set_row(r,"@1g%6ld",(const char*)_sottoconto_succ);
|
||||
set_row(r," %s",(const char*)udata);
|
||||
set_row(r,"@18g%s@49g!@50g%r@67g%r@82g!@83g%r@100g%r@115g!@132g%r@148g!",
|
||||
(const char*)_descr_succ,&_saldoini_dare_succ,&_saldoini_avere_succ,
|
||||
set_row(r,"@18g#a@49g!@50g%r@67g%r@82g!@83g%r@100g%r@115g!@132g%r@148g!",
|
||||
_d,&_saldoini_dare_succ,&_saldoini_avere_succ,
|
||||
&_mov_dare_succ,&_mov_avere_succ,&_saldofinale_succ);
|
||||
if (_descr_succ.len() > 30)
|
||||
set_row(++r, "@49g!@82g!@115g!@148g!");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2590,7 +2613,7 @@ void CG1500_application::set_page(int file, int counter)
|
||||
}
|
||||
}
|
||||
|
||||
int CG1500_application::stampa_record_conto(int g,int c,const char* d,
|
||||
int CG1500_application::stampa_record_conto(int g,int c,const TString& d,
|
||||
const real& r1,const real& r2,const real& r3,const real& r4,const real& r5,
|
||||
const char app)
|
||||
{
|
||||
@ -2611,7 +2634,7 @@ int CG1500_application::stampa_record_conto(int g,int c,const char* d,
|
||||
{
|
||||
// set_row(r++,"%3d-@8g%s@49g|@50g%r@67g%r@82g|@83g%r@100g%r@115g|@116g%r%s",g,d,&r1,&r2,&r3,&r4,&r5,(const char*)app);
|
||||
set_row(r,"%3d-",g);
|
||||
set_row(r,"@8g%s",d);
|
||||
set_row(r,"@8g%s",(const char*)d);
|
||||
set_row(r++,"@49g!@50g%r@67g%r@82g!@83g%r@99g%r@114g!@115g%r %c",&r1,&r2,&r3,&r4,&r5,app);
|
||||
}
|
||||
else
|
||||
@ -2619,42 +2642,50 @@ int CG1500_application::stampa_record_conto(int g,int c,const char* d,
|
||||
{
|
||||
// set_row(r++,"%3d-@8g%s@49g|@50g%r@67g%r@82g|@83g%r@100g%r@115g|@116g%r@148g|",g,d,&r1,&r2,&r3,&r4,&r5);
|
||||
set_row(r,"%3d-",g);
|
||||
set_row(r,"@8g%s",d);
|
||||
set_row(r,"@8g%s",(const char*)d);
|
||||
set_row(r++,"@49g!@50g%r@67g%r@82g!@83g%r@100g%r@115g!@116g%r@148g!",&r1,&r2,&r3,&r4,&r5);
|
||||
}
|
||||
else
|
||||
{
|
||||
// set_row(r++,"%3d-@8g%s@49g|@50g%r@67g%r@82g|@83g%r@100g%r@115g|@132g%r@148g|",g,d,&r1,&r2,&r3,&r4,&r5);
|
||||
set_row(r,"%3d-",g);
|
||||
set_row(r,"@8g%s",d);
|
||||
set_row(r,"@8g%s",(const char*)d);
|
||||
set_row(r++,"@49g!@50g%r@67g%r@82g!@83g%r@100g%r@115g!@132g%r@148g!",&r1,&r2,&r3,&r4,&r5);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
*_d = (const char*) d;
|
||||
|
||||
if (_stampa_width == 132)
|
||||
{
|
||||
// set_row(r++,"%3d-%3d ********@18g%s@49g|@50g%r@67g%r@82g|@83g%r@100g%r@115g|@116g%r%s",g,c,d,&r1,&r2,&r3,&r4,&r5,(const char*)app);
|
||||
set_row(r,"%3d-",g);
|
||||
set_row(r,"%3d ********",c);
|
||||
set_row(r,"@18g%s",d);
|
||||
set_row(r,"@18g#a",_d);
|
||||
set_row(r++,"@49g!@50g%r@67g%r@82g!@83g%r@99g%r@114g!@115g%r %c",&r1,&r2,&r3,&r4,&r5,app);
|
||||
if (d.len() > 30)
|
||||
set_row(r+1, "@49g!@82g!@114g!");
|
||||
}
|
||||
else if (app == 'D')
|
||||
{
|
||||
// set_row(r++,"%3d-%3d ********@18g%s@49g|@50g%r@67g%r@82g|@83g%r@100g%r@115g|@116g%r@148g|",g,c,d,&r1,&r2,&r3,&r4,&r5);
|
||||
set_row(r,"%3d-",g);
|
||||
set_row(r,"%3d ********",c);
|
||||
set_row(r,"@18g%s",d);
|
||||
set_row(r,"@18g#a",_d);
|
||||
set_row(r++,"@49g!@50g%r@67g%r@82g!@83g%r@100g%r@115g!@116g%r@148g!",&r1,&r2,&r3,&r4,&r5);
|
||||
if (d.len() > 30)
|
||||
set_row(r+1, "@49g!@82g!@115g!@148g!");
|
||||
}
|
||||
else
|
||||
{
|
||||
// set_row(r++,"%3d-%3d ********@18g%s@49g|@50g%r@67g%r@82g|@83g%r@100g%r@115g|@132g%r@148g|",g,c,d,&r1,&r2,&r3,&r4,&r5);
|
||||
set_row(r,"%3d-",g);
|
||||
set_row(r,"%3d ********",c);
|
||||
set_row(r,"@18g%s",d);
|
||||
set_row(r,"@18g#a",_d);
|
||||
set_row(r++,"@49g!@50g%r@67g%r@82g!@83g%r@100g%r@115g!@132g%r@148g!",&r1,&r2,&r3,&r4,&r5);
|
||||
if (d.len() > 30)
|
||||
set_row(r+1, "@49g!@82g!@115g!@148g!");
|
||||
}
|
||||
}
|
||||
if (_stampa_width == 148)
|
||||
@ -3061,8 +3092,10 @@ bool CG1500_application::user_create()
|
||||
_pcn = new TLocalisamfile(LF_PCON);
|
||||
_saldi = new TLocalisamfile(LF_SALDI);
|
||||
_nditte = new TLocalisamfile(LF_NDITTE);
|
||||
_anag = new TLocalisamfile(LF_ANAG);
|
||||
_esc = new TTable("ESC");
|
||||
_anag = new TLocalisamfile(LF_ANAG);
|
||||
_caus = new TLocalisamfile(LF_CAUSALI);
|
||||
_esc = new TTable("ESC");
|
||||
_d = new TParagraph_string("",30);
|
||||
_tmp_saldi_att = NULL;
|
||||
_tmp_saldi_pass = NULL;
|
||||
_tmp_saldi_costi = NULL;
|
||||
@ -3084,7 +3117,9 @@ bool CG1500_application::user_destroy()
|
||||
delete _saldi;
|
||||
delete _nditte;
|
||||
delete _anag;
|
||||
delete _caus;
|
||||
delete _esc;
|
||||
delete _d;
|
||||
|
||||
if (_tmp_saldi_att) delete _tmp_saldi_att;
|
||||
if (_tmp_saldi_pass) delete _tmp_saldi_pass;
|
||||
@ -3153,6 +3188,7 @@ bool CG1500_application::set_print(int)
|
||||
_annoes = atoi(m.get(F_ANNO));
|
||||
_bilancio = atoi(m.get(F_BILANCIO));
|
||||
_data = m.get(F_DATASTAMPA);
|
||||
_stampa_mov_prov = m.get_int(F_STAMPAMPROV);
|
||||
if (_bilancio == 1)
|
||||
{
|
||||
_prog = new TProgind(_pcn->items(),"Elaborazione in corso... prego attendere",FALSE);
|
||||
@ -3166,7 +3202,7 @@ bool CG1500_application::set_print(int)
|
||||
_dataini = InizioEsercizio(_annoes);
|
||||
else _dataini = _inizioEs;
|
||||
_datalim = m.get(F_DATALIM);
|
||||
_stampa_mov_prov = (bool)(m.get(F_STAMPAMPROV) == "X");
|
||||
//_stampa_mov_prov = (bool)(m.get(F_STAMPAMPROV) == "X");
|
||||
}
|
||||
bil_sez_contr();
|
||||
}
|
||||
@ -3187,7 +3223,7 @@ bool CG1500_application::set_print(int)
|
||||
else _dataini = _inizioEs;
|
||||
_datada = m.get(F_DATADA);
|
||||
_dataa = m.get(F_DATAA);
|
||||
_stampa_mov_prov = (bool)(m.get(F_STAMPAMPROV) == "X");
|
||||
//_stampa_mov_prov = (bool)(m.get(F_STAMPAMPROV) == "X");
|
||||
}
|
||||
if ( (_verifica == 1)||(_verifica == 2) )
|
||||
{
|
||||
|
@ -4,14 +4,14 @@ PAGE "Stampa bilancio" -1 -1 74 16
|
||||
|
||||
NUMBER F_CODDITTA 5
|
||||
BEGIN
|
||||
PROMPT 2 1 "Ditta "
|
||||
PROMPT 2 1 "Ditta "
|
||||
FLAGS "FRD"
|
||||
USE LF_NDITTE KEY 1
|
||||
CHECKTYPE REQUIRED
|
||||
INPUT CODDITTA F_CODDITTA
|
||||
DISPLAY "Codice" CODDITTA
|
||||
DISPLAY "Ragione sociale @50" RAGSOC
|
||||
OUTPUT F_CODDITTA CODDITTA
|
||||
DISPLAY "Ragione sociale @50" RAGSOC
|
||||
OUTPUT F_CODDITTA CODDITTA
|
||||
OUTPUT F_RAGSOC RAGSOC
|
||||
END
|
||||
|
||||
@ -54,7 +54,7 @@ BEGIN
|
||||
MESSAGE HIDE,F_DATAA|RESET,F_DATAA|HIDE,F_SITUAZIONE|RESET,F_SITUAZIONE
|
||||
MESSAGE HIDE,F_ORDINAMENTO|RESET,F_ORDINAMENTO|HIDE,F_STAMPAC|RESET,F_STAMPAC
|
||||
MESSAGE HIDE,96|HIDE,97|HIDE,98|HIDE,99
|
||||
// MESSAGE HIDE,F_MODULO|RESET,F_MODULO
|
||||
//MESSAGE HIDE,F_MODULO|RESET,F_MODULO
|
||||
MESSAGE SHOW,F_STAMPA|K_SPACE,F_STAMPA
|
||||
ITEM "2|Bilancio di verifica"
|
||||
MESSAGE HIDE,F_STAMPA|RESET,F_STAMPA
|
||||
@ -62,7 +62,7 @@ BEGIN
|
||||
MESSAGE HIDE,F_CODICI|RESET,F_CODICI|HIDE,F_SALDO|RESET,F_SALDO
|
||||
MESSAGE HIDE,F_STAMPAV|RESET,F_STAMPAV
|
||||
MESSAGE SHOW,F_VERIFICA|K_SPACE,F_VERIFICA|SHOW,F_STAMPA1|K_SPACE,F_STAMPA1
|
||||
// MESSAGE SHOW,F_MODULO|K_SPACE,F_MODULO
|
||||
//MESSAGE SHOW,F_MODULO|K_SPACE,F_MODULO
|
||||
MESSAGE SHOW,96|SHOW,97|SHOW,98|SHOW,99
|
||||
END
|
||||
|
||||
@ -71,9 +71,9 @@ BEGIN
|
||||
PROMPT 40 5 "Tipo stampa "
|
||||
HELP "Indicare il tipo di stampa"
|
||||
ITEM "1|Per date limite"
|
||||
MESSAGE SHOW,F_DATALIM|SHOW,F_TOTALI|SHOW,F_CODICI|SHOW,F_SALDO|SHOW,F_STAMPAMPROV
|
||||
MESSAGE SHOW,F_DATALIM|SHOW,F_TOTALI|SHOW,F_CODICI|SHOW,F_SALDO
|
||||
ITEM "2|All' ultima immissione"
|
||||
MESSAGE HIDE,F_DATALIM|HIDE,F_STAMPAMPROV|RESET,F_DATALIM|RESET,F_STAMPAMPROV
|
||||
MESSAGE HIDE,F_DATALIM|RESET,F_DATALIM
|
||||
MESSAGE SHOW,F_TOTALI|SHOW,F_CODICI|SHOW,F_SALDO
|
||||
END
|
||||
|
||||
@ -83,9 +83,9 @@ BEGIN
|
||||
//FLAGS "G"
|
||||
HELP "Indicare il tipo di stampa"
|
||||
ITEM "1|Per date limite"
|
||||
MESSAGE SHOW,F_VERIFICA|SHOW,F_MODULO
|
||||
MESSAGE SHOW,F_VERIFICA|SHOW,F_MODULO|SHOW,F_STAMPAMPROV
|
||||
ITEM "2|All' ultima immissione"
|
||||
MESSAGE SHOW,F_VERIFICA|SHOW,F_MODULO
|
||||
MESSAGE SHOW,F_VERIFICA|SHOW,F_MODULO|SHOW,F_STAMPAMPROV
|
||||
MESSAGE COPY,F_STAMPA
|
||||
END
|
||||
|
||||
@ -144,13 +144,23 @@ BEGIN
|
||||
PROMPT 60 10 ""
|
||||
END
|
||||
|
||||
/*
|
||||
BOOLEAN F_STAMPAMPROV
|
||||
BEGIN
|
||||
PROMPT 2 11 "Stampa movimenti provvisori "
|
||||
HELP "Indicare se stampare i movimenti provvisori"
|
||||
END
|
||||
*/
|
||||
|
||||
LIST F_MODULO 10
|
||||
LIST F_STAMPAMPROV 15
|
||||
BEGIN
|
||||
PROMPT 2 11 "Bilancio "
|
||||
ITEM "1|Normale"
|
||||
ITEM "2|Globale"
|
||||
ITEM "3|Solo provvisori"
|
||||
END
|
||||
|
||||
LIST F_MODULO 8
|
||||
BEGIN
|
||||
PROMPT 2 12 "Stampa su modulo stretto "
|
||||
HELP "Indicare il numero di caratteri del foglio (larghezza)"
|
||||
@ -165,7 +175,7 @@ END
|
||||
|
||||
BUTTON DLG_QUIT 9 2
|
||||
BEGIN
|
||||
PROMPT -22 -1 ""
|
||||
PROMPT -22 -1 ""
|
||||
END
|
||||
|
||||
ENDPAGE
|
||||
|
@ -264,13 +264,14 @@ class CG1600_application : public TPrintapp
|
||||
TLocalisamfile* _pconti;
|
||||
TLocalisamfile* _clifo;
|
||||
TLocalisamfile* _saldi;
|
||||
TLocalisamfile* _caus;
|
||||
const char* _buff;
|
||||
TSort* _sort;
|
||||
Anni_es* _anni_es;
|
||||
Righe_sez_opp _sezopps;
|
||||
TSaldi_list* _listasld;
|
||||
TProgind* _prog;
|
||||
TParagraph_string* _descr;
|
||||
TParagraph_string* _descr,*_d;
|
||||
TSaldo* _sld;
|
||||
|
||||
TDate _data_fine_ese,_data_fine_ese_prec,_data_fine_raf,_data_fine_raf_prec;
|
||||
@ -279,12 +280,13 @@ class CG1600_application : public TPrintapp
|
||||
int _annoese,_annoeserafr,_anno_esercizio,_anno_esercizio_raf;
|
||||
bool _competenza,_intera_struttura,_stampamov,_stampacod,_stampa_modulo;
|
||||
bool _sbilancio_patr_gia_stampato,_attivo_o_passivo;
|
||||
bool _stampa_mov_prov,_diffprod_fatto,_risimp_fatto;
|
||||
bool _diffprod_fatto,_risimp_fatto;
|
||||
TString _classe_stampata, _classe_da_stampare,_numr_tot,_num_tot,_numr;
|
||||
char _sez_da_stamp,_let_da_stamp,_sez_stamp,_let_stamp,_sez_tot,_let_tot,_let,_sez_saldo,_sez,_tot_sez_saldo;
|
||||
TString _numr_da_stamp,_num_da_stamp,_numr_stamp,_num_stamp,_descr_sez;
|
||||
int _tipo_bilancio, _tipo_stampa;
|
||||
int _cont_let,_cont_numr,_cont_num,_cont_gcs,_num;
|
||||
int _stampa_mov_prov;
|
||||
real _sale,_salerafr,_totale_ordine,_totale_economico;
|
||||
real _totale_ordine_raf,_totale_economico_raf;
|
||||
real _totale_numero,_totale_numr,_totale_lettera,_totale_sezione;
|
||||
@ -1549,7 +1551,7 @@ void CG1600_application::crea_sort_piano_conti_verifica()
|
||||
else
|
||||
if (_tipo_stampa == 2)
|
||||
{
|
||||
if (!_sld->ultima_immissione_verifica(_anno_esercizio,g,c,s,indbil))
|
||||
if (!_sld->ultima_immissione_verifica(_anno_esercizio,g,c,s,indbil,_stampa_mov_prov))
|
||||
// continue;
|
||||
//modifica del 05/04/1995
|
||||
{
|
||||
@ -1717,7 +1719,7 @@ void CG1600_application::sottoc_clifo_verifica(int g,int c,int anno,char tipocf,
|
||||
continue;
|
||||
*/
|
||||
//modifica 05/04/1994
|
||||
if (!_sld->ultima_immissione_verifica(_anno_esercizio,g,c,s,indbil))
|
||||
if (!_sld->ultima_immissione_verifica(_anno_esercizio,g,c,s,indbil,_stampa_mov_prov))
|
||||
{
|
||||
if (indbil == 1 || indbil == 2 || indbil == 5)
|
||||
app = _sld->saldofin_esprec(_anno_esercizio,g,c,s);
|
||||
@ -1852,7 +1854,7 @@ bool CG1600_application::calcola_saldo(real& saldo, real& saldo_raf,int g,int c,
|
||||
}
|
||||
else if (_tipo_stampa == 2)
|
||||
{
|
||||
if (!_sld->ultima_immissione_bilancio(_anno_esercizio,g,c,s,indbil))
|
||||
if (!_sld->ultima_immissione_bilancio(_anno_esercizio,g,c,s,indbil,_stampa_mov_prov))
|
||||
{
|
||||
if (!_sld->esiste_saldo() || !_sld->significativo())
|
||||
no_movimentato = TRUE;
|
||||
@ -1904,7 +1906,7 @@ bool CG1600_application::calcola_saldo(real& saldo, real& saldo_raf,int g,int c,
|
||||
}
|
||||
else if (_databilrafr == _data_fine_raf) //(_tipo_stampa == 2)
|
||||
{
|
||||
if (!_sld->ultima_immissione_bilancio(_anno_esercizio_raf,g,c,s,indbil))
|
||||
if (!_sld->ultima_immissione_bilancio(_anno_esercizio_raf,g,c,s,indbil,_stampa_mov_prov))
|
||||
{
|
||||
if (!_sld->esiste_saldo() || !_sld->significativo())
|
||||
no_movimentato_raf = TRUE;
|
||||
@ -1933,6 +1935,7 @@ bool CG1600_application::calcola(int g, int c, long s,
|
||||
real importo;
|
||||
int annoe;
|
||||
long num_reg;
|
||||
char provvis;
|
||||
TDate datareg, datacomp, data;
|
||||
bool conto_mov = FALSE;
|
||||
TLocalisamfile rmov(LF_RMOV);
|
||||
@ -1965,20 +1968,20 @@ bool CG1600_application::calcola(int g, int c, long s,
|
||||
sezione = rmov.get(RMV_SEZIONE);
|
||||
importo = rmov.get_real(RMV_IMPORTO);
|
||||
|
||||
if (importo == ZERO)
|
||||
continue;
|
||||
|
||||
mov.setkey(1);
|
||||
mov.zero();
|
||||
mov.put(MOV_NUMREG, num_reg);
|
||||
mov.read();
|
||||
if (mov.bad()) mov.zero();
|
||||
const bool movprovv = mov.get(MOV_PROVVIS).not_empty();
|
||||
provvis = mov.get_char(MOV_PROVVIS);
|
||||
datacomp = mov.get_date(MOV_DATACOMP);
|
||||
|
||||
if (_stampa_mov_prov == 1 && provvis != '\0') //bilancio normale (non comprende i provvisori)
|
||||
continue;
|
||||
|
||||
if (_stampa_mov_prov == 3 && provvis == '\0') //bilancio dei soli provvisori
|
||||
continue;
|
||||
|
||||
if (!_stampa_mov_prov && movprovv) //se non richiesto
|
||||
continue; //stampa mov provv.
|
||||
//li scarto
|
||||
const TString codcaus(mov.get(MOV_CODCAUS));
|
||||
|
||||
// if (codcaus.not_empty())
|
||||
@ -1993,17 +1996,14 @@ bool CG1600_application::calcola(int g, int c, long s,
|
||||
if (cau.chiusura()) //la causale e' uguale a quella di chiusura
|
||||
continue;
|
||||
|
||||
|
||||
if (_annoese == 0)
|
||||
data = datareg;
|
||||
if (_annoese != 0)
|
||||
data = datacomp;
|
||||
|
||||
TString datastr = data.string();
|
||||
TString datastr3 = _datafine.string();
|
||||
TString datastr1 = _dataini.string();
|
||||
TString datastr2 = _data_ini_ese.string();
|
||||
|
||||
if (importo == ZERO)
|
||||
continue;
|
||||
|
||||
//calcolo i movimenti del periodo
|
||||
/*
|
||||
if ( (data >= _dataini) && (data <= _datafine) )
|
||||
@ -2087,7 +2087,7 @@ if (tasto == K_ENTER)
|
||||
_stampacod = (bool)(_msk->get(F_STAMPACOD) == "X");
|
||||
_stampa_modulo = (bool)(_msk->get(F_STAMPAMODULO) == "X");
|
||||
_tipo_bilancio = atoi(_msk->get(F_TIPOBIL));
|
||||
_stampa_mov_prov = (bool)(_msk->get(F_STAMPAMOVPROV) == "X");
|
||||
_stampa_mov_prov = _msk->get_int(F_STAMPAMOVPROV);
|
||||
if (_tipo_bilancio == 1)
|
||||
{
|
||||
_tipo_stampa = atoi(_msk->get(F_TIPOSTAMPA));
|
||||
@ -3537,7 +3537,7 @@ print_action CG1600_application::postprocess_page(int file, int counter)
|
||||
{
|
||||
reset_print();
|
||||
_i = 1;
|
||||
setta_righe("CONTI D' ORDINE");
|
||||
setta_righe("CONTI D'ORDINE");
|
||||
_reset_righe_stampa = FALSE;
|
||||
}
|
||||
}
|
||||
@ -3545,7 +3545,7 @@ print_action CG1600_application::postprocess_page(int file, int counter)
|
||||
{
|
||||
reset_print();
|
||||
_i = 1;
|
||||
setta_righe("CONTI D' ORDINE");
|
||||
setta_righe("CONTI D'ORDINE");
|
||||
_reset_righe_stampa = FALSE;
|
||||
}
|
||||
}
|
||||
@ -4227,7 +4227,7 @@ void CG1600_application::setta_righe(const char * titolo)
|
||||
descr_numr = descrizione_numeroromano(sezione,lettera,numeror);
|
||||
descr_num = descrizione_numero(sezione,lettera,numeror,numero);
|
||||
descr_sottoc = descrizione_sottoconto(gruppo,conto,sottoc);
|
||||
|
||||
|
||||
//Se la classe prelevata dal record corrente del sort e' diversa dalla classe
|
||||
//prelevata dal record precedente, allora stampo la nuova classe con i relativi
|
||||
//sottoconti. In caso contrario continuo a stampare solo i sottoconti.
|
||||
@ -4242,7 +4242,7 @@ void CG1600_application::setta_righe(const char * titolo)
|
||||
{
|
||||
char app = ' ';
|
||||
set_row (_i++,"@0g%c", app);
|
||||
set_row (_i++,"@0gCONTI D' ORDINE ATTIVI");
|
||||
set_row (_i++,"@0gCONTI D'ORDINE ATTIVI");
|
||||
set_row (_i++,"@0g%c", app);
|
||||
stampa_classe = FALSE;
|
||||
}
|
||||
@ -4259,7 +4259,7 @@ void CG1600_application::setta_righe(const char * titolo)
|
||||
{
|
||||
char app = ' ';
|
||||
set_row(_i++,"@0g%c", app);
|
||||
set_row (_i++,"@0gCONTI D' ORDINE PASSIVI");
|
||||
set_row (_i++,"@0gCONTI D'ORDINE PASSIVI");
|
||||
set_row(_i++,"@0g%c", app);
|
||||
stampa_classe = FALSE;
|
||||
}
|
||||
@ -4315,7 +4315,7 @@ void CG1600_application::setta_righe(const char * titolo)
|
||||
{
|
||||
char app = ' ';
|
||||
set_row (_i++,"@0g%c", app);
|
||||
set_row (_i++,"@0gCONTI D' ORDINE ATTIVI");
|
||||
set_row (_i++,"@0gCONTI D'ORDINE ATTIVI");
|
||||
set_row (_i++,"@0g%c", app);
|
||||
stampa_classe = FALSE;
|
||||
}
|
||||
@ -4323,7 +4323,7 @@ void CG1600_application::setta_righe(const char * titolo)
|
||||
{
|
||||
char app = ' ';
|
||||
set_row(_i++,"@0g%c", app);
|
||||
set_row (_i++,"@0gCONTI D' ORDINE PASSIVI");
|
||||
set_row (_i++,"@0gCONTI D'ORDINE PASSIVI");
|
||||
set_row(_i++,"@0g%c", app);
|
||||
stampa_classe = FALSE;
|
||||
}
|
||||
@ -4486,7 +4486,9 @@ void CG1600_application::setta_righe_verifica()
|
||||
}
|
||||
else
|
||||
descr_sottoc = descrizione_sottoconto(gruppo,conto,sottoc);
|
||||
|
||||
|
||||
*_d = (const char*) descr_sottoc;
|
||||
|
||||
//Se la classe prelevata dal record corrente del sort e' diversa dalla classe
|
||||
//prelevata dal record precedente, allora stampo la nuova classe con i relativi
|
||||
//sottoconti. In caso contrario continuo a stampare solo i sottoconti.
|
||||
@ -4636,11 +4638,12 @@ void CG1600_application::setta_righe_verifica()
|
||||
{
|
||||
if (!_intera_struttura || (_intera_struttura && bil->gruppo[0] != 'Z'))
|
||||
{
|
||||
_cont_gcs += 1;
|
||||
_cont_gcs += 1;
|
||||
set_row (_i,"@0g%s", bil->gruppo);
|
||||
set_row (_i,"@4g%s", bil->conto);
|
||||
set_row (_i,"@8g%s", bil->sottoc);
|
||||
set_row (_i,"@15g%-.33s", (const char*) descr_sottoc);
|
||||
//set_row (_i,"@15g%-.33s", (const char*) descr_sottoc);
|
||||
set_row (_i,"@15g#a", _d);
|
||||
|
||||
if (_dataini == _data_ini_ese)
|
||||
{
|
||||
@ -4699,7 +4702,8 @@ void CG1600_application::setta_righe_verifica()
|
||||
descr_classe = descr_num;
|
||||
if (descr_classe != descr_sottoc)
|
||||
{
|
||||
set_row (_i,"@2g%s", (const char*) descr_sottoc);
|
||||
//set_row (_i,"@2g%s", (const char*) descr_sottoc);
|
||||
set_row (_i,"@2g#a", _d);
|
||||
|
||||
if (_dataini == _data_ini_ese)
|
||||
{
|
||||
@ -5107,9 +5111,10 @@ bool CG1600_application::user_create()
|
||||
_anag = new TLocalisamfile (LF_ANAG);
|
||||
_pconti = new TLocalisamfile (LF_PCON);
|
||||
_clifo = new TLocalisamfile (LF_CLIFO);
|
||||
_saldi = new TLocalisamfile (LF_SALDI);
|
||||
_descr = new TParagraph_string ("",40);
|
||||
|
||||
_saldi = new TLocalisamfile (LF_SALDI);
|
||||
_caus = new TLocalisamfile (LF_CAUSALI);
|
||||
_descr = new TParagraph_string("",40);
|
||||
_d = new TParagraph_string("",33);
|
||||
_tabivd = new TTable (TAB_IVD);
|
||||
_tabesc = new TTable (TAB_ESC);
|
||||
|
||||
@ -5133,8 +5138,10 @@ bool CG1600_application::user_destroy()
|
||||
delete _anag;
|
||||
delete _pconti;
|
||||
delete _clifo;
|
||||
delete _saldi;
|
||||
delete _saldi;
|
||||
delete _caus;
|
||||
delete _descr;
|
||||
delete _d;
|
||||
delete _anni_es;
|
||||
delete _sld;
|
||||
|
||||
|
@ -160,11 +160,21 @@ BEGIN
|
||||
HELP "Indicare se non stampare i movimenti con saldo nullo"
|
||||
END
|
||||
|
||||
/*
|
||||
BOOLEAN F_STAMPAMOVPROV
|
||||
BEGIN
|
||||
PROMPT 41 12 "Stampa movimenti provvisori"
|
||||
HELP "Indicare se stampare anche i movimenti provvisori"
|
||||
END
|
||||
*/
|
||||
|
||||
LIST F_STAMPAMOVPROV 15
|
||||
BEGIN
|
||||
PROMPT 41 12 "Bilancio "
|
||||
ITEM "1|Normale"
|
||||
ITEM "2|Globale"
|
||||
ITEM "3|Solo provvisori"
|
||||
END
|
||||
|
||||
BOOLEAN F_STAMPAMODULO
|
||||
BEGIN
|
||||
|
@ -812,6 +812,7 @@ void TListaMov_application::set_page(int file, int count)
|
||||
TDate data = current_cursor()->curr(LF_MOV).get_date(MOV_DATAREG);
|
||||
TString16 reg = current_cursor()->curr(LF_MOV).get(MOV_REG);
|
||||
int anno = current_cursor()->curr(LF_MOV).get_int(MOV_ANNOIVA);
|
||||
char prov = current_cursor()->curr(LF_MOV).get_char(MOV_PROVVIS);
|
||||
int tipo = CodiceRegistro(reg, anno);
|
||||
int ae = date2esc(data);
|
||||
if ( (tipo == 1) || (tipo == 2) )
|
||||
@ -819,6 +820,7 @@ void TListaMov_application::set_page(int file, int count)
|
||||
set_row (_n, "@103greg @3s",FLD(LF_MOV,MOV_REG));
|
||||
set_row (_n, "@111gpr @5n",FLD(LF_MOV,MOV_PROTIVA));
|
||||
}
|
||||
else set_row (_n, "@103gMov.Provvisorio");
|
||||
if (ae != annoese)
|
||||
if (_annoes == 0) //se non indicato l'anno nella maschera
|
||||
set_row (_n, "@120gcomp @4n", FLD(LF_MOV,MOV_ANNOES));
|
||||
@ -2042,7 +2044,6 @@ bool TListaMov_application::set_print(int m)
|
||||
|
||||
reset_files();
|
||||
TLocalisamfile* fl;
|
||||
//_curr1->set_filterfunction (0);
|
||||
_curr1->set_filterfunction (filter_func);
|
||||
_curr2->set_filterfunction (filter_func);
|
||||
_curr3->set_filterfunction (filter_func_fatture);
|
||||
@ -2064,13 +2065,21 @@ bool TListaMov_application::set_print(int m)
|
||||
_data_ini = msk.get(F_DATAINI);
|
||||
_data_fin = msk.get(F_DATAFIN);
|
||||
_numreg_fin = atoi(msk.get(F_NUMEROFIN));
|
||||
bool provvis = msk.get_bool(F_STAMPAMOVP);
|
||||
//bool provvis = msk.get_bool(F_STAMPAMOVP);
|
||||
int provvis = msk.get_int(F_STAMPAMOVP);
|
||||
if (_decidi == 1)
|
||||
{
|
||||
select_cursor(_cur1);
|
||||
if (!provvis)
|
||||
/*
|
||||
if (!provvis)
|
||||
_curr1->setfilter("(PROVVIS=\"\")");
|
||||
else _curr1->setfilter("");
|
||||
*/
|
||||
if (provvis == 1) //normale
|
||||
_curr1->setfilter("(PROVVIS=\"\")");
|
||||
else _curr1->setfilter("");
|
||||
else if (provvis == 2) //globale
|
||||
_curr1->setfilter("");
|
||||
else _curr1->setfilter("(PROVVIS!=\"\")"); //solo provvisori
|
||||
fl = &(current_cursor()->file(LF_MOV));
|
||||
TRectype da (fl->curr());
|
||||
TRectype a (fl->curr());
|
||||
@ -2086,10 +2095,17 @@ bool TListaMov_application::set_print(int m)
|
||||
else
|
||||
{
|
||||
select_cursor(_cur2);
|
||||
if (!provvis)
|
||||
_curr2->setfilter("(PROVVIS=\"\")");
|
||||
else
|
||||
_curr2->setfilter("");
|
||||
/*
|
||||
if (!provvis)
|
||||
_curr2->setfilter("(PROVVIS=\"\")");
|
||||
else
|
||||
_curr2->setfilter("");
|
||||
*/
|
||||
if (provvis == 1) //normale
|
||||
_curr2->setfilter("(PROVVIS=\"\")");
|
||||
else if (provvis == 2) //globale
|
||||
_curr2->setfilter("");
|
||||
else _curr2->setfilter("(PROVVIS!=\"\")"); //solo provvisori
|
||||
fl = &(current_cursor()->file(LF_MOV));
|
||||
TRectype da (fl->curr());
|
||||
TRectype a (fl->curr());
|
||||
@ -2111,7 +2127,7 @@ bool TListaMov_application::set_print(int m)
|
||||
{
|
||||
fl = &(current_cursor()->file(LF_MOV));
|
||||
TString tipo = msk.get(F_TIPOELENCO);
|
||||
bool movprov = msk.get_bool(F_STAMPAMOVP);
|
||||
//bool movprov = msk.get_bool(F_STAMPAMOVP);
|
||||
_data_ini = msk.get(F_DATAINI);
|
||||
_data_fin = msk.get(F_DATAFIN);
|
||||
_annoes = msk.get_int(F_ANNO);
|
||||
@ -2138,9 +2154,12 @@ bool TListaMov_application::set_print(int m)
|
||||
_tipo_fin = tipo;
|
||||
}
|
||||
select_cursor(_cur3);
|
||||
if (!movprov)
|
||||
_curr3->setfilter("(PROVVIS=\"\")");
|
||||
else _curr3->setfilter("");
|
||||
/*
|
||||
if (!movprov)
|
||||
_curr3->setfilter("(PROVVIS=\"\")");
|
||||
else _curr3->setfilter("");
|
||||
*/
|
||||
_curr3->setfilter("");
|
||||
TRectype da (fl->curr());
|
||||
TRectype a (fl->curr());
|
||||
da.zero();
|
||||
@ -2155,7 +2174,6 @@ bool TListaMov_application::set_print(int m)
|
||||
add_file(LF_MOV);
|
||||
add_file(LF_RMOVIVA,LF_MOV);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case movimenti_sezionale:
|
||||
|
@ -1,6 +1,3 @@
|
||||
#ifndef __CG3100_H
|
||||
#define __CG3100_H
|
||||
|
||||
#define TAB_REG "REG"
|
||||
#define TAB_TPD "%TPD"
|
||||
#define TAB_VAL "%VAL"
|
||||
@ -53,7 +50,6 @@
|
||||
#define ST_COMPLETA_REG 0x4000
|
||||
#define ST_CODICE 0x8000
|
||||
|
||||
#endif // __CG3100_H
|
||||
|
||||
|
||||
|
||||
|
@ -54,7 +54,7 @@ BEGIN
|
||||
END
|
||||
|
||||
|
||||
LIST F_CONTROLLO 21
|
||||
LIST F_CONTROLLO 23
|
||||
BEGIN
|
||||
PROMPT 2 7 "Controllo movimenti errati "
|
||||
HELP "Indicare il tipo di controllo per movimenti errati"
|
||||
@ -200,13 +200,15 @@ END
|
||||
BOOLEAN F_STAMPA
|
||||
BEGIN
|
||||
PROMPT 2 16 "Stampa imponibili, imposte e codici iva "
|
||||
HELP "Indicare se stampare i valori degli imponibili, dell'imposte e i codici IVA"
|
||||
HELP "Indicare se stampare i valori degli imponibili, delle imposte e i codici IVA"
|
||||
END
|
||||
|
||||
BOOLEAN F_STAMPAMOVP
|
||||
LIST F_STAMPAMOVP 16
|
||||
BEGIN
|
||||
PROMPT 2 17 "Stampa movimenti provvisori "
|
||||
HELP "Indicare se stampare i movimenti provvisori"
|
||||
PROMPT 2 17 "Tipo lista "
|
||||
ITEM "1|Normale"
|
||||
ITEM "2|Globale"
|
||||
ITEM "3|Solo provvisori"
|
||||
END
|
||||
|
||||
/*
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
PAGE "" -1 -1 73 16
|
||||
|
||||
|
||||
NUMBER F_CODDITTA 5
|
||||
BEGIN
|
||||
PROMPT 2 1 "Ditta "
|
||||
@ -205,11 +204,13 @@ BEGIN
|
||||
HELP "Indicare se cambiare pagina nel passaggio da cliente/fornitore a cliente/fornitore"
|
||||
END
|
||||
|
||||
/*
|
||||
BOOLEAN F_STAMPAMOVP
|
||||
BEGIN
|
||||
PROMPT 2 13 "Stampa movimenti provvisori "
|
||||
HELP "Indicare se stampare i movimenti provvisori"
|
||||
END
|
||||
*/
|
||||
|
||||
BUTTON DLG_PRINT 9 2
|
||||
BEGIN
|
||||
|
@ -71,9 +71,9 @@ public:
|
||||
const char* causale_chiusura_es();
|
||||
const char* causale_apertura_es();
|
||||
|
||||
bool ultima_immissione_bilancio(int anno,int g,int c,long s,int indbil);
|
||||
bool ultima_immissione_verifica(int anno,int g,int c,long s,int indbil);
|
||||
bool data_limite_bilancio(int,int,int,long,const TDate&,const TDate&,int,bool);
|
||||
bool ultima_immissione_bilancio(int anno,int g,int c,long s,int indbil,int prov);
|
||||
bool ultima_immissione_verifica(int anno,int g,int c,long s,int indbil,int prov);
|
||||
bool data_limite_bilancio(int,int,int,long,const TDate&,const TDate&,int,int);
|
||||
|
||||
TRectype& ricerca_progr_prec(int, int, int, long);
|
||||
|
||||
|
100
cg/cglib01.cpp
100
cg/cglib01.cpp
@ -275,9 +275,9 @@ void TSaldo::leggi_mov(long nr)
|
||||
}
|
||||
}
|
||||
|
||||
//per bilancio scalare per data limite
|
||||
//per bilancio scalare (ovvero a sezioni contrapposte) per data limite
|
||||
bool TSaldo::data_limite_bilancio(int bilancio, int g, int c, long s, const TDate& data_inf,
|
||||
const TDate& data_sup, int indbil, bool stp_prov)
|
||||
const TDate& data_sup, int indbil, int stp_prov)
|
||||
{
|
||||
TString16 gcs_corr, gcs_prec;
|
||||
int gruppo, conto, annoe;
|
||||
@ -294,7 +294,7 @@ bool TSaldo::data_limite_bilancio(int bilancio, int g, int c, long s, const TDat
|
||||
_rec_presente_ep = FALSE;
|
||||
_rec_presente_ec = FALSE;
|
||||
|
||||
gcs_prec = "";
|
||||
gcs_prec = "";
|
||||
|
||||
rmov.setkey(2);
|
||||
rmov.zero();
|
||||
@ -344,19 +344,27 @@ bool TSaldo::data_limite_bilancio(int bilancio, int g, int c, long s, const TDat
|
||||
if (cau.chiusura() || cau.apertura())
|
||||
continue;
|
||||
|
||||
//se non e' richiesta stampa mov. provvisori li scarto
|
||||
if (!stp_prov && _provv.trim().not_empty())
|
||||
continue;
|
||||
|
||||
/*
|
||||
if (!stp_prov && _provv.trim().not_empty())
|
||||
continue;
|
||||
*/
|
||||
|
||||
if (stp_prov == 1 && _provv.trim().not_empty()) //bilancio normale (non comprende i provvisori)
|
||||
continue;
|
||||
|
||||
if (stp_prov == 3 && _provv.trim().empty()) //bilancio dei soli provvisori
|
||||
continue;
|
||||
|
||||
// "I mov. di puro riferimento (= con importo = 0) vanno scartati"
|
||||
if (importo == ZERO) continue;
|
||||
|
||||
gcs_corr = format ("%3d%3d%6ld", gruppo, conto, sottoconto);
|
||||
|
||||
|
||||
if (gcs_corr != gcs_prec)
|
||||
{
|
||||
gcs_prec = gcs_corr;
|
||||
_saldo = calcola_saldo_iniziale(gruppo,conto,sottoconto,indbil);
|
||||
if (stp_prov != 3) //bilancio normale o globale
|
||||
_saldo = calcola_saldo_iniziale(gruppo,conto,sottoconto,indbil);
|
||||
}
|
||||
|
||||
#ifdef DBG
|
||||
@ -375,21 +383,23 @@ bool TSaldo::data_limite_bilancio(int bilancio, int g, int c, long s, const TDat
|
||||
TString dep2(_saldo.string());
|
||||
#endif
|
||||
|
||||
// Se non movimentato vado a vedere il saldo
|
||||
if (!_movimentato)
|
||||
_saldo = calcola_saldo_iniziale(g,c,s,indbil);
|
||||
// Se non movimentato vado a vedere il saldo
|
||||
if (!_movimentato)
|
||||
if (stp_prov != 3)
|
||||
_saldo = calcola_saldo_iniziale(g,c,s,indbil);
|
||||
|
||||
return _movimentato;
|
||||
}
|
||||
|
||||
|
||||
//per bilancio di verifica all'ultima immissione
|
||||
bool TSaldo::ultima_immissione_verifica(int annoes,int g,int c,long s,int indbil)
|
||||
bool TSaldo::ultima_immissione_verifica(int annoes,int g,int c,long s,int indbil,int stp_prov)
|
||||
{
|
||||
//Si considerano i saldi e non piu' i movimenti
|
||||
char sezione;
|
||||
int gruppo, conto, annoe;
|
||||
long sottoconto;
|
||||
real pdarepro, paverepro;
|
||||
bool esito = FALSE;
|
||||
TLocalisamfile saldi(LF_SALDI, FALSE);
|
||||
|
||||
@ -417,32 +427,55 @@ bool TSaldo::ultima_immissione_verifica(int annoes,int g,int c,long s,int indbil
|
||||
_saldo_iniziale = saldi.get_real(SLD_SALDO);
|
||||
_prg_dare = saldi.get_real(SLD_PDARE);
|
||||
_prg_avere = saldi.get_real(SLD_PAVERE);
|
||||
pdarepro = saldi.get_real(SLD_PDAREPRO);
|
||||
paverepro = saldi.get_real(SLD_PAVEREPRO);
|
||||
sezione = saldi.get_char(SLD_FLAGSALINI);
|
||||
|
||||
if (_saldo_iniziale == ZERO && _prg_dare == ZERO && _prg_avere == ZERO)
|
||||
return esito;
|
||||
if (stp_prov == 1) //bilancio normale (senza provvisori)
|
||||
if (_saldo_iniziale == ZERO && _prg_dare == ZERO && _prg_avere == ZERO)
|
||||
return esito;
|
||||
|
||||
if (stp_prov == 2) //bilancio globale (con provvisori)
|
||||
if (_saldo_iniziale == ZERO && _prg_dare == ZERO && _prg_avere == ZERO
|
||||
&& pdarepro == ZERO && paverepro == ZERO)
|
||||
return esito;
|
||||
|
||||
if (stp_prov == 3) //bilancio dei soli mov. provvisori
|
||||
if (pdarepro == ZERO && paverepro == ZERO)
|
||||
return esito;
|
||||
|
||||
if (sezione == 'A') _saldo_iniziale = -_saldo_iniziale;
|
||||
|
||||
_saldoiniziale = _saldo_iniziale; //saldo iniziale presente sul record saldi
|
||||
//non comprensivo del saldo finale es.precedente
|
||||
if (indbil == 1 || indbil == 2 || indbil == 5)
|
||||
if (_saldo_iniziale == ZERO)
|
||||
_saldo_iniziale += saldofin_esprec(annoes,gruppo,conto,sottoconto);
|
||||
|
||||
if (stp_prov != 3)
|
||||
if (indbil == 1 || indbil == 2 || indbil == 5)
|
||||
if (_saldo_iniziale == ZERO)
|
||||
_saldo_iniziale += saldofin_esprec(annoes,gruppo,conto,sottoconto);
|
||||
|
||||
esito = TRUE;
|
||||
_saldo = _saldo_iniziale + _prg_dare - _prg_avere;
|
||||
|
||||
if (stp_prov == 1)
|
||||
_saldo = _saldo_iniziale + _prg_dare - _prg_avere;
|
||||
|
||||
if (stp_prov == 2)
|
||||
_saldo = _saldo_iniziale + _prg_dare - _prg_avere + pdarepro - paverepro;
|
||||
|
||||
if (stp_prov == 3)
|
||||
_saldo = pdarepro - paverepro;
|
||||
}
|
||||
return esito;
|
||||
}
|
||||
|
||||
//per bilancio scalare all'ultima immissione
|
||||
bool TSaldo::ultima_immissione_bilancio(int annoes,int g,int c,long s,int indbil)
|
||||
bool TSaldo::ultima_immissione_bilancio(int annoes,int g,int c,long s,int indbil,int stp_prov)
|
||||
{
|
||||
//Si considerano i saldi e non piu' i movimenti
|
||||
char sezione;
|
||||
int gruppo, conto, annoe;
|
||||
long sottoconto;
|
||||
real pdarepro, paverepro;
|
||||
bool esito = FALSE;
|
||||
TLocalisamfile saldi(LF_SALDI, FALSE);
|
||||
|
||||
@ -473,27 +506,44 @@ bool TSaldo::ultima_immissione_bilancio(int annoes,int g,int c,long s,int indbil
|
||||
_prg_avere = saldi.get_real(SLD_PAVERE);
|
||||
//_prg_daresca = saldi.get_real(SLD_PDARESCA);
|
||||
//_prg_averesca = saldi.get_real(SLD_PAVERESCA);
|
||||
pdarepro = saldi.get_real(SLD_PDAREPRO);
|
||||
paverepro = saldi.get_real(SLD_PAVEREPRO);
|
||||
sezione = saldi.get_char(SLD_FLAGSALINI);
|
||||
|
||||
/*
|
||||
esito = (_saldo_iniziale != ZERO || _prg_dare != ZERO || _prg_avere != ZERO
|
||||
|| _prg_daresca != ZERO || _prg_averesca != ZERO);
|
||||
*/
|
||||
if (stp_prov == 1) //bilancio normale (senza provvisori)
|
||||
esito = (_saldo_iniziale != ZERO || _prg_dare != ZERO || _prg_avere != ZERO);
|
||||
|
||||
esito = (_saldo_iniziale != ZERO || _prg_dare != ZERO || _prg_avere != ZERO);
|
||||
if (stp_prov == 2) //bilancio globale (con provvisori)
|
||||
esito = (_saldo_iniziale != ZERO || _prg_dare != ZERO || _prg_avere != ZERO
|
||||
|| pdarepro != ZERO || paverepro != ZERO);
|
||||
|
||||
if (stp_prov == 3) //bilancio dei soli mov. provvisori
|
||||
esito = (pdarepro != ZERO || paverepro != ZERO);
|
||||
|
||||
if (sezione == 'A') _saldo_iniziale = -_saldo_iniziale;
|
||||
|
||||
_rec_presente_ec = esito;
|
||||
}
|
||||
|
||||
if (indbil == 1 || indbil == 2 || indbil == 5)
|
||||
if (_saldo_iniziale == ZERO)
|
||||
_saldo_iniziale += saldofin_esprec(annoes,g,c,s);
|
||||
if (stp_prov != 3)
|
||||
if (indbil == 1 || indbil == 2 || indbil == 5)
|
||||
if (_saldo_iniziale == ZERO)
|
||||
_saldo_iniziale += saldofin_esprec(annoes,g,c,s);
|
||||
|
||||
//_saldo = _saldo_iniziale + _prg_dare - _prg_avere + _prg_daresca - _prg_averesca;
|
||||
_saldo = _saldo_iniziale + _prg_dare - _prg_avere;
|
||||
if (stp_prov == 1)
|
||||
_saldo = _saldo_iniziale + _prg_dare - _prg_avere;
|
||||
|
||||
if (stp_prov == 2)
|
||||
_saldo = _saldo_iniziale + _prg_dare - _prg_avere + pdarepro - paverepro;
|
||||
|
||||
if (stp_prov == 3)
|
||||
_saldo = pdarepro - paverepro;
|
||||
|
||||
return esito;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user