Bilanci : compattate ragioni sociali

Stampa piano dei conti : correzioni varie
Visualizzazione saldi : disabilitato speadsheet
Mastrini sistemati vari errori non segnalati e compattate descrizioni


git-svn-id: svn://10.65.10.50/trunk@509 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
nik 1994-11-02 09:58:32 +00:00
parent 82ea72349f
commit 43817827af
17 changed files with 2286 additions and 1891 deletions

View File

@ -73,6 +73,7 @@ class CG1100_application : public TPrintapp
TString _classe_da_stampare,_classe_stampata;
bool _conto_classificato,_sottoc_classificato,_stampa_riga_vuota;
bool _prima_volta;
TDate _data_stampa;
public:
@ -198,7 +199,7 @@ print_action CG1100_application::postprocess_page(int file,int counter)
{
//const char * buf;
struct bil_ivd* bil = (struct bil_ivd*) _buf;
/*
if (_sez_da_stamp != _sez_stamp)
{
if (_sez_da_stamp == '5' || _sez_da_stamp == '9')
@ -213,7 +214,7 @@ print_action CG1100_application::postprocess_page(int file,int counter)
}
else
_resetta_righe_stampa = TRUE;
*/
_sez_stamp = _sez_da_stamp;
_let_stamp = _let_da_stamp;
_numr_stamp = _numr_da_stamp;
@ -235,7 +236,7 @@ print_action CG1100_application::postprocess_page(int file,int counter)
_sottoc = atol(bil->sottoc);
_classe_da_stampare.format("%c%c%s%2d",_sez_da_stamp,_let_da_stamp,(const char*)_numr_da_stamp,_num_da_stamp);
set_auto_ff(FALSE);
//set_auto_ff(FALSE);
return REPEAT_PAGE;
}
@ -257,39 +258,39 @@ void CG1100_application::set_page(int file,int counter)
{
case con_IV_direttiva:
{
if (_resetta_righe_stampa)
{
// if (_resetta_righe_stampa)
// {
reset_print();
_i = 1;
}
// }
if (_sez_da_stamp != _sez_stamp)
{
if (_sez_da_stamp=='1' || _sez_da_stamp=='2')
// {
// if (_sez_da_stamp=='1' || _sez_da_stamp=='2')
set_con_IV ();
if (_sez_da_stamp == '5' || _sez_da_stamp == '9')
{
set_row (_i,"%s","");
set_auto_ff(TRUE);
}
}
// if (_sez_da_stamp == '5' || _sez_da_stamp == '9')
// {
// set_row (_i,"%s","");
// set_auto_ff(TRUE);
// }
// }
else
if (_buf != NULL)
set_con_IV();
}
break;
case con_ana_bil:
set_con_ana();
break;
case senza_IV_direttiva:
set_senza_IV();
break;
case senza_ana_bil:
set_senza_ana();
break;
default:
break;
}
break;
case con_ana_bil:
set_con_ana();
break;
case senza_IV_direttiva:
set_senza_IV();
break;
case senza_ana_bil:
set_senza_ana();
break;
default:
break;
}
}
//////////////////////////////////////////////////////////////
@ -428,7 +429,7 @@ void CG1100_application::scegli_cur()
bool CG1100_application::preprocess_print (int file,int counter)
{
//scegli_cur();
//scegli_cur();
switch (_tipo_stampa)
{
case con_IV_direttiva:
@ -455,9 +456,9 @@ bool CG1100_application::preprocess_print (int file,int counter)
return FALSE;
}
break;
default:
break;
}
default:
break;
}
return TRUE;
}
@ -496,15 +497,15 @@ void CG1100_application::set_con_IV()
set_row (_i++,"@0gCONTI D' ORDINE ATTIVI");
set_row (_i++,"@0g%c", app);
stampa_classe = FALSE;
}
}
else
if ((_sez_da_stamp == '1')&&(_let_da_stamp != 'Z'))
{
char app = ' ';
set_row (_i++,"@0g%c", app);
set_row (_i++,"@0gATTIVO");
set_row (_i++,"@0g%c", app);
}
{
char app = ' ';
set_row (_i++,"@0g%c", app);
set_row (_i++,"@0gATTIVO");
set_row (_i++,"@0g%c", app);
}
if ((_sez_da_stamp == '2')&&(_let_da_stamp == 'Z'))
{
@ -565,6 +566,8 @@ void CG1100_application::set_con_IV()
{
if ((_sez_da_stamp=='1')||(_sez_da_stamp=='2')||(_sez_da_stamp== '9'))
{
char app = ' ';
set_row (_i++,"@0g%c", app);
if (_let_da_stamp != ' ')
set_row(_i,"@0g%c", _let_da_stamp);
@ -611,6 +614,7 @@ void CG1100_application::setta_righe_descr(TParagraph_string* str)
set_row (_i,"@14g%s",r);
_i++;
}
_i--;
}
void CG1100_application::set_senza_IV()
@ -658,12 +662,21 @@ void CG1100_application::set_senza_IV()
set_row (i, "@16g@50s", FLD(LF_PCON,PCN_DESCR) );
set_row (i, "@87g@pn", FLD(LF_PCON, PCN_INDBIL, "##") );
set_row (i, "@92g@1s", FLD(LF_PCON, PCN_TMCF) );
set_row (i, "@99g@f", FLD(LF_PCON, PCN_STSOTTBIL) );
set_row (i, "@107g@f", FLD(LF_PCON, PCN_COMPENS) );
set_row (i, "@114g@1n", FLD(LF_PCON, PCN_TIPOSPRIC) );
set_row (i, "@120g@1s", FLD(LF_PCON, PCN_SEZSALDI) );
if (conto != 0 && sottoc == 0l)
{
set_row (i, "@76g@pn", FLD(LF_PCON, PCN_INDBIL, "##") );
set_row (i, "@82g@1s", FLD(LF_PCON, PCN_TMCF) );
set_row (i, "@89g@f", FLD(LF_PCON, PCN_STSOTTBIL) );
set_row (i, "@98g@f", FLD(LF_PCON, PCN_COMPENS) );
set_row (i, "@121g@f", FLD(LF_PCON, PCN_STSOTTAB) );
}
if (sottoc != 0l)
{
set_row (i, "@104g@1n", FLD(LF_PCON, PCN_RICSER) );
set_row (i, "@109g@1n", FLD(LF_PCON, PCN_TIPOSPRIC) );
set_row (i, "@115g@1s", FLD(LF_PCON, PCN_SEZSALDI) );
set_row (i, "@129g@f", FLD(LF_PCON, PCN_STSOTTAB) );
}
}
void CG1100_application::set_con_ana()
@ -761,7 +774,7 @@ void CG1100_application::set_completa()
FLD(LF_PCON, PCN_SOTTOCONTO, "######"));
// set_row (1, "@16g@50s", FLD(LF_PCON,PCN_DESCR) );
// set_row (1, "@16g@50s", FLD(LF_PCON,PCN_DESCR) );
set_row (i, "@16g%.40s", (const char*) desc);
if (sezione != '0' && sezione != '9')
@ -776,12 +789,14 @@ void CG1100_application::set_completa()
set_row (i, "@82g@1s", FLD(LF_PCON, PCN_TMCF) );
set_row (i, "@89g@f", FLD(LF_PCON, PCN_STSOTTBIL) );
set_row (i, "@98g@f", FLD(LF_PCON, PCN_COMPENS) );
set_row (i, "@121g@f", FLD(LF_PCON, PCN_STSOTTAB) );
}
if (sottoc != 0l)
{
set_row (i, "@104g@1n", FLD(LF_PCON, PCN_RICSER) );
set_row (i, "@109g@1n", FLD(LF_PCON, PCN_TIPOSPRIC) );
set_row (i, "@115g@1s", FLD(LF_PCON, PCN_SEZSALDI) );
set_row (i, "@129g@f", FLD(LF_PCON, PCN_STSOTTAB) );
}
_s_prec = sottoc;
}
@ -871,9 +886,15 @@ int CG1100_application::leggo_sottoc(int gruppo,int conto,long sottoc)
esiste_conto_non_classificato = TRUE;
}
if (!esiste_conto_classificato && esiste_conto_non_classificato)
esito = 0;
if (esiste_conto_classificato && esiste_conto_non_classificato)
esito = 1;
if (esiste_conto_classificato && !esiste_conto_non_classificato)
esito = 2;
return esito;
}
@ -905,8 +926,21 @@ bool CG1100_application::preprocess_page(int file,int counter)
if (sez == '0')
{
_conto_classificato = FALSE;
_sottoc_classificato = 2;
_sottoc_classificato = leggo_sottoc(gruppo,conto,sottoc);
if (_sottoc_classificato == 0)
_conto_classificato = TRUE;
else
if (_sottoc_classificato == 1)
{
_conto_classificato = FALSE;
return FALSE;
}
else
if (_sottoc_classificato == 2)
{
_conto_classificato = TRUE;
return FALSE;
}
}
else
{
@ -918,19 +952,10 @@ bool CG1100_application::preprocess_page(int file,int counter)
{
if (!_conto_classificato)
{
if (_sottoc_classificato == 2)
_sottoc_classificato = leggo_sottoc(gruppo,conto,sottoc);
char sezione = rec.get_char(PCN_SEZIVD);
if (_sottoc_classificato == 0)
if (sezione != '0')
return FALSE;
else
if (_sottoc_classificato == 1)
{
char sezione = rec.get_char(PCN_SEZIVD);
if (sezione != '0')
return FALSE;
}
}
else
return FALSE;
@ -974,6 +999,7 @@ bool CG1100_application::set_print(int)
{
_tipo_stampa = (stampe)_msk->get_int(F_SCELTA_STAMPA);
_salto_pag = _msk->get_bool (F_SALTO_PAGINA);
_data_stampa = _msk->get (F_DATA_STAMPA);
// scegli_cur();
enable_link("Collegamento Piano dei conti : ", 'r');
@ -1015,8 +1041,9 @@ void CG1100_application::intesta (stampe tipo)
TString s(132);
s = ditte.get(NDT_RAGSOC);
TString data = _data_stampa.string();
set_header (soh++, "Ditta : %ld %s@110gData : @< Pag. @#", firm, (const char *) s);
set_header (soh++, "Ditta : %ld %s@110gData@115g%s Pag. @#", firm, (const char *) s, (const char*) data);
set_header (soh,"@0gPIANO DEI CONTI");
@ -1036,7 +1063,7 @@ void CG1100_application::intesta (stampe tipo)
s.fill('_');
set_header (soh++, (const char *) s);
set_header (soh++, "@58gCodici Piano@116gSez. e Classe");
set_header (soh++, "Classe@14gDescrizione@58gdei Conti @73gDescrizione@116gclasse opposta");
set_header (soh++, "Classe@14gDescrizione@58gdei Conti @73gDescrizione@116gdi segno opposto");
break;
@ -1044,8 +1071,8 @@ void CG1100_application::intesta (stampe tipo)
set_header (soh++, "@20gStampa conti non collegati per IV direttiva");
s.fill('_');
set_header (soh++, (const char *) s);
set_header (soh++, "Conto@85gTipo@96gDettaglio@112gSpesa @123gDet.bil.");
set_header (soh++, "Sottoconto @16gDescrizione@85gConto @91gC/F @96gBilancio @106gComp. @112gRicavo @119gSez");
set_header (soh++, "Conto @75gTipo@86gDettaglio@104gT@107gSpesa@118gDet.alleg.bil.");
set_header (soh++, "Sottoconto @16gDescrizione@75gConto@81gC/F@86gBilancio@97gComp.@104gA@107gRicavo@114gSez@118gSot.con * Mov.");
break;
case con_ana_bil:
@ -1088,14 +1115,14 @@ const char* CG1100_application::descrizione_numero(char sezione, char lettera, i
dep = format("%1c%1c%04d",sezione, lettera, numr);
else
dep = format("%c%c ",sezione,lettera);
}
else
{
if (numr != 0)
dep = format("%1c%1c%04d%02d",sezione, lettera, numr,numero);
else
dep = format("%c%c %02d",sezione,lettera,numero);
}
}
else
{
if (numr != 0)
dep = format("%1c%1c%04d%02d",sezione, lettera, numr,numero);
else
dep = format("%c%c %02d",sezione,lettera,numero);
}
tabivd.put("CODTAB", dep);
tabivd.read();

View File

@ -1736,7 +1736,7 @@ void CG1500_application::crea_sort_clifo()
int g=0, c=0;
long codcf=0l;
TString80 ragsoc;
char tipocf,tipocfp;
char tipocf,tipocfp,tipoa;
real saldo_finale, saldo_conto, saldo_iniziale, saldodare, saldoavere,
movdare, movavere;
real mov_conto_dare, mov_conto_avere, prg_conto_dare, prg_conto_avere;
@ -1767,6 +1767,16 @@ void CG1500_application::crea_sort_clifo()
codcf = _cur->curr().get_long(CLI_CODCF);
tipocf = _cur->curr().get(CLI_TIPOCF)[0];
ragsoc = _cur->curr().get(CLI_RAGSOC);
tipoa = _cur->curr().get_char(CLI_TIPOAPER);
if (tipoa == 'F') //persona fisica
{
TString80 cognome, nome;
cognome = ragsoc.mid(0,30);
nome = ragsoc.mid(30,20);
cognome.trim(); nome.trim();
ragsoc = cognome;
ragsoc << " " << nome;
}
if (tipocf == 'C')
gccf = _clienti;
@ -2843,6 +2853,7 @@ TDate CG1500_application::UltimaData(int g, int c, long s, int anno)
return uldata;
}
//Non ho potuto usare quella di TConto!!! Chiedere a me!
const char* CG1500_application::DescrizioneConto(int g, int c, long s,
char tipocf)
{
@ -2851,6 +2862,8 @@ const char* CG1500_application::DescrizioneConto(int g, int c, long s,
TMP = tc.descrizione();
return TMP;
*/
TFixed_string ragsoc(&__tmp_string[256], 50);
const char* desc = NULL;
TLocalisamfile pconti(LF_PCON,FALSE);
TLocalisamfile clifo (LF_CLIFO);
@ -2869,9 +2882,24 @@ const char* CG1500_application::DescrizioneConto(int g, int c, long s,
clifo.zero();
clifo.put(CLI_CODCF, s);
clifo.put(CLI_TIPOCF,tipocf);
clifo.read();
if (clifo.good())
TMP = clifo.get(CLI_RAGSOC);
if (clifo.read() == NOERR)
{
char tipoa = clifo.get_char("TIPOAPER");
if (tipoa == 'F') //persona fisica
{
TString80 cognome, nome;
ragsoc = clifo.get("RAGSOC");
cognome = ragsoc.mid(0,30);
nome = ragsoc.mid(30,20);
cognome.trim(); nome.trim();
ragsoc = cognome;
ragsoc << " " << nome;
desc = ragsoc;
}
else
desc = clifo.get("RAGSOC");
TMP = desc;
}
else
TMP = "";
}

View File

@ -22,7 +22,7 @@
#define F_MODULO 121
#define F_STAMPAMPROV 122
#endif // __CG1500_H
#endif // __CG1500_H

View File

@ -36,6 +36,9 @@ BEGIN
DISPLAY "Data inizio esercizio" D0
DISPLAY "Data fine esercizio" D1
OUTPUT F_ANNO CODTAB
//CHECKTYPE NORMAL
//MESSAGE HIDE,98|HIDE,99|SHOW,96|SHOW,97 //se il campo e' vuoto manda questi messaggi
//MESSAGE EMPTY HIDE,96|HIDE,97|SHOW,98|SHOW,99 //se invece e' pieno manda questi
FLAGS "RZ"
END
@ -75,6 +78,7 @@ END
RADIOBUTTON F_STAMPA1 28
BEGIN
PROMPT 40 5 "Tipo stampa "
//FLAGS "G"
HELP "Indicare il tipo di stampa"
ITEM "1|Per date limite"
MESSAGE SHOW,F_VERIFICA|SHOW,F_MODULO

View File

@ -276,12 +276,14 @@ class CG1600_application : public TPrintapp
Righe_sez_opp _sezopps;
TSaldi_list* _listasld;
TProgind* _prog;
TParagraph_string * _descr;
TDate _data_fine_ese,_data_fine_ese_prec,_data_fine_raf,_data_fine_raf_prec;
TDate _datastampa,_datalimite,_databilrafr,_datai,_datairaf;
TDate _dataini,_datafine,_data_ini_ese,_data_ini_raf;
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;
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;
@ -340,6 +342,8 @@ public:
void crea_sort_tabella();
void crea_sort_piano_conti_scalare();
void crea_sort_piano_conti_verifica();
void setta_righe_descr(TParagraph_string*,const TString&,const TString&);
void setta_righe_descr_verifica(TParagraph_string*,const TString&,const TString&);
void scrivi_record(const TString&,const TString&,const TString&,int,int,int,long,const real&,const real&,const real&,const real&,const real&,const real&,char,bool conto_dettagliato = TRUE);
void riempi_record(const TString&,const TString&,const TString&,int,int,int,long,const real&,const real&,const real&,const real&,const real&,const real&,char,bool conto_dettagliato = TRUE);
const char* descrizione_sezione(char);
@ -2014,6 +2018,8 @@ if (tasto == K_ENTER)
_diffprod_fatto = TRUE;
_risimp_fatto = TRUE;
_sbilancio_ordine = FALSE;
_sbilancio_patr_gia_stampato = FALSE;
_attivo_o_passivo = FALSE;
_sez_stamp = ' ';
_let_stamp = ' ';
@ -2095,6 +2101,9 @@ void CG1600_application::stampa_totali()
_sez_tot = ' ';
}
if ((_sez_stamp == '1' || _sez_stamp == '2') && _let_stamp != 'Z')
_attivo_o_passivo = TRUE;
if (_num_da_stamp!=_num_tot)
{
if (_let_stamp != 'Z')
@ -2301,15 +2310,20 @@ void CG1600_application::stampa_totali()
set_row (_i,"@0gTOTALE CONTI D' ORDINE PASSIVI");
set_row (_i++,"@86g%r", &_totale_ordine_passivo);
_i++;
real totale = _totale_ordine_attivo - _totale_ordine_passivo;
if (totale != ZERO)
if (!_attivo_o_passivo)
{
set_row (_i++,"@0gSALDO CONTI D' ORDINE");
set_row (_i,"@0gSBILANCIO");
set_row (_i++,"@86g%r", &totale);
real totale = _totale_ordine_attivo - _totale_ordine_passivo;
if (totale != ZERO)
{
set_row (_i++,"@0gSALDO CONTI D' ORDINE");
set_row (_i,"@0gSBILANCIO");
set_row (_i++,"@86g%r", &totale);
}
_totale_ordine_attivo = ZERO;
_totale_ordine_passivo = ZERO;
_sbilancio_ordine = TRUE;
}
_totale_ordine_attivo = ZERO;
_totale_ordine_passivo = ZERO;
gia_stampato_conto_ord = TRUE;
}
}
@ -2391,15 +2405,32 @@ void CG1600_application::stampa_totali()
if (!gia_stampato_conto_ord)
{
if (_sez_stamp == '2')
{
if (!_sbilancio_patr_gia_stampato)
{
_totale_patrimoniale = _totale_attivita - _totale_passivita;
if (_totale_patrimoniale != ZERO)
{
char app = ' ';
set_row (_i++,"@0g%c", app);
set_row (_i++,"@0gSALDO STATO PATRIMONIALE");
set_row (_i,"@0gSBILANCIO (ATTIVO - PASSIVO)");
//_totale_patrimoniale = _totale_attivita - _totale_passivita;
set_row (_i++,"@86g%r", &_totale_patrimoniale);
_totale_patrimoniale = ZERO;
}
_sbilancio_patr_gia_stampato = TRUE;
}
}
if ((_sez_stamp == '1')&&(_let_stamp == 'Z'))
{
char app = ' ';
set_row (_i++,"@0g%c", app);
set_row (_i,"@0gTOTALE CONTI D' ORDINE ATTIVI");
set_row (_i++,"@86g%r", &_totale_ordine_attivo);
// _totale_ordine_attivo = ZERO;
// _totale_ordine_attivo = ZERO;
}
if ((_sez_stamp == '2')&&(_let_stamp == 'Z'))
{
char app = ' ';
@ -2407,40 +2438,50 @@ void CG1600_application::stampa_totali()
set_row (_i,"@0gTOTALE CONTI D' ORDINE PASSIVI");
set_row (_i++,"@86g%r", &_totale_ordine_passivo);
_i++;
real totale = _totale_ordine_attivo - _totale_ordine_passivo;
if (totale != ZERO)
if (!_sbilancio_ordine)
{
set_row (_i++,"@0g%c", app);
set_row (_i++,"@0gSALDO CONTI D' ORDINE");
set_row (_i,"@0gSBILANCIO");
set_row (_i++,"@86g%r", &totale);
_sbilancio_ordine = TRUE;
real totale = _totale_ordine_attivo - _totale_ordine_passivo;
if (totale != ZERO)
{
set_row (_i++,"@0g%c", app);
set_row (_i++,"@0gSALDO CONTI D' ORDINE");
set_row (_i,"@0gSBILANCIO");
set_row (_i++,"@86g%r", &totale);
_sbilancio_ordine = TRUE;
}
_totale_ordine_passivo = ZERO;
_totale_ordine_attivo = ZERO;
}
_totale_ordine_passivo = ZERO;
_totale_ordine_attivo = ZERO;
}
}
if (_sez_stamp == '2')
{
char app = ' ';
_totale_patrimoniale = _totale_attivita - _totale_passivita;
real totale = _totale_ordine_attivo - _totale_ordine_passivo;
if (totale != ZERO && !_sbilancio_ordine)
if (!_sbilancio_patr_gia_stampato)
{
set_row (_i++,"@0g%c", app);
set_row (_i++,"@0gSALDO CONTI D' ORDINE");
set_row (_i,"@0gSBILANCIO");
set_row (_i++,"@86g%r", &totale);
_totale_patrimoniale = _totale_attivita - _totale_passivita;
if (_totale_patrimoniale != ZERO)
{
set_row (_i++,"@0g%c", app);
set_row (_i++,"@0gSALDO STATO PATRIMONIALE");
set_row (_i,"@0gSBILANCIO (ATTIVO - PASSIVO)");
//_totale_patrimoniale = _totale_attivita - _totale_passivita;
set_row (_i++,"@86g%r", &_totale_patrimoniale);
_totale_patrimoniale = ZERO;
}
}
if (_totale_patrimoniale != ZERO)
if (!_sbilancio_ordine)
{
set_row (_i++,"@0g%c", app);
set_row (_i++,"@0gSALDO STATO PATRIMONIALE");
set_row (_i,"@0gSBILANCIO (ATTIVO - PASSIVO)");
//_totale_patrimoniale = _totale_attivita - _totale_passivita;
set_row (_i++,"@86g%r", &_totale_patrimoniale);
_totale_patrimoniale = ZERO;
real totale = _totale_ordine_attivo - _totale_ordine_passivo;
if (totale != ZERO && !_sbilancio_ordine)
{
set_row (_i++,"@0g%c", app);
set_row (_i++,"@0gSALDO CONTI D' ORDINE");
set_row (_i,"@0gSBILANCIO");
set_row (_i++,"@86g%r", &totale);
}
}
}
if (_sez_stamp == '5')
@ -2506,6 +2547,9 @@ void CG1600_application::stampa_totali_con_raffronto()
_sez_tot = ' ';
}
if ((_sez_stamp == '1' || _sez_stamp == '2') && _let_stamp != 'Z')
_attivo_o_passivo = TRUE;
if (_num_da_stamp!=_num_tot)
{
@ -2738,20 +2782,25 @@ void CG1600_application::stampa_totali_con_raffronto()
set_row (_i,"@86g%r", &_totale_ordine_passivo);
set_row (_i++,"@112g%r", &_totale_ordine_passivo_raf);
_i++;
real totale = _totale_ordine_attivo - _totale_ordine_passivo;
real tot_raf = _totale_ordine_attivo_raf - _totale_ordine_passivo_raf;
if (totale != ZERO || tot_raf != ZERO)
{
set_row (_i++,"@0gSALDO CONTI D' ORDINE");
set_row (_i,"@0gSBILANCIO");
set_row (_i,"@86g%r", &totale);
set_row (_i++,"@112g%r", &tot_raf);
}
_totale_ordine_attivo = ZERO;
_totale_ordine_attivo_raf = ZERO;
_totale_ordine_passivo = ZERO;
_totale_ordine_passivo_raf = ZERO;
gia_stampato_conto_ord = TRUE;
if (!_attivo_o_passivo)
{
real totale = _totale_ordine_attivo - _totale_ordine_passivo;
real tot_raf = _totale_ordine_attivo_raf - _totale_ordine_passivo_raf;
if (totale != ZERO || tot_raf != ZERO)
{
set_row (_i++,"@0gSALDO CONTI D' ORDINE");
set_row (_i,"@0gSBILANCIO");
set_row (_i,"@86g%r", &totale);
set_row (_i++,"@112g%r", &tot_raf);
}
_totale_ordine_attivo = ZERO;
_totale_ordine_attivo_raf = ZERO;
_totale_ordine_passivo = ZERO;
_totale_ordine_passivo_raf = ZERO;
_sbilancio_ordine = TRUE;
_sbilancio_patr_gia_stampato = TRUE; //Se passa di qui non ci sono ne attivi ne passivo
}
}
}
_cont_gcs = 0;
@ -2847,6 +2896,28 @@ void CG1600_application::stampa_totali_con_raffronto()
if (!gia_stampato_conto_ord)
{
if (_sez_stamp == '2')
{
if (!_sbilancio_patr_gia_stampato)
{
_totale_patrimoniale = _totale_attivita - _totale_passivita;
_totale_patrim_raf = _totale_attiv_raf - _totale_passiv_raf;
if (_totale_patrimoniale != ZERO || _totale_patrim_raf != ZERO)
{
char app = ' ';
set_row (_i++,"@0g%c", app);
set_row (_i++,"@0gSALDO STATO PATRIMONIALE");
set_row (_i,"@0gSBILANCIO (ATTIVO - PASSIVO)");
//_totale_patrimoniale = _totale_attivita - _totale_passivita;
//_totale_patrim_raf = _totale_attiv_raf - _totale_passiv_raf;
set_row (_i,"@86g%r", &_totale_patrimoniale);
set_row (_i++,"@112g%r", &_totale_patrim_raf);
_totale_patrimoniale = 0;
_totale_patrim_raf = 0;
}
_sbilancio_patr_gia_stampato = TRUE;
}
}
if ((_sez_stamp == '1')&&(_let_stamp == 'Z'))
{
char app = ' ';
@ -2866,50 +2937,60 @@ void CG1600_application::stampa_totali_con_raffronto()
set_row (_i,"@86g%r", &_totale_ordine_passivo);
set_row (_i++,"@112g%r", &_totale_ordine_passivo_raf);
_i++;
real totale = _totale_ordine_attivo - _totale_ordine_passivo;
real tot_raf = _totale_ordine_attivo_raf - _totale_ordine_passivo_raf;
if (totale != ZERO || tot_raf != ZERO)
if (!_sbilancio_ordine)
{
set_row (_i++,"@0g%c", app);
set_row (_i++,"@0gSALDO CONTI D' ORDINE");
set_row (_i,"@0gSBILANCIO");
set_row (_i,"@86g%r", &totale);
set_row (_i++,"@112g%r", &tot_raf);
real totale = _totale_ordine_attivo - _totale_ordine_passivo;
real tot_raf = _totale_ordine_attivo_raf - _totale_ordine_passivo_raf;
if (totale != ZERO || tot_raf != ZERO)
{
set_row (_i++,"@0g%c", app);
set_row (_i++,"@0gSALDO CONTI D' ORDINE");
set_row (_i,"@0gSBILANCIO");
set_row (_i,"@86g%r", &totale);
set_row (_i++,"@112g%r", &tot_raf);
_sbilancio_ordine = TRUE;
}
_totale_ordine_attivo = ZERO;
_totale_ordine_attivo_raf = ZERO;
_totale_ordine_passivo = ZERO;
_totale_ordine_passivo_raf = ZERO;
_sbilancio_ordine = TRUE;
}
_totale_ordine_attivo = ZERO;
_totale_ordine_attivo_raf = ZERO;
_totale_ordine_passivo = ZERO;
_totale_ordine_passivo_raf = ZERO;
}
}
if (_sez_stamp == '2')
{
char app = ' ';
_totale_patrimoniale = _totale_attivita - _totale_passivita;
_totale_patrim_raf = _totale_attiv_raf - _totale_passiv_raf;
real totale = _totale_ordine_attivo - _totale_ordine_passivo;
real tot_raf = _totale_ordine_attivo_raf - _totale_ordine_passivo_raf;
if ((totale != ZERO || tot_raf != ZERO) && !_sbilancio_ordine)
if (!_sbilancio_patr_gia_stampato)
{
set_row (_i++,"@0g%c", app);
set_row (_i++,"@0gSALDO CONTI D' ORDINE");
set_row (_i,"@0gSBILANCIO");
set_row (_i,"@86g%r", &totale);
set_row (_i++,"@112g%r", &tot_raf);
_totale_patrimoniale = _totale_attivita - _totale_passivita;
_totale_patrim_raf = _totale_attiv_raf - _totale_passiv_raf;
if (_totale_patrimoniale != ZERO || _totale_patrim_raf != ZERO)
{
set_row (_i++,"@0g%c", app);
set_row (_i++,"@0gSALDO STATO PATRIMONIALE");
set_row (_i,"@0gSBILANCIO (ATTIVO - PASSIVO)");
//_totale_patrimoniale = _totale_attivita - _totale_passivita;
//_totale_patrim_raf = _totale_attiv_raf - _totale_passiv_raf;
set_row (_i,"@86g%r", &_totale_patrimoniale);
set_row (_i++,"@112g%r", &_totale_patrim_raf);
_totale_patrimoniale = 0;
_totale_patrim_raf = 0;
}
}
if (_totale_patrimoniale != ZERO || _totale_patrim_raf != ZERO)
if (!_sbilancio_ordine)
{
set_row (_i++,"@0g%c", app);
set_row (_i++,"@0gSALDO STATO PATRIMONIALE");
set_row (_i,"@0gSBILANCIO (ATTIVO - PASSIVO)");
//_totale_patrimoniale = _totale_attivita - _totale_passivita;
//_totale_patrim_raf = _totale_attiv_raf - _totale_passiv_raf;
set_row (_i,"@86g%r", &_totale_patrimoniale);
set_row (_i++,"@112g%r", &_totale_patrim_raf);
_totale_patrimoniale = 0;
_totale_patrim_raf = 0;
real totale = _totale_ordine_attivo - _totale_ordine_passivo;
real tot_raf = _totale_ordine_attivo_raf - _totale_ordine_passivo_raf;
if ((totale != ZERO || tot_raf != ZERO) && !_sbilancio_ordine)
{
set_row (_i++,"@0g%c", app);
set_row (_i++,"@0gSALDO CONTI D' ORDINE");
set_row (_i,"@0gSBILANCIO");
set_row (_i,"@86g%r", &totale);
set_row (_i++,"@112g%r", &tot_raf);
}
}
}
if (_sez_stamp == '5')
@ -3952,7 +4033,14 @@ void CG1600_application::setta_righe(const char * titolo)
TString numrom,numr;
TString descr_let,descr_numr,descr_num,descr_sottoc,descr_classe;
bool stampa_classe = TRUE;
TString lettera1 = "@1g)@3g%s";
TString lettera2 = "@3g%s";
TString numr1 = "@12g-@14g%s";
TString numr2 = "@14g%s";
TString num = "@15g)@18g%s";
TString num2 = "@18g%s";
_descr->set_width(40);
sezione = bil->sez;
lettera = bil->let;
numr = bil->numr;
@ -3964,7 +4052,6 @@ void CG1600_application::setta_righe(const char * titolo)
gruppo = atoi(bil->gruppo);
conto = atoi(bil->conto);
sottoc = atoi(bil->sottoc);
_descr_sez = descrizione_sezione(sezione);
descr_let = descrizione_lettera(sezione,lettera);
descr_numr = descrizione_numeroromano(sezione,lettera,numeror);
descr_num = descrizione_numero(sezione,lettera,numeror,numero);
@ -4029,17 +4116,23 @@ void CG1600_application::setta_righe(const char * titolo)
if (lettera != ' ')
{
set_row(_i,"@0g%c", bil->let);
set_row(_i++,"@1g)@3g%s", (const char*) descr_let);
*_descr = (const char*) descr_let;
setta_righe_descr(_descr,lettera1,lettera2);
//set_row(_i++,"@1g)@3g%s", (const char*) descr_let);
}
if (numrom != "")
{
set_row(_i,"@3g%8s", (const char*) numrom);
set_row(_i++,"@12g-@14g%s", (const char*) descr_numr);
*_descr = (const char*) descr_numr;
setta_righe_descr(_descr,numr1,numr2);
//set_row(_i++,"@12g-@14g%s", (const char*) descr_numr);
}
if (numero != 0)
{
set_row(_i,"@13g%s", bil->num);
set_row(_i++,"@15g)@18g%s", (const char*) descr_num);
*_descr = (const char*) descr_num;
setta_righe_descr(_descr,num,num2);
//set_row(_i++,"@15g)@18g%s", (const char*) descr_num);
}
}
}
@ -4068,7 +4161,9 @@ void CG1600_application::setta_righe(const char * titolo)
if ((_sez_da_stamp=='1')||(_sez_da_stamp=='2')||(_sez_da_stamp=='9'))
{
set_row(_i,"@0g%c", bil->let);
set_row(_i++,"@1g)@3g%s", (const char*) descr_let);
*_descr = (const char*) descr_let;
setta_righe_descr(_descr,lettera1,lettera2);
//set_row(_i++,"@1g)@3g%s", (const char*) descr_let);
//_cont_let += 1;
if (!_intera_struttura || (_intera_struttura && bil->gruppo[0] != 'Z'))
{
@ -4080,12 +4175,16 @@ void CG1600_application::setta_righe(const char * titolo)
if (numrom != "")
{
set_row(_i,"@3g%8s", (const char*) numrom);
set_row(_i++,"@12g-@14g%s", (const char*) descr_numr);
*_descr = (const char*) descr_numr;
setta_righe_descr(_descr,numr1,numr2);
//set_row(_i++,"@12g-@14g%s", (const char*) descr_numr);
}
if (numero != 0)
{
set_row(_i,"@13g%s", bil->num);
set_row(_i++,"@15g)@18g%s", (const char*) descr_num);
*_descr = (const char*) descr_num;
setta_righe_descr(_descr,num,num2);
//set_row(_i++,"@15g)@18g%s", (const char*) descr_num);
}
}
}
@ -4096,7 +4195,9 @@ void CG1600_application::setta_righe(const char * titolo)
if ((_sez_da_stamp=='1')||(_sez_da_stamp=='2')||(_sez_da_stamp=='9'))
{
set_row(_i,"@3g%8s", (const char*) numrom);
set_row(_i++,"@12g-@14g%s", (const char*) descr_numr);
*_descr = (const char*) descr_numr;
setta_righe_descr(_descr,numr1,numr2);
//set_row(_i++,"@12g-@14g%s", (const char*) descr_numr);
//_cont_numr += 1;
//_cont_numr = 1;
if (!_intera_struttura || (_intera_struttura && bil->gruppo[0] != 'Z'))
@ -4108,7 +4209,9 @@ void CG1600_application::setta_righe(const char * titolo)
if (numero != 0)
{
set_row(_i,"@13g%s", bil->num);
set_row(_i++,"@15g)@18g%s", (const char*) descr_num);
*_descr = (const char*) descr_num;
setta_righe_descr(_descr,num,num2);
//set_row(_i++,"@15g)@18g%s", (const char*) descr_num);
}
}
}
@ -4118,7 +4221,9 @@ void CG1600_application::setta_righe(const char * titolo)
if ((_sez_da_stamp=='1')||(_sez_da_stamp=='2')||(_sez_da_stamp=='9'))
{
set_row(_i,"@13g%s", bil->num);
set_row(_i++,"@15g)@18g%s", (const char*) descr_num);
*_descr = (const char*) descr_num;
setta_righe_descr(_descr,num,num2);
//set_row(_i++,"@15g)@18g%s", (const char*) descr_num);
//_cont_num += 1;
if (!_intera_struttura || (_intera_struttura && bil->gruppo[0] != 'Z'))
_cont_gcs = 0;
@ -4175,6 +4280,14 @@ void CG1600_application::setta_righe_verifica()
long sottoc;
TString numrom,numr;
TString descr_let,descr_numr,descr_num,descr_sottoc,descr_classe;
TString lettera1 = "@1g)@3g%s";
TString lettera2 = "@3g%s";
TString numr1 = "@8g)@10g%s";
TString numr2 = "@10g%s";
TString num = "@2g)@4g%s";
TString num2 = "@4g%s";
_descr->set_width(35);
sezione = bil->sez;
lettera = bil->let;
@ -4187,12 +4300,19 @@ void CG1600_application::setta_righe_verifica()
conto = atoi(bil->conto);
sottoc = atoi(bil->sottoc);
tmcf = bil->tipocf;
_descr_sez = descrizione_sezione(sezione);
descr_let = descrizione_lettera(sezione,lettera);
descr_numr = descrizione_numeroromano(sezione,lettera,numeror);
descr_num = descrizione_numero(sezione,lettera,numeror,numero);
if ((tmcf == 'C') || (tmcf == 'F'))
descr_sottoc = descr_sottoc_clifo(tmcf,sottoc);
{
if (gruppo != 0 && conto != 0 && sottoc != 0)
{
TConto tc (gruppo,conto,sottoc,tmcf);
descr_sottoc = tc.descrizione();
}
else
descr_sottoc = descrizione_sottoconto(gruppo,conto,sottoc);
}
else
descr_sottoc = descrizione_sottoconto(gruppo,conto,sottoc);
@ -4219,20 +4339,26 @@ void CG1600_application::setta_righe_verifica()
if (lettera != '\0')
{
set_row(_i,"@0g%c", bil->let);
set_row(_i,"@1g)@3g%s", (const char*) descr_let);
set_row (_i++,"@48g!@81g!@114g!");
*_descr = (const char*) descr_let;
setta_righe_descr_verifica(_descr,lettera1,lettera2);
//set_row(_i,"@1g)@3g%s", (const char*) descr_let);
//set_row (_i++,"@48g!@81g!@114g!");
}
if (numrom != "")
{
set_row(_i,"@0g%8s", (const char*) numrom);
set_row(_i,"@8g)@10g%s", (const char*) descr_numr);
set_row (_i++,"@48g!@81g!@114g!");
*_descr = (const char*) descr_numr;
setta_righe_descr_verifica(_descr,numr1,numr2);
//set_row(_i,"@8g)@10g%s", (const char*) descr_numr);
//set_row (_i++,"@48g!@81g!@114g!");
}
if (numero != 0)
{
set_row(_i,"@0g%s", bil->num);
set_row(_i,"@2g)@4g%s", (const char*) descr_num);
set_row (_i++,"@48g!@81g!@114g!");
*_descr = (const char*) descr_num;
setta_righe_descr_verifica(_descr,num,num2);
//set_row(_i,"@2g)@4g%s", (const char*) descr_num);
//set_row (_i++,"@48g!@81g!@114g!");
}
}
}
@ -4248,8 +4374,10 @@ void CG1600_application::setta_righe_verifica()
if (_let_da_stamp != 'Z')
{
set_row(_i,"@0g%c", bil->let);
set_row(_i,"@1g)@3g%s", (const char*) descr_let);
set_row (_i++,"@48g!@81g!@114g!");
*_descr = (const char*) descr_let;
setta_righe_descr_verifica(_descr,lettera1,lettera2);
//set_row(_i,"@1g)@3g%s", (const char*) descr_let);
//set_row (_i++,"@48g!@81g!@114g!");
//_cont_let += 1;
if (!_intera_struttura || (_intera_struttura && bil->gruppo[0] != 'Z'))
{
@ -4261,14 +4389,18 @@ void CG1600_application::setta_righe_verifica()
if (numrom != "")
{
set_row(_i,"@0g%8s", (const char*) numrom);
set_row(_i,"@8g)@10g%s", (const char*) descr_numr);
set_row (_i++,"@48g!@81g!@114g!");
*_descr = (const char*) descr_numr;
setta_righe_descr_verifica(_descr,numr1,numr2);
//set_row(_i,"@8g)@10g%s", (const char*) descr_numr);
//set_row (_i++,"@48g!@81g!@114g!");
}
if (numero != 0)
{
set_row(_i,"@0g%s", bil->num);
set_row(_i,"@2g)@4g%s", (const char*) descr_num);
set_row (_i++,"@48g!@81g!@114g!");
*_descr = (const char*) descr_num;
setta_righe_descr_verifica(_descr,num,num2);
//set_row(_i,"@2g)@4g%s", (const char*) descr_num);
//set_row (_i++,"@48g!@81g!@114g!");
}
}
}
@ -4284,8 +4416,10 @@ void CG1600_application::setta_righe_verifica()
if (_let_da_stamp != 'Z')
{
set_row(_i,"@0g%8s", (const char*) numrom);
set_row(_i,"@8g)@10g%s", (const char*) descr_numr);
set_row (_i++,"@48g!@81g!@114g!");
*_descr = (const char*) descr_numr;
setta_righe_descr_verifica(_descr,numr1,numr2);
//set_row(_i,"@8g)@10g%s", (const char*) descr_numr);
//set_row (_i++,"@48g!@81g!@114g!");
//_cont_numr += 1;
//_cont_numr = 1;
if (!_intera_struttura || (_intera_struttura && bil->gruppo[0] != 'Z'))
@ -4297,8 +4431,10 @@ void CG1600_application::setta_righe_verifica()
if (numero != 0)
{
set_row(_i,"@0g%s", bil->num);
set_row(_i,"@2g)@4g%s", (const char*) descr_num);
set_row (_i++,"@48g!@81g!@114g!");
*_descr = (const char*) descr_num;
setta_righe_descr_verifica(_descr,num,num2);
//set_row(_i,"@2g)@4g%s", (const char*) descr_num);
//set_row (_i++,"@48g!@81g!@114g!");
}
}
}
@ -4314,8 +4450,10 @@ void CG1600_application::setta_righe_verifica()
if (_let_da_stamp != 'Z')
{
set_row(_i,"@0g%s", bil->num);
set_row(_i,"@2g)@4g%s", (const char*) descr_num);
set_row (_i++,"@48g!@81g!@114g!");
*_descr = (const char*) descr_num;
setta_righe_descr_verifica(_descr,num,num2);
//set_row(_i,"@2g)@4g%s", (const char*) descr_num);
//set_row (_i++,"@48g!@81g!@114g!");
_cont_num += 1;
_cont_gcs = 0;
}
@ -4404,6 +4542,43 @@ void CG1600_application::setta_righe_verifica()
}
}
void CG1600_application::setta_righe_descr(TParagraph_string* str,const TString& formato,const TString& formato2)
{
const char* r;
int i = 1;
while ((r = str->get()) != NULL)
{
if (i == 1)
set_row (_i,formato, r);
else
if (i > 1)
set_row (_i,formato2,r);
_i++;
i++;
}
}
void CG1600_application::setta_righe_descr_verifica(TParagraph_string* str,const TString& formato,const TString& formato2)
{
const char* r;
int i = 1;
while ((r = str->get()) != NULL)
{
if (i == 1)
set_row (_i,formato, r);
else
if (i > 1)
set_row (_i,formato2,r);
set_row (_i,"@48g!@81g!@114g!");
_i++;
i++;
}
}
const char* CG1600_application::descrizione_sezione(char sezione)
{
TTable tabivd(TAB_IVD);
@ -4727,6 +4902,7 @@ void CG1600_application::user_create()
_anag = new TLocalisamfile (LF_ANAG);
_pconti = new TLocalisamfile (LF_PCON);
_clifo = new TLocalisamfile (LF_CLIFO);
_descr = new TParagraph_string ("",40);
_tabivd = new TTable (TAB_IVD);
_tabesc = new TTable (TAB_ESC);
@ -4746,6 +4922,7 @@ void CG1600_application::user_destroy()
delete _anag;
delete _pconti;
delete _clifo;
delete _descr;
}
int cg1600 (int argc, char* argv[])

View File

@ -23,6 +23,6 @@
#define F_ANNORAFFR 117
#define F_STAMPAMOVPROV 118
#endif // __CG1600_H
#endif // __CG1600_H

View File

@ -47,7 +47,7 @@ class CG3200_application : public TPrintapp
TDate _data_ini,_data_fine,_data_finese,_data_finesesucc,_ultima_data_reg;
TDate _datareg,_datadoc,_data_inizioese,_datareg_stampa;
int _cur1,_gruppo,_conto,_numcarat,_stampanum,_numivd;
int _numrig,_natdoc,_tipo,_tipostampa,_g_prec,_c_prec;
int _numrig,_natdoc,_tipo,_tipostampa,_g_prec,_c_prec,_numrivd_int;
real _progredare,_progreavere,_totprogre_dare_al,_totprogre_avere_al;
real _totprogre_dare,_totprogre_avere,_importo;
real _riporto_dare,_riporto_avere,_riporto_parziale_dare,_riporto_parziale_avere;
@ -57,9 +57,8 @@ class CG3200_application : public TPrintapp
TString _ragsoc,_indulc,_civulc,_capulc,_com,_prov,_comulc;
long _codice_ditta,_s_prec;
TString _tipodoc,_codcaus,_descrcaus,_descrdociva,_regiva;
TString16 _lettivd;
int _sezivd;
TString _descrizione,_sezione,_numdoc,_descrizionemov,_numrivd;
char _sezivd,_lettivd;
TString _descrizione,_sezione,_numdoc,_descrizionemov,_numrivd,_descr;
TString _dataregs, _datadocs,_gruppocontr,_contocontr,_sottocontocontr;
bool _stampaprogre,_stampatotiva,_stampatot,_prima_volta,_stampa_mov_prov;
@ -105,11 +104,13 @@ public:
void stampa_totali132();
void stampa_totali198();
void stampa_totaliiva();
void ricerca_classe_IV(bool scelta);
void data_fine_esercizio(int);
const char* descrizione_gruppo();
const char* descrizione_conto();
const char* descrizione_gruppo_clifo();
const char* descrizione_conto_clifo();
const char* descrizione_classe(char,char,int,int);
bool almeno_un_record();
void ricerca_dati_ditta();
void conto();
@ -328,13 +329,13 @@ void CG3200_application::saldi_zero()
long sottoc = atol(rmov.get(RMV_SOTTOCONTO));
if ((gruppo == _gruppo)&&(conto == _conto)&&(sottoc == _sottoc))
{
{
if (sezione == 'D')
saldo_dare += importo;
else if (sezione == 'A')
saldo_avere += importo;
}
else break;
}
else break;
rmov.next();
}
rmov.readat(record);
@ -856,10 +857,14 @@ void CG3200_application::ricerca_regiva()
bool CG3200_application::preprocess_print(int file, int counter)
{
_g_prec = 0;
_c_prec = 0;
_s_prec = 0;
return TRUE;
if (file == LF_SALDI)
{
_g_prec = 0;
_c_prec = 0;
_s_prec = 0;
}
return TRUE;
}
bool CG3200_application::set_print(int)
@ -1119,8 +1124,8 @@ void CG3200_application::crea_intestazione()
set_header (6, (const char *) sep);
set_header (7,"Operazione@19gDocumento@117gContro");
set_header (8,"Data");
if (_stampanum < 3)
set_header (8,"@11gnumero");
if (_stampanum < 3)
set_header (8,"@11gnumero");
set_header (8,"@19gData@30gNumero@38gCod.Causale@61gDescrizione@90gDare@106gAvere@117gPartita");
sep.fill('-');
set_header (9, (const char *) sep);
@ -1130,10 +1135,10 @@ void CG3200_application::crea_intestazione()
sep1.fill('-'); //Stampa 198 - (sep1(198))
set_header (6,"@1g%s", (const char *) sep1);
set_header (7,"Operazione@19gData@30gNumero@172gContro@185gReg@193gNumero");
set_header (8,"Data");
if (_stampanum < 3)
set_header (8,"@11gnumero");
set_header (8,"@19gDocumento@38gCod.Causale@68gDescrizione@108gDare@124gAvere@136gSaldo progress.@154gSaldo movim.@172gPartita@185gIva@189gProtocollo");
set_header (8,"Data");
if (_stampanum < 3)
set_header (8,"@11gnumero");
set_header (8,"@19gDocumento@38gCod.Causale@68gDescrizione@108gDare@124gAvere@136gSaldo progress.@154gSaldo movim.@172gPartita@185gIva@189gProtocollo");
sep1.fill('-');
set_header (9,"@1g%s", (const char *) sep1);
}
@ -1373,35 +1378,35 @@ void CG3200_application::calcola_progressivi()
progavere_prec = saldo;
}
}
else
{
}
} // FOR
//Se il saldo dell'esercizio attuale non e' diverso da zero, allora il saldo
// finale dell'esercizio precedente devo calcolarmelo tenendo conto dell'indbil
if ((_indbil == 1) || (_indbil == 2) || (_indbil == 5))
{
const TRecnotype pos = saldi.recno();
saldo = _sld.saldofin_esprec(_anno_corrente,_gruppo,_conto,_sottoc);
saldi.readat(pos);
if (_annomsk != 0 && saldo == ZERO)
{
if ((_indbil == 1) || (_indbil == 2) || (_indbil == 5))
{
const TRecnotype pos = saldi.recno();
saldo = _sld.saldofin_esprec(_anno_corrente,_gruppo,_conto,_sottoc);
saldi.readat(pos);
if (saldo> ZERO)
{
progredare_eseprec = saldo;// + pdarescap + pdarep;
progdare_prec = saldo;
if (saldo> ZERO)
{
progredare_eseprec = saldo;// + pdarescap + pdarep;
progdare_prec = saldo;
// progreavere_eseprec = paverescap + paverep;
}
else if (saldo < ZERO)
{
// progredare_eseprec = pdarescap + pdarep;
saldo = -saldo;
progreavere_eseprec = saldo;// + paverescap + paverep;
progavere_prec = saldo;
}
}
}
else if (saldo < ZERO)
{
// progredare_eseprec = pdarescap + pdarep;
saldo = -saldo;
progreavere_eseprec = saldo;// + paverescap + paverep;
progavere_prec = saldo;
}
}
} // FOR
}
// saldi->readat(rec);
@ -1462,6 +1467,7 @@ void CG3200_application::ricerca_clifo()
TLocalisamfile clifo(LF_CLIFO);
TLocalisamfile pconti(LF_PCON);
TString16 dataini,datafine;
TString descriz,descriz2;
int numrivd;
clifo.setkey(1);
@ -1471,8 +1477,9 @@ void CG3200_application::ricerca_clifo()
clifo.read();
if (clifo.bad())
clifo.zero();
TConto tc (_gruppo,_conto,_sottoc,_tmcf);
ragsoc = clifo.get(CLI_RAGSOC);
ragsoc = tc.descrizione();
paiv = clifo.get(CLI_PAIV);
cofi = clifo.get(CLI_COFI);
indcf = clifo.get(CLI_INDCF);
@ -1494,32 +1501,44 @@ void CG3200_application::ricerca_clifo()
pconti.zero();
pconti.put(PCN_GRUPPO, _gruppo);
pconti.put(PCN_CONTO, _conto);
pconti.put(PCN_SOTTOCONTO, _sottoc);
//pconti.put(PCN_SOTTOCONTO, _sottoc);
pconti.read();
//_sezivd = pconti.get_char(PCN_SEZIVD);
_sezivd = pconti.get_int(PCN_SEZIVD);
_lettivd = pconti.get(PCN_LETTIVD);
_sezivd = pconti.get_char(PCN_SEZIVD);
_lettivd = pconti.get_char(PCN_LETTIVD);
numrivd = pconti.get_int(PCN_NUMRIVD);
_numrivd = itor(numrivd);
_numivd = pconti.get_int(PCN_NUMIVD);
_tabivd->curr().zero();
//dep.format ("%c%c%04d%2d",_sezivd,_lettivd,numrivd,_numivd);
dep.format ("%d%s%04d%2d", _sezivd, (const char *) _lettivd,numrivd,_numivd);
_tabivd->curr().put("CODTAB", (const char*) dep);
_tabivd->read();
if (_tabivd->bad())
_tabivd->zero();
TString descriz = _tabivd->curr().get("S0");
descriz = descrizione_classe(_sezivd,_lettivd,numrivd,_numivd);
if (_numivd != 0) //Ora devo stampare la descrizione del livello della
{ //classe immediatamente precedente a quello appena
if (_numrivd != "") //stampato
descriz2 = descrizione_classe(_sezivd,_lettivd,_numrivd_int,0);
else
descriz2 = descrizione_classe(_sezivd,_lettivd,0,0);
}
else
if (_numrivd != "")
descriz2 = descrizione_classe(_sezivd,_lettivd,0,0);
else
descriz2 = "";
set_header(3,"@27g%-30s",(const char*) descrizione_gruppo());
set_header(3,"@59g%-30s",(const char*) descrizione_conto());
set_header(3, "@91g%-30s",(const char*) ragsoc);
set_header(4, "Classe@8g%s", (const char*) _lettivd);
set_header(4, "Classe@8g%c", _lettivd);
set_header(4, "@10g%-8s", (const char*) _numrivd);
if (_numivd != 0)
set_header(4, "@19g%2d", _numivd);
set_header(4,"@23g%-50s",(const char*) descriz);
if (descriz2 != "")
{
set_header(4,"@23g%-50s",(const char*) descriz2);
set_header(4,"@80g%-50s",(const char*) descriz);
}
else
set_header(4,"@23g%-50s",(const char*) descriz);
dataini = _data_ini.string();
datafine = _data_fine.string();
@ -1531,15 +1550,15 @@ void CG3200_application::ricerca_clifo()
}
else
{
set_header (5, "Periodo di competenza@23g%s", (const char*) dataini);
set_header (5, "@35g%s", (const char*) datafine);
set_header (5, "Comp. da@9g%s", (const char*) dataini);
set_header (5, "@20ga@22g%s", (const char*) datafine);
}
set_header (5, "@34g%-11s",(const char*) paiv);
set_header (5, "@46g%-16s",(const char*) cofi);
set_header (5, "@63g%-25s",(const char*) indcf);
set_header (5, "@89g%-5s",(const char*) capcf);
set_header (5, "@95g%-30s",(const char*) dencom);
set_header (5, "@33gP.I.@37g%-11s",(const char*) paiv);
set_header (5, "@49gCF@52g%-16s",(const char*) cofi);
set_header (5, "@69g%-25s",(const char*) indcf);
set_header (5, "@95g%-5s",(const char*) capcf);
set_header (5, "@101g%-24s",(const char*) dencom);
set_header (5,"@126g%-5s",(const char*) provcom);
if (_numcarat == 2)
@ -1552,45 +1571,65 @@ void CG3200_application::ricerca_clifo()
// Se la ricerca selezionata sulla maschera e' per gruppo, conto, sottoconto
// ricerca i corrispondenti su PCON, con relativa IV direttiva CEE
void CG3200_application::ricerca_gruppo()
void CG3200_application::ricerca_classe_IV(bool scelta)
{
TString80 descr,descriz,dep;
int numrivd;
TString dataini,datafine;
TLocalisamfile pconti(LF_PCON);
pconti.setkey(1);
pconti.zero();
pconti.put(PCN_GRUPPO, _gruppo);
pconti.put(PCN_CONTO, _conto);
pconti.put(PCN_SOTTOCONTO, _sottoc);
if (scelta)
pconti.put(PCN_SOTTOCONTO, _sottoc);
pconti.read();
//_sezivd = pconti.get_char(PCN_SEZIVD);
_sezivd = pconti.get_int(PCN_SEZIVD);
_lettivd = pconti.get(PCN_LETTIVD);
numrivd = pconti.get_int(PCN_NUMRIVD);
_numrivd = itor(numrivd);
_numivd = pconti.get_int(PCN_NUMIVD);
descr = pconti.get(PCN_DESCR);
_sezivd = pconti.get_char(PCN_SEZIVD);
_lettivd = pconti.get_char(PCN_LETTIVD);
_numrivd_int = pconti.get_int (PCN_NUMRIVD);
_numrivd = itor(_numrivd_int);
_numivd = pconti.get_int (PCN_NUMIVD);
_descr = pconti.get (PCN_DESCR);
}
_tabivd->zero();
//dep.format ("%c%c%04d%2d",_sezivd,_lettivd, numrivd,_numivd);
dep.format ("%d%s%04d%2d",_sezivd,(const char *) _lettivd, numrivd,_numivd);
_tabivd->put("CODTAB", (const char*) dep);
_tabivd->read();
if (_tabivd->bad())
_tabivd->zero();
descriz = _tabivd->get("S0");
void CG3200_application::ricerca_gruppo()
{
TString80 descr,descriz,descriz2,dep;
TString dataini,datafine;
ricerca_classe_IV (TRUE); //Esiste a livello di sottoconto
if (_sezivd == '0') //Non esiste a livello di sottoconto
ricerca_classe_IV (FALSE); //Allora la cerco a livello di conto
descriz = descrizione_classe(_sezivd,_lettivd,_numrivd_int,_numivd);
if (_numivd != 0) //Ora devo stampare la descrizione del livello della
{ //classe immediatamente precedente a quello appena
if (_numrivd != "") //stampato
descriz2 = descrizione_classe(_sezivd,_lettivd,_numrivd_int,0);
else
descriz2 = descrizione_classe(_sezivd,_lettivd,0,0);
}
else
if (_numrivd != "")
descriz2 = descrizione_classe(_sezivd,_lettivd,0,0);
else
descriz2 = "";
set_header(3,"@27g%-30s",(const char*) descrizione_gruppo());
set_header(3,"@59g%-30s",(const char*) descrizione_conto());
set_header(3,"@91g%-30s",(const char*) descr);
set_header(4, "@0gClasse@12g%s",(const char*) _lettivd);
set_header(3,"@91g%-30s",(const char*) _descr);
set_header(4, "@0gClasse@12g%c", _lettivd);
set_header(4, "@14g%-8s",(const char*) _numrivd);
if (_numivd != 0)
set_header(4, "@23g%d", _numivd);
set_header(4,"@27g%-50s",(const char*) descriz);
if (descriz2 != "")
{
set_header(4,"@27g%-50s",(const char*) descriz2);
set_header(4,"@80g%-50s",(const char*) descriz);
}
else
set_header(4,"@27g%-50s",(const char*) descriz);
dataini = _data_ini.string();
datafine = _data_fine.string();
@ -1607,6 +1646,40 @@ void CG3200_application::ricerca_gruppo()
}
}
const char* CG3200_application::descrizione_classe(char sezione, char lettera, int numr, int numero)
{
TTable tabivd(TAB_IVD);
TString dep,dep2;
tabivd.zero();
if (numr == 0 && numero == 0)
dep = format("%c%c",sezione,lettera);
else
if (numero == 0)
{
if (numr != 0)
dep = format("%1c%1c%04d",sezione, lettera, numr);
else
dep = format("%c%c ",sezione,lettera);
}
else
{
if (numr != 0)
dep = format("%1c%1c%04d%02d",sezione, lettera, numr,numero);
else
dep = format("%c%c %02d",sezione,lettera,numero);
}
tabivd.put("CODTAB", dep);
tabivd.read();
dep2 = tabivd.get("CODTAB");
if (dep == dep2)
tmp = tabivd.get("S0");
else
tmp = "";
return (tmp);
}
//Ricerca la descrizione relativa al gruppo da stampare
const char* CG3200_application::descrizione_gruppo()

View File

@ -39,3 +39,4 @@
#define F_FORMATO 131
#endif // __CG3200_H

View File

@ -617,6 +617,7 @@ bool CG4400_application::controlla_mov()
for (mov.first(); !mov.eof(); mov.next())
{
TString16 reg = mov.get(MOV_REG);
if (reg.empty()) continue;
TDate datareg = mov.get_date(MOV_DATAREG);
if (_stampa_tutti_i_registri)
cerca_reg (reg, tipo, udata);
@ -1053,7 +1054,11 @@ bool CG4400_application::compila_reg(const TMask& m)
//_tot_dare = tab_reg.get_real ("R1")
//_tot_avere = tab_reg.get_real ("R2");
if (_tipo_stampa != 3)
_data_da = _tabreg->get_date ("D3");
{
_data_da = _tabreg->get_date ("D3");
if (!_data_da.ok())
_data_da = format("01/01/%4d", _annoes);
}
if ( _tipo_stampa == 1 || _tipo_stampa == 4 )
if ( _data_a <= _data_da)
{
@ -1061,10 +1066,10 @@ bool CG4400_application::compila_reg(const TMask& m)
warning_box ("La data specificata deve essere superiore al %s (ultima data di stampa specificata sul registro)", (const char*)datas);
return FALSE;
}
//_stampa_intesta = _tabreg->get_bool ("B9");
_codatt = _tabreg->get("S8");
_attivita = desc_attivita(_codatt);
_desc_lib = _tabreg->get ("S0");
_stampa_ind_ditta = _tabreg->get_bool ("B9");
_codatt = _tabreg->get("S8");
_attivita = desc_attivita(_codatt);
_desc_lib = _tabreg->get ("S0");
}
else
{
@ -1498,7 +1503,7 @@ bool CG4400_application::set_print(int n)
giorni_del_mese = primo.day();
}
_data_a=format("%02d/%02d/%4d",giorni_del_mese,_fino_a_mese,_annoes);
// NB data_da viene letta nella preprocess_page
// NB data_da viene letta nella compila_reg
}
if (_tipo_stampa == 2)
compila_lib();
@ -1553,28 +1558,32 @@ void CG4400_application::stampa_registri_IVA(const TMask& m)
if ( tipo == 1 || tipo == 2 ) //registro iva
{
_tipo_reg = _tabreg->get_int("I0");
_codreg = codtab.mid(4,3);
_corrispettivi = _tabreg->get_bool("B0");
if (_tipo_stampa != 3)
_data_da = _tabreg->get_date("D3");
_pagine_stampate = _tabreg->get_int("I1");
_codreg = codtab.mid(4,3);
_codatt = _tabreg->get("S8");
_attivita = desc_attivita(_codatt);
_desc_lib = _tabreg->get ("S0");
{
_data_da = _tabreg->get_date("D3");
if (!_data_da.ok()) //e' la prima volta che stampo
_data_da = format("01/01/%4d", _annoes);
}
if (_tipo_stampa == 1 || _tipo_stampa == 4)
if (_data_a <= _data_da)
warning_box("Il registro %s e' gia' stato stampato come bollato di %s", (const char*) _codreg, itom(_fino_a_mese));
_pagine_stampate = _tabreg->get_int("I1");
_codatt = _tabreg->get("S8");
_attivita = desc_attivita(_codatt);
_desc_lib = _tabreg->get ("S0");
_stampa_ind_ditta = _tabreg->get_bool ("B9");
//_primast = get_page_number();
//if (!_mov_empty )
// printer().formfeed();
_cur->set_filterfunction(NULL);
_cur->set_filterfunction(filter_func);
// Vado a vedere se ci sono movimenti
(*_cur) = 0L;
const long items = _cur->items();
if (items > 0)
{
//set_page_number(_u_stampata + 1);
print();
if (_tipo_stampa != 3) aggiorna_reg();
}
if (_tipo_stampa != 3) aggiorna_reg();
}
}
}
@ -1714,29 +1723,26 @@ void CG4400_application::preprocess_header()
TString riga(_stampa_width);
TString data;
//if (_tipo_stampa != 3) //cioe' si tratta di una stampa definitiva
//{
if ( (_tipo_stampa == 1) || (_tipo_stampa == 4) )
data.format("%s %s %d", (const char*)"mese di", itom(_datareg.month()),
_datareg.year());
else if (_tipo_stampa == 2)
data.format("%s %s %d", (const char*)"mese di", itom(_fino_a_mese), _annoes);
//}
else //stampa di prova
//data = _data_da.string();
data.format("%s %s %d", (const char*)"mese di", itom(_data_da.month()), _annoes);
else //stampa di prova
data.format("%s %s %d", (const char*)"mese di", itom(_data_da.month()), _annoes);
reset_header();
if (_tipo_stampa == 2)
{
if (_tipo_stampa != 3)
if (_stampa_ind_ditta)
r = stampa_intestazione();
if (_tipo_stampa == 2)
{
long num = _u_stampata + 1;
set_header(r++, "@94gProgr.Studio %ld@114gProgr.Utente @#", num);
}
else
r = stampa_intestazione();
set_header(r, "Registro IVA: %s %s %s Attivita\' %s %s",
(const char *) _codreg, (const char *) _desc_lib,
(const char *) data, (const char *) _codatt,

View File

@ -130,6 +130,7 @@ public:
void add_r(int,int,real&,real&,real&,char,real&,real&,
real&,real&,TDate&,long,real&,real&,real&);
void compilasheet();
void disable_all();
bool fai_filtro();
TMask* main_mask() const {return _msk;}
TSheet_field& ss() const { return (TSheet_field&)_msk->field(F_SHEET_SALDI);}
@ -268,6 +269,18 @@ bool sottoc_handler(TMask_field& f, KEY key)
if (clifo.read(_isequal, _nolock) == NOERR)
{
TString rs = clifo.get(CLI_RAGSOC);
char tipoa = clifo.get_char("TIPOAPER");
if (tipoa == 'F')
{
TString80 cognome, nome;
cognome = rs.mid(0,30);
nome = rs.mid(30,20);
cognome.trim(); nome.trim();
rs = cognome;
rs << " " << nome;
}
f.mask().set(F_DESCR_CLIENTE, rs);
f.mask().set(F_DESCR_FORN, rs);
f.mask().stop_run(K_AUTO_ENTER);
@ -304,6 +317,7 @@ bool CG5200_application::user_create()
_msk->set_handler(F_SOTTOCONTO, sottoc_handler);
_msk->set_handler(F_SOTTOC_CLIENTE, sottoc_handler);
_msk->set_handler(F_SOTTOC_FORN, sottoc_handler);
disable_all();
_pcon = new TLocalisamfile(LF_PCON);
_clifo = new TLocalisamfile(LF_CLIFO);
_rel = new TRelation(LF_PCON);
@ -314,6 +328,12 @@ bool CG5200_application::user_create()
return TRUE;
}
void CG5200_application::disable_all()
{
for (int i = 0; i < 17; i++)
ss().enable_column(i,FALSE);
}
bool CG5200_application::user_destroy()
{
delete _msk;

View File

@ -47,6 +47,7 @@ BEGIN
DISPLAY "Gruppo" GRUPPO
DISPLAY "Descrizione@50" DESCR
OUTPUT F_GRUPPO GRUPPO
//OUTPUT F_DESCR_CONTO DESCR
FLAGS "R"
END
@ -64,9 +65,15 @@ BEGIN
OUTPUT F_CONTO CONTO
OUTPUT F_GRUPPO GRUPPO
OUTPUT F_TIPOCF TMCF
//OUTPUT F_DESCR_CLIENTE DESCR
//OUTPUT F_DESCR_FORN DESCR
//OUTPUT F_DESCR_CONTO DESCR
FLAGS "R"
CHECKTYPE NORMAL
WARNING "Conto inesistente o mancante"
//MESSAGE DIRTY,F_SOTTOCONTO|DIRTY,F_SOTTOC_CLIENTE|DIRTY,F_SOTTOC_FORN
//MESSAGE DIRTY,F_DESCR_CONTO|DIRTY,F_DESCR_CLIENTE|DIRTY,F_DESCR_FORN
END
NUMBER F_SOTTOCONTO 6
@ -85,8 +92,15 @@ BEGIN
OUTPUT F_SOTTOCONTO SOTTOCONTO
OUTPUT F_GRUPPO GRUPPO
OUTPUT F_CONTO CONTO
//OUTPUT F_DESCR_CONTO DESCR
//OUTPUT F_DESCR_CLIENTE DESCR
//OUTPUT F_DESCR_FORN DESCR
//CHECKTYPE NORMAL
//MESSAGE COPY,F_SOTTOC_FORN //li gestisco da programma senno' fanno casino
//MESSAGE COPY,F_SOTTOC_CLIENTE
FLAGS "R"
CHECKTYPE NORMAL
//VALIDATE AUTOEXIT_FUNC 3 F_GRUPPO F_CONTO F_SOTTOCONTO
GROUP 1
WARNING "Conto inesistente"
END
@ -95,6 +109,7 @@ NUMBER F_SOTTOC_CLIENTE 6
BEGIN
PROMPT 54 3 "Cliente "
USE LF_CLIFO
//FIELD LF_CLIFO->CODCF
INPUT TIPOCF "C"
INPUT CODCF F_SOTTOC_CLIENTE
DISPLAY "Codice" CODCF
@ -102,10 +117,14 @@ BEGIN
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
OUTPUT F_SOTTOC_CLIENTE CODCF
//OUTPUT F_DESCR_CONTO RAGSOC
//OUTPUT F_DESCR_CLIENTE RAGSOC
//OUTPUT F_DESCR_FORN RAGSOC
FLAGS "R"
CHECKTYPE NORMAL
KEY 1
WARNING "Cliente inesistente"
//VALIDATE AUTOEXIT_FUNC 3 F_GRUPPO F_CONTO F_SOTTOC_CLIENTE
GROUP 2
END
@ -120,10 +139,15 @@ BEGIN
DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO
OUTPUT F_SOTTOC_FORN CODCF
// OUTPUT F_DESCR_FORN RAGSOC
// OUTPUT F_DESCR_CONTO RAGSOC
// OUTPUT F_DESCR_CLIENTE RAGSOC
FLAGS "R"
CHECKTYPE NORMAL
// serve per l' autopremimento
KEY 1
WARNING "Fornitore inesistente"
//VALIDATE AUTOEXIT_FUNC 3 F_GRUPPO F_CONTO F_SOTTOC_FORN
GROUP 3
END
@ -320,6 +344,24 @@ BEGIN
PROMPT -22 -1 ""
END
/*
BUTTON DLG_OK 9 2
BEGIN
PROMPT -13 -1 ""
END
BUTTON DLG_CANCEL 9 2
BEGIN
PROMPT -23 -1 ""
END
BUTTON DLG_NULL 9 2
BEGIN
PROMPT -33 -1 "Azzera"
MESSAGE RESET,1@
END
*/
ENDPAGE
ENDMASK

View File

@ -110,6 +110,7 @@ const char* TBill::describe()
{
int err = NOERR;
const char* desc = NULL;
TFixed_string ragsoc(&__tmp_string[256], 50);
if ((_tipo != 'C' && _tipo != 'F') || _sottoconto == 0L)
{
@ -136,7 +137,23 @@ const char* TBill::describe()
err = clifo.read();
if (err == NOERR)
{
desc = clifo.get("RAGSOC");
char tipoa = clifo.get_char("TIPOAPER");
if (tipoa == 'F')
{
TString80 cognome, nome;
ragsoc = clifo.get("RAGSOC");
cognome = ragsoc.mid(0,30);
nome = ragsoc.mid(30,20);
cognome.trim(); nome.trim();
ragsoc = cognome;
ragsoc << " " << nome;
desc = ragsoc;
}
else
desc = clifo.get("RAGSOC");
if (_conto == 0)
{
_gruppo = clifo.get_int("GRUPPO");

View File

@ -26,7 +26,7 @@ protected:
public:
TBill(int g = 0, int c = 0, long s = 0L, char t = ' ', const char* d = NULL, int r = -1)
: _tipo(t), _gruppo(g), _conto(c), _sottoconto(s), _descrizione(d), _tipo_cr(r) {}
: _tipo(t), _gruppo(g), _conto(c), _sottoconto(s), _descrizione(d), _tipo_cr(r) { set(g,c,s,t,d,r);}
TBill(TToken_string& tgcsd, int from, int mode = 0);
TBill(const TBill& b) { copy(b); }