Patch level : 12.0 464

Files correlati     : tf
Commento            : 
- Aggiornata maschera: aggiunti più filtri per gli stati dei movimenti
- Sistemato errore durante il salvataggio dei movimenti custom
- Forzato salvataggio stato movimento per tutti gli stati
- Tolta per una maggiore chiarezza la forzatura del flag di inviato per tutti i record caricati, adesso si vede lo stato presente sul database (ovviamente se i record non hanno stato sarà "Inviare" di default). ATTENZIONE!! tutti i record che hanno uno stato compreso tra "Da inviare", "Forzato" o "Inviato" verranno esportati una volta lanciata l'esportazione.
- Sistemata tabella durante l'impostazione del flag di forzato, adesso agisce sulla singola riga e non su tutto il documento
- Sistemato errore di moltiplicazione dei record custom se presenti in prima nota più righe con la stessa aliquota

git-svn-id: svn://10.65.10.50/branches/R_10_00@24131 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
mtollari 2017-10-05 14:23:59 +00:00
parent eec53aee87
commit 6253ac34a0
6 changed files with 74 additions and 26 deletions

View File

@ -234,8 +234,8 @@ bool saveRec(TToken_string row, bool esportato)
{
static TLocalisamfile trasfatt(LF_TRASFATT);
static TLocalisamfile mov(LF_MOV);
TString key = row.get(_numero); key << "|"<< row.get(_aliquota);
static TString invio; invio.cut(0);
static TString key; key.cut(0) << row.get(_numero) << "|"<< row.get(_aliquota);
TRectype rCust = cache().get(LF_TRASFATT, key);
// Se la riga non esiste metto la chiave
@ -243,10 +243,13 @@ bool saveRec(TToken_string row, bool esportato)
{
rCust.put("NUMREG", row.get(_numero));
// Se il record viene creato al momento svuoto per sicurezza i valori TFINVIO e TFDATA in MOV
TRectype rOrig = cache().get(LF_MOV, row.get(_numero));
rOrig.put("TFINVIO", "");
rOrig.put("TFDATA", "");
rOrig.rewrite(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));
@ -262,10 +265,16 @@ bool saveRec(TToken_string row, bool esportato)
rCust.put("AUTOFATT", row.get(_autofatt));
if(esportato)
{
TString invio = esportato? "I" : row.get(_invio);
rCust.put("TFINVIO", invio);
invio << "I";
rCust.put("TFDATA", TDate(TODAY));
}
else
{
invio << row.get(_invio);
}
rCust.put("TFINVIO", invio);
return rCust.write_rewrite(trasfatt) == NOERR;
}

View File

@ -18,7 +18,7 @@
#define B_TIPO_BOLLADOG 413
#define B_TIPO_STORDOC 414
#define END_BOOLEAN 414
#define END_BOOLEAN 415
#define END_MASK 421

View File

@ -105,7 +105,11 @@ BEGIN
PROMPT 1 6 "Fatture da visualizzare"
ITEM "0|Da inviare"
ITEM "1|Inviate"
ITEM "2|Disabilitate"
ITEM "2|Mai elaborati"
ITEM "3|Forzate"
ITEM "4|Errate"
ITEM "5|Disabilitate"
ITEM "6|Tutti"
END
GROUPBOX DLG_NULL 65 4

View File

@ -39,9 +39,13 @@ enum return_code
// Su DB: X o ''->Da inviare, F->Forzato, I->Inviato, N->Non inviare
enum filter_fatt
{
toSend, // Da inviare
sent, // Inviate
disabled // Disabilitate
toSend, // "", "X", "F", "E"
sent, // "I"
untouched, // "", "X"
forced, // "F"
disabled, // "N"
err, // "E"
all // Nessun controllo
};
#define SHEET_GAP 101
@ -107,7 +111,7 @@ bool saveRec(TToken_string row, bool esportato = false);
// Ritorno una data in formato ANSI
inline TDate toDate(const char * date) { return TDate(date).string(); }
// Salto se la riga non è abilitata
#define IF_IS_ENABLED(strarr) if(strcmp(strarr->get(_invio), FLAG_INVIO) != 0 && strcmp(strarr->get(_invio), FLAG_FORZATO) != 0) continue;
#define IF_IS_ENABLED(strarr) if(strcmp(strarr->get(_invio), FLAG_INVIO) != 0 && strcmp(strarr->get(_invio), FLAG_FORZATO) != 0 && strcmp(strarr->get(_invio), FLAG_INVIATO) != 0) continue;
// Ritorno il carattere senza accento maiuscolo
inline const char * noSpecial(char a);
// Ritorno se è ancora valida la bolla doganale senza informazioni fornitore

View File

@ -306,7 +306,7 @@ bool TTrFa_mask::on_field_event(TOperable_field& o, TField_event e, long jolly)
else
{
TString invio = o.mask().get(A_INVIO);
if(invio != FLAG_FORZATO || invio != FLAG_ERRORE)
if(invio != FLAG_FORZATO && invio != FLAG_ERRORE)
changeInvio(o.mask().get(A_TIPOCF), o.mask().get(A_CODCF), o.mask().get(A_NUMDOC), invio);
}
}
@ -655,12 +655,13 @@ void TTrFa_mask::load_sheet()
* basta settare i valori negli enum e lo sheet
*/
TRectype isCust = getTrasFatt(movimento.get("NUMREG"), iva);
#ifdef DBG
if(isCust.full() && (err < foundcust || err > foundidcust))
bool tolla = true;
row.add(movimento.get("TFINVIO") == "I" ? "X" : "", _spedita); // Spedita
row.add("X"); // Da spedire, sempre!
#endif
const char * toSend = movimento.get("TFINVIO").blank() ? FLAG_INVIO : movimento.get("TFINVIO");
row.add(movimento.get("TFINVIO") == FLAG_INVIATO ? "X" : "", _spedita); // Spedita
row.add(toSend); // Da spedire
row.add(isCust.full() ? "X" : "", _forzata); // Modificato
row.add(movimento.get_long("NUMREG"), _numero); // Numero registrazione
row.add(movimento.get_date("DATAREG"), _datareg); // Data Registrazione
@ -712,16 +713,27 @@ bool TTrFa_mask::checkInvio(const TString& invio)
bool ok;
switch(get_int(F_FATTSEL))
{
case 0:
case toSend:
ok = invio == "" || invio == FLAG_INVIO || invio == FLAG_FORZATO || invio == FLAG_ERRORE;
break;
case 1:
case sent:
ok = invio == FLAG_INVIATO;
break;
case 2:
default:
case untouched:
ok = invio == "" || invio == FLAG_INVIO;
case forced:
ok = invio == FLAG_FORZATO;
break;
case disabled:
ok = invio == FLAG_NINVIO;
break;
case err:
ok = invio == FLAG_ERRORE;
break;
case all:
default:
ok = true;
break;
}
return ok;
}

View File

@ -77,7 +77,7 @@ TRectype TTrFa_cursors::_next(return_code& code, TString& tipocf, TString& codcf
int tipoDoc = getTipoDoc(c_rmoviva->get("23.TIPODOC").as_string());
if(!newMov || !checkRecord(c_rmoviva) || tipoDoc == -1 || !msk().get_bool(tipoDoc))
{
TString codiva;
static TString codiva;
do
{
// Se ritorna false ho finito i records
@ -90,6 +90,7 @@ TRectype TTrFa_cursors::_next(return_code& code, TString& tipocf, TString& codcf
{
// Controllo se ho cambiato movimento
_newMov = numMov != c_rmoviva->get("23.NUMREG").as_string();
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));
@ -105,6 +106,11 @@ TRectype TTrFa_cursors::_next(return_code& code, TString& tipocf, TString& codcf
else
code = found;
#ifdef DBG
if(c_rmoviva->get("23.NUMREG").as_int() == 1930131)
bool tolla = true;
#endif
// Controllo dell'esistenza di un record custom in tasfatt
retRec = getTrasFatt(c_rmoviva->get("23.NUMREG").as_string(), c_rmoviva->get("25.CODIVA").as_string());
if(retRec.empty())
@ -169,16 +175,29 @@ int TTrFa_cursors::updateFilters(const char tipocf, const long codcf, TDate dal,
switch(cod)
{
case toSend:
query << "&&((23.TFINVIO=\"\")||(23.TFINVIO=\"X\")||(23.TFINVIO=\"F\")||(23.TFINVIO=\"E\"))";
queryCust << "&&((TFINVIO=\"\")||(TFINVIO=\"X\")||(TFINVIO=\"F\")||(TFINVIO=\"E\"))";
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;
}