Patch level : 12.0 456
Files correlati : tf Commento : - Potenziate le chiavi durante l'esportazione con l'aggiunta del codice cli/fo occasionale - Portata chiave header da 7 caratteri (tipo + codcf) a 19 (tipo + cod o c/f o occas) - Creata funzione globale per richiamare la maschera - Sistemato controllo tipo documento durante il caricamento - Migliorato controllo cli/fo per i record da filtrare git-svn-id: svn://10.65.10.50/branches/R_10_00@24109 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
d9703da385
commit
49c150e489
@ -291,6 +291,14 @@ bool bd2017()
|
|||||||
return today <= lastDay;
|
return today <= lastDay;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TTrFa_mask& msk()
|
||||||
|
{
|
||||||
|
static TTrFa_mask* msk = NULL;
|
||||||
|
if (msk == NULL)
|
||||||
|
msk = new TTrFa_mask("tf0100a");
|
||||||
|
return *msk;
|
||||||
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
// TTrFa_record
|
// TTrFa_record
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -833,8 +841,8 @@ TString TTrFa_app::getHeader(TToken_string* strarr)
|
|||||||
|
|
||||||
// Cerco/Aggiungo il Clifo all'std::map
|
// Cerco/Aggiungo il Clifo all'std::map
|
||||||
static TString keyMap; keyMap.cut(0);
|
static TString keyMap; keyMap.cut(0);
|
||||||
static TString tipocf, codcf;
|
static TString tipocf, codcf, occas;
|
||||||
tipocf.cut(0); codcf.cut(0);
|
tipocf.cut(0); codcf.cut(0); occas.cut(0);
|
||||||
|
|
||||||
// Controlli per bolladog
|
// Controlli per bolladog
|
||||||
if(strcmp(strarr->get(_codnum),"BD") == 0)
|
if(strcmp(strarr->get(_codnum),"BD") == 0)
|
||||||
@ -848,9 +856,10 @@ TString TTrFa_app::getHeader(TToken_string* strarr)
|
|||||||
{
|
{
|
||||||
tipocf << strarr->get_char(_tipocf);
|
tipocf << strarr->get_char(_tipocf);
|
||||||
codcf << strarr->get(_codcf);
|
codcf << strarr->get(_codcf);
|
||||||
|
occas << strarr->get(_occas);
|
||||||
}
|
}
|
||||||
|
|
||||||
keyMap << tipocf << "|" << codcf;
|
keyMap << tipocf << "|" << codcf << "|" << occas;
|
||||||
|
|
||||||
clifoDoc app;
|
clifoDoc app;
|
||||||
// Non è presente e lo inserisco per la chiave body
|
// Non è presente e lo inserisco per la chiave body
|
||||||
@ -861,7 +870,21 @@ TString TTrFa_app::getHeader(TToken_string* strarr)
|
|||||||
app.countDoc = 0L;
|
app.countDoc = 0L;
|
||||||
mCliDoc.insert(std::pair<TString,clifoDoc>(keyMap, app));
|
mCliDoc.insert(std::pair<TString,clifoDoc>(keyMap, app));
|
||||||
}
|
}
|
||||||
TString header; header.format("%c%06ld", tipocf[0], atol(codcf));
|
static TString header;
|
||||||
|
static TString formatString; formatString.cut(0) << "%c%0";
|
||||||
|
if(occas.blank())
|
||||||
|
{
|
||||||
|
formatString << 18 - codcf.len() << "d";
|
||||||
|
header.format(formatString, tipocf[0], 0);
|
||||||
|
header << codcf; // Perchè cazzo non va il %s!?
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
formatString << 18 - occas.len() << "d";
|
||||||
|
header.format(formatString, 'O', 0);
|
||||||
|
header << occas;
|
||||||
|
}
|
||||||
|
|
||||||
// Ritorno l'header
|
// Ritorno l'header
|
||||||
return header;
|
return header;
|
||||||
}
|
}
|
||||||
@ -878,7 +901,7 @@ TString TTrFa_app::getBody(TToken_string* strarr, bool add)
|
|||||||
/* Sembra che utilizzare identificatori chiari e sensati in questo mondo non è concesso, quindi adesso vi sbatto un bell'ID numerico
|
/* Sembra che utilizzare identificatori chiari e sensati in questo mondo non è concesso, quindi adesso vi sbatto un bell'ID numerico
|
||||||
* Ok per OGNI cliente devo assegnarli un identificativo del numero della fattura
|
* Ok per OGNI cliente devo assegnarli un identificativo del numero della fattura
|
||||||
*/
|
*/
|
||||||
static TString keyMap; keyMap.cut(0) << strarr->get_char(_tipocf) << "|" << strarr->get_int(_codcf);
|
static TString keyMap; keyMap.cut(0) << strarr->get_char(_tipocf) << "|" << strarr->get_int(_codcf) << "|" << strarr->get(_occas);
|
||||||
|
|
||||||
clifoDoc app = mCliDoc[keyMap];
|
clifoDoc app = mCliDoc[keyMap];
|
||||||
if(add)
|
if(add)
|
||||||
@ -1106,7 +1129,11 @@ bool TTrFa_app::tff0400(TSheet_field& sheet)
|
|||||||
}
|
}
|
||||||
if(!foundBolla)
|
if(!foundBolla)
|
||||||
{
|
{
|
||||||
checkClifo << strarr->get_char(_tipocf) << strarr->get_long(_codcf);
|
static TString tempOcfpi; tempOcfpi.cut(0) << strarr->get(_occas);
|
||||||
|
if(tempOcfpi.blank())
|
||||||
|
checkClifo << strarr->get_char(_tipocf) << "|" << strarr->get_long(_codcf);
|
||||||
|
else
|
||||||
|
checkClifo << strarr->get_char(_tipocf) << "|" << strarr->get(_occas);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Controllo il clifo, se non c'è lo aggiungo altrimenti salto sto giro
|
// Controllo il clifo, se non c'è lo aggiungo altrimenti salto sto giro
|
||||||
@ -1315,7 +1342,14 @@ bool TTrFa_app::tff0700(TSheet_field& sheet)
|
|||||||
|
|
||||||
// Chiave: Tipo C/F, Cod C/F, Numero doc. anno doc
|
// Chiave: Tipo C/F, Cod C/F, Numero doc. anno doc
|
||||||
static TString checkFatt;
|
static TString checkFatt;
|
||||||
checkFatt.cut(0) << strarr->get_long(_codcf) << "," << strarr->get(_numdoc) << "," << TString(strarr->get(_datadoc)).right(4);
|
static TString codcf;
|
||||||
|
|
||||||
|
// Prendo il cliente occasionale se c'è
|
||||||
|
codcf.cut(0) << strarr->get(_occas);
|
||||||
|
if(codcf.blank())
|
||||||
|
codcf.cut(0) << strarr->get(_codcf);
|
||||||
|
|
||||||
|
checkFatt.cut(0) << codcf << "," << strarr->get(_numdoc) << "," << TString(strarr->get(_datadoc)).right(4);
|
||||||
|
|
||||||
if(fattSent.find(checkFatt) == fattSent.end())
|
if(fattSent.find(checkFatt) == fattSent.end())
|
||||||
{
|
{
|
||||||
@ -1502,14 +1536,12 @@ void TTrFa_app::main_loop()
|
|||||||
{
|
{
|
||||||
// Sposto SSA
|
// Sposto SSA
|
||||||
if(!copySSA()) return;
|
if(!copySSA()) return;
|
||||||
|
|
||||||
TTrFa_mask msk("tf0100a");
|
|
||||||
|
|
||||||
while (msk.run() == K_ENTER)
|
while (msk().run() == K_ENTER)
|
||||||
{
|
{
|
||||||
if(msk.checkNotEmpty())
|
if(msk().checkNotEmpty())
|
||||||
{
|
{
|
||||||
send(&msk);
|
send(&msk());
|
||||||
//ini_set_string(CONFIG_DITTA, "tf", "LastSend", ++TDate(msk.get(F_DATAFIN)));
|
//ini_set_string(CONFIG_DITTA, "tf", "LastSend", ++TDate(msk.get(F_DATAFIN)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -228,6 +228,7 @@ public:
|
|||||||
};
|
};
|
||||||
// Funzione inline di stampa
|
// Funzione inline di stampa
|
||||||
inline void printError(TPrinter* stampa, TString movimento, TString documento, TString msgerr);
|
inline void printError(TPrinter* stampa, TString movimento, TString documento, TString msgerr);
|
||||||
|
TTrFa_mask& msk();
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////
|
||||||
// TTrFa_app
|
// TTrFa_app
|
||||||
|
@ -74,7 +74,7 @@ TRectype TTrFa_cursors::_next(return_code& code, TString& tipocf, TString& codcf
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Se non è un movimento o il controllo fallisce mi sposto
|
// Se non è un movimento o il controllo fallisce mi sposto
|
||||||
if(!newMov || !checkRecord(c_rmoviva))
|
if(!newMov || !checkRecord(c_rmoviva) || !msk().get_bool(getTipoDoc(c_rmoviva->get("23.TIPODOC").as_string())))
|
||||||
{
|
{
|
||||||
TString codiva;
|
TString codiva;
|
||||||
do
|
do
|
||||||
|
@ -83,11 +83,9 @@ TString getRFSO(TString codrfso)
|
|||||||
*/
|
*/
|
||||||
bool checkRecord(TISAM_recordset* rec)
|
bool checkRecord(TISAM_recordset* rec)
|
||||||
{
|
{
|
||||||
|
TAnagrafica anaCli(rec->get("23.TIPO").as_string()[0], rec->get("23.CODCF").as_int(), rec->get("23.OCFPI").as_string());
|
||||||
TString keyClifo; keyClifo << rec->get("23.TIPO").as_string() << "|" << rec->get("23.CODCF").as_string();
|
|
||||||
TRectype rclifo = cache().get(LF_CLIFO, keyClifo);
|
|
||||||
// Salto le schede carburanti
|
// Salto le schede carburanti
|
||||||
if(rclifo.get("ALLEG") == "C")
|
if(anaCli.inserimento_in_allegato() == 'C')
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Clienti
|
// Clienti
|
||||||
@ -97,7 +95,7 @@ bool checkRecord(TISAM_recordset* rec)
|
|||||||
TCausale caus(rec->get("23.CODCAUS").as_string());
|
TCausale caus(rec->get("23.CODCAUS").as_string());
|
||||||
if(caus.soloiva() && (caus.reverse_charge() || caus.regime_speciale() == 3))
|
if(caus.soloiva() && (caus.reverse_charge() || caus.regime_speciale() == 3))
|
||||||
return false;
|
return false;
|
||||||
} else if((rclifo.get("STATOPAIV").blank() || rclifo.get("STATOPAIV") == "IT") && rclifo.get("PAIV")[0] != '0' && rclifo.get("PAIV")[0] != '1' && (rclifo.get("COFI")[0] == '8' || rclifo.get("COFI")[0] == '9'))
|
} else if(anaCli.italiano() && anaCli.partita_IVA()[0] != '0' && anaCli.partita_IVA()[0] != '1' && anaCli.codice_fiscale()[0] > '8')
|
||||||
// Salto tutti i fornitori con cod cf che inizia per 8 o 9 e con p.iva non valida
|
// Salto tutti i fornitori con cod cf che inizia per 8 o 9 e con p.iva non valida
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user