Patch level :
Files correlati : tp0.exe tp0100a.msk Ricompilazione Demo : [ ] Commento : Corretta gestione Codici Corrispondenti degli articoli in assenza di ArticleComposition git-svn-id: svn://10.65.10.50/branches/R_10_00@22419 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
f16ea19fd5
commit
1e3f90b8f9
@ -479,7 +479,7 @@ void TTrasferimentoPack_mask::trasferisci()
|
||||
pc.activate_paper_size(get_bool(F_SIZE));
|
||||
pc.activate_customer_code(get_bool(F_CUSTCODE));
|
||||
pc.activate_ref_info(get_bool(F_REFINFO));
|
||||
pc.activate_cmsref(get_bool(F_CMSREF));;
|
||||
pc.activate_cmsref(get_bool(F_CMSREF));
|
||||
pc.set_data_limite(get_date(F_DATABOLLE));
|
||||
pc.activate_order_paper_info(get_bool(F_ORDPAPER));
|
||||
pc.activate_extended_discount(get_bool(F_DISCOUNT));
|
||||
|
@ -118,7 +118,7 @@ BEGIN
|
||||
END
|
||||
|
||||
BOOLEAN F_CUSTCODE
|
||||
BEGIN0
|
||||
BEGIN
|
||||
PROMPT 2 12 "Utilizzare il codice articolo del cliente (Richiede tipo riga 14)"
|
||||
END
|
||||
|
||||
|
@ -316,8 +316,7 @@ bool TPack_clifo::trasferisci()
|
||||
{
|
||||
TString query =
|
||||
"SELECT Customers_Suppliers.*, Unit_Measure.UMDesc "
|
||||
"FROM Customers_Suppliers "
|
||||
"LEFT JOIN Unit_Measure "
|
||||
"FROM Customers_Suppliers LEFT JOIN Unit_Measure "
|
||||
"ON (CurrencyCode = Unit_Measure.UMCode AND Unit_Measure.UMType='9') "
|
||||
"WHERE (StatusFlag=1 OR StatusFlag=2 OR StatusFlag=3) AND ";
|
||||
if (_only_agenti)
|
||||
@ -422,7 +421,9 @@ bool TPack_clifo::trasferisci()
|
||||
// iban
|
||||
const bool ibanflag = get_long("IbanFlag") != 0;
|
||||
if (ibanflag)
|
||||
{
|
||||
rec_clifo.put(CLI_IBAN, get_str("IbanCode"));
|
||||
}
|
||||
// agente
|
||||
rec_cfven.put(CFV_CODAG, get_agente());
|
||||
|
||||
|
@ -38,6 +38,8 @@ class TCache_art : public TCache_tp
|
||||
protected:
|
||||
virtual TObject* key2obj(const char* key);
|
||||
virtual const TString& decode(const TToken_string& tok);
|
||||
|
||||
bool update_paper_composition(const char* key, TArticolo_pack& art);
|
||||
int get_extra_info(const char* key, TArticolo_pack& art);
|
||||
|
||||
public:
|
||||
@ -45,25 +47,43 @@ public:
|
||||
TCache_art(TPack_ddt* ddt) : TCache_tp(ddt), _anamag(LF_ANAMAG) {}
|
||||
};
|
||||
|
||||
int TCache_art::get_extra_info(const char* key, TArticolo_pack& art)
|
||||
bool TCache_art::update_paper_composition(const char* key, TArticolo_pack& art)
|
||||
{
|
||||
TString qry(512), article_code;
|
||||
TString qry(512);
|
||||
qry = query_header();
|
||||
qry << "SELECT Paper_Composition_Group.CompDesc, Mag_Existing_Article.ArticleCustCode, Mag_Existing_Article.ArticleCode\n"
|
||||
qry << "SELECT Paper_Composition_Group.CompDesc\n"
|
||||
<< "FROM Mag_Existing_Article, Articles_Composition, Paper_Composition_Group\n"
|
||||
<< "WHERE (Mag_Existing_Article.ArtCode='" << key << "') AND "
|
||||
<< "(Mag_Existing_Article.ArticleCode=Articles_composition.ArticleCode) AND "
|
||||
<< "(Articles_Composition.CompCode=Paper_Composition_Group.CompCode);";
|
||||
TODBC_recordset paperset(qry);
|
||||
int info = paperset.move_first() ? 1 : 0;
|
||||
if (info)
|
||||
bool done = paperset.move_first();
|
||||
if (done)
|
||||
{
|
||||
const TString pc = paperset.get(0u).as_string(); // Paper composition
|
||||
const TString cc = paperset.get(1).as_string(); // Customer code
|
||||
article_code = paperset.get(2).as_string(); // ArticleCode for Articles_environmentTax
|
||||
art.set_paper_composition(pc);
|
||||
}
|
||||
return done;
|
||||
}
|
||||
|
||||
|
||||
int TCache_art::get_extra_info(const char* key, TArticolo_pack& art)
|
||||
{
|
||||
TString qry(512), article_code;
|
||||
qry = query_header();
|
||||
qry << "SELECT Mag_Existing_Article.ArticleCustCode, Mag_Existing_Article.ArticleCode\n"
|
||||
<< "FROM Mag_Existing_Article\n"
|
||||
<< "WHERE Mag_Existing_Article.ArtCode='" << key << "';";
|
||||
TODBC_recordset artset(qry);
|
||||
int info = artset.move_first() ? 1 : 0;
|
||||
if (info)
|
||||
{
|
||||
const TString cc = artset.get(0u).as_string(); // Customer code
|
||||
article_code = artset.get(1).as_string(); // ArticleCode for Articles_environmentTax
|
||||
article_code.trim();
|
||||
art.set_customer_code(cc);
|
||||
art.set_paper_composition(pc);
|
||||
update_paper_composition(key, art);
|
||||
|
||||
if (cc.full())
|
||||
{
|
||||
int righe = 0;
|
||||
@ -173,8 +193,6 @@ TObject* TCache_art::key2obj(const char* key)
|
||||
test_write(_anamag);
|
||||
}
|
||||
|
||||
if (_anamag.curr().get(ANAMAG_CODART) == "48422")
|
||||
int i = 1;
|
||||
TArticolo_pack* art = new TArticolo_pack(_anamag.curr());
|
||||
get_extra_info(key, *art); // CustomerCode, PaperComposition, CONAI infos
|
||||
|
||||
@ -249,8 +267,9 @@ TObject* TCache_umart::key2obj(const char* key)
|
||||
|
||||
bool TPack_ddt::signal_row_error(const char* m)
|
||||
{
|
||||
const long numrig = get_long("CDocRow");
|
||||
TString msg; msg << m << TR(" sulla riga ") << numrig;
|
||||
const long numdoc = get_long("DocCode");
|
||||
const long numrig = get_long("DocRow");
|
||||
TString msg; msg << m << TR(" DocCode:Row=") << numdoc << ':' << numrig;
|
||||
return log_error(msg);
|
||||
}
|
||||
|
||||
@ -320,7 +339,11 @@ bool TPack_ddt::get_um_qta(TString& um, real& qta)
|
||||
|
||||
const bool ok = um.full();
|
||||
if (!ok)
|
||||
signal_row_error(TR("Impossibile determinare l'unita' di misura"));
|
||||
{
|
||||
TString msg;
|
||||
msg << TR("Impossibile decodificare l'unità di misura ") << '"' << get_str(field_um) << '"';
|
||||
signal_row_error(msg);
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
@ -435,7 +458,7 @@ const TString& TPack_ddt::get_codice_iva(const TDate& datadoc)
|
||||
TODBC_recordset iva(qry);
|
||||
|
||||
const TString& codivani = get_str("CodIvaNI");
|
||||
if (codivani.full() && codivani != "0")
|
||||
if (atoi(codivani) > 0)
|
||||
{
|
||||
iva.set_var("#CODIVA", TVariant(codivani));
|
||||
if (iva.move_first())
|
||||
@ -453,12 +476,12 @@ const TString& TPack_ddt::get_codice_iva(const TDate& datadoc)
|
||||
if (iva.move_first())
|
||||
{
|
||||
const TVariant& v = iva.get("xCode");
|
||||
if (!v.is_empty())
|
||||
if (v.as_int() > 0)
|
||||
v.as_string(codiva);
|
||||
}
|
||||
}
|
||||
|
||||
return decode_value("%TPI", codiva);
|
||||
const TString& campiva = decode_value("%TPI", codiva);
|
||||
return campiva;
|
||||
}
|
||||
|
||||
const TString& TPack_ddt::get_customer_reference() const
|
||||
|
Loading…
x
Reference in New Issue
Block a user