Patch level : 2.0 504

Files correlati     : cg0.exe cg3.exe cg3700a.msk
Ricompilazione Demo : [ ]
Commento            :

EP20085
Non riesco a richiamare, perché non viene nemmeno visualizzato fra quelli
esistenti, un registro inserito nella tabella registri con codice
alfanumerico (es.VE1)

EP20087
Lavoro col mouse: inserisco un nuovo movimento con causale V01 (o in
generale con qualsiasi causale) nella pagina testata, seleziono con mouse
la descrizione della causale e clicco su "modifica/copia". Entro nella
tebella descrizioni aggiuntive (come per aggiungerne una nuova) mi
posiziono sul campo descrizione e vado su (modifica/incolla): il testo non
viene copiato e quando esco dalla maschera errore

EP20090
Mancano le ricerche sui campi registri e fornitori


git-svn-id: svn://10.65.10.50/trunk@11255 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2003-06-19 14:29:24 +00:00
parent 38f1905197
commit 405617dfae
7 changed files with 133 additions and 29 deletions

View File

@ -844,7 +844,7 @@ void TCaus_app::sheet2ini(TSheet_field& sheet,TConfig& ini)
void TCaus_app::init_mask(TMask& m) void TCaus_app::init_mask(TMask& m)
{ {
m.set(F_ANNOES, _anno_iva); m.set(F_ANNOES, anno_iva());
carica_righe_libere(); carica_righe_libere();
} }
@ -855,17 +855,20 @@ void TCaus_app::init_query_mode(TMask& m)
void TCaus_app::on_config_change() void TCaus_app::on_config_change()
{ {
TConfig conf(CONFIG_DITTA); TConfig conf(CONFIG_DITTA, "cg");
_saldaconto = conf.get_bool("GesSal"); _saldaconto = conf.get_bool("GesSal");
_valuta = conf.get_bool("GesVal"); _valuta = conf.get_bool("GesVal");
const int questanno = TDate(TODAY).year(); _anno_iva = 0;
_anno_iva = (int)conf.get_long("AnLiIv", NULL, -1, questanno); TTable reg("REG");
if (reg.last() == NOERR)
_anno_iva = atoi(reg.get("CODTAB").left(4));
if (_anno_iva <= 0) if (_anno_iva <= 0)
{ {
_anno_iva = questanno; _anno_iva = conf.get_int("AnLiIv");
conf.set("AnLiIv", questanno); if (_anno_iva <= 0)
_anno_iva = TDate(TODAY).year();
} }
_msk->show(F_TIPO_MOV_1, saldaconto()); _msk->show(F_TIPO_MOV_1, saldaconto());

View File

@ -36,7 +36,6 @@ bool annoes_handler(TMask_field&, KEY);
bool data_inizio (TMask_field&, KEY); bool data_inizio (TMask_field&, KEY);
bool data_fine (TMask_field&, KEY); bool data_fine (TMask_field&, KEY);
class TListaMov_application : public TPrintapp class TListaMov_application : public TPrintapp
{ {
friend bool filter_func (const TRelation *); friend bool filter_func (const TRelation *);
@ -84,6 +83,8 @@ class TListaMov_application : public TPrintapp
bool _cdc_only, _print_cdc; bool _cdc_only, _print_cdc;
TDecoder _simbval, _descdoc; TDecoder _simbval, _descdoc;
static const char* err_msg[];
protected: protected:
virtual void preprocess_header(); virtual void preprocess_header();
virtual bool preprocess_page(int,int); virtual bool preprocess_page(int,int);
@ -127,6 +128,37 @@ public:
virtual ~TListaMov_application() {} virtual ~TListaMov_application() {}
}; };
const char* TListaMov_application::err_msg[] = {
TR("La data operazione non appartiene a nessun esercizio"),
TR("Anno IVA non compatibile con data operazione"),
TR("Data operazione successiva all'esercizio di competenza"),
TR("Movimento con competenza anno precedente"),
TR("La data di competenza non appartiene a nessun esercizio"),
TR("Data competenza incompatibile con data operazione"),
TR("Esercizio incompatibile con data competenza"),
TR("Codice causale non presente in tabella"),
TR("Codice causale sospeso"),
TR("Nella causale e' stato attivato il segnale non va in allegato"),
TR("Tipo documento non corrisponde a quello indicato in causale"),
TR("Tipo documento non presente in tabella"),
TR("Codice registro non corrisponde a quello indicato in causale"),
TR("Codice registro non presente in tabella"),
TR("Codice registro sospeso"),
TR("Tipo registro incompatibile con tipo documento"),
TR("Non indicato codice cliente/fornitore"),
TR("Tipo cliente/fornitore non compatibile con tipo registro"),
TR("Codice cliente/fornitore sospeso"),
TR("Nel cliente/fornitore e' stato attivato il segnale: non va in allegato"),
TR("Indicato codice C/F per allegato che richiama se stesso"),
TR("Indicato codice C/F per allegato sospeso"),
TR("C/F per allegato riporta un altro C/F per allegato"),
TR("Indicato codice C/F per allegato con segnale: non va in allegato"),
TR("Indicato codice C/F per allegato non presente in anagrafica"),
TR("Codice cliente/fornitore non presente in anagrafica"),
TR("Movimento con data competenza diversa da data operazione")};
HIDDEN inline TListaMov_application & app() HIDDEN inline TListaMov_application & app()
{ return (TListaMov_application&)main_app();} { return (TListaMov_application&)main_app();}

View File

@ -4,11 +4,11 @@
// CG3 -6 I ==> Lista fatture con iva indetrabile // CG3 -6 I ==> Lista fatture con iva indetrabile
// CG3 -6 N ==> Lista fatture intracomunitarie // CG3 -6 N ==> Lista fatture intracomunitarie
// //
#include <defmask.h>
#include <mask.h> #include <mask.h>
#include <printapp.h> #include <printapp.h>
#include <recarray.h> #include <recarray.h>
#include <sheet.h> #include <sheet.h>
#include <defmask.h>
#include "cg3.h" #include "cg3.h"
#include "cg3700a.h" #include "cg3700a.h"
@ -52,6 +52,8 @@ class TLista_fatture : public TPrintapp
long _numregprec; // Per la stampa di piu' righe di uno stesso documento long _numregprec; // Per la stampa di piu' righe di uno stesso documento
tipo_st _tipo; // Tipo di stampa tipo_st _tipo; // Tipo di stampa
TArray_sheet* _ditte; // Sheet di selezione ditte TArray_sheet* _ditte; // Sheet di selezione ditte
long _unica_ditta;
TAssoc_array _intra_items;// Array ordinato (per codice IVA) dei totali per fatture INTRA TAssoc_array _intra_items;// Array ordinato (per codice IVA) dei totali per fatture INTRA
long _from_cf, // Estremi selezione clienti/fornitori long _from_cf, // Estremi selezione clienti/fornitori
_to_cf; _to_cf;
@ -178,6 +180,12 @@ bool TLista_fatture::date_handler(TMask_field& f, KEY key)
TMask& m = f.mask(); TMask& m = f.mask();
const TDate da(m.get_date(FLD_DATE_FROM)); const TDate da(m.get_date(FLD_DATE_FROM));
const TDate a(m.get_date(FLD_DATE_TO)); const TDate a(m.get_date(FLD_DATE_TO));
if (da.ok())
m.set(FLD_ANNO, da.year()); else
if (a.ok())
m.set(FLD_ANNO, a.year());
if (a.ok() && da.ok()) // Solo se sono entrambi compilati if (a.ok() && da.ok()) // Solo se sono entrambi compilati
{ {
if (da > a) if (da > a)
@ -337,13 +345,8 @@ void TLista_fatture::set_choice_limits(TMask& m)
} }
if (first != -1) if (first != -1)
m.set(FLD_DFR, first); m.set(FLD_DFR, first);
//else
// m.reset(FLD_DFR);
if (last != -1) if (last != -1)
m.set(FLD_DTO, last); m.set(FLD_DTO, last);
//else
// m.reset(FLD_DFR);
const long checked = _ditte->checked(); const long checked = _ditte->checked();
m.enable(DLG_PRINT,checked > 0); m.enable(DLG_PRINT,checked > 0);
m.set(FLD_SELECTED, checked); m.set(FLD_SELECTED, checked);
@ -352,9 +355,12 @@ void TLista_fatture::set_choice_limits(TMask& m)
void TLista_fatture::build_ditte_sheet() void TLista_fatture::build_ditte_sheet()
{ {
_ditte->destroy(); _ditte->destroy();
TLocalisamfile nditte(LF_NDITTE);
for (nditte.first(); nditte.good(); nditte.next()) long first_enabled = 0;
long firms_enabled = 0;
TLocalisamfile nditte(LF_NDITTE);
for (int err = nditte.first(); err == NOERR; err = nditte.next())
{ {
TToken_string* d = new TToken_string(64); TToken_string* d = new TToken_string(64);
d->add(" "); d->add(" ");
@ -368,8 +374,14 @@ void TLista_fatture::build_ditte_sheet()
if (unselectable) if (unselectable)
_ditte->disable_row(pos); _ditte->disable_row(pos);
else else
{
_ditte->enable_row(pos); _ditte->enable_row(pos);
if (firms_enabled++ == 0)
first_enabled = pos;
} }
}
_unica_ditta = (firms_enabled == 1) ? first_enabled : -1;
} }
bool TLista_fatture::preprocess_page(int file, int counter) bool TLista_fatture::preprocess_page(int file, int counter)
@ -699,6 +711,12 @@ bool TLista_fatture::set_print(int m)
set_real_picture("###.###.###.###"); set_real_picture("###.###.###.###");
set_magic_currency(TRUE); set_magic_currency(TRUE);
if (_unica_ditta >= 0)
{
_ditte->check(_unica_ditta);
set_choice_limits(msk);
}
switch (_tipo) switch (_tipo)
{ {
case costo_ricavo: case costo_ricavo:

View File

@ -10,6 +10,7 @@
#define FLD_TO_REG 109 #define FLD_TO_REG 109
#define FLD_FROM_CAU 110 #define FLD_FROM_CAU 110
#define FLD_TO_CAU 111 #define FLD_TO_CAU 111
#define FLD_ANNO 112
#define BUT_SEL 201 #define BUT_SEL 201
#define BUT_ANN 202 #define BUT_ANN 202

View File

@ -54,12 +54,31 @@ NUMBER FLD_FROM_FOR 6
BEGIN BEGIN
PROMPT 1 6 "Da fornitore " PROMPT 1 6 "Da fornitore "
GROUP 1 GROUP 1
USE LF_CLIFO
INPUT TIPOCF "F"
INPUT CODCF FLD_FROM_FOR
DISPLAY "Codice" CODCF
DISPLAY "Ragione Sociale@50" RAGSOC
OUTPUT FLD_FROM_FOR CODCF
CHECKTYPE SEARCH
END END
NUMBER FLD_TO_FOR 6 NUMBER FLD_TO_FOR 6
BEGIN BEGIN
PROMPT 1 7 "A fornitore " PROMPT 1 7 "A fornitore "
GROUP 1 GROUP 1
COPY USE FLD_FROM_FOR
INPUT TIPOCF "F"
INPUT CODCF FLD_TO_FOR
COPY DISPLAY FLD_FROM_FOR
OUTPUT FLD_TO_FOR CODCF
CHECKTYPE SEARCH
END
NUMBER FLD_ANNO 4
BEGIN
PROMPT 35 5 ""
FLAGS "AH"
END END
STRING FLD_FROM_REG 3 STRING FLD_FROM_REG 3
@ -67,6 +86,13 @@ BEGIN
PROMPT 35 6 "Da registro " PROMPT 35 6 "Da registro "
FLAGS "UZ" FLAGS "UZ"
GROUP 1 GROUP 1
USE REG
INPUT CODTAB[1,4] FLD_ANNO SELECT
INPUT CODTAB[5,7] FLD_FROM_REG
DISPLAY "Codice" CODTAB[5,7]
DISPLAY "Descrizione@50" S0
OUTPUT FLD_FROM_REG CODTAB[5,7]
CHECKTYPE SEARCH
END END
STRING FLD_TO_REG 3 STRING FLD_TO_REG 3
@ -74,6 +100,12 @@ BEGIN
PROMPT 35 7 "A registro " PROMPT 35 7 "A registro "
FLAGS "UZ" FLAGS "UZ"
GROUP 1 GROUP 1
COPY USE FLD_FROM_REG
INPUT CODTAB[1,4] FLD_ANNO SELECT
INPUT CODTAB[5,7] FLD_TO_REG
COPY DISPLAY FLD_FROM_REG
OUTPUT FLD_TO_REG CODTAB[5,7]
CHECKTYPE SEARCH
END END
STRING FLD_FROM_CAU 3 STRING FLD_FROM_CAU 3
@ -81,6 +113,12 @@ BEGIN
PROMPT 1 6 "Da causale " PROMPT 1 6 "Da causale "
FLAGS "HUZ" FLAGS "HUZ"
GROUP 2 GROUP 2
USE LF_CAUSALI
INPUT CODCAUS FLD_FROM_CAU
DISPLAY "Codice" CODCAUS
DISPLAY "Descrizione@50" DESCR
OUTPUT FLD_FROM_CAU CODCAUS
CHECKTYPE SEARCH
END END
STRING FLD_TO_CAU 3 STRING FLD_TO_CAU 3
@ -88,6 +126,11 @@ BEGIN
PROMPT 1 7 "A causale " PROMPT 1 7 "A causale "
FLAGS "HUZ" FLAGS "HUZ"
GROUP 2 GROUP 2
COPY USE FLD_FROM_CAU
INPUT CODCAUS FLD_TO_CAU
COPY DISPLAY FLD_FROM_CAU
OUTPUT FLD_TO_CAU CODCAUS
CHECKTYPE SEARCH
END END
BUTTON DLG_PRINT 10 2 BUTTON DLG_PRINT 10 2

View File

@ -7,11 +7,9 @@
#include <diction.h> #include <diction.h>
#include <progind.h> #include <progind.h>
#include <relation.h> #include <relation.h>
#include <tabutil.h> #include <tabutil.h>
#include <utility.h> #include <utility.h>
#include <xvtility.h> #include <xvtility.h>
#include <diction.h>
#include "cglib01.h" #include "cglib01.h"
#include "cglib02.h" #include "cglib02.h"
@ -167,17 +165,23 @@ real TSaldo::calcola_saldo_iniziale(int g,int c,long s,int indbil)
return _saldo_iniziale; return _saldo_iniziale;
} }
const char* TSaldo::causale_chiusura_es() /*
const TString& TSaldo::causale_chiusura_es() const
{ {
TConfig conf(CONFIG_DITTA); TConfig conf(CONFIG_DITTA, "cg");
return conf.get("CoCaCh"); TString& tmp = get_tmp_string();
tmp = conf.get("CoCaCh");
return tmp;
} }
const char* TSaldo::causale_apertura_es() const TString& TSaldo::causale_apertura_es() const
{ {
TConfig conf(CONFIG_DITTA); TConfig conf(CONFIG_DITTA, "cg");
return conf.get("CoCaAp"); TString& tmp = get_tmp_string();
tmp = conf.get("CoCaAp");
return tmp;
} }
*/
bool TSaldo::leggi_mov(long nr) bool TSaldo::leggi_mov(long nr)
{ {
@ -228,11 +232,11 @@ bool TSaldo::data_limite_bilancio(int bilancio, int g, int c, long s, const TDat
for (cur = 0L; cur.pos() < items; ++cur) for (cur = 0L; cur.pos() < items; ++cur)
{ {
const long num_reg = rmov.get_long(RMV_NUMREG); const long num_reg = rmov.get_long(RMV_NUMREG);
if (!leggi_mov(num_reg)) // Leggo la testata
continue; // Evita righe orfane!
TDate data_mov; TDate data_mov;
// Leggo la testata
leggi_mov(num_reg);
if (bilancio == DataLimite) if (bilancio == DataLimite)
data_mov = _datacomp; data_mov = _datacomp;
else else

View File

@ -105,8 +105,11 @@ public:
void set_annoes (int anno) { _annoes = anno; } void set_annoes (int anno) { _annoes = anno; }
bool causale_mov(long, const TDate&, const TDate&, TString&); bool causale_mov(long, const TDate&, const TDate&, TString&);
const char* causale_chiusura_es();
const char* causale_apertura_es(); /* Inutilizzate!
const TString& causale_chiusura_es() const;
const TString& causale_apertura_es() const;
*/
bool ultima_immissione_bilancio(int anno,int g,int c,long s,int indbil,int prov,bool saldo_chiusura = TRUE); bool ultima_immissione_bilancio(int anno,int g,int c,long s,int indbil,int prov,bool saldo_chiusura = TRUE);
bool ultima_immissione_verifica(int anno,int g,int c,long s,int indbil,int prov); bool ultima_immissione_verifica(int anno,int g,int c,long s,int indbil,int prov);