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

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,11 @@
#ifndef __CG1100_H
#define __CG1100_H
#define F_DATA_STAMPA 100
#define F_SCELTA_STAMPA 101
#define F_SALTO_PAGINA 102
#define F_CODDITTA 103
#define F_RAGSOC 104
#endif
#ifndef __CG1100_H
#define __CG1100_H
#define F_DATA_STAMPA 100
#define F_SCELTA_STAMPA 101
#define F_SALTO_PAGINA 102
#define F_CODDITTA 103
#define F_RAGSOC 104
#endif

View File

@ -1,66 +1,66 @@
#include "cg1100.h"
PAGE "" -1 -1 70 18
NUMBER F_CODDITTA 5
BEGIN
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
OUTPUT F_RAGSOC RAGSOC
END
STRING F_RAGSOC 50
BEGIN
PROMPT 2 2 "Ragione sociale "
FLAGS "D"
END
DATE F_DATA_STAMPA
BEGIN
PROMPT 2 4 "Data di stampa "
FLAGS "A"
END
RADIOBUTTON F_SCELTA_STAMPA 47
BEGIN
PROMPT 2 6 "Tipo di stampa "
HELP "Scegliere il tipo di stampa desiderata"
ITEM "1|Completa per IV direttiva"
ITEM "2|Conti riclassificati per IV direttiva"
ITEM "3|Conti non collegati per IV direttiva"
ITEM "4|Completa per analisi di bilancio"
ITEM "5|Conti riclassificati per analisi di bilancio"
ITEM "6|Conti non collegati per analisi di bilancio"
END
BOOLEAN F_SALTO_PAGINA
BEGIN
PROMPT 3 14 "Salto pagina per cambio gruppo "
HELP "Indicare se si desidera un salto pagina ogni volta che cambia il gruppo"
END
BUTTON DLG_OK 9 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_QUIT 9 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
ENDMASK
#include "cg1100.h"
PAGE "" -1 -1 70 18
NUMBER F_CODDITTA 5
BEGIN
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
OUTPUT F_RAGSOC RAGSOC
END
STRING F_RAGSOC 50
BEGIN
PROMPT 2 2 "Ragione sociale "
FLAGS "D"
END
DATE F_DATA_STAMPA
BEGIN
PROMPT 2 4 "Data di stampa "
FLAGS "A"
END
RADIOBUTTON F_SCELTA_STAMPA 47
BEGIN
PROMPT 2 6 "Tipo di stampa "
HELP "Scegliere il tipo di stampa desiderata"
ITEM "1|Completa per IV direttiva"
ITEM "2|Conti riclassificati per IV direttiva"
ITEM "3|Conti non collegati per IV direttiva"
ITEM "4|Completa per analisi di bilancio"
ITEM "5|Conti riclassificati per analisi di bilancio"
ITEM "6|Conti non collegati per analisi di bilancio"
END
BOOLEAN F_SALTO_PAGINA
BEGIN
PROMPT 3 14 "Salto pagina per cambio gruppo "
HELP "Indicare se si desidera un salto pagina ogni volta che cambia il gruppo"
END
BUTTON DLG_OK 9 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_QUIT 9 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
ENDMASK

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

@ -1,41 +1,41 @@
#ifndef __CG1500_H
#define __CG1500_H
#define F_CODDITTA 101
#define F_DATASTAMPA 102
#define F_RAGSOC 104
#define F_BILANCIO 105
#define F_ANNO 106
#define F_STAMPA 107
#define F_STAMPA1 108
#define F_DATALIM 109
#define F_TOTALI 110
#define F_CODICI 111
#define F_SALDO 112
#define F_VERIFICA 113
#define F_STAMPAV 114
#define F_DATADA 115
#define F_DATAA 116
#define F_SITUAZIONE 118
#define F_STAMPAC 119
#define F_ORDINAMENTO 120
#define F_MODULO 121
#define F_STAMPAMPROV 122
#endif // __CG1500_H
#ifndef __CG1500_H
#define __CG1500_H
#define F_CODDITTA 101
#define F_DATASTAMPA 102
#define F_RAGSOC 104
#define F_BILANCIO 105
#define F_ANNO 106
#define F_STAMPA 107
#define F_STAMPA1 108
#define F_DATALIM 109
#define F_TOTALI 110
#define F_CODICI 111
#define F_SALDO 112
#define F_VERIFICA 113
#define F_STAMPAV 114
#define F_DATADA 115
#define F_DATAA 116
#define F_SITUAZIONE 118
#define F_STAMPAC 119
#define F_ORDINAMENTO 120
#define F_MODULO 121
#define F_STAMPAMPROV 122
#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

@ -275,13 +275,15 @@ class CG1600_application : public TPrintapp
Anni_es _anni_es;
Righe_sez_opp _sezopps;
TSaldi_list* _listasld;
TProgind* _prog;
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);
@ -2013,7 +2017,9 @@ if (tasto == K_ENTER)
_statopatr_no_stamp = TRUE;
_diffprod_fatto = TRUE;
_risimp_fatto = TRUE;
_sbilancio_ordine = FALSE;
_sbilancio_ordine = FALSE;
_sbilancio_patr_gia_stampato = FALSE;
_attivo_o_passivo = FALSE;
_sez_stamp = ' ';
_let_stamp = ' ';
@ -2094,7 +2100,10 @@ void CG1600_application::stampa_totali()
_let_tot = ' ';
_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;
}
}
@ -2390,57 +2404,84 @@ 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 = ' ';
set_row (_i++,"@0g%c", app);
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)
{
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;
_i++;
if (!_sbilancio_ordine)
{
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)
{
set_row (_i++,"@0g%c", app);
set_row (_i++,"@0gSALDO CONTI D' ORDINE");
set_row (_i,"@0gSBILANCIO");
set_row (_i++,"@86g%r", &totale);
}
if (_totale_patrimoniale != ZERO)
if (!_sbilancio_patr_gia_stampato)
{
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;
_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 (!_sbilancio_ordine)
{
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')
@ -2505,7 +2546,10 @@ void CG1600_application::stampa_totali_con_raffronto()
_let_tot = ' ';
_sez_tot = ' ';
}
if ((_sez_stamp == '1' || _sez_stamp == '2') && _let_stamp != 'Z')
_attivo_o_passivo = TRUE;
if (_num_da_stamp!=_num_tot)
{
@ -2737,21 +2781,26 @@ void CG1600_application::stampa_totali_con_raffronto()
set_row (_i,"@0gTOTALE CONTI D' ORDINE PASSIVI");
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;
_i++;
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;
@ -2846,7 +2895,29 @@ 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 = ' ';
@ -2865,52 +2936,62 @@ void CG1600_application::stampa_totali_con_raffronto()
set_row (_i,"@0gTOTALE CONTI D' ORDINE PASSIVI");
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++,"@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;
_i++;
if (!_sbilancio_ordine)
{
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)
{
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);
char app = ' ';
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)
{
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')
{
@ -3951,8 +4032,15 @@ void CG1600_application::setta_righe(const char * titolo)
long sottoc;
TString numrom,numr;
TString descr_let,descr_numr,descr_num,descr_sottoc,descr_classe;
bool stampa_classe = TRUE;
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);
@ -4028,18 +4115,24 @@ 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);
set_row(_i,"@0g%c", bil->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);
}
}
}
@ -4067,8 +4160,10 @@ 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);
set_row(_i,"@0g%c", bil->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,7 +4280,15 @@ 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;
numr = bil->numr;
@ -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 ((tmcf == 'C') || (tmcf == 'F'))
{
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;
}
@ -4402,6 +4540,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)
@ -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);
@ -4745,7 +4921,8 @@ void CG1600_application::user_destroy()
delete _unloc;
delete _anag;
delete _pconti;
delete _clifo;
delete _clifo;
delete _descr;
}
int cg1600 (int argc, char* argv[])

View File

@ -1,28 +1,28 @@
#ifndef __CG1600_H
#define __CG1600_H
#define TAB_ESC "ESC"
#define TAB_IVD "%IVD"
#define F_CODDITTA 101
#define F_RAGSOC 102
#define F_DATASTAMPA 103
#define F_TIPOBIL 104
#define F_TIPOSTAMPA 105
#define F_TIPOSTAMPA1 106
#define F_DATALIM 107
#define F_DATABILRAF 108
#define F_STAMPAINT 109
#define F_STAMPACOD 110
#define F_STAMPAMOV 111
#define F_COMPETENZA 112
#define F_STAMPAMODULO 113
#define F_DATAINI 114
#define F_DATAFINE 115
#define F_ANNOESE 116
#define F_ANNORAFFR 117
#define F_STAMPAMOVPROV 118
#endif // __CG1600_H
#ifndef __CG1600_H
#define __CG1600_H
#define TAB_ESC "ESC"
#define TAB_IVD "%IVD"
#define F_CODDITTA 101
#define F_RAGSOC 102
#define F_DATASTAMPA 103
#define F_TIPOBIL 104
#define F_TIPOSTAMPA 105
#define F_TIPOSTAMPA1 106
#define F_DATALIM 107
#define F_DATABILRAF 108
#define F_STAMPAINT 109
#define F_STAMPACOD 110
#define F_STAMPAMOV 111
#define F_COMPETENZA 112
#define F_STAMPAMODULO 113
#define F_DATAINI 114
#define F_DATAFINE 115
#define F_ANNOESE 116
#define F_ANNORAFFR 117
#define F_STAMPAMOVPROV 118
#endif // __CG1600_H

View File

@ -1,173 +1,173 @@
#include "cg1600.h"
PAGE "" -1 -1 78 20
NUMBER F_CODDITTA 5
BEGIN
PROMPT 4 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
OUTPUT F_RAGSOC RAGSOC
END
STRING F_RAGSOC 50
BEGIN
PROMPT 4 2 "Ragione sociale "
FLAGS "D"
END
NUMBER F_ANNOESE 4
BEGIN
PROMPT 4 5 "Anno esercizio "
USE ESC
INPUT CODTAB F_ANNOESE
DISPLAY "Anno" CODTAB
DISPLAY "Data inizio esercizio" D0
DISPLAY "Data fine esercizio" D1
OUTPUT F_ANNOESE CODTAB
FLAGS "RZ"
CHECKTYPE NORMAL
END
NUMBER F_ANNORAFFR 4
BEGIN
PROMPT 36 5 "Anno esercizio da raffrontare "
COPY USE F_ANNOESE
INPUT CODTAB F_ANNORAFFR
COPY DISPLAY F_ANNOESE
OUTPUT F_ANNORAFFR CODTAB
FLAGS "RZ"
CHECKTYPE NORMAL
END
LIST F_TIPOBIL 22
BEGIN
PROMPT 4 6 "Tipo bilancio "
ITEM "1|Bilancio scalare"
MESSAGE HIDE,F_TIPOSTAMPA1|RESET,F_TIPOSTAMPA1|SHOW,F_TIPOSTAMPA|K_SPACE,F_TIPOSTAMPA
MESSAGE SHOW,F_ANNORAFFR|SHOW,F_DATABILRAF
ITEM "2|Bilancio di verifica"
MESSAGE HIDE,F_TIPOSTAMPA|RESET,F_TIPOSTAMPA|SHOW,F_TIPOSTAMPA1|K_SPACE,F_TIPOSTAMPA1
MESSAGE HIDE,F_ANNORAFFR|HIDE,F_DATABILRAF
END
LIST F_TIPOSTAMPA 23
BEGIN
PROMPT 4 7 "Tipo stampa "
ITEM "1|Per data limite"
MESSAGE HIDE,F_STAMPAMODULO|HIDE,F_DATAINI|HIDE,F_DATAFINE
MESSAGE RESET,F_STAMPAMODULO|RESET,F_DATAINI|RESET,F_DATAFINE
MESSAGE SHOW,F_DATALIM|SHOW,F_STAMPAINT|SHOW,F_STAMPAMOV
ITEM "2|All'ultima immissione"
MESSAGE HIDE,F_DATALIM|HIDE,F_STAMPAMODULO|HIDE,F_DATAINI|HIDE,F_DATAFINE
MESSAGE RESET,F_STAMPAMODULO|RESET,F_DATAINI|RESET,F_DATALIM|RESET,F_DATAFINE|
MESSAGE SHOW,F_STAMPAINT|SHOW,F_STAMPACOD|SHOW,F_STAMPAMOV
END
LIST F_TIPOSTAMPA1 23
BEGIN
PROMPT 4 7 "Tipo stampa1 "
ITEM "1|Per data "
MESSAGE HIDE,F_DATALIM
MESSAGE RESET,F_DATALIM
MESSAGE SHOW,F_STAMPAINT|SHOW,F_STAMPACOD|SHOW,F_STAMPAMOV
MESSAGE SHOW,F_DATAINI|SHOW,F_DATAFINE|SHOW,F_STAMPAMODULO
ITEM "2|All'ultima immissione"
MESSAGE HIDE,F_DATALIM|HIDE,F_DATAINI|HIDE,F_DATAFINE
MESSAGE RESET,F_DATAINI|RESET,F_DATALIM|RESET,F_DATAFINE
MESSAGE SHOW,F_STAMPAINT|SHOW,F_STAMPACOD|SHOW,F_STAMPAMOV|SHOW,F_STAMPAMODULO
MESSAGE COPY,F_TIPOSTAMPA
END
DATE F_DATASTAMPA
BEGIN
PROMPT 4 4 "Data stampa "
FLAGS "A"
END
TEXT 96
BEGIN
PROMPT 4 9 "Dalla data competenza "
END
TEXT 97
BEGIN
PROMPT 40 9 "Alla data competenza "
END
TEXT 98
BEGIN
PROMPT 4 9 "Dalla data operazione "
END
TEXT 99
BEGIN
PROMPT 40 9 "Alla data operazione "
END
DATE F_DATALIM
BEGIN
PROMPT 4 9 "Data limite "
// VALIDATE NOT_EMPTY_FUNC
END
DATE F_DATABILRAF
BEGIN
PROMPT 36 9 "Data bil. da raffrontare "
// VALIDATE NOT_EMPTY_FUNC
END
DATE F_DATAINI
BEGIN
PROMPT 26 9 ""
// VALIDATE NOT_EMPTY_FUNC
END
DATE F_DATAFINE
BEGIN
PROMPT 62 9 ""
// VALIDATE NOT_EMPTY_FUNC
END
BOOLEAN F_STAMPAINT
BEGIN
PROMPT 4 11 "Stampa intera struttura"
END
BOOLEAN F_STAMPACOD
BEGIN
PROMPT 41 11 "Non stampare cod. conti"
END
BOOLEAN F_STAMPAMOV
BEGIN
PROMPT 4 12 "Non stampare mov. con saldo a 0"
END
BOOLEAN F_STAMPAMOVPROV
BEGIN
PROMPT 41 12 "Stampa movimenti provvisori"
END
BOOLEAN F_STAMPAMODULO
BEGIN
PROMPT 4 13 "Stampa su modulo stretto"
END
BUTTON DLG_OK 9 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_QUIT 9 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
ENDMASK
#include "cg1600.h"
PAGE "" -1 -1 78 20
NUMBER F_CODDITTA 5
BEGIN
PROMPT 4 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
OUTPUT F_RAGSOC RAGSOC
END
STRING F_RAGSOC 50
BEGIN
PROMPT 4 2 "Ragione sociale "
FLAGS "D"
END
NUMBER F_ANNOESE 4
BEGIN
PROMPT 4 5 "Anno esercizio "
USE ESC
INPUT CODTAB F_ANNOESE
DISPLAY "Anno" CODTAB
DISPLAY "Data inizio esercizio" D0
DISPLAY "Data fine esercizio" D1
OUTPUT F_ANNOESE CODTAB
FLAGS "RZ"
CHECKTYPE NORMAL
END
NUMBER F_ANNORAFFR 4
BEGIN
PROMPT 36 5 "Anno esercizio da raffrontare "
COPY USE F_ANNOESE
INPUT CODTAB F_ANNORAFFR
COPY DISPLAY F_ANNOESE
OUTPUT F_ANNORAFFR CODTAB
FLAGS "RZ"
CHECKTYPE NORMAL
END
LIST F_TIPOBIL 22
BEGIN
PROMPT 4 6 "Tipo bilancio "
ITEM "1|Bilancio scalare"
MESSAGE HIDE,F_TIPOSTAMPA1|RESET,F_TIPOSTAMPA1|SHOW,F_TIPOSTAMPA|K_SPACE,F_TIPOSTAMPA
MESSAGE SHOW,F_ANNORAFFR|SHOW,F_DATABILRAF
ITEM "2|Bilancio di verifica"
MESSAGE HIDE,F_TIPOSTAMPA|RESET,F_TIPOSTAMPA|SHOW,F_TIPOSTAMPA1|K_SPACE,F_TIPOSTAMPA1
MESSAGE HIDE,F_ANNORAFFR|HIDE,F_DATABILRAF
END
LIST F_TIPOSTAMPA 23
BEGIN
PROMPT 4 7 "Tipo stampa "
ITEM "1|Per data limite"
MESSAGE HIDE,F_STAMPAMODULO|HIDE,F_DATAINI|HIDE,F_DATAFINE
MESSAGE RESET,F_STAMPAMODULO|RESET,F_DATAINI|RESET,F_DATAFINE
MESSAGE SHOW,F_DATALIM|SHOW,F_STAMPAINT|SHOW,F_STAMPAMOV
ITEM "2|All'ultima immissione"
MESSAGE HIDE,F_DATALIM|HIDE,F_STAMPAMODULO|HIDE,F_DATAINI|HIDE,F_DATAFINE
MESSAGE RESET,F_STAMPAMODULO|RESET,F_DATAINI|RESET,F_DATALIM|RESET,F_DATAFINE|
MESSAGE SHOW,F_STAMPAINT|SHOW,F_STAMPACOD|SHOW,F_STAMPAMOV
END
LIST F_TIPOSTAMPA1 23
BEGIN
PROMPT 4 7 "Tipo stampa1 "
ITEM "1|Per data "
MESSAGE HIDE,F_DATALIM
MESSAGE RESET,F_DATALIM
MESSAGE SHOW,F_STAMPAINT|SHOW,F_STAMPACOD|SHOW,F_STAMPAMOV
MESSAGE SHOW,F_DATAINI|SHOW,F_DATAFINE|SHOW,F_STAMPAMODULO
ITEM "2|All'ultima immissione"
MESSAGE HIDE,F_DATALIM|HIDE,F_DATAINI|HIDE,F_DATAFINE
MESSAGE RESET,F_DATAINI|RESET,F_DATALIM|RESET,F_DATAFINE
MESSAGE SHOW,F_STAMPAINT|SHOW,F_STAMPACOD|SHOW,F_STAMPAMOV|SHOW,F_STAMPAMODULO
MESSAGE COPY,F_TIPOSTAMPA
END
DATE F_DATASTAMPA
BEGIN
PROMPT 4 4 "Data stampa "
FLAGS "A"
END
TEXT 96
BEGIN
PROMPT 4 9 "Dalla data competenza "
END
TEXT 97
BEGIN
PROMPT 40 9 "Alla data competenza "
END
TEXT 98
BEGIN
PROMPT 4 9 "Dalla data operazione "
END
TEXT 99
BEGIN
PROMPT 40 9 "Alla data operazione "
END
DATE F_DATALIM
BEGIN
PROMPT 4 9 "Data limite "
// VALIDATE NOT_EMPTY_FUNC
END
DATE F_DATABILRAF
BEGIN
PROMPT 36 9 "Data bil. da raffrontare "
// VALIDATE NOT_EMPTY_FUNC
END
DATE F_DATAINI
BEGIN
PROMPT 26 9 ""
// VALIDATE NOT_EMPTY_FUNC
END
DATE F_DATAFINE
BEGIN
PROMPT 62 9 ""
// VALIDATE NOT_EMPTY_FUNC
END
BOOLEAN F_STAMPAINT
BEGIN
PROMPT 4 11 "Stampa intera struttura"
END
BOOLEAN F_STAMPACOD
BEGIN
PROMPT 41 11 "Non stampare cod. conti"
END
BOOLEAN F_STAMPAMOV
BEGIN
PROMPT 4 12 "Non stampare mov. con saldo a 0"
END
BOOLEAN F_STAMPAMOVPROV
BEGIN
PROMPT 41 12 "Stampa movimenti provvisori"
END
BOOLEAN F_STAMPAMODULO
BEGIN
PROMPT 4 13 "Stampa su modulo stretto"
END
BUTTON DLG_OK 9 2
BEGIN
PROMPT -12 -1 ""
END
BUTTON DLG_QUIT 9 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
ENDMASK

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;
@ -104,12 +103,14 @@ public:
void fai_stampa198();
void stampa_totali132();
void stampa_totali198();
void stampa_totaliiva();
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_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);
@ -855,11 +856,15 @@ 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);
@ -1461,7 +1466,8 @@ void CG3200_application::ricerca_clifo()
TString ragsoc,paiv,cofi,indcf,capcf,ptel,tel,statocf,comcf,dencom,provcom,dep;
TLocalisamfile clifo(LF_CLIFO);
TLocalisamfile pconti(LF_PCON);
TString16 dataini,datafine;
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();
ragsoc = clifo.get(CLI_RAGSOC);
TConto tc (_gruppo,_conto,_sottoc,_tmcf);
ragsoc = tc.descrizione();
paiv = clifo.get(CLI_PAIV);
cofi = clifo.get(CLI_COFI);
indcf = clifo.get(CLI_INDCF);
@ -1494,33 +1501,45 @@ 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)
@ -1551,47 +1570,67 @@ 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()
{
TString80 descr,descriz,dep;
int numrivd;
TString dataini,datafine;
TLocalisamfile pconti(LF_PCON);
void CG3200_application::ricerca_classe_IV(bool scelta)
{
TLocalisamfile pconti(LF_PCON);
pconti.setkey(1);
pconti.zero();
pconti.put(PCN_GRUPPO, _gruppo);
pconti.put(PCN_CONTO, _conto);
pconti.put(PCN_SOTTOCONTO, _sottoc);
pconti.put(PCN_CONTO, _conto);
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);
_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");
_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);
}
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);
set_header(4, "@23g%d", _numivd);
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

@ -1,41 +1,42 @@
#ifndef __CG3200_H
#define __CG3200_H
#define TAB_IVD "%IVD"
#define TAB_TPD "%TPD"
#define TAB_REG "REG"
#define TAB_ESC "ESC"
#define F_CODDITTA 101
#define F_RAGSOC 102
#define F_TIPOCF 103
#define F_GRUPPOINI 104
#define F_GRUPPOFINE 105
#define F_CONTOINI 106
#define F_CONTOFINE 107
#define F_SOTTOCINI_CONTO 108
#define F_SOTTOCFINE_CONTO 109
#define F_SOTTOCINI_CLIENTE 110
#define F_SOTTOCFINE_CLIENTE 111
#define F_SOTTOCINI_FORN 112
#define F_SOTTOCFINE_FORN 113
#define F_DESCRINI_CONTO 114
#define F_DESCRFINE_CONTO 115
#define F_DESCRINI_CLIENTE 116
#define F_DESCRFINE_CLIENTE 117
#define F_DESCRINI_FORN 118
#define F_DESCRFINE_FORN 119
#define F_DATAINI 120
#define F_DATAFINE 121
#define F_STAMPANUM 122
#define F_STAMPAPROGRE 123
#define F_STAMPATOTIVA 124
#define F_TIPOSTAMPA 125
#define F_STAMPAMOVPROV 126
#define F_MEMORIZZA 127
#define F_NUMCARAT 128
#define F_NUMMAST 129
#define F_ANNO 130
#define F_FORMATO 131
#endif // __CG3200_H
#ifndef __CG3200_H
#define __CG3200_H
#define TAB_IVD "%IVD"
#define TAB_TPD "%TPD"
#define TAB_REG "REG"
#define TAB_ESC "ESC"
#define F_CODDITTA 101
#define F_RAGSOC 102
#define F_TIPOCF 103
#define F_GRUPPOINI 104
#define F_GRUPPOFINE 105
#define F_CONTOINI 106
#define F_CONTOFINE 107
#define F_SOTTOCINI_CONTO 108
#define F_SOTTOCFINE_CONTO 109
#define F_SOTTOCINI_CLIENTE 110
#define F_SOTTOCFINE_CLIENTE 111
#define F_SOTTOCINI_FORN 112
#define F_SOTTOCFINE_FORN 113
#define F_DESCRINI_CONTO 114
#define F_DESCRFINE_CONTO 115
#define F_DESCRINI_CLIENTE 116
#define F_DESCRFINE_CLIENTE 117
#define F_DESCRINI_FORN 118
#define F_DESCRFINE_FORN 119
#define F_DATAINI 120
#define F_DATAFINE 121
#define F_STAMPANUM 122
#define F_STAMPAPROGRE 123
#define F_STAMPATOTIVA 124
#define F_TIPOSTAMPA 125
#define F_STAMPAMOVPROV 126
#define F_MEMORIZZA 127
#define F_NUMCARAT 128
#define F_NUMMAST 129
#define F_ANNO 130
#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);}
@ -267,7 +268,19 @@ bool sottoc_handler(TMask_field& f, KEY key)
clifo.setkey(1);
if (clifo.read(_isequal, _nolock) == NOERR)
{
TString rs = clifo.get(CLI_RAGSOC);
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

@ -1,11 +1,11 @@
#define F_ANNO 101
#define F_TIPOCF 102
#define F_GRUPPO 103
#define F_CONTO 104
#define F_SOTTOCONTO 105
#define F_DESCR_CONTO 106
#define F_SOTTOC_CLIENTE 107
#define F_DESCR_CLIENTE 108
#define F_SOTTOC_FORN 109
#define F_DESCR_FORN 110
#define F_SHEET_SALDI 111
#define F_ANNO 101
#define F_TIPOCF 102
#define F_GRUPPO 103
#define F_CONTO 104
#define F_SOTTOCONTO 105
#define F_DESCR_CONTO 106
#define F_SOTTOC_CLIENTE 107
#define F_DESCR_CLIENTE 108
#define F_SOTTOC_FORN 109
#define F_DESCR_FORN 110
#define F_SHEET_SALDI 111

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

@ -1,82 +1,82 @@
#ifndef __CONTO_H
#define __CONTO_H
#ifndef __STRINGS_H
#include <strings.h>
#endif
#ifndef __REAL_H
#include <real.h>
#endif
class TBill : public TSortable
{
char _tipo; // ' ' = Conto, 'C' = Cliente, 'F' = 'Fornitore'
int _gruppo, _conto;
long _sottoconto; // Sottoconto, codice cliente o fornitore
TString80 _descrizione; // Vuota fino alla chiamata di describe
int _tipo_cr; // Tipo costo/ricavo
protected:
virtual int compare(const TSortable& s) const;
virtual const char* class_name() const { return "Conto"; }
const char* describe();
const TBill& copy(const TBill& b);
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) {}
TBill(TToken_string& tgcsd, int from, int mode = 0);
TBill(const TBill& b) { copy(b); }
virtual ~TBill() {}
const TBill& set(int g = 0, int c = 0, long s = 0L, char t = ' ',
const char* d = NULL, int r = -1);
const TBill& add_to(TToken_string& ts, int from, int mode = 0);
const TBill& operator=(const TBill& b) { return copy(b); }
virtual bool ok() const; // Gruppo, Conto e Sottoconto non nulli
bool empty() const { return _gruppo==0 && _conto==0 && _sottoconto == 0; }
char tipo() const { return _tipo; }
int gruppo() const { return _gruppo; }
int conto() const { return _conto; }
long sottoconto() const { return _sottoconto; }
const TString& descrizione();
int tipo_cr();
void tipo_cr(int tcr) { _tipo_cr = tcr; }
int tipo_att();
bool read(TRectype& r);
const char* string(int mode = 0);
};
enum TIndbil { ib_null, ib_attivita, ib_passivita, ib_costi, ib_ricavi, ib_conti_ordine };
class TConto : public TBill
{
real _dare, _avere, _darepro, _averepro, _saldo;
public:
TConto(int g = 0, int c = 0, long s = 0L, char t = ' ', const char* d = NULL)
: TBill(g, c, s, t, d) {}
TConto (TToken_string& tgcsd, int from, int mode = 0)
: TBill(tgcsd, from, mode) {};
real& dare() { return _dare; }
real& avere() { return _avere; }
real& darepro() { return _darepro; }
real& averepro() { return _averepro; }
real& saldo() { return _saldo; }
};
#endif
#ifndef __CONTO_H
#define __CONTO_H
#ifndef __STRINGS_H
#include <strings.h>
#endif
#ifndef __REAL_H
#include <real.h>
#endif
class TBill : public TSortable
{
char _tipo; // ' ' = Conto, 'C' = Cliente, 'F' = 'Fornitore'
int _gruppo, _conto;
long _sottoconto; // Sottoconto, codice cliente o fornitore
TString80 _descrizione; // Vuota fino alla chiamata di describe
int _tipo_cr; // Tipo costo/ricavo
protected:
virtual int compare(const TSortable& s) const;
virtual const char* class_name() const { return "Conto"; }
const char* describe();
const TBill& copy(const TBill& b);
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) { set(g,c,s,t,d,r);}
TBill(TToken_string& tgcsd, int from, int mode = 0);
TBill(const TBill& b) { copy(b); }
virtual ~TBill() {}
const TBill& set(int g = 0, int c = 0, long s = 0L, char t = ' ',
const char* d = NULL, int r = -1);
const TBill& add_to(TToken_string& ts, int from, int mode = 0);
const TBill& operator=(const TBill& b) { return copy(b); }
virtual bool ok() const; // Gruppo, Conto e Sottoconto non nulli
bool empty() const { return _gruppo==0 && _conto==0 && _sottoconto == 0; }
char tipo() const { return _tipo; }
int gruppo() const { return _gruppo; }
int conto() const { return _conto; }
long sottoconto() const { return _sottoconto; }
const TString& descrizione();
int tipo_cr();
void tipo_cr(int tcr) { _tipo_cr = tcr; }
int tipo_att();
bool read(TRectype& r);
const char* string(int mode = 0);
};
enum TIndbil { ib_null, ib_attivita, ib_passivita, ib_costi, ib_ricavi, ib_conti_ordine };
class TConto : public TBill
{
real _dare, _avere, _darepro, _averepro, _saldo;
public:
TConto(int g = 0, int c = 0, long s = 0L, char t = ' ', const char* d = NULL)
: TBill(g, c, s, t, d) {}
TConto (TToken_string& tgcsd, int from, int mode = 0)
: TBill(tgcsd, from, mode) {};
real& dare() { return _dare; }
real& avere() { return _avere; }
real& darepro() { return _darepro; }
real& averepro() { return _averepro; }
real& saldo() { return _saldo; }
};
#endif