Patch level : 12.0 550
Files correlati : bs Commento : - Tolti commenti log inutili Articoli: - Aggiunta contropartita fiscale Clienti: - Aggiunto numero civico, veniva calcolato ma non inserito - Impostati true di default ragg effetti e addebito bolle rit banc - Aggiunto codice assoggettamento fiscale - Sistemato campo cod fisc Documenti: - Aggiunto agente - Aggiunto codice pagamento - Aggiunto controllo più severo sulla validità del record git-svn-id: svn://10.65.10.50/branches/R_10_00@24439 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
80b73c800b
commit
dffa0c0d41
@ -117,7 +117,9 @@ public:
|
|||||||
return anag(tipo, codice);
|
return anag(tipo, codice);
|
||||||
}
|
}
|
||||||
const TAnagrafica& anag(const TISAM_recordset& rec)
|
const TAnagrafica& anag(const TISAM_recordset& rec)
|
||||||
{ return anag(rec.cursor()->curr()); }
|
{
|
||||||
|
return anag(rec.cursor()->curr());
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static TSknet_cache _anagr;
|
static TSknet_cache _anagr;
|
||||||
@ -137,10 +139,14 @@ public:
|
|||||||
void autosave() const;
|
void autosave() const;
|
||||||
|
|
||||||
bool get_bool(const char* fld)
|
bool get_bool(const char* fld)
|
||||||
{ TMask_field* f = find_by_fieldname(fld); return f ? f->get().full() : false; }
|
{
|
||||||
|
TMask_field* f = find_by_fieldname(fld); return f ? f->get().full() : false;
|
||||||
|
}
|
||||||
|
|
||||||
TDate get_date(const char* fld)
|
TDate get_date(const char* fld)
|
||||||
{ TMask_field* f = find_by_fieldname(fld); return TDate(f ? f->get() : EMPTY_STRING); }
|
{
|
||||||
|
TMask_field* f = find_by_fieldname(fld); return TDate(f ? f->get() : EMPTY_STRING);
|
||||||
|
}
|
||||||
|
|
||||||
TSknet_mask() : TAutomask("bs0300a") { autoload(); }
|
TSknet_mask() : TAutomask("bs0300a") { autoload(); }
|
||||||
~TSknet_mask() { autosave(); }
|
~TSknet_mask() { autosave(); }
|
||||||
@ -357,9 +363,7 @@ void TSknet_sync::load_their_origine(TISAM_recordset& out_set, const char* in_ta
|
|||||||
str << " Data di ultimo aggiornamento obsoleta";
|
str << " Data di ultimo aggiornamento obsoleta";
|
||||||
if (dirty)
|
if (dirty)
|
||||||
{
|
{
|
||||||
if (file.rewrite() == 0)
|
if (file.rewrite() != 0)
|
||||||
_log->log(1, str);
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
TString80 err; err << TR("ERRORE ") << err << TR(" aggiornando il ");
|
TString80 err; err << TR("ERRORE ") << err << TR(" aggiornando il ");
|
||||||
str.insert(err);
|
str.insert(err);
|
||||||
@ -368,10 +372,10 @@ void TSknet_sync::load_their_origine(TISAM_recordset& out_set, const char* in_ta
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_log->log(0, str);
|
|
||||||
file.reread(_unlock);
|
file.reread(_unlock);
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
if (err == _iskeynotfound)
|
if (err == _iskeynotfound)
|
||||||
{
|
{
|
||||||
file.zero();
|
file.zero();
|
||||||
@ -473,6 +477,9 @@ void TSknet_sync::sync_anamag()
|
|||||||
fields.add("CodIva|" ANAMAG_CODIVA);
|
fields.add("CodIva|" ANAMAG_CODIVA);
|
||||||
fields.add("CodLinea|" ANAMAG_GRMERC "|1|3");
|
fields.add("CodLinea|" ANAMAG_GRMERC "|1|3");
|
||||||
fields.add("CodCategMerceologica|" ANAMAG_GRMERC);
|
fields.add("CodCategMerceologica|" ANAMAG_GRMERC);
|
||||||
|
fields.add("ArtGruppo|" ANAMAG_GRUPPOV);
|
||||||
|
fields.add("ArtConto|" ANAMAG_CONTOV);
|
||||||
|
fields.add("ArtSottoconto|" ANAMAG_SOTTOCV);
|
||||||
fields.add("Bloccato|" ANAMAG_SOSPESO);
|
fields.add("Bloccato|" ANAMAG_SOSPESO);
|
||||||
|
|
||||||
TString query = build_query(LF_ANAMAG);
|
TString query = build_query(LF_ANAMAG);
|
||||||
@ -786,7 +793,7 @@ void TSknet_sync::load_clifo(const char tipocf)
|
|||||||
|
|
||||||
clifo.put(CLI_RAGSOC, odbc.get("RagSoc").as_string());
|
clifo.put(CLI_RAGSOC, odbc.get("RagSoc").as_string());
|
||||||
clifo.put(CLI_PAIV, odbc.get("PartitaIva").as_string());
|
clifo.put(CLI_PAIV, odbc.get("PartitaIva").as_string());
|
||||||
clifo.put(CLI_COFI, odbc.get("CodiceFiscale").as_string());
|
clifo.put(CLI_COFI, odbc.get("CodFiscale").as_string());
|
||||||
clifo.put(CLI_MAIL, odbc.get("EMail").as_string());
|
clifo.put(CLI_MAIL, odbc.get("EMail").as_string());
|
||||||
|
|
||||||
const int tipo = odbc.get("Tipo").as_int(); // 1=Fisica; 2=Giuridica; 3=Altro
|
const int tipo = odbc.get("Tipo").as_int(); // 1=Fisica; 2=Giuridica; 3=Altro
|
||||||
@ -814,6 +821,7 @@ void TSknet_sync::load_clifo(const char tipocf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
clifo.put(CLI_INDCF, ind.left(50));
|
clifo.put(CLI_INDCF, ind.left(50));
|
||||||
|
clifo.put(CLI_CAPCF, civ);
|
||||||
clifo.put(CLI_CAPCF, odbc.get("Cap").as_string());
|
clifo.put(CLI_CAPCF, odbc.get("Cap").as_string());
|
||||||
|
|
||||||
// Stato
|
// Stato
|
||||||
@ -943,14 +951,23 @@ void TSknet_sync::load_clifo(const char tipocf)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err == NOERR)
|
// Abi e Cab sempre, posso anche avere solo il primo dei due
|
||||||
{
|
|
||||||
cfb.put("ABI", abi);
|
cfb.put("ABI", abi);
|
||||||
cfb.put("CAB", cab);
|
cfb.put("CAB", cab);
|
||||||
|
// Il conto corrente ovviamente solo se è giusto
|
||||||
|
if (err == NOERR)
|
||||||
|
{
|
||||||
cfb.put("NUMCC", contcor);
|
cfb.put("NUMCC", contcor);
|
||||||
cfb.put("IBAN", iban);
|
cfb.put("IBAN", iban);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Always true
|
||||||
|
cfv.put(CFV_RAGGEFF, true);
|
||||||
|
cfv.put(CFV_ADDBOLLI, true);
|
||||||
|
|
||||||
|
// Non ho capito se alla fine mi passa qua i dati o nel campo NOTE
|
||||||
|
cfv.put(CFV_ASSFIS, tipocf == 'C' ? odbc.get("Cli_CodIva").as_string() : odbc.get("For_CodIva").as_string());
|
||||||
|
|
||||||
// Parso il campo Note
|
// Parso il campo Note
|
||||||
TToken_string note(odbc.get("Note").as_string());
|
TToken_string note(odbc.get("Note").as_string());
|
||||||
if (!note.blank() && note[note.len() - 1] == '|')
|
if (!note.blank() && note[note.len() - 1] == '|')
|
||||||
@ -976,11 +993,13 @@ void TSknet_sync::load_clifo(const char tipocf)
|
|||||||
nonscd.cut(nonscd.len() - 1);
|
nonscd.cut(nonscd.len() - 1);
|
||||||
cfv.put(CFV_NONACCEFF, nonacc);
|
cfv.put(CFV_NONACCEFF, nonacc);
|
||||||
cfv.put(CFV_NONSCADEFF, nonscd);
|
cfv.put(CFV_NONSCADEFF, nonscd);
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
if (token.starts_with("RE="))
|
if (token.starts_with("RE="))
|
||||||
{
|
{
|
||||||
cfv.put(CFV_RAGGEFF, token == "RE=X");
|
// Disabled, always true by analysis
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
if (token.starts_with("NOTE="))
|
if (token.starts_with("NOTE="))
|
||||||
{
|
{
|
||||||
TString note = token.mid(5);
|
TString note = token.mid(5);
|
||||||
@ -1000,22 +1019,31 @@ void TSknet_sync::load_clifo(const char tipocf)
|
|||||||
clifo.put(CLI_BYMAIL, bymail);
|
clifo.put(CLI_BYMAIL, bymail);
|
||||||
clifo.put(CLI_DOCMAIL, email);
|
clifo.put(CLI_DOCMAIL, email);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (token.starts_with("REF="))
|
if (token.starts_with("REF="))
|
||||||
{
|
{
|
||||||
clifo.put(CLI_REFERENTE, token.mid(4));
|
clifo.put(CLI_REFERENTE, token.mid(4));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (token.starts_with("EDOC="))
|
if (token.starts_with("EDOC="))
|
||||||
{
|
{
|
||||||
clifo.put(CLI_BYMAIL, true);
|
clifo.put(CLI_BYMAIL, true);
|
||||||
clifo.put(CLI_DOCMAIL, token.mid(5));
|
clifo.put(CLI_DOCMAIL, token.mid(5));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (token.starts_with("SCONTO="))
|
if (token.starts_with("SCONTO="))
|
||||||
{
|
{
|
||||||
clifo.put(CLI_SCONTO, token.mid(7));
|
cfv.put(CFV_SCONTO, token.mid(7));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (token.starts_with("AGENT="))
|
if (token.starts_with("AGENT="))
|
||||||
{
|
{
|
||||||
clifo.put(CLI_CODAG, token.mid(6));
|
cfv.put(CFV_CODAG, token.mid(6));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (token.starts_with("ASSFIS="))
|
||||||
|
{
|
||||||
|
cfv.put(CFV_ASSFIS, token.mid(7));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1200,8 +1228,12 @@ void TSknet_sync::sync_doc()
|
|||||||
codcf = atol(wrk);
|
codcf = atol(wrk);
|
||||||
tipocf = docs.get("TipoIntestatario").as_string();
|
tipocf = docs.get("TipoIntestatario").as_string();
|
||||||
|
|
||||||
if (tipocf != "C" && tipocf != "F")
|
if ((tipocf != "C" && tipocf != "F") || codcf == 0)
|
||||||
warning_box("Attenzione! Per il doc n.%d è presente il tipo C/F = '%s'\nIl documento verrà saltato.", nd , tipocf);
|
{
|
||||||
|
TString msg; msg.format("Attenzione! Per il doc n.%d è presente il tipo C/F = '%s' con cod = %d \nIl documento verrà saltato.", nd, tipocf, codcf);
|
||||||
|
_log->log(1, msg);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (nd != num_doc)
|
if (nd != num_doc)
|
||||||
{
|
{
|
||||||
@ -1301,6 +1333,17 @@ void TSknet_sync::sync_doc()
|
|||||||
doc->put(DOC_ASPBENI2, asp.smid(50));
|
doc->put(DOC_ASPBENI2, asp.smid(50));
|
||||||
doc->put(DOC_NCOLLI, ncolli);
|
doc->put(DOC_NCOLLI, ncolli);
|
||||||
doc->put(DOC_CAUSMAG, codcaus);
|
doc->put(DOC_CAUSMAG, codcaus);
|
||||||
|
|
||||||
|
const TString codAg = docs.get("CodAgente").as_string();
|
||||||
|
const TString codPag = docs.get("CodPagamento").as_string();
|
||||||
|
|
||||||
|
if (!codAg.blank())
|
||||||
|
doc->put(DOC_CODAG, codAg);
|
||||||
|
|
||||||
|
if (!codPag.blank())
|
||||||
|
doc->put(DOC_CODPAG, codPag);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
const int tipoart = docs.get("TipoArticolo").as_int();
|
const int tipoart = docs.get("TipoArticolo").as_int();
|
||||||
TString4 tiporiga;
|
TString4 tiporiga;
|
||||||
@ -1423,6 +1466,9 @@ void TSknet_sync::sync_doc()
|
|||||||
}
|
}
|
||||||
rdoc.put(RDOC_SCONTO, sconto);
|
rdoc.put(RDOC_SCONTO, sconto);
|
||||||
|
|
||||||
|
// Provvigione agenti
|
||||||
|
rdoc.put(RDOC_PERCPROV, docs.get("PercProvv").as_real());
|
||||||
|
|
||||||
|
|
||||||
// "CONSCACC", "CONSCALL", "CONSCCAR", "CONSCPLA", "CONSCLEG", "CONSCVET"
|
// "CONSCACC", "CONSCALL", "CONSCCAR", "CONSCPLA", "CONSCLEG", "CONSCVET"
|
||||||
TString keyCli; keyCli << tipocf << "|" << codcf;
|
TString keyCli; keyCli << tipocf << "|" << codcf;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user