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 #ifndef __CG1100_H
#define __CG1100_H #define __CG1100_H
#define F_DATA_STAMPA 100 #define F_DATA_STAMPA 100
#define F_SCELTA_STAMPA 101 #define F_SCELTA_STAMPA 101
#define F_SALTO_PAGINA 102 #define F_SALTO_PAGINA 102
#define F_CODDITTA 103 #define F_CODDITTA 103
#define F_RAGSOC 104 #define F_RAGSOC 104
#endif #endif

View File

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

View File

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

View File

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

View File

@ -36,6 +36,9 @@ BEGIN
DISPLAY "Data inizio esercizio" D0 DISPLAY "Data inizio esercizio" D0
DISPLAY "Data fine esercizio" D1 DISPLAY "Data fine esercizio" D1
OUTPUT F_ANNO CODTAB 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" FLAGS "RZ"
END END
@ -75,6 +78,7 @@ END
RADIOBUTTON F_STAMPA1 28 RADIOBUTTON F_STAMPA1 28
BEGIN BEGIN
PROMPT 40 5 "Tipo stampa " PROMPT 40 5 "Tipo stampa "
//FLAGS "G"
HELP "Indicare il tipo di stampa" HELP "Indicare il tipo di stampa"
ITEM "1|Per date limite" ITEM "1|Per date limite"
MESSAGE SHOW,F_VERIFICA|SHOW,F_MODULO MESSAGE SHOW,F_VERIFICA|SHOW,F_MODULO

View File

@ -275,13 +275,15 @@ class CG1600_application : public TPrintapp
Anni_es _anni_es; Anni_es _anni_es;
Righe_sez_opp _sezopps; Righe_sez_opp _sezopps;
TSaldi_list* _listasld; 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 _data_fine_ese,_data_fine_ese_prec,_data_fine_raf,_data_fine_raf_prec;
TDate _datastampa,_datalimite,_databilrafr,_datai,_datairaf; TDate _datastampa,_datalimite,_databilrafr,_datai,_datairaf;
TDate _dataini,_datafine,_data_ini_ese,_data_ini_raf; TDate _dataini,_datafine,_data_ini_ese,_data_ini_raf;
int _annoese,_annoeserafr,_anno_esercizio,_anno_esercizio_raf; int _annoese,_annoeserafr,_anno_esercizio,_anno_esercizio_raf;
bool _competenza,_intera_struttura,_stampamov,_stampacod,_stampa_modulo; bool _competenza,_intera_struttura,_stampamov,_stampacod,_stampa_modulo;
bool _sbilancio_patr_gia_stampato,_attivo_o_passivo;
bool _stampa_mov_prov,_diffprod_fatto,_risimp_fatto; bool _stampa_mov_prov,_diffprod_fatto,_risimp_fatto;
TString _classe_stampata, _classe_da_stampare,_numr_tot,_num_tot,_numr; 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; 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_tabella();
void crea_sort_piano_conti_scalare(); void crea_sort_piano_conti_scalare();
void crea_sort_piano_conti_verifica(); 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 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); 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); const char* descrizione_sezione(char);
@ -2013,7 +2017,9 @@ if (tasto == K_ENTER)
_statopatr_no_stamp = TRUE; _statopatr_no_stamp = TRUE;
_diffprod_fatto = TRUE; _diffprod_fatto = TRUE;
_risimp_fatto = TRUE; _risimp_fatto = TRUE;
_sbilancio_ordine = FALSE; _sbilancio_ordine = FALSE;
_sbilancio_patr_gia_stampato = FALSE;
_attivo_o_passivo = FALSE;
_sez_stamp = ' '; _sez_stamp = ' ';
_let_stamp = ' '; _let_stamp = ' ';
@ -2094,7 +2100,10 @@ void CG1600_application::stampa_totali()
_let_tot = ' '; _let_tot = ' ';
_sez_tot = ' '; _sez_tot = ' ';
} }
if ((_sez_stamp == '1' || _sez_stamp == '2') && _let_stamp != 'Z')
_attivo_o_passivo = TRUE;
if (_num_da_stamp!=_num_tot) if (_num_da_stamp!=_num_tot)
{ {
if (_let_stamp != 'Z') if (_let_stamp != 'Z')
@ -2301,15 +2310,20 @@ void CG1600_application::stampa_totali()
set_row (_i,"@0gTOTALE CONTI D' ORDINE PASSIVI"); set_row (_i,"@0gTOTALE CONTI D' ORDINE PASSIVI");
set_row (_i++,"@86g%r", &_totale_ordine_passivo); set_row (_i++,"@86g%r", &_totale_ordine_passivo);
_i++; _i++;
real totale = _totale_ordine_attivo - _totale_ordine_passivo;
if (totale != ZERO) if (!_attivo_o_passivo)
{ {
set_row (_i++,"@0gSALDO CONTI D' ORDINE"); real totale = _totale_ordine_attivo - _totale_ordine_passivo;
set_row (_i,"@0gSBILANCIO"); if (totale != ZERO)
set_row (_i++,"@86g%r", &totale); {
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; gia_stampato_conto_ord = TRUE;
} }
} }
@ -2390,57 +2404,84 @@ void CG1600_application::stampa_totali()
} }
if (!gia_stampato_conto_ord) 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')) if ((_sez_stamp == '1')&&(_let_stamp == 'Z'))
{ {
char app = ' '; char app = ' ';
set_row (_i++,"@0g%c", app); set_row (_i++,"@0g%c", app);
set_row (_i,"@0gTOTALE CONTI D' ORDINE ATTIVI"); set_row (_i,"@0gTOTALE CONTI D' ORDINE ATTIVI");
set_row (_i++,"@86g%r", &_totale_ordine_attivo); set_row (_i++,"@86g%r", &_totale_ordine_attivo);
// _totale_ordine_attivo = ZERO; // _totale_ordine_attivo = ZERO;
} }
if ((_sez_stamp == '2')&&(_let_stamp == 'Z')) if ((_sez_stamp == '2')&&(_let_stamp == 'Z'))
{ {
char app = ' '; char app = ' ';
set_row (_i++,"@0g%c", app); set_row (_i++,"@0g%c", app);
set_row (_i,"@0gTOTALE CONTI D' ORDINE PASSIVI"); set_row (_i,"@0gTOTALE CONTI D' ORDINE PASSIVI");
set_row (_i++,"@86g%r", &_totale_ordine_passivo); set_row (_i++,"@86g%r", &_totale_ordine_passivo);
_i++; _i++;
real totale = _totale_ordine_attivo - _totale_ordine_passivo; if (!_sbilancio_ordine)
if (totale != ZERO) {
{ real totale = _totale_ordine_attivo - _totale_ordine_passivo;
set_row (_i++,"@0g%c", app); if (totale != ZERO)
set_row (_i++,"@0gSALDO CONTI D' ORDINE"); {
set_row (_i,"@0gSBILANCIO"); set_row (_i++,"@0g%c", app);
set_row (_i++,"@86g%r", &totale); set_row (_i++,"@0gSALDO CONTI D' ORDINE");
_sbilancio_ordine = TRUE; 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') if (_sez_stamp == '2')
{ {
char app = ' '; char app = ' ';
_totale_patrimoniale = _totale_attivita - _totale_passivita;
real totale = _totale_ordine_attivo - _totale_ordine_passivo; if (!_sbilancio_patr_gia_stampato)
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)
{ {
set_row (_i++,"@0g%c", app); _totale_patrimoniale = _totale_attivita - _totale_passivita;
set_row (_i++,"@0gSALDO STATO PATRIMONIALE"); if (_totale_patrimoniale != ZERO)
set_row (_i,"@0gSBILANCIO (ATTIVO - PASSIVO)"); {
//_totale_patrimoniale = _totale_attivita - _totale_passivita; set_row (_i++,"@0g%c", app);
set_row (_i++,"@86g%r", &_totale_patrimoniale); set_row (_i++,"@0gSALDO STATO PATRIMONIALE");
_totale_patrimoniale = ZERO; 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') if (_sez_stamp == '5')
@ -2505,7 +2546,10 @@ void CG1600_application::stampa_totali_con_raffronto()
_let_tot = ' '; _let_tot = ' ';
_sez_tot = ' '; _sez_tot = ' ';
} }
if ((_sez_stamp == '1' || _sez_stamp == '2') && _let_stamp != 'Z')
_attivo_o_passivo = TRUE;
if (_num_da_stamp!=_num_tot) 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,"@0gTOTALE CONTI D' ORDINE PASSIVI");
set_row (_i,"@86g%r", &_totale_ordine_passivo); set_row (_i,"@86g%r", &_totale_ordine_passivo);
set_row (_i++,"@112g%r", &_totale_ordine_passivo_raf); set_row (_i++,"@112g%r", &_totale_ordine_passivo_raf);
_i++; _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; 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; _cont_gcs = 0;
@ -2846,7 +2895,29 @@ void CG1600_application::stampa_totali_con_raffronto()
} }
if (!gia_stampato_conto_ord) 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')) if ((_sez_stamp == '1')&&(_let_stamp == 'Z'))
{ {
char app = ' '; char app = ' ';
@ -2865,52 +2936,62 @@ void CG1600_application::stampa_totali_con_raffronto()
set_row (_i,"@0gTOTALE CONTI D' ORDINE PASSIVI"); set_row (_i,"@0gTOTALE CONTI D' ORDINE PASSIVI");
set_row (_i,"@86g%r", &_totale_ordine_passivo); set_row (_i,"@86g%r", &_totale_ordine_passivo);
set_row (_i++,"@112g%r", &_totale_ordine_passivo_raf); set_row (_i++,"@112g%r", &_totale_ordine_passivo_raf);
_i++; _i++;
real totale = _totale_ordine_attivo - _totale_ordine_passivo; if (!_sbilancio_ordine)
real tot_raf = _totale_ordine_attivo_raf - _totale_ordine_passivo_raf; {
if (totale != ZERO || tot_raf != ZERO) real totale = _totale_ordine_attivo - _totale_ordine_passivo;
{ real tot_raf = _totale_ordine_attivo_raf - _totale_ordine_passivo_raf;
set_row (_i++,"@0g%c", app); if (totale != ZERO || tot_raf != ZERO)
set_row (_i++,"@0gSALDO CONTI D' ORDINE"); {
set_row (_i,"@0gSBILANCIO"); set_row (_i++,"@0g%c", app);
set_row (_i,"@86g%r", &totale); set_row (_i++,"@0gSALDO CONTI D' ORDINE");
set_row (_i++,"@112g%r", &tot_raf); set_row (_i,"@0gSBILANCIO");
_sbilancio_ordine = TRUE; 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') if (_sez_stamp == '2')
{ {
char app = ' '; char app = ' ';
_totale_patrimoniale = _totale_attivita - _totale_passivita; if (!_sbilancio_patr_gia_stampato)
_totale_patrim_raf = _totale_attiv_raf - _totale_passiv_raf; {
real totale = _totale_ordine_attivo - _totale_ordine_passivo; _totale_patrimoniale = _totale_attivita - _totale_passivita;
real tot_raf = _totale_ordine_attivo_raf - _totale_ordine_passivo_raf; _totale_patrim_raf = _totale_attiv_raf - _totale_passiv_raf;
if ((totale != ZERO || tot_raf != ZERO) && !_sbilancio_ordine) if (_totale_patrimoniale != ZERO || _totale_patrim_raf != ZERO)
{ {
set_row (_i++,"@0g%c", app); set_row (_i++,"@0g%c", app);
set_row (_i++,"@0gSALDO CONTI D' ORDINE"); set_row (_i++,"@0gSALDO STATO PATRIMONIALE");
set_row (_i,"@0gSBILANCIO"); set_row (_i,"@0gSBILANCIO (ATTIVO - PASSIVO)");
set_row (_i,"@86g%r", &totale); //_totale_patrimoniale = _totale_attivita - _totale_passivita;
set_row (_i++,"@112g%r", &tot_raf); //_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); real totale = _totale_ordine_attivo - _totale_ordine_passivo;
set_row (_i++,"@0gSALDO STATO PATRIMONIALE"); real tot_raf = _totale_ordine_attivo_raf - _totale_ordine_passivo_raf;
set_row (_i,"@0gSBILANCIO (ATTIVO - PASSIVO)"); if ((totale != ZERO || tot_raf != ZERO) && !_sbilancio_ordine)
//_totale_patrimoniale = _totale_attivita - _totale_passivita; {
//_totale_patrim_raf = _totale_attiv_raf - _totale_passiv_raf; set_row (_i++,"@0g%c", app);
set_row (_i,"@86g%r", &_totale_patrimoniale); set_row (_i++,"@0gSALDO CONTI D' ORDINE");
set_row (_i++,"@112g%r", &_totale_patrim_raf); set_row (_i,"@0gSBILANCIO");
_totale_patrimoniale = 0; set_row (_i,"@86g%r", &totale);
_totale_patrim_raf = 0; set_row (_i++,"@112g%r", &tot_raf);
} }
}
} }
if (_sez_stamp == '5') if (_sez_stamp == '5')
{ {
@ -3951,8 +4032,15 @@ void CG1600_application::setta_righe(const char * titolo)
long sottoc; long sottoc;
TString numrom,numr; TString numrom,numr;
TString descr_let,descr_numr,descr_num,descr_sottoc,descr_classe; 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; sezione = bil->sez;
lettera = bil->let; lettera = bil->let;
numr = bil->numr; numr = bil->numr;
@ -3964,7 +4052,6 @@ void CG1600_application::setta_righe(const char * titolo)
gruppo = atoi(bil->gruppo); gruppo = atoi(bil->gruppo);
conto = atoi(bil->conto); conto = atoi(bil->conto);
sottoc = atoi(bil->sottoc); sottoc = atoi(bil->sottoc);
_descr_sez = descrizione_sezione(sezione);
descr_let = descrizione_lettera(sezione,lettera); descr_let = descrizione_lettera(sezione,lettera);
descr_numr = descrizione_numeroromano(sezione,lettera,numeror); descr_numr = descrizione_numeroromano(sezione,lettera,numeror);
descr_num = descrizione_numero(sezione,lettera,numeror,numero); descr_num = descrizione_numero(sezione,lettera,numeror,numero);
@ -4028,18 +4115,24 @@ void CG1600_application::setta_righe(const char * titolo)
} }
if (lettera != ' ') if (lettera != ' ')
{ {
set_row(_i,"@0g%c", bil->let); 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 != "") if (numrom != "")
{ {
set_row(_i,"@3g%8s", (const char*) 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) if (numero != 0)
{ {
set_row(_i,"@13g%s", bil->num); 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')) if ((_sez_da_stamp=='1')||(_sez_da_stamp=='2')||(_sez_da_stamp=='9'))
{ {
set_row(_i,"@0g%c", bil->let); 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; //_cont_let += 1;
if (!_intera_struttura || (_intera_struttura && bil->gruppo[0] != 'Z')) if (!_intera_struttura || (_intera_struttura && bil->gruppo[0] != 'Z'))
{ {
@ -4080,12 +4175,16 @@ void CG1600_application::setta_righe(const char * titolo)
if (numrom != "") if (numrom != "")
{ {
set_row(_i,"@3g%8s", (const char*) 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) if (numero != 0)
{ {
set_row(_i,"@13g%s", bil->num); 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')) if ((_sez_da_stamp=='1')||(_sez_da_stamp=='2')||(_sez_da_stamp=='9'))
{ {
set_row(_i,"@3g%8s", (const char*) 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);
//_cont_numr += 1; //_cont_numr += 1;
//_cont_numr = 1; //_cont_numr = 1;
if (!_intera_struttura || (_intera_struttura && bil->gruppo[0] != 'Z')) if (!_intera_struttura || (_intera_struttura && bil->gruppo[0] != 'Z'))
@ -4108,7 +4209,9 @@ void CG1600_application::setta_righe(const char * titolo)
if (numero != 0) if (numero != 0)
{ {
set_row(_i,"@13g%s", bil->num); 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')) if ((_sez_da_stamp=='1')||(_sez_da_stamp=='2')||(_sez_da_stamp=='9'))
{ {
set_row(_i,"@13g%s", bil->num); 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; //_cont_num += 1;
if (!_intera_struttura || (_intera_struttura && bil->gruppo[0] != 'Z')) if (!_intera_struttura || (_intera_struttura && bil->gruppo[0] != 'Z'))
_cont_gcs = 0; _cont_gcs = 0;
@ -4175,7 +4280,15 @@ void CG1600_application::setta_righe_verifica()
long sottoc; long sottoc;
TString numrom,numr; TString numrom,numr;
TString descr_let,descr_numr,descr_num,descr_sottoc,descr_classe; 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; sezione = bil->sez;
lettera = bil->let; lettera = bil->let;
numr = bil->numr; numr = bil->numr;
@ -4187,12 +4300,19 @@ void CG1600_application::setta_righe_verifica()
conto = atoi(bil->conto); conto = atoi(bil->conto);
sottoc = atoi(bil->sottoc); sottoc = atoi(bil->sottoc);
tmcf = bil->tipocf; tmcf = bil->tipocf;
_descr_sez = descrizione_sezione(sezione);
descr_let = descrizione_lettera(sezione,lettera); descr_let = descrizione_lettera(sezione,lettera);
descr_numr = descrizione_numeroromano(sezione,lettera,numeror); descr_numr = descrizione_numeroromano(sezione,lettera,numeror);
descr_num = descrizione_numero(sezione,lettera,numeror,numero); descr_num = descrizione_numero(sezione,lettera,numeror,numero);
if ((tmcf == 'C') || (tmcf == 'F')) 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 else
descr_sottoc = descrizione_sottoconto(gruppo,conto,sottoc); descr_sottoc = descrizione_sottoconto(gruppo,conto,sottoc);
@ -4219,20 +4339,26 @@ void CG1600_application::setta_righe_verifica()
if (lettera != '\0') if (lettera != '\0')
{ {
set_row(_i,"@0g%c", bil->let); set_row(_i,"@0g%c", bil->let);
set_row(_i,"@1g)@3g%s", (const char*) descr_let); *_descr = (const char*) descr_let;
set_row (_i++,"@48g!@81g!@114g!"); 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 != "") if (numrom != "")
{ {
set_row(_i,"@0g%8s", (const char*) numrom); set_row(_i,"@0g%8s", (const char*) numrom);
set_row(_i,"@8g)@10g%s", (const char*) descr_numr); *_descr = (const char*) descr_numr;
set_row (_i++,"@48g!@81g!@114g!"); 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) if (numero != 0)
{ {
set_row(_i,"@0g%s", bil->num); set_row(_i,"@0g%s", bil->num);
set_row(_i,"@2g)@4g%s", (const char*) descr_num); *_descr = (const char*) descr_num;
set_row (_i++,"@48g!@81g!@114g!"); 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') if (_let_da_stamp != 'Z')
{ {
set_row(_i,"@0g%c", bil->let); set_row(_i,"@0g%c", bil->let);
set_row(_i,"@1g)@3g%s", (const char*) descr_let); *_descr = (const char*) descr_let;
set_row (_i++,"@48g!@81g!@114g!"); 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; //_cont_let += 1;
if (!_intera_struttura || (_intera_struttura && bil->gruppo[0] != 'Z')) if (!_intera_struttura || (_intera_struttura && bil->gruppo[0] != 'Z'))
{ {
@ -4261,14 +4389,18 @@ void CG1600_application::setta_righe_verifica()
if (numrom != "") if (numrom != "")
{ {
set_row(_i,"@0g%8s", (const char*) numrom); set_row(_i,"@0g%8s", (const char*) numrom);
set_row(_i,"@8g)@10g%s", (const char*) descr_numr); *_descr = (const char*) descr_numr;
set_row (_i++,"@48g!@81g!@114g!"); 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) if (numero != 0)
{ {
set_row(_i,"@0g%s", bil->num); set_row(_i,"@0g%s", bil->num);
set_row(_i,"@2g)@4g%s", (const char*) descr_num); *_descr = (const char*) descr_num;
set_row (_i++,"@48g!@81g!@114g!"); 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') if (_let_da_stamp != 'Z')
{ {
set_row(_i,"@0g%8s", (const char*) numrom); set_row(_i,"@0g%8s", (const char*) numrom);
set_row(_i,"@8g)@10g%s", (const char*) descr_numr); *_descr = (const char*) descr_numr;
set_row (_i++,"@48g!@81g!@114g!"); 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;
//_cont_numr = 1; //_cont_numr = 1;
if (!_intera_struttura || (_intera_struttura && bil->gruppo[0] != 'Z')) if (!_intera_struttura || (_intera_struttura && bil->gruppo[0] != 'Z'))
@ -4297,8 +4431,10 @@ void CG1600_application::setta_righe_verifica()
if (numero != 0) if (numero != 0)
{ {
set_row(_i,"@0g%s", bil->num); set_row(_i,"@0g%s", bil->num);
set_row(_i,"@2g)@4g%s", (const char*) descr_num); *_descr = (const char*) descr_num;
set_row (_i++,"@48g!@81g!@114g!"); 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') if (_let_da_stamp != 'Z')
{ {
set_row(_i,"@0g%s", bil->num); set_row(_i,"@0g%s", bil->num);
set_row(_i,"@2g)@4g%s", (const char*) descr_num); *_descr = (const char*) descr_num;
set_row (_i++,"@48g!@81g!@114g!"); 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_num += 1;
_cont_gcs = 0; _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) const char* CG1600_application::descrizione_sezione(char sezione)
@ -4727,6 +4902,7 @@ void CG1600_application::user_create()
_anag = new TLocalisamfile (LF_ANAG); _anag = new TLocalisamfile (LF_ANAG);
_pconti = new TLocalisamfile (LF_PCON); _pconti = new TLocalisamfile (LF_PCON);
_clifo = new TLocalisamfile (LF_CLIFO); _clifo = new TLocalisamfile (LF_CLIFO);
_descr = new TParagraph_string ("",40);
_tabivd = new TTable (TAB_IVD); _tabivd = new TTable (TAB_IVD);
_tabesc = new TTable (TAB_ESC); _tabesc = new TTable (TAB_ESC);
@ -4745,7 +4921,8 @@ void CG1600_application::user_destroy()
delete _unloc; delete _unloc;
delete _anag; delete _anag;
delete _pconti; delete _pconti;
delete _clifo; delete _clifo;
delete _descr;
} }
int cg1600 (int argc, char* argv[]) int cg1600 (int argc, char* argv[])

View File

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

View File

@ -1,173 +1,173 @@
#include "cg1600.h" #include "cg1600.h"
PAGE "" -1 -1 78 20 PAGE "" -1 -1 78 20
NUMBER F_CODDITTA 5 NUMBER F_CODDITTA 5
BEGIN BEGIN
PROMPT 4 1 "Ditta " PROMPT 4 1 "Ditta "
FLAGS "FRD" FLAGS "FRD"
USE LF_NDITTE KEY 1 USE LF_NDITTE KEY 1
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
INPUT CODDITTA F_CODDITTA INPUT CODDITTA F_CODDITTA
DISPLAY "Codice" CODDITTA DISPLAY "Codice" CODDITTA
DISPLAY "Ragione sociale @50" RAGSOC DISPLAY "Ragione sociale @50" RAGSOC
OUTPUT F_CODDITTA CODDITTA OUTPUT F_CODDITTA CODDITTA
OUTPUT F_RAGSOC RAGSOC OUTPUT F_RAGSOC RAGSOC
END END
STRING F_RAGSOC 50 STRING F_RAGSOC 50
BEGIN BEGIN
PROMPT 4 2 "Ragione sociale " PROMPT 4 2 "Ragione sociale "
FLAGS "D" FLAGS "D"
END END
NUMBER F_ANNOESE 4 NUMBER F_ANNOESE 4
BEGIN BEGIN
PROMPT 4 5 "Anno esercizio " PROMPT 4 5 "Anno esercizio "
USE ESC USE ESC
INPUT CODTAB F_ANNOESE INPUT CODTAB F_ANNOESE
DISPLAY "Anno" CODTAB DISPLAY "Anno" CODTAB
DISPLAY "Data inizio esercizio" D0 DISPLAY "Data inizio esercizio" D0
DISPLAY "Data fine esercizio" D1 DISPLAY "Data fine esercizio" D1
OUTPUT F_ANNOESE CODTAB OUTPUT F_ANNOESE CODTAB
FLAGS "RZ" FLAGS "RZ"
CHECKTYPE NORMAL CHECKTYPE NORMAL
END END
NUMBER F_ANNORAFFR 4 NUMBER F_ANNORAFFR 4
BEGIN BEGIN
PROMPT 36 5 "Anno esercizio da raffrontare " PROMPT 36 5 "Anno esercizio da raffrontare "
COPY USE F_ANNOESE COPY USE F_ANNOESE
INPUT CODTAB F_ANNORAFFR INPUT CODTAB F_ANNORAFFR
COPY DISPLAY F_ANNOESE COPY DISPLAY F_ANNOESE
OUTPUT F_ANNORAFFR CODTAB OUTPUT F_ANNORAFFR CODTAB
FLAGS "RZ" FLAGS "RZ"
CHECKTYPE NORMAL CHECKTYPE NORMAL
END END
LIST F_TIPOBIL 22 LIST F_TIPOBIL 22
BEGIN BEGIN
PROMPT 4 6 "Tipo bilancio " PROMPT 4 6 "Tipo bilancio "
ITEM "1|Bilancio scalare" ITEM "1|Bilancio scalare"
MESSAGE HIDE,F_TIPOSTAMPA1|RESET,F_TIPOSTAMPA1|SHOW,F_TIPOSTAMPA|K_SPACE,F_TIPOSTAMPA MESSAGE HIDE,F_TIPOSTAMPA1|RESET,F_TIPOSTAMPA1|SHOW,F_TIPOSTAMPA|K_SPACE,F_TIPOSTAMPA
MESSAGE SHOW,F_ANNORAFFR|SHOW,F_DATABILRAF MESSAGE SHOW,F_ANNORAFFR|SHOW,F_DATABILRAF
ITEM "2|Bilancio di verifica" ITEM "2|Bilancio di verifica"
MESSAGE HIDE,F_TIPOSTAMPA|RESET,F_TIPOSTAMPA|SHOW,F_TIPOSTAMPA1|K_SPACE,F_TIPOSTAMPA1 MESSAGE HIDE,F_TIPOSTAMPA|RESET,F_TIPOSTAMPA|SHOW,F_TIPOSTAMPA1|K_SPACE,F_TIPOSTAMPA1
MESSAGE HIDE,F_ANNORAFFR|HIDE,F_DATABILRAF MESSAGE HIDE,F_ANNORAFFR|HIDE,F_DATABILRAF
END END
LIST F_TIPOSTAMPA 23 LIST F_TIPOSTAMPA 23
BEGIN BEGIN
PROMPT 4 7 "Tipo stampa " PROMPT 4 7 "Tipo stampa "
ITEM "1|Per data limite" ITEM "1|Per data limite"
MESSAGE HIDE,F_STAMPAMODULO|HIDE,F_DATAINI|HIDE,F_DATAFINE MESSAGE HIDE,F_STAMPAMODULO|HIDE,F_DATAINI|HIDE,F_DATAFINE
MESSAGE RESET,F_STAMPAMODULO|RESET,F_DATAINI|RESET,F_DATAFINE MESSAGE RESET,F_STAMPAMODULO|RESET,F_DATAINI|RESET,F_DATAFINE
MESSAGE SHOW,F_DATALIM|SHOW,F_STAMPAINT|SHOW,F_STAMPAMOV MESSAGE SHOW,F_DATALIM|SHOW,F_STAMPAINT|SHOW,F_STAMPAMOV
ITEM "2|All'ultima immissione" ITEM "2|All'ultima immissione"
MESSAGE HIDE,F_DATALIM|HIDE,F_STAMPAMODULO|HIDE,F_DATAINI|HIDE,F_DATAFINE 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 RESET,F_STAMPAMODULO|RESET,F_DATAINI|RESET,F_DATALIM|RESET,F_DATAFINE|
MESSAGE SHOW,F_STAMPAINT|SHOW,F_STAMPACOD|SHOW,F_STAMPAMOV MESSAGE SHOW,F_STAMPAINT|SHOW,F_STAMPACOD|SHOW,F_STAMPAMOV
END END
LIST F_TIPOSTAMPA1 23 LIST F_TIPOSTAMPA1 23
BEGIN BEGIN
PROMPT 4 7 "Tipo stampa1 " PROMPT 4 7 "Tipo stampa1 "
ITEM "1|Per data " ITEM "1|Per data "
MESSAGE HIDE,F_DATALIM MESSAGE HIDE,F_DATALIM
MESSAGE RESET,F_DATALIM MESSAGE RESET,F_DATALIM
MESSAGE SHOW,F_STAMPAINT|SHOW,F_STAMPACOD|SHOW,F_STAMPAMOV MESSAGE SHOW,F_STAMPAINT|SHOW,F_STAMPACOD|SHOW,F_STAMPAMOV
MESSAGE SHOW,F_DATAINI|SHOW,F_DATAFINE|SHOW,F_STAMPAMODULO MESSAGE SHOW,F_DATAINI|SHOW,F_DATAFINE|SHOW,F_STAMPAMODULO
ITEM "2|All'ultima immissione" ITEM "2|All'ultima immissione"
MESSAGE HIDE,F_DATALIM|HIDE,F_DATAINI|HIDE,F_DATAFINE MESSAGE HIDE,F_DATALIM|HIDE,F_DATAINI|HIDE,F_DATAFINE
MESSAGE RESET,F_DATAINI|RESET,F_DATALIM|RESET,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 SHOW,F_STAMPAINT|SHOW,F_STAMPACOD|SHOW,F_STAMPAMOV|SHOW,F_STAMPAMODULO
MESSAGE COPY,F_TIPOSTAMPA MESSAGE COPY,F_TIPOSTAMPA
END END
DATE F_DATASTAMPA DATE F_DATASTAMPA
BEGIN BEGIN
PROMPT 4 4 "Data stampa " PROMPT 4 4 "Data stampa "
FLAGS "A" FLAGS "A"
END END
TEXT 96 TEXT 96
BEGIN BEGIN
PROMPT 4 9 "Dalla data competenza " PROMPT 4 9 "Dalla data competenza "
END END
TEXT 97 TEXT 97
BEGIN BEGIN
PROMPT 40 9 "Alla data competenza " PROMPT 40 9 "Alla data competenza "
END END
TEXT 98 TEXT 98
BEGIN BEGIN
PROMPT 4 9 "Dalla data operazione " PROMPT 4 9 "Dalla data operazione "
END END
TEXT 99 TEXT 99
BEGIN BEGIN
PROMPT 40 9 "Alla data operazione " PROMPT 40 9 "Alla data operazione "
END END
DATE F_DATALIM DATE F_DATALIM
BEGIN BEGIN
PROMPT 4 9 "Data limite " PROMPT 4 9 "Data limite "
// VALIDATE NOT_EMPTY_FUNC // VALIDATE NOT_EMPTY_FUNC
END END
DATE F_DATABILRAF DATE F_DATABILRAF
BEGIN BEGIN
PROMPT 36 9 "Data bil. da raffrontare " PROMPT 36 9 "Data bil. da raffrontare "
// VALIDATE NOT_EMPTY_FUNC // VALIDATE NOT_EMPTY_FUNC
END END
DATE F_DATAINI DATE F_DATAINI
BEGIN BEGIN
PROMPT 26 9 "" PROMPT 26 9 ""
// VALIDATE NOT_EMPTY_FUNC // VALIDATE NOT_EMPTY_FUNC
END END
DATE F_DATAFINE DATE F_DATAFINE
BEGIN BEGIN
PROMPT 62 9 "" PROMPT 62 9 ""
// VALIDATE NOT_EMPTY_FUNC // VALIDATE NOT_EMPTY_FUNC
END END
BOOLEAN F_STAMPAINT BOOLEAN F_STAMPAINT
BEGIN BEGIN
PROMPT 4 11 "Stampa intera struttura" PROMPT 4 11 "Stampa intera struttura"
END END
BOOLEAN F_STAMPACOD BOOLEAN F_STAMPACOD
BEGIN BEGIN
PROMPT 41 11 "Non stampare cod. conti" PROMPT 41 11 "Non stampare cod. conti"
END END
BOOLEAN F_STAMPAMOV BOOLEAN F_STAMPAMOV
BEGIN BEGIN
PROMPT 4 12 "Non stampare mov. con saldo a 0" PROMPT 4 12 "Non stampare mov. con saldo a 0"
END END
BOOLEAN F_STAMPAMOVPROV BOOLEAN F_STAMPAMOVPROV
BEGIN BEGIN
PROMPT 41 12 "Stampa movimenti provvisori" PROMPT 41 12 "Stampa movimenti provvisori"
END END
BOOLEAN F_STAMPAMODULO BOOLEAN F_STAMPAMODULO
BEGIN BEGIN
PROMPT 4 13 "Stampa su modulo stretto" PROMPT 4 13 "Stampa su modulo stretto"
END END
BUTTON DLG_OK 9 2 BUTTON DLG_OK 9 2
BEGIN BEGIN
PROMPT -12 -1 "" PROMPT -12 -1 ""
END END
BUTTON DLG_QUIT 9 2 BUTTON DLG_QUIT 9 2
BEGIN BEGIN
PROMPT -22 -1 "" PROMPT -22 -1 ""
END END
ENDPAGE ENDPAGE
ENDMASK 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 _data_ini,_data_fine,_data_finese,_data_finesesucc,_ultima_data_reg;
TDate _datareg,_datadoc,_data_inizioese,_datareg_stampa; TDate _datareg,_datadoc,_data_inizioese,_datareg_stampa;
int _cur1,_gruppo,_conto,_numcarat,_stampanum,_numivd; 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 _progredare,_progreavere,_totprogre_dare_al,_totprogre_avere_al;
real _totprogre_dare,_totprogre_avere,_importo; real _totprogre_dare,_totprogre_avere,_importo;
real _riporto_dare,_riporto_avere,_riporto_parziale_dare,_riporto_parziale_avere; 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; TString _ragsoc,_indulc,_civulc,_capulc,_com,_prov,_comulc;
long _codice_ditta,_s_prec; long _codice_ditta,_s_prec;
TString _tipodoc,_codcaus,_descrcaus,_descrdociva,_regiva; TString _tipodoc,_codcaus,_descrcaus,_descrdociva,_regiva;
TString16 _lettivd; char _sezivd,_lettivd;
int _sezivd; TString _descrizione,_sezione,_numdoc,_descrizionemov,_numrivd,_descr;
TString _descrizione,_sezione,_numdoc,_descrizionemov,_numrivd;
TString _dataregs, _datadocs,_gruppocontr,_contocontr,_sottocontocontr; TString _dataregs, _datadocs,_gruppocontr,_contocontr,_sottocontocontr;
bool _stampaprogre,_stampatotiva,_stampatot,_prima_volta,_stampa_mov_prov; bool _stampaprogre,_stampatotiva,_stampatot,_prima_volta,_stampa_mov_prov;
@ -104,12 +103,14 @@ public:
void fai_stampa198(); void fai_stampa198();
void stampa_totali132(); void stampa_totali132();
void stampa_totali198(); void stampa_totali198();
void stampa_totaliiva(); void stampa_totaliiva();
void ricerca_classe_IV(bool scelta);
void data_fine_esercizio(int); void data_fine_esercizio(int);
const char* descrizione_gruppo(); const char* descrizione_gruppo();
const char* descrizione_conto(); const char* descrizione_conto();
const char* descrizione_gruppo_clifo(); 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(); bool almeno_un_record();
void ricerca_dati_ditta(); void ricerca_dati_ditta();
void conto(); void conto();
@ -328,13 +329,13 @@ void CG3200_application::saldi_zero()
long sottoc = atol(rmov.get(RMV_SOTTOCONTO)); long sottoc = atol(rmov.get(RMV_SOTTOCONTO));
if ((gruppo == _gruppo)&&(conto == _conto)&&(sottoc == _sottoc)) if ((gruppo == _gruppo)&&(conto == _conto)&&(sottoc == _sottoc))
{ {
if (sezione == 'D') if (sezione == 'D')
saldo_dare += importo; saldo_dare += importo;
else if (sezione == 'A') else if (sezione == 'A')
saldo_avere += importo; saldo_avere += importo;
} }
else break; else break;
rmov.next(); rmov.next();
} }
rmov.readat(record); rmov.readat(record);
@ -855,11 +856,15 @@ void CG3200_application::ricerca_regiva()
} }
bool CG3200_application::preprocess_print(int file, int counter) bool CG3200_application::preprocess_print(int file, int counter)
{ {
_g_prec = 0; if (file == LF_SALDI)
_c_prec = 0; {
_s_prec = 0; _g_prec = 0;
return TRUE; _c_prec = 0;
_s_prec = 0;
}
return TRUE;
} }
bool CG3200_application::set_print(int) bool CG3200_application::set_print(int)
@ -1119,8 +1124,8 @@ void CG3200_application::crea_intestazione()
set_header (6, (const char *) sep); set_header (6, (const char *) sep);
set_header (7,"Operazione@19gDocumento@117gContro"); set_header (7,"Operazione@19gDocumento@117gContro");
set_header (8,"Data"); set_header (8,"Data");
if (_stampanum < 3) if (_stampanum < 3)
set_header (8,"@11gnumero"); set_header (8,"@11gnumero");
set_header (8,"@19gData@30gNumero@38gCod.Causale@61gDescrizione@90gDare@106gAvere@117gPartita"); set_header (8,"@19gData@30gNumero@38gCod.Causale@61gDescrizione@90gDare@106gAvere@117gPartita");
sep.fill('-'); sep.fill('-');
set_header (9, (const char *) sep); set_header (9, (const char *) sep);
@ -1130,10 +1135,10 @@ void CG3200_application::crea_intestazione()
sep1.fill('-'); //Stampa 198 - (sep1(198)) sep1.fill('-'); //Stampa 198 - (sep1(198))
set_header (6,"@1g%s", (const char *) sep1); set_header (6,"@1g%s", (const char *) sep1);
set_header (7,"Operazione@19gData@30gNumero@172gContro@185gReg@193gNumero"); set_header (7,"Operazione@19gData@30gNumero@172gContro@185gReg@193gNumero");
set_header (8,"Data"); set_header (8,"Data");
if (_stampanum < 3) if (_stampanum < 3)
set_header (8,"@11gnumero"); set_header (8,"@11gnumero");
set_header (8,"@19gDocumento@38gCod.Causale@68gDescrizione@108gDare@124gAvere@136gSaldo progress.@154gSaldo movim.@172gPartita@185gIva@189gProtocollo"); set_header (8,"@19gDocumento@38gCod.Causale@68gDescrizione@108gDare@124gAvere@136gSaldo progress.@154gSaldo movim.@172gPartita@185gIva@189gProtocollo");
sep1.fill('-'); sep1.fill('-');
set_header (9,"@1g%s", (const char *) sep1); set_header (9,"@1g%s", (const char *) sep1);
} }
@ -1373,35 +1378,35 @@ void CG3200_application::calcola_progressivi()
progavere_prec = saldo; progavere_prec = saldo;
} }
} }
else }
{ } // FOR
//Se il saldo dell'esercizio attuale non e' diverso da zero, allora il saldo //Se il saldo dell'esercizio attuale non e' diverso da zero, allora il saldo
// finale dell'esercizio precedente devo calcolarmelo tenendo conto dell'indbil // finale dell'esercizio precedente devo calcolarmelo tenendo conto dell'indbil
if ((_indbil == 1) || (_indbil == 2) || (_indbil == 5)) if (_annomsk != 0 && saldo == ZERO)
{ {
const TRecnotype pos = saldi.recno(); if ((_indbil == 1) || (_indbil == 2) || (_indbil == 5))
saldo = _sld.saldofin_esprec(_anno_corrente,_gruppo,_conto,_sottoc); {
saldi.readat(pos); const TRecnotype pos = saldi.recno();
saldo = _sld.saldofin_esprec(_anno_corrente,_gruppo,_conto,_sottoc);
saldi.readat(pos);
if (saldo> ZERO) if (saldo> ZERO)
{ {
progredare_eseprec = saldo;// + pdarescap + pdarep; progredare_eseprec = saldo;// + pdarescap + pdarep;
progdare_prec = saldo; progdare_prec = saldo;
// progreavere_eseprec = paverescap + paverep; // 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); // 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; TString ragsoc,paiv,cofi,indcf,capcf,ptel,tel,statocf,comcf,dencom,provcom,dep;
TLocalisamfile clifo(LF_CLIFO); TLocalisamfile clifo(LF_CLIFO);
TLocalisamfile pconti(LF_PCON); TLocalisamfile pconti(LF_PCON);
TString16 dataini,datafine; TString16 dataini,datafine;
TString descriz,descriz2;
int numrivd; int numrivd;
clifo.setkey(1); clifo.setkey(1);
@ -1471,8 +1477,9 @@ void CG3200_application::ricerca_clifo()
clifo.read(); clifo.read();
if (clifo.bad()) if (clifo.bad())
clifo.zero(); clifo.zero();
TConto tc (_gruppo,_conto,_sottoc,_tmcf);
ragsoc = clifo.get(CLI_RAGSOC);
ragsoc = tc.descrizione();
paiv = clifo.get(CLI_PAIV); paiv = clifo.get(CLI_PAIV);
cofi = clifo.get(CLI_COFI); cofi = clifo.get(CLI_COFI);
indcf = clifo.get(CLI_INDCF); indcf = clifo.get(CLI_INDCF);
@ -1494,33 +1501,45 @@ void CG3200_application::ricerca_clifo()
pconti.zero(); pconti.zero();
pconti.put(PCN_GRUPPO, _gruppo); pconti.put(PCN_GRUPPO, _gruppo);
pconti.put(PCN_CONTO, _conto); pconti.put(PCN_CONTO, _conto);
pconti.put(PCN_SOTTOCONTO, _sottoc); //pconti.put(PCN_SOTTOCONTO, _sottoc);
pconti.read(); pconti.read();
//_sezivd = pconti.get_char(PCN_SEZIVD); //_sezivd = pconti.get_char(PCN_SEZIVD);
_sezivd = pconti.get_int(PCN_SEZIVD); _sezivd = pconti.get_char(PCN_SEZIVD);
_lettivd = pconti.get(PCN_LETTIVD); _lettivd = pconti.get_char(PCN_LETTIVD);
numrivd = pconti.get_int(PCN_NUMRIVD); numrivd = pconti.get_int(PCN_NUMRIVD);
_numrivd = itor(numrivd); _numrivd = itor(numrivd);
_numivd = pconti.get_int(PCN_NUMIVD); _numivd = pconti.get_int(PCN_NUMIVD);
_tabivd->curr().zero(); descriz = descrizione_classe(_sezivd,_lettivd,numrivd,_numivd);
//dep.format ("%c%c%04d%2d",_sezivd,_lettivd,numrivd,_numivd);
dep.format ("%d%s%04d%2d", _sezivd, (const char *) _lettivd,numrivd,_numivd); if (_numivd != 0) //Ora devo stampare la descrizione del livello della
_tabivd->curr().put("CODTAB", (const char*) dep); { //classe immediatamente precedente a quello appena
_tabivd->read(); if (_numrivd != "") //stampato
if (_tabivd->bad()) descriz2 = descrizione_classe(_sezivd,_lettivd,_numrivd_int,0);
_tabivd->zero(); else
TString descriz = _tabivd->curr().get("S0"); 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,"@27g%-30s",(const char*) descrizione_gruppo());
set_header(3,"@59g%-30s",(const char*) descrizione_conto()); set_header(3,"@59g%-30s",(const char*) descrizione_conto());
set_header(3, "@91g%-30s",(const char*) ragsoc); 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); set_header(4, "@10g%-8s", (const char*) _numrivd);
if (_numivd != 0) if (_numivd != 0)
set_header(4, "@19g%2d", _numivd); 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(); dataini = _data_ini.string();
datafine = _data_fine.string(); datafine = _data_fine.string();
@ -1531,15 +1550,15 @@ void CG3200_application::ricerca_clifo()
} }
else else
{ {
set_header (5, "Periodo di competenza@23g%s", (const char*) dataini); set_header (5, "Comp. da@9g%s", (const char*) dataini);
set_header (5, "@35g%s", (const char*) datafine); set_header (5, "@20ga@22g%s", (const char*) datafine);
} }
set_header (5, "@34g%-11s",(const char*) paiv); set_header (5, "@33gP.I.@37g%-11s",(const char*) paiv);
set_header (5, "@46g%-16s",(const char*) cofi); set_header (5, "@49gCF@52g%-16s",(const char*) cofi);
set_header (5, "@63g%-25s",(const char*) indcf); set_header (5, "@69g%-25s",(const char*) indcf);
set_header (5, "@89g%-5s",(const char*) capcf); set_header (5, "@95g%-5s",(const char*) capcf);
set_header (5, "@95g%-30s",(const char*) dencom); set_header (5, "@101g%-24s",(const char*) dencom);
set_header (5,"@126g%-5s",(const char*) provcom); set_header (5,"@126g%-5s",(const char*) provcom);
if (_numcarat == 2) if (_numcarat == 2)
@ -1551,47 +1570,67 @@ void CG3200_application::ricerca_clifo()
// Se la ricerca selezionata sulla maschera e' per gruppo, conto, sottoconto // Se la ricerca selezionata sulla maschera e' per gruppo, conto, sottoconto
// ricerca i corrispondenti su PCON, con relativa IV direttiva CEE // 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.setkey(1);
pconti.zero(); pconti.zero();
pconti.put(PCN_GRUPPO, _gruppo); pconti.put(PCN_GRUPPO, _gruppo);
pconti.put(PCN_CONTO, _conto); pconti.put(PCN_CONTO, _conto);
pconti.put(PCN_SOTTOCONTO, _sottoc); if (scelta)
pconti.put(PCN_SOTTOCONTO, _sottoc);
pconti.read(); pconti.read();
//_sezivd = pconti.get_char(PCN_SEZIVD); //_sezivd = pconti.get_char(PCN_SEZIVD);
_sezivd = pconti.get_int(PCN_SEZIVD); _sezivd = pconti.get_char(PCN_SEZIVD);
_lettivd = pconti.get(PCN_LETTIVD); _lettivd = pconti.get_char(PCN_LETTIVD);
numrivd = pconti.get_int(PCN_NUMRIVD); _numrivd_int = pconti.get_int (PCN_NUMRIVD);
_numrivd = itor(numrivd); _numrivd = itor(_numrivd_int);
_numivd = pconti.get_int(PCN_NUMIVD); _numivd = pconti.get_int (PCN_NUMIVD);
descr = pconti.get(PCN_DESCR); _descr = pconti.get (PCN_DESCR);
}
_tabivd->zero();
//dep.format ("%c%c%04d%2d",_sezivd,_lettivd, numrivd,_numivd); void CG3200_application::ricerca_gruppo()
dep.format ("%d%s%04d%2d",_sezivd,(const char *) _lettivd, numrivd,_numivd); {
_tabivd->put("CODTAB", (const char*) dep); TString80 descr,descriz,descriz2,dep;
_tabivd->read(); TString dataini,datafine;
if (_tabivd->bad())
_tabivd->zero(); ricerca_classe_IV (TRUE); //Esiste a livello di sottoconto
descriz = _tabivd->get("S0");
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,"@27g%-30s",(const char*) descrizione_gruppo());
set_header(3,"@59g%-30s",(const char*) descrizione_conto()); set_header(3,"@59g%-30s",(const char*) descrizione_conto());
set_header(3,"@91g%-30s",(const char*) descr); set_header(3,"@91g%-30s",(const char*) _descr);
set_header(4, "@0gClasse@12g%s",(const char*) _lettivd); set_header(4, "@0gClasse@12g%c", _lettivd);
set_header(4, "@14g%-8s",(const char*) _numrivd); set_header(4, "@14g%-8s",(const char*) _numrivd);
if (_numivd != 0) if (_numivd != 0)
set_header(4, "@23g%d", _numivd); 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(); dataini = _data_ini.string();
datafine = _data_fine.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 //Ricerca la descrizione relativa al gruppo da stampare
const char* CG3200_application::descrizione_gruppo() const char* CG3200_application::descrizione_gruppo()

View File

@ -1,41 +1,42 @@
#ifndef __CG3200_H #ifndef __CG3200_H
#define __CG3200_H #define __CG3200_H
#define TAB_IVD "%IVD" #define TAB_IVD "%IVD"
#define TAB_TPD "%TPD" #define TAB_TPD "%TPD"
#define TAB_REG "REG" #define TAB_REG "REG"
#define TAB_ESC "ESC" #define TAB_ESC "ESC"
#define F_CODDITTA 101 #define F_CODDITTA 101
#define F_RAGSOC 102 #define F_RAGSOC 102
#define F_TIPOCF 103 #define F_TIPOCF 103
#define F_GRUPPOINI 104 #define F_GRUPPOINI 104
#define F_GRUPPOFINE 105 #define F_GRUPPOFINE 105
#define F_CONTOINI 106 #define F_CONTOINI 106
#define F_CONTOFINE 107 #define F_CONTOFINE 107
#define F_SOTTOCINI_CONTO 108 #define F_SOTTOCINI_CONTO 108
#define F_SOTTOCFINE_CONTO 109 #define F_SOTTOCFINE_CONTO 109
#define F_SOTTOCINI_CLIENTE 110 #define F_SOTTOCINI_CLIENTE 110
#define F_SOTTOCFINE_CLIENTE 111 #define F_SOTTOCFINE_CLIENTE 111
#define F_SOTTOCINI_FORN 112 #define F_SOTTOCINI_FORN 112
#define F_SOTTOCFINE_FORN 113 #define F_SOTTOCFINE_FORN 113
#define F_DESCRINI_CONTO 114 #define F_DESCRINI_CONTO 114
#define F_DESCRFINE_CONTO 115 #define F_DESCRFINE_CONTO 115
#define F_DESCRINI_CLIENTE 116 #define F_DESCRINI_CLIENTE 116
#define F_DESCRFINE_CLIENTE 117 #define F_DESCRFINE_CLIENTE 117
#define F_DESCRINI_FORN 118 #define F_DESCRINI_FORN 118
#define F_DESCRFINE_FORN 119 #define F_DESCRFINE_FORN 119
#define F_DATAINI 120 #define F_DATAINI 120
#define F_DATAFINE 121 #define F_DATAFINE 121
#define F_STAMPANUM 122 #define F_STAMPANUM 122
#define F_STAMPAPROGRE 123 #define F_STAMPAPROGRE 123
#define F_STAMPATOTIVA 124 #define F_STAMPATOTIVA 124
#define F_TIPOSTAMPA 125 #define F_TIPOSTAMPA 125
#define F_STAMPAMOVPROV 126 #define F_STAMPAMOVPROV 126
#define F_MEMORIZZA 127 #define F_MEMORIZZA 127
#define F_NUMCARAT 128 #define F_NUMCARAT 128
#define F_NUMMAST 129 #define F_NUMMAST 129
#define F_ANNO 130 #define F_ANNO 130
#define F_FORMATO 131 #define F_FORMATO 131
#endif // __CG3200_H #endif // __CG3200_H

View File

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

View File

@ -130,6 +130,7 @@ public:
void add_r(int,int,real&,real&,real&,char,real&,real&, void add_r(int,int,real&,real&,real&,char,real&,real&,
real&,real&,TDate&,long,real&,real&,real&); real&,real&,TDate&,long,real&,real&,real&);
void compilasheet(); void compilasheet();
void disable_all();
bool fai_filtro(); bool fai_filtro();
TMask* main_mask() const {return _msk;} TMask* main_mask() const {return _msk;}
TSheet_field& ss() const { return (TSheet_field&)_msk->field(F_SHEET_SALDI);} 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); clifo.setkey(1);
if (clifo.read(_isequal, _nolock) == NOERR) 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_CLIENTE, rs);
f.mask().set(F_DESCR_FORN, rs); f.mask().set(F_DESCR_FORN, rs);
f.mask().stop_run(K_AUTO_ENTER); 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_SOTTOCONTO, sottoc_handler);
_msk->set_handler(F_SOTTOC_CLIENTE, sottoc_handler); _msk->set_handler(F_SOTTOC_CLIENTE, sottoc_handler);
_msk->set_handler(F_SOTTOC_FORN, sottoc_handler); _msk->set_handler(F_SOTTOC_FORN, sottoc_handler);
disable_all();
_pcon = new TLocalisamfile(LF_PCON); _pcon = new TLocalisamfile(LF_PCON);
_clifo = new TLocalisamfile(LF_CLIFO); _clifo = new TLocalisamfile(LF_CLIFO);
_rel = new TRelation(LF_PCON); _rel = new TRelation(LF_PCON);
@ -314,6 +328,12 @@ bool CG5200_application::user_create()
return TRUE; return TRUE;
} }
void CG5200_application::disable_all()
{
for (int i = 0; i < 17; i++)
ss().enable_column(i,FALSE);
}
bool CG5200_application::user_destroy() bool CG5200_application::user_destroy()
{ {
delete _msk; delete _msk;

View File

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

View File

@ -47,6 +47,7 @@ BEGIN
DISPLAY "Gruppo" GRUPPO DISPLAY "Gruppo" GRUPPO
DISPLAY "Descrizione@50" DESCR DISPLAY "Descrizione@50" DESCR
OUTPUT F_GRUPPO GRUPPO OUTPUT F_GRUPPO GRUPPO
//OUTPUT F_DESCR_CONTO DESCR
FLAGS "R" FLAGS "R"
END END
@ -64,9 +65,15 @@ BEGIN
OUTPUT F_CONTO CONTO OUTPUT F_CONTO CONTO
OUTPUT F_GRUPPO GRUPPO OUTPUT F_GRUPPO GRUPPO
OUTPUT F_TIPOCF TMCF OUTPUT F_TIPOCF TMCF
//OUTPUT F_DESCR_CLIENTE DESCR
//OUTPUT F_DESCR_FORN DESCR
//OUTPUT F_DESCR_CONTO DESCR
FLAGS "R" FLAGS "R"
CHECKTYPE NORMAL CHECKTYPE NORMAL
WARNING "Conto inesistente o mancante" 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 END
NUMBER F_SOTTOCONTO 6 NUMBER F_SOTTOCONTO 6
@ -85,8 +92,15 @@ BEGIN
OUTPUT F_SOTTOCONTO SOTTOCONTO OUTPUT F_SOTTOCONTO SOTTOCONTO
OUTPUT F_GRUPPO GRUPPO OUTPUT F_GRUPPO GRUPPO
OUTPUT F_CONTO CONTO 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" FLAGS "R"
CHECKTYPE NORMAL CHECKTYPE NORMAL
//VALIDATE AUTOEXIT_FUNC 3 F_GRUPPO F_CONTO F_SOTTOCONTO
GROUP 1 GROUP 1
WARNING "Conto inesistente" WARNING "Conto inesistente"
END END
@ -95,6 +109,7 @@ NUMBER F_SOTTOC_CLIENTE 6
BEGIN BEGIN
PROMPT 54 3 "Cliente " PROMPT 54 3 "Cliente "
USE LF_CLIFO USE LF_CLIFO
//FIELD LF_CLIFO->CODCF
INPUT TIPOCF "C" INPUT TIPOCF "C"
INPUT CODCF F_SOTTOC_CLIENTE INPUT CODCF F_SOTTOC_CLIENTE
DISPLAY "Codice" CODCF DISPLAY "Codice" CODCF
@ -102,10 +117,14 @@ BEGIN
DISPLAY "Gruppo" GRUPPO DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO DISPLAY "Conto" CONTO
OUTPUT F_SOTTOC_CLIENTE CODCF OUTPUT F_SOTTOC_CLIENTE CODCF
//OUTPUT F_DESCR_CONTO RAGSOC
//OUTPUT F_DESCR_CLIENTE RAGSOC
//OUTPUT F_DESCR_FORN RAGSOC
FLAGS "R" FLAGS "R"
CHECKTYPE NORMAL CHECKTYPE NORMAL
KEY 1 KEY 1
WARNING "Cliente inesistente" WARNING "Cliente inesistente"
//VALIDATE AUTOEXIT_FUNC 3 F_GRUPPO F_CONTO F_SOTTOC_CLIENTE
GROUP 2 GROUP 2
END END
@ -120,10 +139,15 @@ BEGIN
DISPLAY "Gruppo" GRUPPO DISPLAY "Gruppo" GRUPPO
DISPLAY "Conto" CONTO DISPLAY "Conto" CONTO
OUTPUT F_SOTTOC_FORN CODCF OUTPUT F_SOTTOC_FORN CODCF
// OUTPUT F_DESCR_FORN RAGSOC
// OUTPUT F_DESCR_CONTO RAGSOC
// OUTPUT F_DESCR_CLIENTE RAGSOC
FLAGS "R" FLAGS "R"
CHECKTYPE NORMAL CHECKTYPE NORMAL
// serve per l' autopremimento
KEY 1 KEY 1
WARNING "Fornitore inesistente" WARNING "Fornitore inesistente"
//VALIDATE AUTOEXIT_FUNC 3 F_GRUPPO F_CONTO F_SOTTOC_FORN
GROUP 3 GROUP 3
END END
@ -320,6 +344,24 @@ BEGIN
PROMPT -22 -1 "" PROMPT -22 -1 ""
END 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 ENDPAGE
ENDMASK ENDMASK

View File

@ -110,6 +110,7 @@ const char* TBill::describe()
{ {
int err = NOERR; int err = NOERR;
const char* desc = NULL; const char* desc = NULL;
TFixed_string ragsoc(&__tmp_string[256], 50);
if ((_tipo != 'C' && _tipo != 'F') || _sottoconto == 0L) if ((_tipo != 'C' && _tipo != 'F') || _sottoconto == 0L)
{ {
@ -136,7 +137,23 @@ const char* TBill::describe()
err = clifo.read(); err = clifo.read();
if (err == NOERR) 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) if (_conto == 0)
{ {
_gruppo = clifo.get_int("GRUPPO"); _gruppo = clifo.get_int("GRUPPO");

View File

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