diff --git a/src/tf/tf0200.cpp b/src/tf/tf0200.cpp index 63a66f62a..a0d7546e0 100644 --- a/src/tf/tf0200.cpp +++ b/src/tf/tf0200.cpp @@ -253,41 +253,23 @@ bool ComLiqPerIva_mask::on_field_event(TOperable_field& o, TField_event e, long enable(F_TRIMESTRE); } } - else if(e == fe_init && !query_mode()) - { - // Per trovare un valore tento per 5 anni di vedere se c'č una liquidazione aperta, cosė da valorizzare tutta la roba - int year = TDate(TODAY).year(); - for(int i = year; i >= year - 5; i--) - { - TString cod = get(F_CODDITTA); - cod << i; - if(cache().get("%LIA", cod).empty()) continue; - - // Trovato - set(F_ANNO, i); - if(cache().get("%LIA", cod, "S7") == "M") - { - mensile = true; - enable(F_MESE); - disable(F_TRIMESTRE); - } - else - { - mensile = false; - disable(F_MESE); - enable(F_TRIMESTRE); - } - break; - } - } break; case F_MESE: if(e == fe_modify && mensile) set(F_TRIMESTRE, (get_int(F_MESE) - 1) / 3 + 1); break; case F_TRIMESTRE: - if(e == fe_modify && !mensile) + if(e == fe_init && !query_mode()) + disable(F_TRIMESTRE); + if(e == fe_modify && !mensile && query_mode()) + { set(F_MESE, get_int(F_TRIMESTRE) * 3); + disable(F_TRIMESTRE); + send_key(K_TAB, F_ANNO); + } + break; + case DLG_CANCEL: + enable(F_TRIMESTRE); break; case DLG_RECALC: // Vado a prendere i dati di quel mese dalla liquidazione IVA diff --git a/src/tf/tf0200a.uml b/src/tf/tf0200a.uml index 372f62766..a55331857 100644 --- a/src/tf/tf0200a.uml +++ b/src/tf/tf0200a.uml @@ -66,7 +66,7 @@ BEGIN OUTPUT F_TRIMESTRE TRIMESTRE KEY 1 CHECKTYPE REQUIRED - FLAGS "A" + FLAGS "" WARNING "Inserire un anno di liquidazione" END diff --git a/src/tf/tf0500.cpp b/src/tf/tf0500.cpp index a1c60c3e4..c95ff17ee 100644 --- a/src/tf/tf0500.cpp +++ b/src/tf/tf0500.cpp @@ -135,6 +135,10 @@ bool TIvaSend_msk::on_field_event(TOperable_field& o, TField_event e, long jolly if(e == fe_modify) set(F_AMESE, get_int(F_DAMESE)+2); break; + case F_DATRIMESTRE: + if(e == fe_modify) + set(F_ATRIMESTRE, get_int(F_DATRIMESTRE)); + break; } return true; } @@ -270,8 +274,20 @@ TToken_string TIvaSend_app::getTestata(TIvaSend_msk& msk) testata.add(""); // P.IVA Controllante testata.add(""); // Flag Liq. gruppo testata.add(""); // Flag firma comunicazione - testata.add(""); // Cod.Fisc. Dichiarante - testata.add(""); // Cod.Carica Dichiarante + + int codiceCarica = atoi(prefix().firm().get("CARRAPP")); + if(codiceCarica > 0) + { + TString key = "F|"; key << prefix().firm().get("RAPPR"); + TString codFisc = cache().get(LF_ANAG, key, "COFI"); + testata.add(codFisc); // Cod.Fisc. Dichiarante + testata.add(codiceCarica); // Cod.Carica Dichiarante + } + else + { + testata.add(""); // Cod.Fisc. Dichiarante + testata.add(""); // Cod.Carica Dichiarante + } testata.add(""); // Cod.Fisc. Soc. Dichiarante testata.add(""); // Cod.Fisc. Intermediario testata.add(""); // Flag Impegno