Patch level : 12.0 386

Files correlati     : tf
Commento            : 
- Aggiunti trick per far andare chiave la chiave "MESE" con liquidazione trimestrale in tf0200
- Aggiunta lettura rappresentante in tf0500

git-svn-id: svn://10.65.10.50/branches/R_10_00@23781 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
mtollari 2017-05-05 13:19:12 +00:00
parent 75216c1af6
commit 04e37cc8d6
3 changed files with 29 additions and 31 deletions

View File

@ -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

View File

@ -66,7 +66,7 @@ BEGIN
OUTPUT F_TRIMESTRE TRIMESTRE
KEY 1
CHECKTYPE REQUIRED
FLAGS "A"
FLAGS ""
WARNING "Inserire un anno di liquidazione"
END

View File

@ -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