Terminata gestione dei livelli di giacenza
git-svn-id: svn://10.65.10.50/trunk@4661 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
dea93322f2
commit
41ef2df2f8
@ -515,12 +515,16 @@ TMask* TMotore_application::get_mask( int mode )
|
|||||||
const TString & header = l.name(i);
|
const TString & header = l.name(i);
|
||||||
const int len = header.len() + 1;
|
const int len = header.len() + 1;
|
||||||
const int f_len = l.code_lenght(i);
|
const int f_len = l.code_lenght(i);
|
||||||
|
_doc->set_liv_giac_len(i, f_len);
|
||||||
|
|
||||||
_sheet->set_column_header(pos, l.name(i));
|
_sheet->set_column_header(pos, l.name(i));
|
||||||
_sheet->set_column_width(pos, (len > f_len ? len : f_len) * 8);
|
_sheet->set_column_width(pos, (len > f_len ? len : f_len) * 8);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
_sheet->delete_column(pos);
|
_sheet->delete_column(pos);
|
||||||
|
_doc->set_liv_giac_len(i, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// configurazione campi
|
// configurazione campi
|
||||||
|
@ -351,6 +351,7 @@ class TDocumento : public TAuto_variable_rectype // velib03
|
|||||||
TRecfield *_codcf;
|
TRecfield *_codcf;
|
||||||
TRecfield *_cod_occas;
|
TRecfield *_cod_occas;
|
||||||
static TAssoc_array _tipi;
|
static TAssoc_array _tipi;
|
||||||
|
int _liv_len[4];
|
||||||
|
|
||||||
TRecord_array _rows; // Array di TRectype per le righe documenti di vendita.
|
TRecord_array _rows; // Array di TRectype per le righe documenti di vendita.
|
||||||
bool _nuovo;
|
bool _nuovo;
|
||||||
@ -402,7 +403,7 @@ public:
|
|||||||
virtual int read(TBaseisamfile& f, word op = _isequal, word lockop = _nolock);
|
virtual int read(TBaseisamfile& f, word op = _isequal, word lockop = _nolock);
|
||||||
virtual int write(TBaseisamfile& f) const { return write_rewrite(f, FALSE); }
|
virtual int write(TBaseisamfile& f) const { return write_rewrite(f, FALSE); }
|
||||||
virtual int rewrite(TBaseisamfile& f) const { return write_rewrite(f, TRUE); }
|
virtual int rewrite(TBaseisamfile& f) const { return write_rewrite(f, TRUE); }
|
||||||
virtual int remove(TBaseisamfile& f) const;
|
virtual int remove(TBaseisamfile& f) const;
|
||||||
|
|
||||||
int read(char provv, int anno, const char* codnum, long numdoc, word op = _isequal, word lockop = _nolock);
|
int read(char provv, int anno, const char* codnum, long numdoc, word op = _isequal, word lockop = _nolock);
|
||||||
int read(const TRectype& rec, word op = _isequal, word lockop = _nolock) { *this = rec; return read(op, lockop); }
|
int read(const TRectype& rec, word op = _isequal, word lockop = _nolock) { *this = rec; return read(op, lockop); }
|
||||||
@ -423,6 +424,8 @@ public:
|
|||||||
bool tipo_valido() const { return get("TIPODOC").not_empty(); }
|
bool tipo_valido() const { return get("TIPODOC").not_empty(); }
|
||||||
const TTipo_documento& tipo() const;
|
const TTipo_documento& tipo() const;
|
||||||
void set_tipo(const char * tipo) { head().put("TIPODOC", tipo);}
|
void set_tipo(const char * tipo) { head().put("TIPODOC", tipo);}
|
||||||
|
void set_liv_giac_len(int liv, int len) { _liv_len[liv - 1] = len;}
|
||||||
|
int liv_giac_len(int liv) const { return _liv_len[liv - 1];}
|
||||||
|
|
||||||
char stato() const { return get_char("STATO"); }
|
char stato() const { return get_char("STATO"); }
|
||||||
void stato(char s) { put("STATO", s); }
|
void stato(char s) { put("STATO", s); }
|
||||||
|
@ -549,10 +549,11 @@ void TRiga_documento::autosave(TSheet_field & f)
|
|||||||
codmag << row.get( f.cid2index(FR_CODDEP ));
|
codmag << row.get( f.cid2index(FR_CODDEP ));
|
||||||
put( "CODMAG", codmag);
|
put( "CODMAG", codmag);
|
||||||
put( "CODART", row.get( f.cid2index(FR_CODART )) );
|
put( "CODART", row.get( f.cid2index(FR_CODART )) );
|
||||||
put( "LIVELLO",row.get( f.cid2index(FR_LIV1 ))); // da modificare
|
TString liv(row.get(f.cid2index(FR_LIV1)));
|
||||||
put( "LIVELLO",row.get( f.cid2index(FR_LIV2 )));
|
liv << row.get(f.cid2index(FR_LIV2));
|
||||||
put( "LIVELLO",row.get( f.cid2index(FR_LIV3 )));
|
liv << row.get(f.cid2index(FR_LIV3));
|
||||||
put( "LIVELLO",row.get( f.cid2index(FR_LIV4 )));
|
liv << row.get(f.cid2index(FR_LIV4));
|
||||||
|
put( "LIVELLO", liv); // da modificare
|
||||||
TString s(row.get(f.cid2index(FR_DESCR)));
|
TString s(row.get(f.cid2index(FR_DESCR)));
|
||||||
int split_pos = s.find('\n');
|
int split_pos = s.find('\n');
|
||||||
|
|
||||||
@ -608,10 +609,32 @@ void TRiga_documento::autoload(TSheet_field & f)
|
|||||||
row.add( codmag.left(3), f.cid2index(FR_CODMAG ));
|
row.add( codmag.left(3), f.cid2index(FR_CODMAG ));
|
||||||
row.add( codmag.mid(3), f.cid2index(FR_CODDEP ));
|
row.add( codmag.mid(3), f.cid2index(FR_CODDEP ));
|
||||||
row.add( get( "CODART" ), f.cid2index(FR_CODART ));
|
row.add( get( "CODART" ), f.cid2index(FR_CODART ));
|
||||||
row.add( get( "LIVELLO" ), f.cid2index(FR_LIV1 )); // da modificare
|
TString liv(get("LIVELLO"));
|
||||||
row.add( get( "LIVELLO" ), f.cid2index(FR_LIV2 ));
|
|
||||||
row.add( get( "LIVELLO" ), f.cid2index(FR_LIV3 ));
|
int l = doc().liv_giac_len(1);
|
||||||
row.add( get( "LIVELLO" ), f.cid2index(FR_LIV4 ));
|
if (l > 0)
|
||||||
|
{
|
||||||
|
row.add(liv.left(l), f.cid2index(FR_LIV1 ));
|
||||||
|
liv.ltrim(l);
|
||||||
|
}
|
||||||
|
l = doc().liv_giac_len(2);
|
||||||
|
if (l > 0)
|
||||||
|
{
|
||||||
|
row.add(liv.left(l), f.cid2index(FR_LIV2 ));
|
||||||
|
liv.ltrim(l);
|
||||||
|
}
|
||||||
|
l = doc().liv_giac_len(3);
|
||||||
|
if (l > 0)
|
||||||
|
{
|
||||||
|
row.add(liv.left(l), f.cid2index(FR_LIV3 ));
|
||||||
|
liv.ltrim(l);
|
||||||
|
}
|
||||||
|
l = doc().liv_giac_len(4);
|
||||||
|
if (l > 0)
|
||||||
|
{
|
||||||
|
row.add(liv.left(l), f.cid2index(FR_LIV4 ));
|
||||||
|
liv.ltrim(l);
|
||||||
|
}
|
||||||
TString s(get("DESCR"));
|
TString s(get("DESCR"));
|
||||||
if (get_bool("DESCLUNGA"))
|
if (get_bool("DESCLUNGA"))
|
||||||
s << get("DESCEST");
|
s << get("DESCEST");
|
||||||
|
@ -154,6 +154,7 @@ TDocumento::TDocumento()
|
|||||||
_codcf = new TRecfield(*this, "CODCF");
|
_codcf = new TRecfield(*this, "CODCF");
|
||||||
_cod_occas = new TRecfield(*this, "OCFPI");
|
_cod_occas = new TRecfield(*this, "OCFPI");
|
||||||
set_memo_fld("G1");
|
set_memo_fld("G1");
|
||||||
|
for (int i = 3 ; i >= 0; i--) _liv_len[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
TDocumento::TDocumento(char provv, int anno, const char* codnum, long numdoc,
|
TDocumento::TDocumento(char provv, int anno, const char* codnum, long numdoc,
|
||||||
@ -176,6 +177,7 @@ TDocumento::TDocumento(char provv, int anno, const char* codnum, long numdoc,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
read(provv, anno, codnum, numdoc);
|
read(provv, anno, codnum, numdoc);
|
||||||
|
for (int i = 3 ; i >= 0; i--) _liv_len[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
TDocumento::TDocumento(const TRectype& rec, TCond_vendita * condv, TRelation * rel)
|
TDocumento::TDocumento(const TRectype& rec, TCond_vendita * condv, TRelation * rel)
|
||||||
@ -187,6 +189,7 @@ TDocumento::TDocumento(const TRectype& rec, TCond_vendita * condv, TRelation * r
|
|||||||
_cod_occas = new TRecfield(*this, "OCFPI");
|
_cod_occas = new TRecfield(*this, "OCFPI");
|
||||||
set_memo_fld("G1");
|
set_memo_fld("G1");
|
||||||
read(rec);
|
read(rec);
|
||||||
|
for (int i = 3 ; i >= 0; i--) _liv_len[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
TDocumento::~TDocumento()
|
TDocumento::~TDocumento()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user