Corretti errori prima nota

Eliminate le troppe TMP string in cg3 e cglib
Risolti conflitti in cg3100*.*


git-svn-id: svn://10.65.10.50/trunk@868 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1995-01-16 15:08:33 +00:00
parent a1486179c9
commit 4510dcba25
37 changed files with 537 additions and 574 deletions

View File

@ -145,7 +145,7 @@ END
STRING F_PROFILO 5 STRING F_PROFILO 5
BEGIN BEGIN
PROMPT 2 13 "Profilo " PROMPT 2 13 "Profilo "
VALIDATE ZEROFILL_FUNC 5 FLAGS "UZ"
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
END END

View File

@ -27,6 +27,7 @@ BEGIN
DISPLAY "Descrizione@50" DESCR DISPLAY "Descrizione@50" DESCR
OUTPUT FLD_CM1_GRUPPO GRUPPO OUTPUT FLD_CM1_GRUPPO GRUPPO
OUTPUT FLD_CM1_DESCG DESCR OUTPUT FLD_CM1_DESCG DESCR
OUTPUT FLD_CM1_DESC DESCR
CHECKTYPE NORMAL CHECKTYPE NORMAL
END END
@ -43,7 +44,7 @@ BEGIN
FIELD LF_PCON->CONTO FIELD LF_PCON->CONTO
FLAGS "R" FLAGS "R"
KEY 1 KEY 1
USE LF_PCON KEY 1 SELECT ((CONTO!="") && (SOTTOCONTO="")) USE LF_PCON KEY 1 SELECT ((CONTO!="")&&(SOTTOCONTO=""))
COPY INPUT FLD_CM1_GRUPPO COPY INPUT FLD_CM1_GRUPPO
INPUT CONTO FLD_CM1_CONTO INPUT CONTO FLD_CM1_CONTO
DISPLAY "Gruppo" GRUPPO DISPLAY "Gruppo" GRUPPO
@ -52,6 +53,7 @@ BEGIN
OUTPUT FLD_CM1_GRUPPO GRUPPO OUTPUT FLD_CM1_GRUPPO GRUPPO
OUTPUT FLD_CM1_CONTO CONTO OUTPUT FLD_CM1_CONTO CONTO
OUTPUT FLD_CM1_DESCC DESCR OUTPUT FLD_CM1_DESCC DESCR
OUTPUT FLD_CM1_DESC DESCR
CHECKTYPE NORMAL CHECKTYPE NORMAL
END END

View File

@ -182,6 +182,19 @@ BEGIN
HELP "Localita' del recapito" HELP "Localita' del recapito"
END END
STRING F_CAPCF 5
BEGIN
PROMPT 50 8 "CAP "
FIELD LF_CLIFO->CAPCF
HELP "Codice di avviamento postale del recapito"
END
STRING F_PROVCF 5
BEGIN
PROMPT 63 8 "Prov."
FLAGS "D"
END
NUMBER F_STATOCF 3 NUMBER F_STATOCF 3
BEGIN BEGIN
PROMPT 2 9 "Comune:Stato " PROMPT 2 9 "Comune:Stato "
@ -208,19 +221,6 @@ BEGIN
COPY OUTPUT F_STATOCF COPY OUTPUT F_STATOCF
END END
STRING F_PROVCF 5
BEGIN
PROMPT 63 8 "Prov."
FLAGS "D"
END
STRING F_CAPCF 5
BEGIN
PROMPT 50 8 "CAP "
FIELD LF_CLIFO->CAPCF
HELP "Codice di avviamento postale del recapito"
END
STRING F_COMCF 4 STRING F_COMCF 4
BEGIN BEGIN
PROMPT 8 10 ":Codice " PROMPT 8 10 ":Codice "

View File

@ -41,7 +41,9 @@ typedef enum { no_descr, acquisto, vendita, incasso_pagamento,
int _anno_iva; int _anno_iva;
protected: protected:
static bool filtra_reg(const TRelation * r); static bool filtra_reg(const TRelation * r);
void set_reg_filter();
static bool tipocf_hndl (TMask_field& f, KEY k); static bool tipocf_hndl (TMask_field& f, KEY k);
static bool cod_reg_hndl (TMask_field& f, KEY k); static bool cod_reg_hndl (TMask_field& f, KEY k);
@ -69,7 +71,6 @@ protected:
void causale_vendite (); void causale_vendite ();
void causale_acquisti(); void causale_acquisti();
protected:
virtual bool user_create(); virtual bool user_create();
virtual bool user_destroy(); virtual bool user_destroy();
@ -99,7 +100,7 @@ public:
void add_riga (int numrig, char sz, TConto& tc, const TString& d, const TString& da); void add_riga (int numrig, char sz, TConto& tc, const TString& d, const TString& da);
bool mostra_campi(TMask_field& f); bool mostra_campi(TMask_field& f);
bool valuta() const { return _valuta; } bool valuta() const { return _valuta; }
bool saldaconto() const { return _saldaconto; } bool saldaconto() const { return _saldaconto; }
int anno_iva() const { return _anno_iva; } int anno_iva() const { return _anno_iva; }
@ -275,6 +276,15 @@ bool TCaus_app::m770_hndl (TMask_field& f, KEY k)
return TRUE; return TRUE;
} }
void TCaus_app::set_reg_filter()
{
TEdit_field& reg = _msk->efield(F_COD_REG);
reg.browse()->cursor()->set_filterfunction(filtra_reg);
TEdit_field& des = _msk->efield(F_DES_REG);
des.browse()->cursor()->set_filterfunction(filtra_reg);
}
bool TCaus_app::tipodoc_hndl (TMask_field& f, KEY k) bool TCaus_app::tipodoc_hndl (TMask_field& f, KEY k)
{ {
// Testo K_TAB perche' il controllo deve scattare anche all'inizio // Testo K_TAB perche' il controllo deve scattare anche all'inizio
@ -289,10 +299,9 @@ bool TCaus_app::tipodoc_hndl (TMask_field& f, KEY k)
{ {
m.hide(F_TIPO_MOV_2); m.hide(F_TIPO_MOV_2);
if (app().saldaconto()) m.show(F_TIPO_MOV_1); if (app().saldaconto()) m.show(F_TIPO_MOV_1);
field_reg.enable(); field_reg.enable();
m.enable(F_DES_REG); m.enable(F_DES_REG);
field_reg.check_type(CHECK_REQUIRED);
TTable tabtpd("%TPD"); TTable tabtpd("%TPD");
tabtpd.put("CODTAB", val); tabtpd.put("CODTAB", val);
@ -307,32 +316,32 @@ bool TCaus_app::tipodoc_hndl (TMask_field& f, KEY k)
if (corrisp) // vendite con corrispettivi if (corrisp) // vendite con corrispettivi
{ {
app()._filtro = 2; app()._filtro = 2;
field_reg.browse()->cursor()->set_filterfunction(filtra_reg); app().set_reg_filter();
} }
else // vendite senza corrispettivi else // vendite senza corrispettivi
{ {
app()._filtro = 1; app()._filtro = 1;
field_reg.browse()->cursor()->set_filterfunction(filtra_reg); app().set_reg_filter();
} }
} else } else
if ( i == 2 ) // acquisti if ( i == 2 ) // acquisti
{ {
app()._filtro = 3; app()._filtro = 3;
field_reg.browse()->cursor()->set_filterfunction(filtra_reg); app().set_reg_filter();
} else } else
if ( i == 9 ) // sia acquisti che vendite if ( i == 9 ) // sia acquisti che vendite
{ {
app()._filtro = 4; app()._filtro = 4;
field_reg.browse()->cursor()->set_filterfunction(filtra_reg); app().set_reg_filter();
} }
} }
} }
else // TIPODOC vuoto || IN || PG || AN else // TIPODOC vuoto || IN || PG || AN
{ {
field_reg.reset(); field_reg.reset();
field_reg.disable(); field_reg.enable(m.query_mode());
m.reset(F_DES_REG); m.reset(F_DES_REG);
m.disable(F_DES_REG); m.enable(F_DES_REG, m.query_mode());
m.hide(F_TIPO_MOV_1); m.hide(F_TIPO_MOV_1);
if (app().saldaconto()) if (app().saldaconto())
@ -865,7 +874,6 @@ void TCaus_app::init_insert_mode(TMask& m)
void TCaus_app::init_modify_mode(TMask& m) void TCaus_app::init_modify_mode(TMask& m)
{ {
init_mask(m); init_mask(m);
m.efield(F_COD_REG).check_type(CHECK_NONE); // Disabilita temporaneamente il check sui registri
} }

View File

@ -98,7 +98,7 @@ BEGIN
HELP "Codice registro collegato alla causale" HELP "Codice registro collegato alla causale"
FIELD REG FIELD REG
USE REG USE REG
INPUT CODTAB[1,4] F_ANNOES SELECT INPUT CODTAB[1,4] F_ANNOES
INPUT CODTAB[5,7] F_COD_REG INPUT CODTAB[5,7] F_COD_REG
DISPLAY "Anno" CODTAB[1,4] DISPLAY "Anno" CODTAB[1,4]
DISPLAY "Codice registro " CODTAB[5,7] DISPLAY "Codice registro " CODTAB[5,7]
@ -110,14 +110,13 @@ BEGIN
OUTPUT F_CORRISP B0 OUTPUT F_CORRISP B0
OUTPUT F_DES_REG S0 OUTPUT F_DES_REG S0
WARNING "Registro assente o non compatibile col tipo documento" WARNING "Registro assente o non compatibile col tipo documento"
CHECKTYPE NORMAL CHECKTYPE REQUIRED
FLAGS "DUZ" FLAGS "UZ"
END END
STRING F_DES_REG 50 STRING F_DES_REG 50
BEGIN BEGIN
PROMPT 24 4 "" PROMPT 24 4 ""
HELP "Codice registro collegato alla causale"
USE REG KEY 2 USE REG KEY 2
INPUT S0 F_DES_REG INPUT S0 F_DES_REG
DISPLAY "Descrizione @50" S0 DISPLAY "Descrizione @50" S0
@ -126,10 +125,20 @@ BEGIN
DISPLAY "Tipo" I0 DISPLAY "Tipo" I0
DISPLAY "Corrispettivi" B0 DISPLAY "Corrispettivi" B0
COPY OUTPUT F_COD_REG COPY OUTPUT F_COD_REG
CHECKTYPE NORMAL CHECKTYPE REQUIRED
FLAGS "D"
END END
NUMBER F_ANNOES 4
BEGIN
PROMPT 2 5 "Anno liquidaz. "
FLAGS "HA"
END
NUMBER F_TIPO_REG 1
BEGIN
PROMPT 25 5 "Tipo "
FLAGS "H"
END
// Questo rimane quasi sempre nascosto // Questo rimane quasi sempre nascosto
STRING F_TIPO_MOV 2 STRING F_TIPO_MOV 2
@ -179,18 +188,6 @@ BEGIN
ITEM "6|Ritenute per prestazioni occasionali" ITEM "6|Ritenute per prestazioni occasionali"
END END
NUMBER F_ANNOES 4
BEGIN
PROMPT 2 5 ""
FLAGS "AH"
END
NUMBER F_TIPO_REG 1
BEGIN
PROMPT 23 5 ""
FLAGS "H"
END
BOOLEAN F_CORRISP BOOLEAN F_CORRISP
BEGIN BEGIN
PROMPT 33 5 "" PROMPT 33 5 ""

View File

@ -1,5 +1,7 @@
#include <xvt.h> #include <xvt.h>
#include <checks.h> #include <checks.h>
#define __MAIN__
#include "cg1.h" #include "cg1.h"
#define usage "Error - usage : %s -{0|1|2|3|4|5} [params]" #define usage "Error - usage : %s -{0|1|2|3|4|5} [params]"

View File

@ -1,21 +1,10 @@
#ifndef __CG1_H #ifndef __CG1_H
#define __CG1_H #define __CG1_H
#ifdef MAIN
#define extern
#endif
#ifdef MAIN
#undef extern
#endif
#ifndef __STRINGS_H #ifndef __STRINGS_H
#include <strings.h> #include <strings.h>
#endif #endif
const MAXSTR = 128;
static char __tmp [MAXSTR];
int cg1100(int argc, char* argv[]); int cg1100(int argc, char* argv[]);
int cg1200(int argc, char* argv[]); int cg1200(int argc, char* argv[]);
int cg1300(int argc, char* argv[]); int cg1300(int argc, char* argv[]);
@ -24,6 +13,17 @@ int cg1500(int argc, char* argv[]);
int cg1600(int argc, char* argv[]); int cg1600(int argc, char* argv[]);
int cg1700(int argc, char* argv[]); int cg1700(int argc, char* argv[]);
#ifdef __MAIN__
#define extern
#endif
extern TString80 tmp;
#ifdef __MAIN__
#undef extern
#endif
#endif // __CG1_H #endif // __CG1_H

View File

@ -30,9 +30,6 @@ enum stampe {
senza_ana_bil senza_ana_bil
}; };
extern char __tmp [MAXSTR];
static TFixed_string tmp(__tmp, MAXSTR);
class CG1100_application : public TPrintapp class CG1100_application : public TPrintapp
{ {
struct bil_ivd struct bil_ivd
@ -1139,7 +1136,7 @@ const char* CG1100_application::descrizione_numero(char sezione, char lettera, i
tmp = tabivd.get("S0"); tmp = tabivd.get("S0");
else else
tmp = ""; tmp = "";
return (__tmp); return tmp;
} }

View File

@ -26,9 +26,6 @@ enum pw { clienti = 1, fornitori = 2, both = 3 };
bool mask2_reset_fields(TMask_field& mf, KEY k); bool mask2_reset_fields(TMask_field& mf, KEY k);
extern char __tmp [MAXSTR];
static TFixed_string tmp(__tmp, MAXSTR);
class CG1200_App : public TPrintapp class CG1200_App : public TPrintapp
{ {
friend bool mask2_reset_fields(TMask_field& mf, KEY k); friend bool mask2_reset_fields(TMask_field& mf, KEY k);
@ -136,7 +133,7 @@ const char* CG1200_App::descrizione_conto_ric(int gruppo, int conto, long sottoc
pconti.zero(); pconti.zero();
tmp = pconti.get(PCN_DESCR); tmp = pconti.get(PCN_DESCR);
return (__tmp); return tmp;
} }
const char* CG1200_App::descrizione_allegato(char tipocf,long cod) const char* CG1200_App::descrizione_allegato(char tipocf,long cod)
@ -153,7 +150,7 @@ const char* CG1200_App::descrizione_allegato(char tipocf,long cod)
_tipoaper = clifo.get_char(CLI_TIPOAPER); _tipoaper = clifo.get_char(CLI_TIPOAPER);
tmp = clifo.get(CLI_RAGSOC); tmp = clifo.get(CLI_RAGSOC);
return (__tmp); return tmp;
} }
bool CG1200_App::preprocess_page(int file, int counter) bool CG1200_App::preprocess_page(int file, int counter)
@ -402,7 +399,7 @@ const char* CG1200_App::compatta_ragsoc(TString& ragsoc,char tipoa)
tmp = ragsoc; tmp = ragsoc;
return (__tmp); return tmp;
} }
void CG1200_App::preprocess_header() void CG1200_App::preprocess_header()

View File

@ -145,7 +145,7 @@ END
STRING F_PROFILO 5 STRING F_PROFILO 5
BEGIN BEGIN
PROMPT 2 13 "Profilo " PROMPT 2 13 "Profilo "
VALIDATE ZEROFILL_FUNC 5 FLAGS "UZ"
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
END END

View File

@ -24,8 +24,6 @@
#include "cg1.h" #include "cg1.h"
#include "cg1500.h" #include "cg1500.h"
static TString256 TMP;
bool my_handler (TMask_field& f, KEY k); bool my_handler (TMask_field& f, KEY k);
bool mask_anno (TMask_field& f, KEY k); bool mask_anno (TMask_field& f, KEY k);
bool mask_datalim (TMask_field& f, KEY k); bool mask_datalim (TMask_field& f, KEY k);
@ -2857,11 +2855,6 @@ TDate CG1500_application::UltimaData(int g, int c, long s, int anno)
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)
{ {
/*
TConto tc (g,c,s,tipocf);
TMP = tc.descrizione();
return TMP;
*/
TString80 ragsoc; TString80 ragsoc;
const char* desc = NULL; const char* desc = NULL;
TLocalisamfile pconti(LF_PCON,FALSE); TLocalisamfile pconti(LF_PCON,FALSE);
@ -2875,7 +2868,7 @@ const char* CG1500_application::DescrizioneConto(int g, int c, long s,
pconti.put(PCN_SOTTOCONTO, s); pconti.put(PCN_SOTTOCONTO, s);
pconti.read(); pconti.read();
if (pconti.good()) if (pconti.good())
TMP = pconti.get(PCN_DESCR); tmp = pconti.get(PCN_DESCR);
else else
{ {
clifo.setkey(1); //occorre settare la chiave 1, anche se di solito e' di default, poiche' nella create il file clifo e' stato aperto con la chiave 3 clifo.setkey(1); //occorre settare la chiave 1, anche se di solito e' di default, poiche' nella create il file clifo e' stato aperto con la chiave 3
@ -2898,12 +2891,12 @@ const char* CG1500_application::DescrizioneConto(int g, int c, long s,
} }
else else
desc = clifo.get("RAGSOC"); desc = clifo.get("RAGSOC");
TMP = desc; tmp = desc;
} }
else else
TMP = ""; tmp = "";
} }
return TMP; return tmp;
} }
bool CG1500_application::user_create() bool CG1500_application::user_create()

View File

@ -21,9 +21,6 @@
#include "cg1.h" #include "cg1.h"
#include "cg1600.h" #include "cg1600.h"
extern char __tmp [MAXSTR];
static TFixed_string tmp(__tmp, MAXSTR);
bool our_handler (TMask_field & f,KEY k); bool our_handler (TMask_field & f,KEY k);
class Anno_es : public TObject class Anno_es : public TObject
@ -4614,7 +4611,7 @@ const char* CG1600_application::descrizione_sezione(char sezione)
tmp = tabivd.get("S0"); tmp = tabivd.get("S0");
else else
tmp = ""; tmp = "";
return (__tmp); return tmp;
} }
const char* CG1600_application::descrizione_lettera(char sezione, char lettera) const char* CG1600_application::descrizione_lettera(char sezione, char lettera)
@ -4631,7 +4628,7 @@ const char* CG1600_application::descrizione_lettera(char sezione, char lettera)
tmp = tabivd.get("S0"); tmp = tabivd.get("S0");
else else
tmp = ""; tmp = "";
return (__tmp); return tmp;
} }
const char* CG1600_application::descrizione_numeroromano(char sezione, char lettera, int numr) const char* CG1600_application::descrizione_numeroromano(char sezione, char lettera, int numr)
@ -4652,7 +4649,7 @@ const char* CG1600_application::descrizione_numeroromano(char sezione, char lett
tmp = tabivd.get("S0"); tmp = tabivd.get("S0");
else else
tmp = ""; tmp = "";
return (__tmp); return tmp;
} }
const char* CG1600_application::descrizione_numero(char sezione, char lettera, int numr, int numero) const char* CG1600_application::descrizione_numero(char sezione, char lettera, int numr, int numero)
@ -4672,7 +4669,7 @@ const char* CG1600_application::descrizione_numero(char sezione, char lettera, i
tmp = tabivd.get("S0"); tmp = tabivd.get("S0");
else else
tmp = ""; tmp = "";
return (__tmp); return tmp;
} }
const char* CG1600_application::descrizione_sottoconto(int gruppo, int conto, long sottoc) const char* CG1600_application::descrizione_sottoconto(int gruppo, int conto, long sottoc)
@ -4689,7 +4686,7 @@ const char* CG1600_application::descrizione_sottoconto(int gruppo, int conto, lo
if (pconti.bad()) if (pconti.bad())
pconti.zero(); pconti.zero();
tmp = pconti.get(PCN_DESCR); tmp = pconti.get(PCN_DESCR);
return (__tmp); return tmp;
} }
const char* CG1600_application::descr_sottoc_clifo(char tipocf,long s) const char* CG1600_application::descr_sottoc_clifo(char tipocf,long s)
@ -4704,7 +4701,7 @@ const char* CG1600_application::descr_sottoc_clifo(char tipocf,long s)
if (clifo.bad()) if (clifo.bad())
clifo.zero(); clifo.zero();
tmp = clifo.get(CLI_RAGSOC); tmp = clifo.get(CLI_RAGSOC);
return (__tmp); return tmp;
} }
void CG1600_application::preprocess_header() void CG1600_application::preprocess_header()

View File

@ -75,12 +75,7 @@ END
LIST F_TIPOSTAMPA1 23 LIST F_TIPOSTAMPA1 23
BEGIN BEGIN
<<<<<<< cg1600a.uml
PROMPT 4 7 "Tipo stampa1 "
HELP "Indicare il tipo di stampa che si vuole avere"
=======
PROMPT 4 7 "Tipo stampa " PROMPT 4 7 "Tipo stampa "
>>>>>>> 1.5
ITEM "1|Per data " ITEM "1|Per data "
MESSAGE HIDE,F_DATALIM MESSAGE HIDE,F_DATALIM
MESSAGE RESET,F_DATALIM MESSAGE RESET,F_DATALIM
@ -95,12 +90,8 @@ END
DATE F_DATASTAMPA DATE F_DATASTAMPA
BEGIN BEGIN
<<<<<<< cg1600a.uml
PROMPT 4 4 "Data stampa " PROMPT 4 4 "Data stampa "
HELP "Indicare la data da stampare sul bilancio" HELP "Indicare la data da stampare sul bilancio"
=======
PROMPT 4 8 "Data stampa "
>>>>>>> 1.5
FLAGS "A" FLAGS "A"
END END

View File

@ -75,7 +75,7 @@ TMask* TPrimanota_application::load_mask(int n)
m->set_handler(F_OCCASEDIT, occas_handler); m->set_handler(F_OCCASEDIT, occas_handler);
m->set_handler(F_SOLAIVA, solaiva_handler); m->set_handler(F_SOLAIVA, solaiva_handler);
m->set_handler(F_SHEETIVA, iva_handler); m->set_handler(F_SHEETIVA, iva_handler);
TSheet_field& is = (TSheet_field&)m->field(F_SHEETIVA); TSheet_field& is = (TSheet_field&)m->field(F_SHEETIVA);
is.set_notify(iva_notify); is.set_notify(iva_notify);
TMask& ism = is.sheet_mask(); TMask& ism = is.sheet_mask();
@ -220,6 +220,7 @@ bool TPrimanota_application::read_caus(const char* cod, int year)
m->show(F_NUMRIF, sal); m->show(F_NUMRIF, sal);
m->enable(F_ANNORIF, ins); // Dis/abilita anno e riferimento partita m->enable(F_ANNORIF, ins); // Dis/abilita anno e riferimento partita
m->enable(F_NUMRIF, ins); m->enable(F_NUMRIF, ins);
m->field(F_NUMRIF).set_justify(iva == iva_acquisti ? _num_for : _num_cli);
if (ins) if (ins)
{ {
@ -365,6 +366,8 @@ void TPrimanota_application::on_config_change()
TConfig cnf(CONFIG_DITTA); TConfig cnf(CONFIG_DITTA);
_ges_val = cnf.get_bool("GesVal"); _ges_val = cnf.get_bool("GesVal");
_ges_sal = cnf.get_bool("GesSal"); _ges_sal = cnf.get_bool("GesSal");
_num_cli = cnf.get_bool("NrCliDx");
_num_for = cnf.get_bool("NrForDx");
} }
@ -688,11 +691,11 @@ void TPrimanota_application::mask2rel(const TMask& m)
_rel->lfile().put("TIPO", clifo()); _rel->lfile().put("TIPO", clifo());
int err = ~NOERR; int err = ~NOERR;
if (m.get_bool(F_OCCASIONALE)) if (m.field(F_OCCASEDIT).active()) // Se e' un occasionale
{ {
TRelation occas(LF_OCCAS); TRelation occas(LF_OCCAS);
const TMask& om = occas_mask(); const TMask& om = occas_mask();
om.autosave(&occas); om.autosave(&occas); // Salva i dati anagrafici
err = occas.write(); err = occas.write();
if (err == _isreinsert) if (err == _isreinsert)

View File

@ -42,7 +42,6 @@
#define F_CAMBIO 127 #define F_CAMBIO 127
#define F_VISVAL 128 #define F_VISVAL 128
#define F_PROVVISORIO 129 #define F_PROVVISORIO 129
#define F_OCCASIONALE 130
#define F_OCCASEDIT 131 #define F_OCCASEDIT 131
#define F_SOLAIVA 132 #define F_SOLAIVA 132
#define F_CORRLIRE 133 #define F_CORRLIRE 133

View File

@ -241,6 +241,7 @@ NUMBER F_CLIENTE 6
BEGIN BEGIN
PROMPT 1 10 "Cliente " PROMPT 1 10 "Cliente "
HELP "Codice del cliente" HELP "Codice del cliente"
FLAGS "R"
FIELD LF_MOV->CODCF FIELD LF_MOV->CODCF
GROUP 1 GROUP 1
USE LF_CLIFO KEY 1 USE LF_CLIFO KEY 1
@ -261,7 +262,6 @@ BEGIN
OUTPUT F_CODPAG CODPAG OUTPUT F_CODPAG CODPAG
OUTPUT F_STATOPAIV STATOPAIV OUTPUT F_STATOPAIV STATOPAIV
OUTPUT F_PIVACLIENTE PAIV OUTPUT F_PIVACLIENTE PAIV
OUTPUT F_OCCASIONALE OCCAS
MESSAGE COPY,F_FORNITORE MESSAGE COPY,F_FORNITORE
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
WARNING "Cliente assente" WARNING "Cliente assente"
@ -271,6 +271,7 @@ END
NUMBER F_FORNITORE 6 NUMBER F_FORNITORE 6
BEGIN BEGIN
PROMPT 1 10 "Fornitore " PROMPT 1 10 "Fornitore "
FLAGS "R"
HELP "Codice del fornitore" HELP "Codice del fornitore"
FIELD LF_MOV->CODCF FIELD LF_MOV->CODCF
GROUP 2 GROUP 2
@ -289,7 +290,6 @@ BEGIN
OUTPUT F_GRUPPORIC GRUPPORIC OUTPUT F_GRUPPORIC GRUPPORIC
OUTPUT F_CONTORIC CONTORIC OUTPUT F_CONTORIC CONTORIC
OUTPUT F_SOTTOCONTORIC SOTTOCRIC OUTPUT F_SOTTOCONTORIC SOTTOCRIC
OUTPUT F_OCCASIONALE OCCAS
OUTPUT F_CODPAG CODPAG OUTPUT F_CODPAG CODPAG
OUTPUT F_STATOPAIV STATOPAIV OUTPUT F_STATOPAIV STATOPAIV
OUTPUT F_PIVAFORNITORE PAIV OUTPUT F_PIVAFORNITORE PAIV
@ -336,7 +336,7 @@ STRING F_PIVACLIENTE 14
BEGIN BEGIN
PROMPT 1 11 "Partita IVA " PROMPT 1 11 "Partita IVA "
HELP "Partita IVA del cliente del documento" HELP "Partita IVA del cliente del documento"
GROUP 1 GROUP 1 7
USE LF_CLIFO KEY 5 USE LF_CLIFO KEY 5
INPUT TIPOCF "C" INPUT TIPOCF "C"
INPUT STATOPAIV F_STATOPAIV INPUT STATOPAIV F_STATOPAIV
@ -353,7 +353,7 @@ STRING F_PIVAFORNITORE 14
BEGIN BEGIN
PROMPT 1 11 "Partita IVA " PROMPT 1 11 "Partita IVA "
HELP "Partita IVA del fornitore del documento" HELP "Partita IVA del fornitore del documento"
GROUP 2 GROUP 2 7
USE LF_CLIFO KEY 5 USE LF_CLIFO KEY 5
INPUT TIPOCF "F" INPUT TIPOCF "F"
INPUT STATOPAIV F_STATOPAIV INPUT STATOPAIV F_STATOPAIV
@ -381,22 +381,15 @@ BEGIN
ITEM "LU|Lussemburgo" ITEM "LU|Lussemburgo"
ITEM "NL|Olanda" ITEM "NL|Olanda"
ITEM "PT|Portogallo" ITEM "PT|Portogallo"
GROUP 1 GROUP 1 7
END END
BUTTON F_OCCASEDIT 18 BUTTON F_OCCASEDIT 56
BEGIN BEGIN
PROMPT 32 11 "Dati anagrafici" PROMPT 1 11 "Dati anagrafici del cliente o fornitore occasionale"
FLAGS "H" FLAGS "H"
END END
BOOLEAN F_OCCASIONALE
BEGIN
MESSAGE FALSE HIDE,F_OCCASEDIT|ENABLE,F_PIVACLIENTE|ENABLE,F_PIVAFORNITORE|SHOW,F_STATOPAIV
MESSAGE TRUE SHOW,F_OCCASEDIT|DISABLE,F_PIVACLIENTE|DISABLE,F_PIVAFORNITORE|HIDE,F_STATOPAIV
FLAGS "GH"
END
STRING F_CODPAG 4 STRING F_CODPAG 4
BEGIN BEGIN
PROMPT 60 11 "Pagamento " PROMPT 60 11 "Pagamento "
@ -418,7 +411,7 @@ BEGIN
PROMPT 1 12 "Valuta " PROMPT 1 12 "Valuta "
HELP "Codice della valuta per operazione con l'estero" HELP "Codice della valuta per operazione con l'estero"
FIELD LF_MOV->CODVAL FIELD LF_MOV->CODVAL
FLAGS "U" FLAGS "UZ"
GROUP 3 GROUP 3
USE %VAL USE %VAL
INPUT CODTAB F_VALUTA INPUT CODTAB F_VALUTA
@ -517,7 +510,7 @@ BEGIN
PROMPT 68 15 "/ " PROMPT 68 15 "/ "
FIELD LF_PARTITE->NUMPART FIELD LF_PARTITE->NUMPART
FLAGS "D" FLAGS "D"
HELP "Numero documento (o protocollo IVA) di riferimento" HELP "Numero documento di riferimento"
WARNING "E' richiesto il numero di riferimento partita" WARNING "E' richiesto il numero di riferimento partita"
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
END END
@ -527,7 +520,7 @@ BEGIN
PROMPT 1 17 "Valuta intracom. " PROMPT 1 17 "Valuta intracom. "
HELP "Codice della valuta per operazione intracomunitaria" HELP "Codice della valuta per operazione intracomunitaria"
FIELD CODVALI FIELD CODVALI
FLAGS "U" FLAGS "UZ"
GROUP 4 GROUP 4
USE %VAL USE %VAL
INPUT CODTAB F_VALUTAINTRA INPUT CODTAB F_VALUTAINTRA

View File

@ -322,16 +322,12 @@ void TPrimanota_application::disable_cgs_cells(int n, char tipo)
} }
} }
void TPrimanota_application::reset_sheet_row(TSheet_field& s, int n)
void TPrimanota_application::reset_cgs_row(int n)
{ {
TSheet_field& cg = cgs(); s.row(s.items()); // Append a new line
cg.row(cg.items()); // Append a new line s.destroy(n); // Remove line n
cg.destroy(n); // Remove line n
} }
int TPrimanota_application::set_cgs_row(int n, const TImporto& imp, int TPrimanota_application::set_cgs_row(int n, const TImporto& imp,
TBill& conto, const char* desc, TBill& conto, const char* desc,
char tipo) char tipo)
@ -590,34 +586,27 @@ void TPrimanota_application::generazione_righe_cg(int r)
bool TPrimanota_application::cg_notify(int r, KEY k) bool TPrimanota_application::cg_notify(int r, KEY k)
{ {
TSheet_field& cg = app().cgs();
const char tipo = cg.row(r).right(1)[0];
switch(k) switch(k)
{ {
case K_SPACE: case K_SPACE:
{
TSheet_field& cg = app().cgs();
TToken_string& row = cg.row(r);
const char tipo = row.right(1)[0];
cg.sheet_mask().enable(DLG_DELREC, tipo <= ' '); cg.sheet_mask().enable(DLG_DELREC, tipo <= ' ');
break;
case K_ENTER:
if (app().iva() == nessuna_iva)
app().generazione_righe_cg(r);
app().calcola_saldo();
break;
case K_DEL:
if (tipo > ' ')
return error_box("La riga %d non puo' essere cancellata", r+1);
default:
break;
} }
break; return TRUE;
case K_ENTER:
if (app().iva() == nessuna_iva)
app().generazione_righe_cg(r);
app().calcola_saldo();
break;
case K_DEL:
{
TToken_string& row = app().cgs().row(r);
const char tipo = row.right(1)[0];
if (tipo > ' ')
return error_box("La riga %d non puo' essere cancellata", r+1);
}
break;
default:
break;
}
return TRUE;
} }
bool TPrimanota_application::descr_handler(TMask_field& f, KEY k) bool TPrimanota_application::descr_handler(TMask_field& f, KEY k)
@ -767,7 +756,7 @@ bool TPrimanota_application::imposta_handler(TMask_field& f, KEY key)
{ {
f.warning_box("L'imposta dovrebbe essere %s", (const char*)imposta.string(".")); f.warning_box("L'imposta dovrebbe essere %s", (const char*)imposta.string("."));
if (val.is_zero()) f.set(imposta.string()); if (val.is_zero()) f.set(imposta.string());
} }
} else } else
if (key == K_F8) if (key == K_F8)
{ {
@ -788,6 +777,9 @@ bool TPrimanota_application::imposta_handler(TMask_field& f, KEY key)
} }
// Calcola il totale degli imponibili e delle imposte e aggiorna
// i corrispondenti campi della maschera
// Certified 99%
real TPrimanota_application::calcola_imp() const real TPrimanota_application::calcola_imp() const
{ {
TArray& rows = ivas().rows_array(); TArray& rows = ivas().rows_array();
@ -907,11 +899,12 @@ bool TPrimanota_application::iva_notify(int r, KEY k)
// Aggiorna conto sulla riga contabile // Aggiorna conto sulla riga contabile
if (newpos < 0) if (newpos < 0)
{ {
if (delimp >= 0) app().reset_cgs_row(delimp); // Cancella vecchia riga if (delimp >= 0)
app().reset_cgs_row(delimp); // Cancella vecchia riga
const TImporto val(app().real2imp(imponibile, 'I')); const TImporto val(app().real2imp(imponibile, 'I'));
if (conto.ok() && !val.is_zero()) // Se c'e' imponibile ... if (conto.ok() && !val.is_zero()) // Se c'e' imponibile ...
{ // crea una nuova riga contabile { // crea una nuova riga contabile
const TString80 d(cau.desc_agg(2)); const TString80 d(cau.desc_agg(2));
app().set_cgs_row(-1, val, conto, d, 'I'); app().set_cgs_row(-1, val, conto, d, 'I');
} }
@ -920,8 +913,8 @@ bool TPrimanota_application::iva_notify(int r, KEY k)
{ {
TImporto val(app().real2imp(imponibile, 'I')); TImporto val(app().real2imp(imponibile, 'I'));
val = app().add_cgs_imp(newpos, val); val = app().add_cgs_imp(newpos, val);
if (val.valore().is_zero()) // Se la riga si e' azzerata ... if (val.valore().is_zero()) // Se la riga si e' azzerata ...
{ // ... cancellala { // ... cancellala
app().reset_cgs_row(newpos); app().reset_cgs_row(newpos);
newpos = -1; newpos = -1;
} }
@ -935,7 +928,10 @@ bool TPrimanota_application::iva_notify(int r, KEY k)
int newposiva = type2pos(tipod); int newposiva = type2pos(tipod);
if (newposiva < 0) if (newposiva < 0)
{ {
if (deliva >= 0)
app().reset_ivas_row(deliva);
if (!imposta.is_zero()) // Se c'e' imposta ... if (!imposta.is_zero()) // Se c'e' imposta ...
{ // ... crea nuova riga per l'IVA { // ... crea nuova riga per l'IVA
const TImporto val(app().real2imp(imposta, 'I')); const TImporto val(app().real2imp(imposta, 'I'));
@ -959,6 +955,10 @@ oldposiva = newposiva;
if (r == 0) // Se cambio la prima riga ... if (r == 0) // Se cambio la prima riga ...
app().add_cgs_tot(app().curr_mask()); // ... ricalcola conti app().add_cgs_tot(app().curr_mask()); // ... ricalcola conti
if (imponibile.is_zero() && imposta.is_zero()) // Svuota riga iva nulla
app().reset_ivas_row(r);
app().calcola_imp(); // Ricalcola totale IVA app().calcola_imp(); // Ricalcola totale IVA
app().calcola_saldo(); // Ricalcola sbilanci app().calcola_saldo(); // Ricalcola sbilanci
} }
@ -991,9 +991,9 @@ bool TPrimanota_application::iva_handler(TMask_field& f, KEY k)
const real im(row.get(0)); const real im(row.get(0));
if (!im.is_zero()) if (!im.is_zero())
{ {
const TBill c(row, 6, 0x0); TBill c(row, 6, 0x0);
if (!c.ok()) if (!c.ok() || !c.find())
return f.error_box("Il conto della riga iva %d non e' completo", i+1); return error_box("Il conto della riga iva %d e' errato o incompleto", i+1);
} }
} }
} }
@ -1408,33 +1408,46 @@ bool TPrimanota_application::clifo_handler(TMask_field& f, KEY key)
if (!suspended_handler(f, key)) if (!suspended_handler(f, key))
return FALSE; return FALSE;
if (key == K_TAB && f.focusdirty()) if (key == K_TAB && f.active())
{ {
TMask& m = f.mask(); const char cf = app().clifo();
app().add_cgs_tot(m); TLocalisamfile& clifo = ((TEdit_field&)f).browse()->cursor()->file();
if (clifo.get_char(CLI_TIPOCF) != cf)
{
clifo.put(CLI_TIPOCF, cf);
clifo.read();
}
TLocalisamfile& clifo = ((TEdit_field&)f).browse()->cursor()->file();
const int alleg = clifo.get_int(CLI_ALLEG); const int alleg = clifo.get_int(CLI_ALLEG);
TMask& m = f.mask();
TEdit_field& upi = m.efield(F_RIEPILOGO); TEdit_field& upi = m.efield(F_RIEPILOGO);
upi.check_type(alleg == 3 ? CHECK_REQUIRED : CHECK_NORMAL); upi.check_type(alleg == 3 ? CHECK_REQUIRED : CHECK_NORMAL);
const bool occas = clifo.get_bool(CLI_OCCAS);
m.show(F_OCCASEDIT, occas); // Dati anagrfici
m.show(-7, !occas); // Partita IVA e stato partita IVA
if (clifo.get_bool(CLI_OCCAS)) if (f.focusdirty())
m.send_key(K_SPACE, F_OCCASEDIT); // Lancia maschera occasionali {
app().add_cgs_tot(m);
if (m.field(F_VISVAL).active())
{ if (m.field(F_VISVAL).active())
const TString16 valuta(clifo.get("CODVAL")); {
if (valuta.not_empty() && valuta != m.get(F_VALUTA)) const TString16 valuta(clifo.get("CODVAL"));
{ if (valuta.not_empty() && valuta != m.get(F_VALUTA))
TTable val("%val");
val.put("CODTAB", valuta);
if (val.read() == NOERR)
{ {
m.set(F_VALUTA, valuta); TTable val("%val");
m.set(F_CAMBIO, val.get("R0"), TRUE); val.put("CODTAB", valuta);
} if (val.read() == NOERR)
} {
} m.set(F_VALUTA, valuta);
m.set(F_CAMBIO, val.get("R0"), TRUE);
}
}
}
if (occas)
m.send_key(K_SPACE, F_OCCASEDIT); // Lancia maschera occasionali
}
} }
return TRUE; return TRUE;
} }

View File

@ -40,8 +40,10 @@ class TPrimanota_application : public TRelation_application
TLibro_giornale* _giornale; // Libro giornale corrente TLibro_giornale* _giornale; // Libro giornale corrente
TipoIVA _iva; // Tipo di IVA corrente TipoIVA _iva; // Tipo di IVA corrente
bool _ges_val, _ges_sal; // Gestione valuta e saldaconto bool _ges_val, _ges_sal; // Gestione valuta e saldaconto
bool _num_cli, _num_for; // Riferimento partita allineato a destra
bool _savenew; // Registra e nuovo bool _savenew; // Registra e nuovo
short _firstfocus; // First field to gain focus short _firstfocus; // First field to gain focus
bool _iva_showed; // Lo sheet IVA e' gia' stato visualizzato una volta? bool _iva_showed; // Lo sheet IVA e' gia' stato visualizzato una volta?
TSaldo_agg _saldi; // Saldi da aggiornare TSaldo_agg _saldi; // Saldi da aggiornare
@ -89,6 +91,8 @@ class TPrimanota_application : public TRelation_application
static bool cg_notify(int r, KEY key); static bool cg_notify(int r, KEY key);
static bool cg_handler(TMask_field& f, KEY key); static bool cg_handler(TMask_field& f, KEY key);
static bool pag_notify(int r, KEY key); static bool pag_notify(int r, KEY key);
void reset_sheet_row(TSheet_field& s, int n);
protected: protected:
virtual bool user_create(); virtual bool user_create();
@ -165,12 +169,14 @@ protected:
real calcola_imp() const; real calcola_imp() const;
int set_cgs_row(int n, const TImporto& importo, TBill& conto, const char* desc, char tipo); int set_cgs_row(int n, const TImporto& importo, TBill& conto, const char* desc, char tipo);
void reset_cgs_row(int n);
void disable_cgs_cells(int n, char tipo); void disable_cgs_cells(int n, char tipo);
void add_cgs_tot(TMask& m); void add_cgs_tot(TMask& m);
void add_cgs_rit(bool fisc); void add_cgs_rit(bool fisc);
void generazione_righe_cg(int r); void generazione_righe_cg(int r);
void reset_cgs_row(int n) { reset_sheet_row(cgs(), n); }
void reset_ivas_row(int n) { reset_sheet_row(ivas(), n); }
void* get_app_data() { return _app_data; } void* get_app_data() { return _app_data; }
void set_app_data(void* v) { _app_data = v; } void set_app_data(void* v) { _app_data = v; }

View File

@ -150,6 +150,7 @@ bool TRegistro::read_att()
chiave << attivita() << "1"; chiave << attivita() << "1";
TTable pla("PLA"); TTable pla("PLA");
attiv.setkey(1);
pla.put("CODTAB", chiave); pla.put("CODTAB", chiave);
if (pla.read() == NOERR) if (pla.read() == NOERR)
{ {

View File

@ -1,6 +1,7 @@
#include <xvt.h> #include <xvt.h>
#include <checks.h> #include <checks.h>
#define __MAIN__
#include "cg3.h" #include "cg3.h"
#define usage "Error - usage : %s -{0|1|2|3|4|5}" #define usage "Error - usage : %s -{0|1|2|3|4|5}"

View File

@ -1,11 +1,17 @@
#ifndef __CG3_H #ifndef __CG3_H
#define __CG3_H #define __CG3_H
#ifdef MAIN #ifndef __STRINGS_H
#include <strings.h>
#endif
#ifdef __MAIN__
#define extern #define extern
#endif #endif
#ifdef MAIN extern TString256 TMP;
#ifdef __MAIN__
#undef extern #undef extern
#endif #endif

View File

@ -6,8 +6,6 @@
#include <tabutil.h> #include <tabutil.h>
#include <utility.h> #include <utility.h>
#include <urldefid.h> #include <urldefid.h>
#include <array.h>
#include <lffiles.h>
#include <mov.h> #include <mov.h>
#include <rmov.h> #include <rmov.h>
@ -25,8 +23,6 @@
#include "cglib03.h" #include "cglib03.h"
#include "cg2103.h" #include "cg2103.h"
static TString256 TMP;
enum liste { enum liste {
movimenti=1, movimenti=1,
fatture=2, fatture=2,

View File

@ -1,249 +1,232 @@
#include "cg3100.h" #include "cg3100.h"
PAGE "" -1 -1 76 20 PAGE "" -1 -1 76 20
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_DATASTAMPA DATE F_DATASTAMPA
BEGIN BEGIN
PROMPT 48 1 "Data stampa " PROMPT 48 1 "Data stampa "
HELP "Data in cui viene effettuata la stampa" HELP "Data in cui viene effettuata la stampa"
FLAGS "A" FLAGS "A"
END END
NUMBER F_ANNO 4 NUMBER F_ANNO 4
BEGIN BEGIN
GROUP 3 GROUP 3
PROMPT 2 3 "Anno esercizio " PROMPT 2 3 "Anno esercizio "
HELP "Anno d'esercizio di cui si vuole la lista" HELP "Anno d'esercizio di cui si vuole la lista"
USE ESC USE ESC
CHECKTYPE NORMAL CHECKTYPE NORMAL
INPUT CODTAB F_ANNO INPUT CODTAB F_ANNO
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_ANNO CODTAB OUTPUT F_ANNO CODTAB
FLAGS "RZ" FLAGS "RZ"
END END
RADIOBUTTON F_MOVIMENTI 38 RADIOBUTTON F_MOVIMENTI 38
BEGIN BEGIN
PROMPT 30 3 "Scelta stampa " PROMPT 30 3 "Scelta stampa "
HELP "Indicare il tipo di stampa" HELP "Indicare il tipo di stampa"
ITEM "0|Lista movimenti" ITEM "0|Lista movimenti"
MESSAGE SHOW,F_CONTROLLO|SHOW,F_REGISTROFIN|SHOW,F_REGISTROINI|SHOW,F_STAMPA|HIDE,1@|RESET,1@ MESSAGE SHOW,F_CONTROLLO|SHOW,F_REGISTROFIN|SHOW,F_REGISTROINI|SHOW,F_STAMPA|HIDE,1@|RESET,1@
ITEM "1|Lista movimenti di sola prima nota" ITEM "1|Lista movimenti di sola prima nota"
MESSAGE HIDE,F_CONTROLLO|RESET,F_CONTROLLO|HIDE,1@|RESET,1@|HIDE,F_REGISTROFIN|RESET,F_REGISTROFIN|HIDE,F_REGISTROINI|RESET,F_REGISTROINI|HIDE,F_STAMPA|RESET,F_STAMPA MESSAGE HIDE,F_CONTROLLO|RESET,F_CONTROLLO|HIDE,1@|RESET,1@|HIDE,F_REGISTROFIN|RESET,F_REGISTROFIN|HIDE,F_REGISTROINI|RESET,F_REGISTROINI|HIDE,F_STAMPA|RESET,F_STAMPA
END END
LIST F_CONTROLLO 21 LIST F_CONTROLLO 21
BEGIN BEGIN
PROMPT 2 7 "Controllo movimenti errati " PROMPT 2 7 "Controllo movimenti errati "
HELP "Indicare il tipo di controllo per movimenti errati" HELP "Indicare il tipo di controllo per movimenti errati"
ITEM "3|No" MESSAGE HIDE,1@|RESET,1@ ITEM "3|No" MESSAGE HIDE,1@|RESET,1@
ITEM "2|Si" MESSAGE SHOW,1@ ITEM "2|Si" MESSAGE SHOW,1@
ITEM "1|Stampa movimenti errati" MESSAGE SHOW,1@ ITEM "1|Stampa movimenti errati" MESSAGE SHOW,1@
END END
TEXT DLG_NULL TEXT DLG_NULL
BEGIN BEGIN
GROUP 1 GROUP 1
PROMPT 2 8 "Stampa messaggi : " PROMPT 2 8 "Stampa messaggi : "
END END
BOOLEAN F_ANNOC BOOLEAN F_ANNOC
BEGIN BEGIN
GROUP 1 GROUP 1
PROMPT 20 8 "Anno di competenza " PROMPT 20 8 "Anno di competenza "
HELP "Indicare se stampa l'anno di competenza" HELP "Indicare se stampa l'anno di competenza"
END END
BOOLEAN F_ALLEGATO BOOLEAN F_ALLEGATO
BEGIN BEGIN
GROUP 1 GROUP 1
PROMPT 20 9 "Allegato iva " PROMPT 20 9 "Allegato iva "
HELP "Indicare se stampare l'allegato IVA" HELP "Indicare se stampare l'allegato IVA"
MESSAGE TRUE DISABLE,F_STAMPA|COPY,F_STAMPA MESSAGE TRUE DISABLE,F_STAMPA|COPY,F_STAMPA
MESSAGE FALSE ENABLE,F_STAMPA MESSAGE FALSE ENABLE,F_STAMPA
END END
RADIOBUTTON F_DECIDI 10 RADIOBUTTON F_DECIDI 10
BEGIN BEGIN
PROMPT 2 10 "Stampa " PROMPT 2 10 "Stampa "
HELP "Indicare il criterio di scelta dei movimenti" HELP "Indicare il criterio di scelta dei movimenti"
ITEM "2|data" MESSAGE DISABLE,2@|RESET,2@|ENABLE,3@ ITEM "2|data" MESSAGE DISABLE,2@|RESET,2@|ENABLE,3@
ITEM "1|numero" MESSAGE DISABLE,3@|RESET,3@|ENABLE,2@ ITEM "1|numero" MESSAGE DISABLE,3@|RESET,3@|ENABLE,2@
END END
DATE F_DATAINI DATE F_DATAINI
BEGIN BEGIN
<<<<<<< cg3100a.uml HELP "Data da cui iniziare la stampa"
PROMPT 19 11 "Stampa mov. dalla data " PROMPT 16 11 "Stampa mov. dalla data "
HELP "Data da cui iniziare la stampa" GROUP 3
======= END
PROMPT 16 11 "Stampa mov. dalla data "
//HELP "Se non indicato nessun valore viene effettuata una stampa completa in ordine di data" DATE F_DATAFIN
>>>>>>> 1.12 BEGIN
GROUP 3 HELP "Data fino a cui stampare i movimenti"
END PROMPT 52 11 "alla data "
GROUP 3
DATE F_DATAFIN END
BEGIN
<<<<<<< cg3100a.uml NUMBER F_NUMEROINI 7
PROMPT 55 11 "alla data " BEGIN
HELP "Data fino a cui stampare i movimenti" HELP "Numero del movimento da cui iniziare la stampa"
======= PROMPT 16 12 "Stampa mov. dal numero "
PROMPT 52 11 "alla data " USE LF_MOV KEY 1
>>>>>>> 1.12 INPUT NUMREG F_NUMEROINI
GROUP 3 DISPLAY "Numero@6" NUMREG
END DISPLAY "Data@10" DATAREG
DISPLAY "Causale" CODCAUS
NUMBER F_NUMEROINI 7 DISPLAY "Documento" NUMDOC
BEGIN DISPLAY "Descrizione@50" DESCR
<<<<<<< cg3100a.uml OUTPUT F_NUMEROINI NUMREG
PROMPT 19 12 "Stampa mov. dal numero " CHECKTYPE NORMAL
HELP "Numero del movimento da cui iniziare la stampa" FLAGS "R"
======= GROUP 2
PROMPT 16 12 "Stampa mov. dal numero " END
>>>>>>> 1.12
USE LF_MOV KEY 1 NUMBER F_NUMEROFIN 7
INPUT NUMREG F_NUMEROINI BEGIN
DISPLAY "Numero@6" NUMREG HELP "Numero del movimenti fino cui fare la stampa"
DISPLAY "Data@10" DATAREG PROMPT 52 12 "al numero "
DISPLAY "Causale" CODCAUS COPY USE F_NUMEROINI
DISPLAY "Documento" NUMDOC INPUT NUMREG F_NUMEROFIN
DISPLAY "Descrizione@50" DESCR COPY DISPLAY F_NUMEROINI
OUTPUT F_NUMEROINI NUMREG OUTPUT F_NUMEROFIN NUMREG
CHECKTYPE NORMAL CHECKTYPE NORMAL
FLAGS "R" FLAGS "R"
GROUP 2 NUM_EXPR {(#F_NUMEROFIN==0)||(#F_NUMEROFIN>=#F_NUMEROINI)}
END WARNING "Limite superiore errato"
GROUP 2
NUMBER F_NUMEROFIN 7 END
BEGIN
<<<<<<< cg3100a.uml STRING F_CAUSALEINI 3
PROMPT 55 12 "al numero " BEGIN
HELP "Numero del movimenti fino cui fare la stampa" PROMPT 2 14 "Stampa dalla causale "
======= USE LF_CAUSALI KEY 1
PROMPT 52 12 "al numero " INPUT CODCAUS F_CAUSALEINI
>>>>>>> 1.12 DISPLAY "Codice causale" CODCAUS
COPY USE F_NUMEROINI DISPLAY "Descrizione@50" DESCR
INPUT NUMREG F_NUMEROFIN OUTPUT F_CAUSALEINI CODCAUS
COPY DISPLAY F_NUMEROINI FLAGS "U"
OUTPUT F_NUMEROFIN NUMREG HELP "Causale di inizio stampa: vuoto = inizio archivio"
CHECKTYPE NORMAL VALIDATE ZEROFILL_FUNC 3
FLAGS "R" END
NUM_EXPR {(#F_NUMEROFIN==0)||(#F_NUMEROFIN>=#F_NUMEROINI)}
WARNING "Limite superiore errato" STRING F_CAUSALEFIN 3
GROUP 2 BEGIN
END PROMPT 40 14 "alla causale "
COPY USE F_CAUSALEINI
STRING F_CAUSALEINI 3 INPUT CODCAUS F_CAUSALEFIN
BEGIN DISPLAY "Codice causale" CODCAUS
PROMPT 2 14 "Stampa dalla causale " DISPLAY "Descrizione@50" DESCR
USE LF_CAUSALI KEY 1 OUTPUT F_CAUSALEFIN CODCAUS
INPUT CODCAUS F_CAUSALEINI FLAGS "U"
DISPLAY "Codice causale" CODCAUS HELP "Causale di fine stampa: vuoto = fine archivio"
DISPLAY "Descrizione@50" DESCR VALIDATE ZEROFILL_FUNC 3
OUTPUT F_CAUSALEINI CODCAUS END
FLAGS "U"
HELP "Causale di inizio stampa: vuoto = inizio archivio" STRING F_REGISTROINI 3
VALIDATE ZEROFILL_FUNC 3 BEGIN
END PROMPT 2 15 "Stampa dal registro iva "
USE REG SELECT I0<"3"
STRING F_CAUSALEFIN 3 //INPUT CODTAB[1,5] F_ANNO SELECT
BEGIN INPUT CODTAB[5,7] F_REGISTROINI
PROMPT 40 14 "alla causale " DISPLAY "Anno" CODTAB[1,4]
COPY USE F_CAUSALEINI DISPLAY "Cod. registro iva" CODTAB[5,7]
INPUT CODCAUS F_CAUSALEFIN DISPLAY "Descrizione@40" S0
DISPLAY "Codice causale" CODCAUS OUTPUT F_REGISTROINI CODTAB[5,7]
DISPLAY "Descrizione@50" DESCR FLAGS "U"
OUTPUT F_CAUSALEFIN CODCAUS //CHECKTYPE NORMAL
FLAGS "U" HELP "Codice registro iva di inizio stampa: vuoto = inizio archivio"
HELP "Causale di fine stampa: vuoto = fine archivio" VALIDATE ZEROFILL_FUNC 3
VALIDATE ZEROFILL_FUNC 3 END
END
STRING F_REGISTROFIN 3
STRING F_REGISTROINI 3 BEGIN
BEGIN PROMPT 40 15 "al reg. iva "
PROMPT 2 15 "Stampa dal registro iva " COPY USE F_REGISTROINI
USE REG SELECT I0<"3" //INPUT CODTAB[1,5] F_ANNO SELECT
//INPUT CODTAB[1,5] F_ANNO SELECT INPUT CODTAB[5,7] F_REGISTROFIN
INPUT CODTAB[5,7] F_REGISTROINI DISPLAY "Anno" CODTAB[1,4]
DISPLAY "Anno" CODTAB[1,4] DISPLAY "Cod. registro iva" CODTAB[5,7]
DISPLAY "Cod. registro iva" CODTAB[5,7] DISPLAY "Descrizione@40" S0
DISPLAY "Descrizione@40" S0 OUTPUT F_REGISTROFIN CODTAB[5,7]
OUTPUT F_REGISTROINI CODTAB[5,7] FLAGS "U"
FLAGS "U" //CHECKTYPE NORMAL
//CHECKTYPE NORMAL HELP "Codice registro iva di fine stampa: vuoto = fine archivio"
HELP "Codice registro iva di inizio stampa: vuoto = inizio archivio" VALIDATE ZEROFILL_FUNC 3
VALIDATE ZEROFILL_FUNC 3 END
END
BOOLEAN F_STAMPA
STRING F_REGISTROFIN 3 BEGIN
BEGIN PROMPT 2 16 "Stampa imponibili, imposte e codici iva "
PROMPT 40 15 "al reg. iva " HELP "Indicare se stampare i valori degli imponibili, dell'imposte e i codici IVA"
COPY USE F_REGISTROINI END
//INPUT CODTAB[1,5] F_ANNO SELECT
INPUT CODTAB[5,7] F_REGISTROFIN BOOLEAN F_STAMPAMOVP
DISPLAY "Anno" CODTAB[1,4] BEGIN
DISPLAY "Cod. registro iva" CODTAB[5,7] PROMPT 2 17 "Stampa movimenti provvisori "
DISPLAY "Descrizione@40" S0 HELP "Indicare se stampare i movimenti provvisori"
OUTPUT F_REGISTROFIN CODTAB[5,7] END
FLAGS "U"
//CHECKTYPE NORMAL /*
HELP "Codice registro iva di fine stampa: vuoto = fine archivio" TEXT DLG_NULL
VALIDATE ZEROFILL_FUNC 3 BEGIN
END PROMPT 2 17 "N.B. se non indicato nessun valore stampa completa in ordine di data"
END
BOOLEAN F_STAMPA */
BEGIN
PROMPT 2 16 "Stampa imponibili, imposte e codici iva " BUTTON DLG_PRINT 9 2
HELP "Indicare se stampare i valori degli imponibili, dell'imposte e i codici IVA" BEGIN
END PROMPT -12 -1 "~Stampa"
MESSAGE EXIT,K_ENTER
BOOLEAN F_STAMPAMOVP END
BEGIN
PROMPT 2 17 "Stampa movimenti provvisori " BUTTON DLG_QUIT 9 2
HELP "Indicare se stampare i movimenti provvisori" BEGIN
END PROMPT -22 -1 ""
END
/*
TEXT DLG_NULL ENDPAGE
BEGIN
PROMPT 2 17 "N.B. se non indicato nessun valore stampa completa in ordine di data" ENDMASK
END
*/
BUTTON DLG_PRINT 9 2
BEGIN
PROMPT -12 -1 "~Stampa"
MESSAGE EXIT,K_ENTER
END
BUTTON DLG_QUIT 9 2
BEGIN
PROMPT -22 -1 ""
END
ENDPAGE
ENDMASK

View File

@ -1,8 +1,10 @@
#include <execp.h>
#include <mailbox.h>
#include <mask.h> #include <mask.h>
#include <printapp.h> #include <printapp.h>
#include <sort.h>
#include <tabutil.h> #include <tabutil.h>
#include <utility.h> #include <utility.h>
#include <sort.h>
#include <clifo.h> #include <clifo.h>
#include <pconti.h> #include <pconti.h>
@ -13,16 +15,12 @@
#include <causali.h> #include <causali.h>
#include <nditte.h> #include <nditte.h>
#include <unloc.h> #include <unloc.h>
#include <mailbox.h>
#include <execp.h>
#include "cg3.h" #include "cg3.h"
#include "cg3200.h" #include "cg3200.h"
#include "cglib.h" #include "cglib.h"
#include "cglib03.h" #include "cglib03.h"
static TString256 tmp;
int date2esc(const TDate& d, int* prevesc = NULL); int date2esc(const TDate& d, int* prevesc = NULL);
bool sottoc_handler_ini (TMask_field& f, KEY k); bool sottoc_handler_ini (TMask_field& f, KEY k);
bool sottoc_handler_fine (TMask_field& f, KEY k); bool sottoc_handler_fine (TMask_field& f, KEY k);
@ -1916,10 +1914,10 @@ const char* TMastrini_application::descrizione_classe(char sezione, char lettera
tabivd.read(); tabivd.read();
dep2 = tabivd.get("CODTAB"); dep2 = tabivd.get("CODTAB");
if (dep == dep2) if (dep == dep2)
tmp = tabivd.get("S0"); TMP = tabivd.get("S0");
else else
tmp = ""; TMP = "";
return (tmp); return TMP;
} }
//Ricerca la descrizione relativa al gruppo da stampare //Ricerca la descrizione relativa al gruppo da stampare
@ -1931,8 +1929,8 @@ const char* TMastrini_application::descrizione_gruppo()
pconti.zero(); pconti.zero();
pconti.put(PCN_GRUPPO,_gruppo); pconti.put(PCN_GRUPPO,_gruppo);
if (pconti.read() != NOERR) pconti.zero(); if (pconti.read() != NOERR) pconti.zero();
tmp = pconti.get(PCN_DESCR); TMP = pconti.get(PCN_DESCR);
return tmp; return TMP;
} }
// Ricerca la descrizione relativa al conto da stampare // Ricerca la descrizione relativa al conto da stampare
@ -1945,8 +1943,8 @@ const char* TMastrini_application::descrizione_conto()
pconti.put(PCN_GRUPPO,_gruppo); pconti.put(PCN_GRUPPO,_gruppo);
pconti.put(PCN_CONTO,_conto); pconti.put(PCN_CONTO,_conto);
if (pconti.read() != NOERR) pconti.zero(); if (pconti.read() != NOERR) pconti.zero();
tmp = pconti.get(PCN_DESCR); TMP = pconti.get(PCN_DESCR);
return tmp; return TMP;
} }
bool TMastrini_application::user_create() bool TMastrini_application::user_create()

View File

@ -5,15 +5,11 @@
#include <mask.h> #include <mask.h>
#include <printapp.h> #include <printapp.h>
#include <progind.h> #include <progind.h>
#include <scanner.h> #include <sort.h>
#include <tabutil.h> #include <tabutil.h>
#include <utility.h> #include <utility.h>
#include <lffiles.h>
#include <sort.h>
#include <real.h>
#include <validate.h>
#include <string.h>
#include <urldefid.h> #include <urldefid.h>
#include <validate.h>
#include <comuni.h> #include <comuni.h>
#include <anagr.h> #include <anagr.h>
@ -36,10 +32,6 @@
#define DISTANZA_HEADER_CORPO 5 #define DISTANZA_HEADER_CORPO 5
#define LUNGHEZZA_RECORD 128 #define LUNGHEZZA_RECORD 128
#define MAXSTR 128
static char __tmp[MAXSTR];
static TFixed_string tmp(__tmp, MAXSTR);
const int CODTABLEN = 15; const int CODTABLEN = 15;
HIDDEN const char * SEGNO_MENO = "-"; HIDDEN const char * SEGNO_MENO = "-";
@ -203,9 +195,9 @@ const char * CG3300_application::decodifica_desc_att (TString & codatt)
if (attivita.bad()) if (attivita.bad())
attivita.zero(); attivita.zero();
tmp = attivita.get ("S0"); TMP = attivita.get ("S0");
return __tmp; return TMP;
} }
bool CG3300_application::corrispettivo (const char * tipodoc) bool CG3300_application::corrispettivo (const char * tipodoc)

View File

@ -1,13 +1,12 @@
// cg3400 - Stampa libro giornale // cg3400 - Stampa libro giornale
#include <isam.h> #include <config.h>
#include <mask.h> #include <mask.h>
#include <utility.h> #include <printapp.h>
#include <progind.h>
#include <tabutil.h> #include <tabutil.h>
#include <urldefid.h> #include <urldefid.h>
#include <printapp.h> #include <utility.h>
#include <config.h>
#include <progind.h>
#include <mov.h> #include <mov.h>
#include <rmov.h> #include <rmov.h>
@ -22,6 +21,7 @@
#include <clifo.h> #include <clifo.h>
#include <occas.h> #include <occas.h>
#include "cg3.h"
#include "conto.h" #include "conto.h"
#include "cglib03.h" #include "cglib03.h"
#include "cg2103.h" #include "cg2103.h"
@ -44,8 +44,6 @@ HIDDEN const int AVERE132 = 112;
HIDDEN const int DARE198 = 150; HIDDEN const int DARE198 = 150;
HIDDEN const int AVERE198 = 174; HIDDEN const int AVERE198 = 174;
HIDDEN TString256 tmp;
HIDDEN int date2esc(const TDate& d, int* prevesc = NULL); HIDDEN int date2esc(const TDate& d, int* prevesc = NULL);
HIDDEN enum descr { causale, conto, operazione }; HIDDEN enum descr { causale, conto, operazione };
@ -241,23 +239,25 @@ TRectype& CG3400_application::look_com (const char * cod)
return _com->curr(); return _com->curr();
} }
const char* CG3400_application::SimboloValuta (const char* cod) /*
{ const char* CG3400_application::SimboloValuta (const char* cod)
TString16 codtab; {
TString16 codtab;
codtab.format ("%-3s", cod); codtab.format ("%-3s", cod);
_tabval->zero(); _tabval->zero();
_tabval->put("CODTAB", codtab); _tabval->put("CODTAB", codtab);
_tabval->read(); _tabval->read();
if (_tabval->good()) if (_tabval->good())
tmp = _tabval->get("S7"); TMP = _tabval->get("S7");
else else
tmp = ""; TMP = "";
return tmp; return TMP;
} }
*/
const char * CG3400_application::get_descr_caus (const char * codcaus) const char * CG3400_application::get_descr_caus (const char * codcaus)
{ {
@ -267,8 +267,8 @@ const char * CG3400_application::get_descr_caus (const char * codcaus)
caus.put (CAU_CODCAUS, codcaus); caus.put (CAU_CODCAUS, codcaus);
if (caus.read() != NOERR) caus.zero(); if (caus.read() != NOERR) caus.zero();
tmp = caus.get(CAU_DESCR); TMP = caus.get(CAU_DESCR);
return tmp; return TMP;
} }
void CG3400_application::get_dati_ditta () void CG3400_application::get_dati_ditta ()

View File

@ -1,17 +1,16 @@
//Stampa riepilogo gruppi/conti //Stampa riepilogo gruppi/conti
#include <config.h>
#include <mask.h>
#include <printapp.h>
#include <relation.h> #include <relation.h>
#include <tabutil.h> #include <tabutil.h>
#include <printapp.h>
#include <mask.h>
#include <utility.h> #include <utility.h>
#include <prefix.h>
#include <config.h>
#include <progind.h> #include <progind.h>
#include <pconti.h> #include <pconti.h>
#include <comuni.h> #include <comuni.h>
#include <clifo.h> #include <clifo.h>
#include <saldi.h> #include <saldi.h>
#include <nditte.h> #include <nditte.h>
#include <anagr.h> #include <anagr.h>

View File

@ -822,7 +822,7 @@ void CG4400_application::calcola_progressivi()
int CG4400_application::riga_rmoviva() int CG4400_application::riga_rmoviva()
{ {
TString codiva; TString16 codiva;
real impo, impos; real impo, impos;
int tipodet, tipocr, tipoatt; int tipodet, tipocr, tipoatt;
bool intra; bool intra;
@ -2325,9 +2325,7 @@ bool CG4400_application::set_print(int n)
else else
{ {
_tipo_riepilogativo = ' '; _tipo_riepilogativo = ' ';
TDate primo = format("01/%02d/%4d", _fino_a_mese+1, _annoes); giorni_del_mese = TDate::last_day(_fino_a_mese, _annoes);
--primo;
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);
} }

View File

@ -43,22 +43,12 @@ BEGIN
FIELD PcTcCm FIELD PcTcCm
END END
GROUPBOX DLG_NULL 53 4 GROUPBOX DLG_NULL 76 4
BEGIN BEGIN
PROMPT 2 3 "Archivi in comune" PROMPT 2 3 "Archivi in comune"
END END
RADIOBUTTON LST_RIFPAR 20
BEGIN
PROMPT 55 3 "Riferimenti partite "
HELP "Indicaer il criterio dei riferimenti delle partite"
ITEM " |N. protocollo"
ITEM "X|N. documento"
HELP ""
FIELD RifPar
END
GROUPBOX DLG_NULL 76 12 GROUPBOX DLG_NULL 76 12
BEGIN BEGIN
PROMPT 2 6 "" PROMPT 2 6 ""

View File

@ -53,6 +53,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
CHECKTYPE NORMAL CHECKTYPE NORMAL
VALIDATE CHECK_FIELD F_GRUPPO VALIDATE CHECK_FIELD F_GRUPPO
FLAGS "R" FLAGS "R"

View File

@ -53,7 +53,7 @@ BEGIN
PROMPT 4 4 "Parametri ditta" PROMPT 4 4 "Parametri ditta"
END END
LIST F_FREQ_VERS 14 LIST F_FREQ_VERS 1 14
BEGIN BEGIN
PROMPT 6 5 "Frequenza versamenti " PROMPT 6 5 "Frequenza versamenti "
HELP "Indicare la frequenza dei versamenti delle liquidazioni IVA" HELP "Indicare la frequenza dei versamenti delle liquidazioni IVA"

View File

@ -21,8 +21,8 @@ class TRipristina_stampa : public TApplication
virtual bool create() ; virtual bool create() ;
virtual bool destroy() ; virtual bool destroy() ;
bool menu(MENU_TAG); bool menu(MENU_TAG);
bool do_restore(long firm, const char * reg, const char * year, int month, bool do_restore(long firm, const char * reg, int year, int month,
bool giornale); int day, bool giornale);
static bool firm_handler(TMask_field& f, KEY key); static bool firm_handler(TMask_field& f, KEY key);
public: public:
@ -50,7 +50,7 @@ bool TRipristina_stampa::firm_handler(TMask_field& f, KEY key)
} }
bool TRipristina_stampa::do_restore(long firm, const char * regist, bool TRipristina_stampa::do_restore(long firm, const char * regist,
const char * year, int month, int year, int month, int day,
bool giornale) bool giornale)
{ {
bool ok = TRUE; bool ok = TRUE;
@ -65,14 +65,13 @@ bool TRipristina_stampa::do_restore(long firm, const char * regist,
TTable reg("REG"); TTable reg("REG");
TString16 s; TString16 s;
s.format("%-4s%s", year, regist); s.format("%04d%s", year, regist);
reg.zero(); reg.zero();
reg.put("CODTAB", s); reg.put("CODTAB", s);
if (reg.read(_isequal, _lock) == NOERR) if (reg.read(_isequal, _lock) == NOERR)
{ {
TDate dlast(reg.get_date("D3")); TDate dlast(reg.get_date("D3"));
int wyear = atoi(year);
if (giornale) if (giornale)
{ {
@ -87,11 +86,11 @@ bool TRipristina_stampa::do_restore(long firm, const char * regist,
TDate wd(esc.get_date("D0")); TDate wd(esc.get_date("D0"));
wyear = wd.year(); year = wd.year();
if (wd.month() > month) if (wd.month() > month)
wyear++; year++;
} }
TDate d(1, month, wyear); TDate d(day, month, year);
TRectype from(mov.curr()); from.zero(); TRectype from(mov.curr()); from.zero();
TRectype to(from); TRectype to(from);
@ -164,23 +163,23 @@ bool TRipristina_stampa::menu(MENU_TAG)
while (_msk->run() == K_ENTER) while (_msk->run() == K_ENTER)
{ {
const long firm = _msk->get_long(F_FIRM); const long firm = _msk->get_long(F_FIRM);
const TString16 reg = _msk->get(F_REG); const TString16 reg = _msk->get(F_REG);
const bool giornale = _msk->get_int(F_TIPO) == 5; const bool giornale = _msk->get_int(F_TIPO) == 5;
const TString16 year = _msk->get(giornale ? F_ESER : F_YEAR); const int year = _msk->get_int(giornale ? F_ESER : F_YEAR);
int month = _msk->get_int(F_MESE); const int month = _msk->get_int(F_MESE);
const int day = giornale ? _msk->get_int(F_DAY) : 1;
if (prefhndl->exist(firm)) if (prefhndl->exist(firm))
{ {
TString mess; TString256 mess("Attenzione sara' ripristinata la stampa\n del registro ");
mess << reg << " dell'" << (giornale ? "esercizio " : "anno ") << year
mess.format("Attenzione sara' ripristinata la stampa\n del registro %s %s %s della ditta %ld dal mese di %s. Devo continuare", << " della ditta " << firm << "dal " << day << '-' << month << '-' << year;
(const char *) reg, giornale ? "esercizio" : "anno",
(const char *) year, (const char *) firm, itom(month));
if (yesno_box((const char *) mess)) if (yesno_box((const char *) mess))
{ {
mess.rtrim(16); mess << " Devo veramente continuare"; mess << "\nSi desidera veramente continuare";
if (yesno_box((const char *) mess)) if (yesno_box((const char *) mess))
do_restore(firm, reg, year, month, giornale); do_restore(firm, reg, year, month, day, giornale);
} }
} }
else error_box("Gli archivi della ditta %d non sono stati ancora generati",firm); else error_box("Gli archivi della ditta %d non sono stati ancora generati",firm);

View File

@ -6,4 +6,4 @@
#define F_YEAR 106 #define F_YEAR 106
#define F_ESER 107 #define F_ESER 107
#define F_MESE 108 #define F_MESE 108
#define F_DAY 109

View File

@ -1,6 +1,6 @@
#include "cg5400.h" #include "cg5400.h"
PAGE "Ripristino stampa giornale" -1 -1 78 11 PAGE "Ripristino stampa registri" -1 -1 78 11
NUMBER F_FIRM 5 NUMBER F_FIRM 5
BEGIN BEGIN
@ -44,7 +44,7 @@ BEGIN
OUTPUT F_YEAR CODTAB[1,4] OUTPUT F_YEAR CODTAB[1,4]
OUTPUT F_REG CODTAB[5,7] OUTPUT F_REG CODTAB[5,7]
OUTPUT F_DREG S0 OUTPUT F_DREG S0
OUTPUT F_TIPO I0 OUTPUT F_TIPO I0
CHECKTYPE REQUIRED CHECKTYPE REQUIRED
HELP "Codice del registro di cui ripristinare la stampa" HELP "Codice del registro di cui ripristinare la stampa"
WARNING "Registro assente" WARNING "Registro assente"
@ -68,10 +68,10 @@ END
LIST F_TIPO LIST F_TIPO
BEGIN BEGIN
FLAGS "HG" FLAGS "HG"
ITEM "1|Vendite" MESSAGE HIDE,F_ESER|SHOW,F_YEAR ITEM "1|Vendite" MESSAGE HIDE,F_ESER|SHOW,F_YEAR|HIDE,F_DAY
ITEM "2|Vendite" MESSAGE HIDE,F_ESER|SHOW,F_YEAR ITEM "2|Vendite" MESSAGE HIDE,F_ESER|SHOW,F_YEAR|HIDE,F_DAY
ITEM "3|Riepilogativo" MESSAGE HIDE,F_ESER|SHOW,F_YEAR ITEM "3|Riepilogativo" MESSAGE HIDE,F_ESER|SHOW,F_YEAR|HIDE,F_DAY
ITEM "5|Giornale" MESSAGE SHOW,F_ESER|HIDE,F_YEAR ITEM "5|Giornale" MESSAGE SHOW,F_ESER|HIDE,F_YEAR|SHOW,F_DAY
END END
NUMBER F_YEAR 4 NUMBER F_YEAR 4
@ -97,12 +97,18 @@ BEGIN
WARNING "Esercizio assente" WARNING "Esercizio assente"
END END
NUMBER F_DAY 2
BEGIN
PROMPT 4 6 "Giorno "
HELP "Giorno da cui ripristinare la stampa del giornale"
END
LIST F_MESE 10 LIST F_MESE 10
BEGIN BEGIN
PROMPT 4 7 "Mese " PROMPT 4 7 "Mese "
FLAGS "M" FLAGS "M"
HELP "Mese di ripristino" HELP "Mese da cui ripristinare la stampa del registro"
HELP "Mese da cui ripristinare la stampa"
END END
BUTTON DLG_OK 9 2 BUTTON DLG_OK 9 2

View File

@ -15,8 +15,6 @@
#include "cglib.h" #include "cglib.h"
HIDDEN TString256 tmp;
// aep e' l'esercizio precedente // aep e' l'esercizio precedente
TSaldi_list::TSaldi_list(int gr, int co, int aec, int aep) TSaldi_list::TSaldi_list(int gr, int co, int aec, int aep)
{ {
@ -196,17 +194,13 @@ real TSaldo::calcola_saldo_iniziale(int g,int c,long s,int indbil)
const char* TSaldo::causale_chiusura_es() const char* TSaldo::causale_chiusura_es()
{ {
TConfig conf(CONFIG_DITTA); TConfig conf(CONFIG_DITTA);
tmp = conf.get("CoCaCh"); return conf.get("CoCaCh");
return tmp;
} }
const char* TSaldo::causale_apertura_es() const char* TSaldo::causale_apertura_es()
{ {
TConfig conf(CONFIG_DITTA); TConfig conf(CONFIG_DITTA);
tmp = conf.get("CoCaAp"); return conf.get("CoCaAp");
return tmp;
} }
void TSaldo::leggi_mov(long nr) void TSaldo::leggi_mov(long nr)

View File

@ -106,44 +106,46 @@ int TBill::compare(const TSortable& s) const
// Certified 95% // Certified 95%
void TBill::describe() bool TBill::find()
{ {
int err = NOERR; bool ok = FALSE;
if ((_tipo != 'C' && _tipo != 'F') || _sottoconto == 0L) if ((_tipo != 'C' && _tipo != 'F') || _sottoconto == 0L)
{ {
TRectype pcon(LF_PCON); TRectype pcon(LF_PCON);
read(pcon); ok = read(pcon);
} }
if ((_tipo == 'C' || _tipo == 'F') && _sottoconto != 0L) else
{ if ((_tipo == 'C' || _tipo == 'F') && _sottoconto != 0L)
TLocalisamfile clifo(LF_CLIFO, FALSE);
clifo.setkey(1);
clifo.zero();
clifo.put("TIPOCF", _tipo);
clifo.put("CODCF", _sottoconto);
err = clifo.read();
if (err == NOERR)
{ {
_descrizione = clifo.get("RAGSOC"); TLocalisamfile clifo(LF_CLIFO, FALSE);
if (_tipo_cr < 0) _tipo_cr = 0; clifo.setkey(1);
_sospeso = clifo.get_bool("SOSPESO"); clifo.put("TIPOCF", _tipo);
clifo.put("CODCF", _sottoconto);
const char tipoa = clifo.get_char("TIPOAPER"); ok = clifo.read() == NOERR;
if (tipoa == 'F') if (ok)
{ {
TString80 nome = _descrizione.mid(30); _descrizione = clifo.get("RAGSOC");
_descrizione.cut(30); if (_tipo_cr < 0) _tipo_cr = 0;
_descrizione.trim(); nome.trim(); _sospeso = clifo.get_bool("SOSPESO");
_descrizione << ' ' << nome;
} const char tipoa = clifo.get_char("TIPOAPER");
if (_gruppo == 0 || _conto == 0) if (tipoa == 'F')
{ {
_gruppo = clifo.get_int("GRUPPO"); TString80 nome = _descrizione.mid(30);
_conto = clifo.get_int("CONTO"); _descrizione.cut(30);
} _descrizione.trim(); nome.trim();
} _descrizione << ' ' << nome;
} }
if (_gruppo == 0 || _conto == 0)
{
_gruppo = clifo.get_int("GRUPPO");
_conto = clifo.get_int("CONTO");
}
}
}
return ok;
} }
@ -180,8 +182,8 @@ int TBill::tipo_att()
if (ib == ib_passivita || ib == ib_ricavi) if (ib == ib_passivita || ib == ib_ricavi)
{ {
read(rec); read(rec);
const int ricser = rec.get_int("RICSER"); const int ricser = rec.get_int("RICSER"); // 0 = Altre attivita 1 = Servizi
tipo_att = (ricser == 0) ? 2 : 1; tipo_att = (ricser == 1) ? 1 : 2;
} }
} }
return tipo_att; return tipo_att;
@ -192,8 +194,7 @@ const TString& TBill::descrizione()
{ {
if (_descrizione.empty()) if (_descrizione.empty())
{ {
describe(); if (!find())
if (_descrizione.empty())
_descrizione = "Sconosciuto"; _descrizione = "Sconosciuto";
} }
return _descrizione; return _descrizione;
@ -202,7 +203,7 @@ const TString& TBill::descrizione()
int TBill::tipo_cr() int TBill::tipo_cr()
{ {
if (_tipo_cr < 0) if (_tipo_cr < 0)
describe(); find();
return _tipo_cr; return _tipo_cr;
} }

View File

@ -21,7 +21,6 @@ class TBill : public TSortable
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"; }
void describe();
const TBill& copy(const TBill& b); const TBill& copy(const TBill& b);
@ -46,6 +45,7 @@ public:
int conto() const { return _conto; } int conto() const { return _conto; }
long sottoconto() const { return _sottoconto; } long sottoconto() const { return _sottoconto; }
bool find();
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; }