Patch level : 10.0 patch 808

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :

Bug 0001696: Non viene più proposta l'unità di misura dell'articolo

Non viene più proposta in automatico l'unità di misura di default dell'articolo

Bug 0001698: Errore - Esplosione Articolo con distinta dalle righe documento

	Se esplodo con F8 un articolo nelle sue righe di distinta mantenedo anche la righa originale, quest'ultima in realtà viene sostituita con l'ultima righa di esplosione


git-svn-id: svn://10.65.10.50/branches/R_10_00@20886 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 2010-09-21 11:21:30 +00:00
parent 216c3e60a7
commit a16fcd0b21
4 changed files with 46 additions and 41 deletions

View File

@ -445,6 +445,13 @@ public:
char tipo() const { return get_char("S7"); }
bool has_formula(const char* name) { return _formule.get_pos(name) >= 0; }
bool is_merce() const { return tipo() == RIGA_MERCE;}
bool is_spese() const { return tipo() == RIGA_SPESEDOC;}
bool is_prestazione() const { return tipo() == RIGA_PRESTAZIONI;}
bool is_risorsa() const { return tipo() == RIGA_RISORSE;}
bool is_attrezzatura() const { return tipo() == RIGA_ATTREZZATURE;}
bool is_sconto() const {return tipo() == RIGA_SCONTI;}
const TString& imponibile() const { return _imponibile;}
const TString& imposta() const { return _field_imposta;}
const TString& quant() const { return _quant;}
@ -575,6 +582,7 @@ public:
void autosave(TSheet_field& f);
const TTipo_riga_documento & tipo() const ;
static const TTipo_riga_documento & tipo(const char * tiporiga);
const TSpesa_prest & spesa() const;
static const TCodiceIVA & iva(const char * codice);
const TCodiceIVA & iva() const {const TString4 cod(get(RDOC_CODIVA)); return iva(cod);}

View File

@ -184,11 +184,10 @@ TRiga_documento::TRiga_documento(const TRiga_documento& rec, TDocumento* doc,
set_tipo(tipo);
}*/
const TTipo_riga_documento& TRiga_documento::tipo() const
const TTipo_riga_documento& TRiga_documento::tipo(const char * tiporiga)
{
const TString4 tiporig = get(RDOC_TIPORIGA);
CHECK(tiporig.full(), "Tipo riga documento nullo");
TTipo_riga_documento* o = (TTipo_riga_documento*)_tipi.objptr(tiporig);
CHECK(tiporiga && *tiporiga, "Tipo riga documento nullo");
TTipo_riga_documento* o = (TTipo_riga_documento*)_tipi.objptr(tiporiga);
if (o == NULL)
{
if (_tipi.items() == 0)
@ -201,16 +200,24 @@ const TTipo_riga_documento& TRiga_documento::tipo() const
_tipi.add(codice, new TTipo_riga_documento(tri.cursor()->curr()));
}
}
o = (TTipo_riga_documento*)_tipi.objptr(tiporig);
o = (TTipo_riga_documento*)_tipi.objptr(tiporiga);
if (o == NULL)
{
o = new TTipo_riga_documento(tiporig);
_tipi.add(tiporig, o);
o = new TTipo_riga_documento(tiporiga);
_tipi.add(tiporiga, o);
}
}
return *o;
}
const TTipo_riga_documento& TRiga_documento::tipo() const
{
const TString4 tiporiga = get(RDOC_TIPORIGA);
CHECK(tiporiga.full(), "Tipo riga documento nullo");
return TRiga_documento::tipo(tiporiga);
}
const TSpesa_prest & TRiga_documento::spesa() const
{
const char tipor = tipo().tipo();

View File

@ -1694,11 +1694,11 @@ bool TDocumento_mask::ss_notify( TSheet_field& ss, int r, KEY key )
const bool on = rdoc.get(RDOC_DACODNUM).full();
riga_mask.enable(DLG_USER, on);
}
const bool merce = rdoc.is_merce();
const bool artmag = rdoc.get(RDOC_CODARTMAG).full();
const bool merce = TRiga_documento::tipo(riga_mask.get(FR_TIPORIGA)).is_merce();
const bool artmag = merce && riga_mask.get(FR_CODARTMAG).full();
riga_mask.show(FR_UMQTA, artmag || !merce);
riga_mask.show(FR_UMQTA2, !artmag || !merce);
riga_mask.show(FR_UMQTA, artmag);
riga_mask.show(FR_UMQTA2, !artmag);
if (rdoc.get(RDOC_CODART).empty() && rdoc.get(RDOC_DESCR).empty())
{

View File

@ -575,7 +575,7 @@ bool dcons_handler( TMask_field& f, KEY key )
TDocumento::copy_data(riga, doc[r - 1]);
s.insert(r - 1);
s.select(r - 1);
s.post_select(r - 1);
TToken_string & tr = s.row(r - 1);
@ -1739,30 +1739,18 @@ bool codart_handler(TMask_field& f, KEY key )
}
}
else
if (key == K_F8 && !sh.sheet_mask().is_running())
if (key == K_F8 && !row_mask.is_running())
{
static int explode_db = 3;
static bool valcomp = false;
static bool matbase = true;
static TExplosion_grouping raggart = RAGGR_EXP_NONE;
static bool elrorig = false;
static int livello = 1;
static int ordin = 0;
if (explode_db > 2)
{
TConfig d(CONFIG_DITTA, "ve");
explode_db = d.get_bool("EXPLODEDB", "ve");
valcomp = d.get_bool("VALCOMP", "ve");
matbase = d.get_bool("TIPOESPL", "ve");
raggart = (TExplosion_grouping) d.get_int("RAGGART", "ve");
livello = d.get_int("LIVESPL", "ve");
elrorig = d.get_bool("ELRORIG", "ve");
ordin = d.get_int("ORDDB", "ve");
}
const bool explode_db = ini_get_bool(CONFIG_DITTA, "ve", "EXPLODEDB");
if (explode_db && !sh.sheet_mask().is_running())
{
const bool valcomp = ini_get_bool(CONFIG_DITTA, "ve", "VALCOMP");
const bool matbase = ini_get_bool(CONFIG_DITTA, "ve", "TIPOESPL");
const TExplosion_grouping raggart = (TExplosion_grouping) ini_get_int(CONFIG_DITTA, "ve", "RAGGART");
const bool elrorig = ini_get_bool(CONFIG_DITTA, "ve", "ELRORIG");
const int livello = ini_get_int(CONFIG_DITTA, "ve", "LIVESPL");
const int ordin = ini_get_int(CONFIG_DITTA, "ve", "ORDDB");
TDocumento & doc = mask.doc();
TRiga_documento & curr_row = doc[current_doc_row];
const int start_level = curr_row.get_int(RDOC_LEVEL);
@ -1804,15 +1792,15 @@ bool codart_handler(TMask_field& f, KEY key )
new_row.put(RDOC_QTA, r.val() /* * qta_fin */);
const int level = start_level + r.livello();
new_row.put(RDOC_LEVEL, level);
new_row.autoload(sh);
sh.check_row(row);
new_row.autosave(sh); // Da sheet a rdoc
if (!valcomp)
{
new_row.zero(RDOC_PREZZO);
sh.row(row).add("0", sh.cid2index(FR_PREZZO));
row_mask.reset(FR_PREZZO);
}
new_row.autoload(sh);
sh.check_row(row);
new_row.autosave(sh); // Da sheet a rdoc
row++;
}
if (elrorig)
@ -1828,7 +1816,8 @@ bool codart_handler(TMask_field& f, KEY key )
curr_row.autoload(sh);
}
sh.force_update();
sh.select(current_doc_row-1);
sh.post_select(current_doc_row - 1);
sh.update_mask(current_doc_row - 1);
}
}
mask.update_giacenza();
@ -1851,11 +1840,12 @@ bool codartmag_handler( TMask_field& f, KEY key )
if (to_check)
{
const int r = s.selected();
const bool merce = mask.doc()[r + 1].is_merce();
const bool artmag = f.get().full();
const bool merce = TRiga_documento::tipo(m.get(FR_TIPORIGA)).is_merce();
const bool artmag = merce && f.get().full();
mask.show(FR_UMQTA, artmag || !merce);
mask.show(FR_UMQTA2, !artmag || !merce); mask.update_giacenza();
m.show(FR_UMQTA, artmag);
m.show(FR_UMQTA2, !artmag);
mask.update_giacenza();
}
return true;