diff --git a/cg/cg2100.cpp b/cg/cg2100.cpp index 27140714a..69aec1500 100755 --- a/cg/cg2100.cpp +++ b/cg/cg2100.cpp @@ -4,6 +4,7 @@ #include "../ca/movana.h" #include "../in/inlib01.h" +#include #include #include #include @@ -665,6 +666,39 @@ void TPrimanota_application::fill_sheet(TMask& m) const } } +bool TPrimanota_application::can_I_write(const TRelation* rel) const +{ + static int err = -1; + if (err < 0) + { + Tdninst dninst; + err = dninst.check_customer(); + if (err != 0) + { + TString html; + html << "" + << "
Attenzione: chiave " << dongle().number() << " non riconosciuta.
\n" + << "

Al fine di poter riattivare la chiave " << dongle().product().before(" ") + << " in oggetto e poter quindi effettuare registrazioni, " + << "La preghiamo di contattare Sirio informatica e sistemi ai seguenti riferimenti:


" + << "" + << ""; + warning_box(html); + } + } + + bool yes = TRelation_application::can_I_write(rel); + if (yes && err > 0) + { + yes = rel != NULL && _rel->cg_items() > 0; // Posso registrare ma non inserire + } + + return yes; +} + // Ritorna il prossimo numero di registrazione libero // Certified 100% bool TPrimanota_application::get_next_key(TToken_string& tmp) @@ -1253,13 +1287,13 @@ void TPrimanota_application::check_saldi() int TPrimanota_application::write(const TMask& m) { static int lasterr = NOERR; - + const long numreg = m.get_long(F_NUMREG); if (numreg > _lastreg) _lastreg = numreg; // Aggiorna ultima registrazione libera if (lasterr == NOERR) mask2rel(m); // Altrimenti raddoppia i saldi! - + _last_dreg = m.get(F_DATAREG); _last_dcom = m.get(F_DATACOMP); //l'handler della datacomp non viene chiamato quando il campo è read_only (vedi crpa e dinamica) diff --git a/cg/cg2100c.uml b/cg/cg2100c.uml index e21047fd0..760448846 100755 --- a/cg/cg2100c.uml +++ b/cg/cg2100c.uml @@ -458,9 +458,9 @@ END LIST F_MODPAG 1 14 BEGIN PROMPT 42 12 "Modalità pagamento " - ITEM "3|Non frazionato" - ITEM "1|Acconto" - ITEM "2|Saldo" + ITEM "1|Non frazionato" + ITEM "2|Frazionato" + ITEM "3|Periodico" MODULE fe GROUP 1 2 FIELD MODPAG diff --git a/cg/cg2102.h b/cg/cg2102.h index 1d07ed613..e9bf9c0fc 100755 --- a/cg/cg2102.h +++ b/cg/cg2102.h @@ -188,6 +188,7 @@ protected: // TRelation_application virtual bool remove(); virtual void write_enable(bool) {} virtual bool protected_record(TRectype& rec); + virtual bool can_I_write(const TRelation* rel) const; protected: void check_saldi(); diff --git a/cg/cg7.cpp b/cg/cg7.cpp index c7b2a93eb..9b9471714 100755 --- a/cg/cg7.cpp +++ b/cg/cg7.cpp @@ -1,8 +1,6 @@ #include - #include "cg7.h" - int main(int argc,char** argv) { const int r = (argc > 1) ? atoi(&argv[1][1]) : -1; diff --git a/cg/f22.trr b/cg/f22.trr index 28964a558..0a08de535 100755 --- a/cg/f22.trr +++ b/cg/f22.trr @@ -6,12 +6,11 @@ TIPOCF|1|1|0|Tipo liente ornitore CODCF|3|6|0|Codice Cliente/Fornitore OCFPI|1|16|0|Codice occasionale NUMREG|3|7|0|Numero di registrazione originale -IGNORA|8|1|0|Riga da ignorare +IGNORA|2|2|0|Eventuale motivo per ignorare la riga (0 = da inviare) DATAREG|5|8|0|Data registrazione MODPAG|2|1|0|Modalità di pagamento (1=Acconto;2=Saldo;3=Non frazionato) IMPORTO|4|12|2|Importo dovuto IMPOSTA|4|12|2|Imposta -NATOPE|2|1|0|Natura operazione TIPOPE|2|1|0|Tipo operazione CONTRATTO|1|18|0|Contratto IMPORTOTOT|4|12|2|Importo totale operazione (contratto) @@ -20,4 +19,4 @@ NUMRETT|3|7|0|Numero di registrazione rettificata 3 ANNO+PROGR| ANNO+TIPOCF+CODCF+OCFPI+PROGR| -NUMREG|X +NUMREG+PROGR|