diff --git a/tp/tp0100.h b/tp/tp0100.h index 35a2d5c06..d7376a82a 100755 --- a/tp/tp0100.h +++ b/tp/tp0100.h @@ -29,6 +29,8 @@ class TProgind; #include "../ve/clifor.h" #endif +#include "../ve/velib.h" + class TPack_log; class TCache_tp; @@ -175,6 +177,32 @@ class TCache_art; class TCache_umart; class TDocumento; +////////////////////////////////////////////////////////// +// Cache articoli +/////////////////////////////////////////////////////////// + +class TArticolo_pack : public TRectype +{ + TString _cust_code, _paper_comp; + + TString4 _conai_scat[CONAI_CLASSES]; + real _conai_peso[CONAI_CLASSES]; + +public: + void set_customer_code(const TString& cc) { _cust_code = cc; } + const TString& customer_code() const { return _cust_code; } + + void set_paper_composition(const TString& pc) { _paper_comp = pc; } + const TString& paper_composition() const { return _paper_comp; } + + const TString& conai_subclass(TCONAI_class cc) const { CHECK_CONAI(cc); return _conai_scat[cc]; } + const real& conai_weight(TCONAI_class cc) const { CHECK_CONAI(cc); return _conai_peso[cc]; } + bool set_conai(TCONAI_class cc, const TString& scat, const real& weight); + + TArticolo_pack(const TRectype& anamag); + TArticolo_pack(); +}; + class TPack_ddt : public TPack_transfer { TCache_art* _art; @@ -192,7 +220,7 @@ protected: bool get_um_qta(TString& um, real& qta); bool get_clifo(char& tipocf, long& codcf); const TString& get_indsped() const; - const TRectype& get_articolo(TString& um, real& qta, TString& custcode); + const TArticolo_pack& get_articolo(TString& um, real& qta, TString& custcode); const TString& get_codice_iva(const TDate & datadoc); const TString& get_customer_reference() const; bool get_paper_from_order(TString& desc) const; diff --git a/tp/tp0102.cpp b/tp/tp0102.cpp index 4dbdc7d26..830f4eca0 100755 --- a/tp/tp0102.cpp +++ b/tp/tp0102.cpp @@ -1,34 +1,7 @@ #include "tp0100.h" -#include "../ve/velib.h" #include "../mg/codcorr.h" -////////////////////////////////////////////////////////// -// Cache articoli -/////////////////////////////////////////////////////////// - -class TArticolo_pack : public TRectype -{ - TString _cust_code, _paper_comp; - - TString4 _conai_scat[CONAI_CLASSES]; - real _conai_peso[CONAI_CLASSES]; - -public: - void set_customer_code(const TString& cc) { _cust_code = cc; } - const TString& customer_code() const { return _cust_code; } - - void set_paper_composition(const TString& pc) { _paper_comp = pc; } - const TString& paper_composition() const { return _paper_comp; } - - const TString& conai_subclass(TCONAI_class cc) const { CHECK_CONAI(cc); return _conai_scat[cc]; } - const real& conai_weight(TCONAI_class cc) const { CHECK_CONAI(cc); return _conai_peso[cc]; } - bool set_conai(TCONAI_class cc, const TString& scat, const real& weight); - - TArticolo_pack(const TRectype& anamag); - TArticolo_pack(); -}; - // Assegna sottocategoria e peso di una classe CONAI solo se non vuoti bool TArticolo_pack::set_conai(TCONAI_class cc, const TString& scat, const real& weight) { @@ -199,6 +172,8 @@ 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 @@ -348,7 +323,7 @@ bool TPack_ddt::get_um_qta(TString& um, real& qta) return ok; } -const TRectype& TPack_ddt::get_articolo(TString& um, real& qta, TString& custcode) +const TArticolo_pack& TPack_ddt::get_articolo(TString& um, real& qta, TString& custcode) { if (_art == NULL) _art = new TCache_art(this);