Patch level : 12.0 464

Files correlati     : tf
Commento            : 
- Tolta sovrascrittura flag inviato durante salvataggio record custom in prima nota
- Aggiunto flag "Inviato" nella tabella
- Cambiata scritta "Forzata" a "Modificata" per migliore comprensione
- Aggiunta nuova funzione filtro che si appoggia a quella della maschera, così facendo riesco a filtrare record con stati differenti tra prima nota e Trasferimento fatture (vedi primo punto)
- Tolto vecchio filtro flag invio

git-svn-id: svn://10.65.10.50/branches/R_10_00@24133 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
mtollari 2017-10-06 07:26:58 +00:00
parent 6253ac34a0
commit 0902283d6a
4 changed files with 25 additions and 40 deletions

View File

@ -242,14 +242,6 @@ bool saveRec(TToken_string row, bool esportato)
if(rCust.empty())
{
rCust.put("NUMREG", row.get(_numero));
// Se il record viene creato al momento svuoto per sicurezza i valori TFINVIO e TFDATA in MOV
if(row.get_int(_numero) < MOV_CUSTOM)
{
TRectype rOrig = cache().get(LF_MOV, row.get(_numero));
rOrig.put("TFINVIO", "");
rOrig.put("TFDATA", "");
rOrig.rewrite(mov);
}
}
rCust.put("TIPO", row.get(_tipocf));
rCust.put("CODCF", row.get(_codcf));

View File

@ -186,7 +186,7 @@ BEGIN
ITEM "Auto\nfatt.@3"
ITEM "Spedita@5"
ITEM "Inviare@5"
ITEM "Forzata@10"
ITEM "Modificata@10"
ITEM "N.\nRegistraz.@10"
ITEM "Codici Errori@10"
@ -209,6 +209,7 @@ LIST A_INVIO 1 15
BEGIN
PROMPT 1 10 "Da inviare"
ITEM "X|X, Da Inviare"
ITEM "I|I, Inviato"
ITEM "N|N, Disabilitato"
ITEM "F|F, Forzato"
ITEM "E|E, Errato"

View File

@ -175,6 +175,7 @@ class TTrFa_cursors : TObject
TRectype _next(return_code& code, TString& tipocf, TString& codcf, TString& ocfpi); // Si sposta avanti di un elemento
TRectype _nextCust(return_code& code, TString& tipocf, TString& codcf, TString& ocfpi); // Si sposta avanti di un elemento tra quelli custom
bool checkEnabled(TISAM_recordset* origCur);
public:
//TTrFa_cursors();
~TTrFa_cursors();

View File

@ -93,7 +93,7 @@ TRectype TTrFa_cursors::_next(return_code& code, TString& tipocf, TString& codcf
codiva.cut(0) << c_rmoviva->get("25.CODIVA").as_string();
}
} // Ciclo finchè non trovo un nuovo movimento o trovo cod IVA già presi da cust
while(!checkRecord(c_rmoviva) || (!_newMov && _alqCust.get_pos(codiva) > -1));
while((!_newMov && _alqCust.get_pos(codiva) > -1) || !checkEnabled(c_rmoviva) || !checkRecord(c_rmoviva));
}
// Se ho cambiato movimento ritorno, leggerò poi al prossimo giro
@ -159,6 +159,27 @@ TRectype TTrFa_cursors::_nextCust(return_code& code, TString& tipocf, TString& c
return c_trasfatt->cursor()->curr();
}
bool TTrFa_cursors::checkEnabled(TISAM_recordset* origCur)
{
// Controllo che il record sia effettivamente abilitato
static TString flag; flag.cut(0);
// Controllo se sono su un movimento custom
if(origCur->find_column("MOV.REG") >= 0)
{
TRectype rCust = getTrasFatt(c_rmoviva->get("23.NUMREG").as_string(), c_rmoviva->get("25.CODIVA").as_string());
if(rCust.empty())
flag << origCur->get("23.TFINVIO");
else
flag << rCust.get("TFINVIO");
}
else
{
flag << origCur->get("TFINVIO").as_string();
}
return msk().checkInvio(flag);
}
int TTrFa_cursors::updateFilters(const char tipocf, const long codcf, TDate dal, TDate al, int cod)
{
@ -172,36 +193,6 @@ int TTrFa_cursors::updateFilters(const char tipocf, const long codcf, TDate dal,
queryCust << "&&STR((CODCF=#CODCF))";
}
switch(cod)
{
case toSend:
query << "&&((23.TFINVIO=\"\")||(23.TFINVIO=\"X\")||(23.TFINVIO=\"F\"))";
queryCust << "&&((TFINVIO=\"\")||(TFINVIO=\"X\")||(TFINVIO=\"F\"))";
break;
case sent:
query << "&&(23.TFINVIO=\"I\")";
queryCust << "&&(TFINVIO=\"I\")";
break;
case untouched:
query << "&&((23.TFINVIO=\"\")||(23.TFINVIO=\"X\")";
queryCust << "&&((TFINVIO=\"\")||(TFINVIO=\"X\")";
break;
case forced:
query << "&&(23.TFINVIO=\"F\")";
queryCust << "&&(TFINVIO=\"F\")";
break;
case disabled:
query << "&&(23.TFINVIO=\"N\")";
queryCust << "&&(TFINVIO=\"N\")";
case err:
query << "&&(23.TFINVIO=\"E\")";
queryCust << "&&(TFINVIO=\"E\")";
break;
case all:
default:
break;
}
query << "\nJOIN MOV INTO NUMREG==NUMREG\n";
queryCust << "\nFROM NUMREG=" << MOV_CUSTOM;