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();
@ -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
@ -292,7 +302,6 @@ bool TCaus_app::tipodoc_hndl (TMask_field& f, KEY k)
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

@ -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)
@ -591,15 +587,13 @@ 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; break;
case K_ENTER: case K_ENTER:
if (app().iva() == nessuna_iva) if (app().iva() == nessuna_iva)
@ -607,17 +601,12 @@ bool TPrimanota_application::cg_notify(int r, KEY k)
app().calcola_saldo(); app().calcola_saldo();
break; break;
case K_DEL: case K_DEL:
{
TToken_string& row = app().cgs().row(r);
const char tipo = row.right(1)[0];
if (tipo > ' ') if (tipo > ' ')
return error_box("La riga %d non puo' essere cancellata", r+1); return error_box("La riga %d non puo' essere cancellata", r+1);
} default:
break; break;
default: }
break; return TRUE;
}
return TRUE;
} }
bool TPrimanota_application::descr_handler(TMask_field& f, KEY k) bool TPrimanota_application::descr_handler(TMask_field& f, KEY k)
@ -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,7 +899,8 @@ 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 ...
@ -936,6 +929,9 @@ bool TPrimanota_application::iva_notify(int r, KEY k)
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,18 +1408,28 @@ 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(); TLocalisamfile& clifo = ((TEdit_field&)f).browse()->cursor()->file();
if (clifo.get_char(CLI_TIPOCF) != cf)
{
clifo.put(CLI_TIPOCF, cf);
clifo.read();
}
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);
if (clifo.get_bool(CLI_OCCAS)) const bool occas = clifo.get_bool(CLI_OCCAS);
m.send_key(K_SPACE, F_OCCASEDIT); // Lancia maschera occasionali m.show(F_OCCASEDIT, occas); // Dati anagrfici
m.show(-7, !occas); // Partita IVA e stato partita IVA
if (f.focusdirty())
{
app().add_cgs_tot(m);
if (m.field(F_VISVAL).active()) if (m.field(F_VISVAL).active())
{ {
@ -1435,6 +1445,9 @@ bool TPrimanota_application::clifo_handler(TMask_field& f, KEY key)
} }
} }
} }
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
@ -90,6 +92,8 @@ class TPrimanota_application : public TRelation_application
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();
virtual bool user_destroy(); virtual bool user_destroy();
@ -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

@ -95,35 +95,22 @@ END
DATE F_DATAINI DATE F_DATAINI
BEGIN BEGIN
<<<<<<< cg3100a.uml
PROMPT 19 11 "Stampa mov. dalla data "
HELP "Data da cui iniziare la stampa" HELP "Data da cui iniziare la stampa"
=======
PROMPT 16 11 "Stampa mov. dalla data " PROMPT 16 11 "Stampa mov. dalla data "
//HELP "Se non indicato nessun valore viene effettuata una stampa completa in ordine di data"
>>>>>>> 1.12
GROUP 3 GROUP 3
END END
DATE F_DATAFIN DATE F_DATAFIN
BEGIN BEGIN
<<<<<<< cg3100a.uml
PROMPT 55 11 "alla data "
HELP "Data fino a cui stampare i movimenti" HELP "Data fino a cui stampare i movimenti"
=======
PROMPT 52 11 "alla data " PROMPT 52 11 "alla data "
>>>>>>> 1.12
GROUP 3 GROUP 3
END END
NUMBER F_NUMEROINI 7 NUMBER F_NUMEROINI 7
BEGIN BEGIN
<<<<<<< cg3100a.uml
PROMPT 19 12 "Stampa mov. dal numero "
HELP "Numero del movimento da cui iniziare la stampa" HELP "Numero del movimento da cui iniziare la stampa"
=======
PROMPT 16 12 "Stampa mov. dal numero " PROMPT 16 12 "Stampa mov. dal numero "
>>>>>>> 1.12
USE LF_MOV KEY 1 USE LF_MOV KEY 1
INPUT NUMREG F_NUMEROINI INPUT NUMREG F_NUMEROINI
DISPLAY "Numero@6" NUMREG DISPLAY "Numero@6" NUMREG
@ -139,12 +126,8 @@ END
NUMBER F_NUMEROFIN 7 NUMBER F_NUMEROFIN 7
BEGIN BEGIN
<<<<<<< cg3100a.uml
PROMPT 55 12 "al numero "
HELP "Numero del movimenti fino cui fare la stampa" HELP "Numero del movimenti fino cui fare la stampa"
=======
PROMPT 52 12 "al numero " PROMPT 52 12 "al numero "
>>>>>>> 1.12
COPY USE F_NUMEROINI COPY USE F_NUMEROINI
INPUT NUMREG F_NUMEROFIN INPUT NUMREG F_NUMEROFIN
COPY DISPLAY F_NUMEROINI COPY DISPLAY F_NUMEROINI

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,8 +239,9 @@ 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);
@ -252,12 +251,13 @@ const char* CG3400_application::SimboloValuta (const char* cod)
_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);
@ -166,21 +165,21 @@ bool TRipristina_stampa::menu(MENU_TAG)
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
<< " della ditta " << firm << "dal " << day << '-' << month << '-' << year;
mess.format("Attenzione sara' ripristinata la stampa\n del registro %s %s %s della ditta %ld dal mese di %s. Devo continuare",
(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
@ -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,24 +106,24 @@ 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);
} }
else
if ((_tipo == 'C' || _tipo == 'F') && _sottoconto != 0L) if ((_tipo == 'C' || _tipo == 'F') && _sottoconto != 0L)
{ {
TLocalisamfile clifo(LF_CLIFO, FALSE); TLocalisamfile clifo(LF_CLIFO, FALSE);
clifo.setkey(1); clifo.setkey(1);
clifo.zero();
clifo.put("TIPOCF", _tipo); clifo.put("TIPOCF", _tipo);
clifo.put("CODCF", _sottoconto); clifo.put("CODCF", _sottoconto);
err = clifo.read(); ok = clifo.read() == NOERR;
if (err == NOERR) if (ok)
{ {
_descrizione = clifo.get("RAGSOC"); _descrizione = clifo.get("RAGSOC");
if (_tipo_cr < 0) _tipo_cr = 0; if (_tipo_cr < 0) _tipo_cr = 0;
@ -144,6 +144,8 @@ void TBill::describe()
} }
} }
} }
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; }