diff --git a/cg/cg2100o.uml b/cg/cg2100o.uml index 207df1b48..fe5178a56 100755 --- a/cg/cg2100o.uml +++ b/cg/cg2100o.uml @@ -115,12 +115,12 @@ BEGIN PROMPT 1 8 "@bDati nascita" END -LIST O_SESSO 1 12 +LIST O_SESSO 1 7 BEGIN PROMPT 2 9 "Sesso " ITEM "M|Maschio" ITEM "F|Femmina" - FLAGS "H" + FLAGS "D" END DATE O_DATANAS diff --git a/cg/cg2102.cpp b/cg/cg2102.cpp index b624a1ed7..6b9109979 100755 --- a/cg/cg2102.cpp +++ b/cg/cg2102.cpp @@ -4,7 +4,8 @@ #include #include #include -#include +#include +#include #include "cg2100.h" #include "cg2102.h" @@ -2329,6 +2330,12 @@ bool TPrimanota_application::occas_code_handler(TMask_field& f, KEY key) if (occas.read(_isequal) == NOERR) { m.autoload(occas); + + if (m.field(O_COFI).empty() && !isdigit(code[0]) && cf_check(m.get(O_STATONAS), code)) + m.set(O_COFI, code, 1); + if (m.field(O_PAIV).empty() && isdigit(code[0]) && pi_check(m.get(O_STATONAS), code)) + m.set(O_PAIV, code, 1); + m.send_key(K_TAB, O_COMUNE); // Forza decodifica comuni m.send_key(K_TAB, O_COMUNENAS); } @@ -2339,15 +2346,33 @@ bool TPrimanota_application::occas_code_handler(TMask_field& f, KEY key) bool TPrimanota_application::occas_cfpi_handler(TMask_field& f, KEY key) { - if (key == K_ENTER) + TMask& om = f.mask(); + if (key == K_TAB && (f.focusdirty() || !om.is_running())) { - const TMask& om = f.mask(); - if (om.field(O_COFI).empty() && om.field(O_PAIV).empty()) + TString16 cofi = om.get(O_COFI); + if (cofi.empty()) + cofi = om.get(O_CODICE); + + if (cf_check(om.get(O_STATONAS), cofi)) { - TMask& m = app().curr_mask(); - const int anno = m.get_int(F_ANNOIVA); - if (anno >= 2007) - return f.error_box(TR("E' necessario specificare il codice fiscale o la partita IVA")); + int giorno = atoi(cofi.mid(9,2)); + om.set(O_SESSO, giorno > 40 ? "F" : "M"); + + if (om.field(O_COMUNENAS).empty()) + om.set(O_COMUNENAS, cofi.mid(11,4), 0x2); + + if (om.field(O_DATANAS).empty()) + { + const TFixed_string mesi("ABCDEHLMPRST"); + const int mese = mesi.find(cofi[8])+1; + int anno = atoi(cofi.mid(6,2)); + if (giorno > 0 && mese > 0 && anno > 0) + { + giorno %= 40; + anno += anno < 5 ? 2000 : 1900; + om.set(O_DATANAS, TDate(giorno, mese, anno)); + } + } } } return true; diff --git a/cg/cg6900.cpp b/cg/cg6900.cpp index 4d578b5ba..84ff714a1 100755 --- a/cg/cg6900.cpp +++ b/cg/cg6900.cpp @@ -244,7 +244,7 @@ void TInv_cont::main_loop() const char* message = TR("Trasferimento in corso... Prego attendere"); - TProgind w(_dim_tot, message, TRUE, TRUE, 60); + TProgind w(_dim_tot, message, true, true); bool continua = TRUE; for (int j = 0; j < num_disk; j++) @@ -340,7 +340,7 @@ void TInv_cont::main_loop() } const char* message= "Trasferimento in corso... Prego attendere"; - TProgind w(_dim_tot, message, TRUE, TRUE, 60); + TProgind w(_dim_tot, message, true, true); bool continua = TRUE; for (int j = 0; j < num_disk && continua; j++) diff --git a/cg/cglib04.cpp b/cg/cglib04.cpp index 1d78e9a88..9e9830df9 100755 --- a/cg/cglib04.cpp +++ b/cg/cglib04.cpp @@ -3436,7 +3436,7 @@ void TTransfer_file::scrivi_IVA(long nrec) { TString buffer(sizeT); - _prog = new TProgind (nrec,TR("Trasferimento Movimenti Iva"),false, true); + _prog = new TProgind(nrec,TR("Trasferimento Movimenti IVA"),false, true); const TRic_recfield recf(_ttab->curr(), "S0", 0, sizeT);