diff --git a/ve/f33.dir b/ve/f33.dir
index 15638e1fe..611612ec9 100755
--- a/ve/f33.dir
+++ b/ve/f33.dir
@@ -1,3 +1,3 @@
33
0
-$doc|0|0|462|0|Documenti di vendita|NDOC*3||
+$doc|0|0|496|0|Documenti di vendita|NDOC*3||
diff --git a/ve/f33.trr b/ve/f33.trr
index e01142c6f..cafdf66a1 100755
--- a/ve/f33.trr
+++ b/ve/f33.trr
@@ -1,5 +1,5 @@
33
-76
+77
CODNUM|1|4|0|Codice della numerazione
ANNO|2|4|0|Anno
PROVV|1|1|0|Tipo numerazione
rovvisorio efinitivo
@@ -22,6 +22,7 @@ CODPAG|1|4|0|Codice condizione di pagamento
DATAINSC|5|8|0|Data inizio scadenza
CODABIA|10|5|0|Codice ABI banca di appoggio
CODCABA|10|5|0|Codice CAB banca di appoggio
+IBAN|1|34|0|Codice IBAN di appoggio
CODABIP|10|5|0|Codice ABI banca di presentazione
CODCABP|10|5|0|Codice CAB banca di presentazione
CATVEN|1|2|0|Categoria di vendita
diff --git a/ve/fatturac.src b/ve/fatturac.src
index e7a31c8bd..68a16d215 100755
--- a/ve/fatturac.src
+++ b/ve/fatturac.src
@@ -55,6 +55,14 @@ DATASCAD5 = S_DISABILITATO //500
CODABIA = S_OBBLIGATORIO //600
CODCABA = S_OBBLIGATORIO //600
DESBANAPP = S_NORMALE //600
+IBAN = S_NORMALE //600
+IBAN_STATO = S_NORMALE //600
+IBAN_CHECK = S_NORMALE //600
+BBAN = S_NORMALE //600
+BBAN_CIN = S_NORMALE //600
+BBAN_ABI = S_NORMALE //600
+BBAN_CAB = S_NORMALE //600
+BBAN_CONTO = S_NORMALE //600
CODABIP = S_NORMALE //700
CODCABP = S_NORMALE //700
DESBANPRE = S_NORMALE //700
diff --git a/ve/ve0100.cpp b/ve/ve0100.cpp
index 00b594899..30779d094 100755
--- a/ve/ve0100.cpp
+++ b/ve/ve0100.cpp
@@ -96,8 +96,6 @@ void TMotore_application::init_insert_mode( TMask& m )
void TMotore_application::init_modify_mode( TMask& m )
{
- static TString80 __last_key;
-
enable_menu_item(M_FILE_PRINT);
m.enable(DLG_PRINT);
m.enable(DLG_ELABORA);
@@ -112,7 +110,7 @@ void TMotore_application::init_modify_mode( TMask& m )
if (autodeleting() != 0x3)
{
const bool transaction = is_transaction();
- const bool no_mod = !doc().modificabile() && !transaction;
+ const bool no_mod = !transaction && !doc().modificabile();
const bool no_del = !doc().cancellabile();
if (no_del || no_mod)
{
@@ -136,6 +134,9 @@ void TMotore_application::init_modify_mode( TMask& m )
m.disable(DLG_SAVEREC);
if (no_del)
m.disable(DLG_DELREC);
+
+ if (m.id2pos(F_IBAN_STATO) > 0)
+ m.efield(F_IBAN_STATO).validate(K_TAB); // Decodifica IBAN
}
__last_key = key;
}
diff --git a/ve/ve0100.h b/ve/ve0100.h
index 424365b95..ad6577cda 100755
--- a/ve/ve0100.h
+++ b/ve/ve0100.h
@@ -29,6 +29,7 @@ class TMotore_application : public TRelation_application
TString16 _codnum;
TString16 _tipodoc;
+ TString80 __last_key;
// Array di maschere documento
diff --git a/ve/ve0300.cpp b/ve/ve0300.cpp
index 4c9deb66b..0dc5b1665 100755
--- a/ve/ve0300.cpp
+++ b/ve/ve0300.cpp
@@ -111,8 +111,8 @@ public:
// ENDMASK
void endmask( void ) { outline ( "ENDMASK" ); };
- // FLAG
- void flag( const char* s ) { _out << "FLAG \"" << s << "\"\n"; };
+ // FLAGS
+ void flag( const char* s ) { _out << "FL \"" << s << "\"\n"; };
// HELP
void help( const TString& s ) { _out << "HE \"" << s << "\"\n"; };
diff --git a/ve/ve0300a.src b/ve/ve0300a.src
index 22c2e37c6..edb2f3930 100755
--- a/ve/ve0300a.src
+++ b/ve/ve0300a.src
@@ -512,13 +512,13 @@ Y=0
FIELDNAME=CODABIA
MSKID=F_CODABIA
TYPE=T_NUMERO
-PROMPT="Banca appoggio : cod. ABI "
+PROMPT="Banca appoggio : Cod. ABI "
SIZE=5
FLAG=Z
USE=%BAN SE CODTAB?="?????"
INPUT=CODTAB[1,5] F_CODABIA
DISPLAY="Cod. Istit." CODTAB[1,5]~"Cod. Fil." CODTAB[6,10]~"Denominazione@50" S0
-OUTPUT=F_CODABIA CODTAB[1,5]~F_DESBANAPP S0
+OUTPUT=F_CODABIA CODTAB[1,5]~F_DESBANAPP S0~F_BBAN_ABI CODTAB[1,5]
[CODCABA]
GROUP=600
@@ -527,13 +527,13 @@ Y=0
FIELDNAME=CODCABA
MSKID=F_CODCABA
TYPE=T_NUMERO
-PROMPT="cod. CAB "
+PROMPT="Cod. CAB "
SIZE=5
FLAG=Z
USE=%BAN SE CODTAB?="??????????"
INPUT=CODTAB[1,5] F_CODABIA~CODTAB[6,10] F_CODCABA
DISPLAY=@F_CODABIA
-OUTPUT=F_CODABIA CODTAB[1,5]~F_CODCABA CODTAB[6,10]~F_DESBANAPP S0
+OUTPUT=F_CODABIA CODTAB[1,5]~F_CODCABA CODTAB[6,10]~F_DESBANAPP S0~F_BBAN_CAB CODTAB[6,10]
[DESBANAPP]
GROUP=600
@@ -548,6 +548,91 @@ INPUT=S0 F_DESBANAPP
DISPLAY=@F_CODABIA
OUTPUT=@F_CODABIA
+[IBAN]
+GROUP=600
+X = 2
+Y = 2
+MSKID=F_IBAN
+TYPE=T_STRINGA
+PROMPT=""
+SIZE=34
+FLAG=H
+FIELDNAME=IBAN
+
+[IBAN_STATO]
+GROUP=600
+X = 2
+Y = 2
+MSKID=F_IBAN_STATO
+TYPE=T_STRINGA
+PROMPT="Codice conto IBAN "
+SIZE=2
+FLAG=U
+SPECIAL=VA 24 8 F_IBAN F_IBAN_STATO F_IBAN_CHECK F_BBAN F_BBAN_CIN F_BBAN_ABI F_BBAN_CAB F_BBAN_CONTO
+
+[IBAN_CHECK]
+GROUP=600
+X = 28
+Y = 2
+MSKID=F_IBAN_CHECK
+TYPE=T_NUMERO
+PROMPT=""
+SIZE=2
+FLAG=UZ
+SPECIAL=VA 24 8 F_IBAN F_IBAN_STATO F_IBAN_CHECK F_BBAN F_BBAN_CIN F_BBAN_ABI F_BBAN_CAB F_BBAN_CONTO
+
+[BBAN]
+GROUP=600
+X = 39
+Y = 2
+MSKID=F_BBAN
+TYPE=T_STRINGA
+PROMPT="BBAN "
+SIZE=30
+FLAG=HUZ
+
+[BBAN_CIN]
+GROUP=600
+X = 40
+Y = 2
+MSKID=F_BBAN_CIN
+TYPE=T_STRINGA
+PROMPT="BBAN "
+SIZE=1
+FLAG=U
+SPECIAL=VA 25 5 F_BBAN F_BBAN_CIN F_BBAN_ABI F_BBAN_CAB F_BBAN_CONTO
+
+[BBAN_ABI]
+GROUP=600
+X = 48
+Y = 2
+MSKID=F_BBAN_ABI
+TYPE=T_NUMERO
+PROMPT=""
+SIZE=5
+FLAG=DZ
+
+[BBAN_CAB]
+GROUP=600
+X = 55
+Y = 2
+MSKID=F_BBAN_CAB
+TYPE=T_NUMERO
+PROMPT=""
+SIZE=5
+FLAG=DZ
+
+[BBAN_CONTO]
+GROUP=600
+X = 62
+Y = 2
+MSKID=F_BBAN_CONTO
+TYPE=T_STRINGA
+PROMPT=""
+SIZE=12
+FLAG=Z
+SPECIAL=VA 25 5 F_BBAN F_BBAN_CIN F_BBAN_ABI F_BBAN_CAB F_BBAN_CONTO
+
[CODABIP]
GROUP=700
X=2
@@ -555,7 +640,7 @@ Y=0
FIELDNAME=CODABIP
MSKID=F_CODABIP
TYPE=T_NUMERO
-PROMPT="Banca presentazione : cod. ABI "
+PROMPT="Banca presentazione : Cod. ABI "
SIZE=5
FLAG=Z
USE=@F_CODABIA
@@ -570,7 +655,7 @@ Y=0
FIELDNAME=CODCABP
MSKID=F_CODCABP
TYPE=T_NUMERO
-PROMPT="cod. CAB "
+PROMPT="Cod. CAB "
SIZE=5
FLAG=Z
USE=@F_CODCABA
diff --git a/ve/ve1100.cpp b/ve/ve1100.cpp
index 07ccb562c..78b24b3d7 100755
--- a/ve/ve1100.cpp
+++ b/ve/ve1100.cpp
@@ -170,13 +170,11 @@ TDocumento_form::TDocumento_form(TRectype& doc, TRelation& rel, bool definitiva,
{
_form = this;
- //const TString codnum(doc.get(DOC_CODNUM));
- //const TString numdoc(doc.get(DOC_NDOC));
- const TString8 tipodoc(doc.get(DOC_TIPODOC));
+ const TString4 tipodoc(doc.get(DOC_TIPODOC));
TFilename nomeform;
- const TRectype rec = cache().get("%TIP", tipodoc);
+ const TRectype& rec = cache().get("%TIP", tipodoc);
if (!rec.empty())
{ // se non ci sono errori procede con la stampa
nomeform = aggiuntivo ? rec.get("S5").mid(8) : rec.get("S5").left(8); // legge il nome del form di stampa
diff --git a/ve/ve6200a.uml b/ve/ve6200a.uml
index e99ebe52a..db83e05da 100755
--- a/ve/ve6200a.uml
+++ b/ve/ve6200a.uml
@@ -204,6 +204,7 @@ BEGIN
DISPLAY "Tipo@50" 104@->S0
DISPLAY "Ragione sociale@50" LF_CLIFO->RAGSOC
OUTPUT F_NUMERO_DOCUMENTO_DA NDOC
+ ADD RUN ve0 -0
END
NUMBER F_NUMERO_DOCUMENTO_A 7
@@ -218,6 +219,7 @@ BEGIN
OUTPUT F_NUMERO_DOCUMENTO_A NDOC
NUM_EXPR (#THIS_FIELD==0)||(#THIS_FIELD>=#F_NUMERO_DOCUMENTO_DA)
WARNING "Specificare un numero documento superiore a quello di partenza"
+ ADD RUN ve0 -0
END
BUTTON DLG_OK 10 2
diff --git a/ve/velib01.cpp b/ve/velib01.cpp
index 030b92d7a..f545c62f9 100755
--- a/ve/velib01.cpp
+++ b/ve/velib01.cpp
@@ -22,12 +22,12 @@ TCodice_numerazione::~TCodice_numerazione()
{
}
-const TString & TCodice_numerazione::tipo_doc(int i) const
+const TString& TCodice_numerazione::tipo_doc(int i) const
{
CHECK(i < MAX_TIPI_DOC, "Impossibbile tipo documento");
const char * field = i < 17 ? "S2" : "S3";
- if (i > 16)
+ if (i > 16)
i -= 17;
return ((TString& ) get(field).mid(i << 2, 4)).trim();
}
diff --git a/ve/velib04.cpp b/ve/velib04.cpp
index 79bff69fd..b115219a4 100755
--- a/ve/velib04.cpp
+++ b/ve/velib04.cpp
@@ -18,7 +18,7 @@ TDate TLista_documenti::num2date(char provv, int anno, const char* codnum, long
if (doc.read(_isgteq) != NOERR) // In caso d'errore ...
doc.last(); // prendi l'ultimo
- return doc.get("DATADOC");
+ return doc.get(DOC_DATADOC);
}
int TLista_documenti::read(char provv, char tipocf, long clifo, int anno,
@@ -37,59 +37,59 @@ int TLista_documenti::read(char provv, char tipocf, long clifo, int anno,
TRectype start(LF_DOC), stop(LF_DOC);
int anno_start, anno_stop;
- start.put("TIPOCF", tipocf);
- stop.put("TIPOCF", tipocf);
+ start.put(DOC_TIPOCF, tipocf);
+ stop.put(DOC_TIPOCF, tipocf);
- start.put("CODCF", clifo);
- stop.put("CODCF", clifo);
+ start.put(DOC_CODCF, clifo);
+ stop.put(DOC_CODCF, clifo);
- start.put("PROVV", provv);
- stop.put("PROVV", provv);
+ start.put(DOC_PROVV, provv);
+ stop.put(DOC_PROVV, provv);
anno_start = anno_stop = anno;
if (dd.ok())
{
anno_start = dd.year();
- start.put("ANNO", anno_start);
+ start.put(DOC_ANNO, anno_start);
}
if (ad.ok())
{
anno_stop = ad.year();
- stop.put("ANNO", anno_stop);
+ stop.put(DOC_ANNO, anno_stop);
}
if (dn > 0)
{
const TDate d(num2date(provv, anno_start, codnum, dn));
- start.put("DATADOC", d);
- start.put("ANNO", d.year());
- start.put("NDOC", dn);
+ start.put(DOC_DATADOC, d);
+ start.put(DOC_ANNO, d.year());
+ start.put(DOC_NDOC, dn);
}
else
{
if (dd.ok() && dd > botime)
- start.put("DATADOC", dd);
+ start.put(DOC_DATADOC, dd);
if (anno_start <= anno_stop)
- start.put("ANNO", anno_start);
+ start.put(DOC_ANNO, anno_start);
}
if (an > 0)
{
const TDate d(num2date(provv, anno_stop, codnum, an));
- stop.put("DATADOC", d);
- stop.put("ANNO", d.year());
- stop.put("NDOC", an);
+ stop.put(DOC_DATADOC, d);
+ stop.put(DOC_ANNO, d.year());
+ stop.put(DOC_NDOC, an);
}
else
{
if (ad.ok() && ad < eotime)
- stop.put("DATADOC", ad);
+ stop.put(DOC_DATADOC, ad);
- stop.put("ANNO", anno_stop);
+ stop.put(DOC_ANNO, anno_stop);
}
TString filter(16);
@@ -97,15 +97,15 @@ int TLista_documenti::read(char provv, char tipocf, long clifo, int anno,
{
bool numfilter = FALSE;
- if (start.get("DATADOC").empty())
+ if (start.get(DOC_DATADOC).empty())
numfilter = TRUE;
else
- start.put("CODNUM", codnum);
+ start.put(DOC_CODNUM, codnum);
- if (stop.get("DATADOC").empty())
+ if (stop.get(DOC_DATADOC).empty())
numfilter = TRUE;
else
- stop.put("CODNUM", codnum);
+ stop.put(DOC_CODNUM, codnum);
if (numfilter)
filter << "CODNUM=\"" << codnum << '"';
@@ -117,8 +117,8 @@ int TLista_documenti::read(char provv, char tipocf, long clifo, int anno,
_documenti.destroy();
for (cur = 0; cur.ok(); ++cur)
{
- const TString16 tipodoc = head.get("TIPODOC");
- const TString16 statodoc = head.get("STATO");
+ const TString16 tipodoc = head.get(DOC_TIPODOC);
+ const TString16 statodoc = head.get(DOC_STATO);
bool match = FALSE;
for (int i = tipidoc.items()-1; i>=0; i--)
diff --git a/ve/velib04c.cpp b/ve/velib04c.cpp
index bb3c987d7..0e929ccee 100755
--- a/ve/velib04c.cpp
+++ b/ve/velib04c.cpp
@@ -336,27 +336,29 @@ long TGenerazione_effetti::group_bills(TAssoc_array& group_array)
{
// Se non esiste effetto n-esimo (corrisponde al numero di rata corrente+offset)
// lo genera con la relativa riga. Se esiste vi somma gli importi ed accoda la riga
- const bool is_new = n+offset > _effetti_array.items();
- if (is_new) // Nuovo effetto: crea effetto con i dati di questo documento (e' il primo che incontro nella scansione)
+ const int index = n+offset-1;
+ // Nuovo effetto: crea effetto con i dati di questo documento (e' il primo che incontro nella scansione)
+ if (index >= _effetti_array.items())
{
- TEffetto effetto;
+ TEffetto* effetto = new TEffetto;
// Setta i dati della testata;
- effetto.put(EFF_DATASCAD, pag.data_rata(n-1));
- effetto.put(EFF_TIPOPAG,pag.tipo_rata(n-1));
- effetto.put(EFF_ULTCLASS,pag.ulc_rata(n-1));
- effetto.put(EFF_TIPOCF, doc.get_char(DOC_TIPOCF));
- effetto.put(EFF_CODCF, doc.get_long(DOC_CODCF));
- effetto.put(EFF_CODVAL, doc.get(DOC_CODVAL));
- effetto.put(EFF_CAMBIO, change);
- effetto.put(EFF_DATACAMBIO,doc.get_date(DOC_DATACAMBIO));
- effetto.put(EFF_CONTROEURO,doc.get_date(DOC_CONTROEURO));
- effetto.put(EFF_CODABI,doc.get(DOC_CODABIA));
- effetto.put(EFF_CODCAB,doc.get(DOC_CODCABA));
- effetto.put(EFF_EFFCOMP,TRUE);
+ effetto->put(EFF_DATASCAD, pag.data_rata(n-1));
+ effetto->put(EFF_TIPOPAG,pag.tipo_rata(n-1));
+ effetto->put(EFF_ULTCLASS,pag.ulc_rata(n-1));
+ effetto->put(EFF_TIPOCF, doc.get_char(DOC_TIPOCF));
+ effetto->put(EFF_CODCF, doc.get_long(DOC_CODCF));
+ effetto->put(EFF_CODVAL, doc.get(DOC_CODVAL));
+ effetto->put(EFF_CAMBIO, change);
+ effetto->put(EFF_DATACAMBIO,doc.get_date(DOC_DATACAMBIO));
+ effetto->put(EFF_CONTROEURO,doc.get_date(DOC_CONTROEURO));
+ effetto->put(EFF_CODABI,doc.get(DOC_CODABIA));
+ effetto->put(EFF_CODCAB,doc.get(DOC_CODCABA));
+ effetto->put(EFF_IBAN,doc.get(DOC_IBAN));
+ effetto->put(EFF_EFFCOMP,TRUE);
_effetti_array.add(effetto);
}
// aggiorna totale effetto (testata)
- TEffetto& effetto=(TEffetto&)_effetti_array[n+offset-1];
+ TEffetto& effetto=(TEffetto&)_effetti_array[index];
const int rows = effetto.rows_r();
importo = effetto.get_real(EFF_IMPORTO);
@@ -582,6 +584,7 @@ void TGenerazione_effetti::generate_bill(TDocumento& doc) // bill in inglese sig
const bool contro_euro = doc.get_bool(DOC_CONTROEURO);
const long codabi = doc.get_long(DOC_CODABIA);
const long codcab = doc.get_long(DOC_CODCABA);
+ const TString80 iban = doc.get(DOC_IBAN);
const TString16 provv(doc.get(DOC_PROVV));
const int anno = doc.get_int(DOC_ANNO);
const TString16 codnum(doc.get(DOC_CODNUM));
@@ -613,6 +616,7 @@ void TGenerazione_effetti::generate_bill(TDocumento& doc) // bill in inglese sig
}
effetto.put(EFF_CODABI,codabi);
effetto.put(EFF_CODCAB,codcab);
+ effetto.put(EFF_IBAN,iban);
effetto.put(EFF_EFFCOMP,TRUE);
if (i == numrate - 1) effetto.put(EFF_ULTRATA,TRUE);
// Put sulla riga dell'effetto
diff --git a/ve/velib06.cpp b/ve/velib06.cpp
index 1a5d17384..8443eff2b 100755
--- a/ve/velib06.cpp
+++ b/ve/velib06.cpp
@@ -438,6 +438,22 @@ void TDocumento_mask::cli2mask()
set(F_CODPAG, c.get(CLI_CODPAG));
set(F_CODABIA, c.get(CLI_CODABI));
set(F_CODCABA, c.get(CLI_CODCAB));
+ if (id2pos(F_IBAN_STATO) > 0)
+ {
+ const TString& iban = c.get(CLI_IBAN);
+ set(F_IBAN, iban);
+ efield(F_IBAN_STATO).validate(K_TAB);
+ if (iban.not_empty())
+ {
+ set(F_IBAN_STATO, iban.left(2));
+ set(F_IBAN_CHECK, iban.mid(2,2));
+ set(F_BBAN , iban.mid(4));
+ set(F_BBAN_CIN , iban.mid(4,1));
+ set(F_BBAN_ABI , iban.mid(5,5));
+ set(F_BBAN_CAB , iban.mid(10,5));
+ set(F_BBAN_CONTO, iban.mid(15,12));
+ }
+ }
// Setta i campi che appartengono al file LF_CFVEN
set(F_CODABIP, ven_rec.get(CFV_CODABIPR));
set(F_CODCABP, ven_rec.get(CFV_CODCABPR));
@@ -1064,26 +1080,25 @@ bool TDocumento_mask::clifo_handler( TMask_field& f, KEY key )
{
TDocumento_mask & m = (TDocumento_mask &) f.mask();
TDocumento & d = m.doc();
- const TString & val = f.get();
TTipo_documento& tdoc = (TTipo_documento&) d.tipo();
- d.put("TIPOCF", tdoc.tipocf());
- d.put("CODCF", atol(val));
+ d.put(DOC_TIPOCF, tdoc.tipocf());
+ d.put(DOC_CODCF, f.get());
TCli_for & cli_for = d.clifor();
cli_for.put(CLI_CODCF, ""); // force reload
- if ( cli_for.get_bool("SOSPESO") )
- return f.error_box( "Il codice '%ld' e' sospeso e non puo' essere utilizzato", atol(val) );
+ if ( cli_for.get_bool(CLI_SOSPESO) )
+ return f.error_box( "Il codice '%ld' e' sospeso e non puo' essere utilizzato", atol(f.get()));
m.cli2mask();
if (cli_for.occasionale())
{
- TOccasionale & occas = d.occas();
+ TOccasionale& occas = d.occas();
if(m.id2pos(F_OCCASEDIT) > 0 && f.to_check(key) && *(occas.codice()) == '\0')
m.send_key( K_SPACE, F_OCCASEDIT ); // Lancia maschera occasionali
}
else
- d.zero("OCFPI");
+ d.zero(DOC_OCFPI);
}
return TRUE;
}
diff --git a/ve/veuml.h b/ve/veuml.h
index 0aeb0f603..b7e42c488 100755
--- a/ve/veuml.h
+++ b/ve/veuml.h
@@ -84,6 +84,14 @@
#define F_DESCRCMS 189
#define F_FASCMS 190
#define F_DESCRFAS 191
+#define F_IBAN 192
+#define F_IBAN_STATO 193
+#define F_IBAN_CHECK 194
+#define F_BBAN 195
+#define F_BBAN_CIN 196
+#define F_BBAN_ABI 197
+#define F_BBAN_CAB 198
+#define F_BBAN_CONTO 199
#define F_CODVAL1 200
#define F_NOMEVAL1 201
diff --git a/ve/veuml1.h b/ve/veuml1.h
index b1160f13f..764841a15 100755
--- a/ve/veuml1.h
+++ b/ve/veuml1.h
@@ -2,7 +2,7 @@
#define __VEUML1_H
#ifndef __VEUML_H
-#include "VEUML.H"
+#include "veuml.h"
#endif
// gruppo dei vettori