Tab esplosi
git-svn-id: svn://10.65.10.50/trunk@4699 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
0b8f07e996
commit
cfc16a03b7
@ -148,7 +148,7 @@ bool TMask_movmag::handle_righe(TMask_field &f, KEY k)
|
||||
TSheet_field & ss=(TSheet_field & )f;
|
||||
for (int i=0; i< ss.items(); i++)
|
||||
{
|
||||
if (ss.cell(i,ss.cid2index(F_CODMAG))==NULL || *ss.cell(i,ss.cid2index(F_CODMAG)) ==' ')
|
||||
if (*ss.cell(i,ss.cid2index(F_CODMAG)) ==' ')
|
||||
{
|
||||
f.error_box("Nella riga %d manca l'indicazione del magazzino ",i+1);
|
||||
return FALSE;
|
||||
@ -163,11 +163,11 @@ bool TMask_movmag::notify_righe(TSheet_field & ss, int r, KEY key)
|
||||
static TString16 old_codcaus;
|
||||
if ( key == K_DEL ) // Cancellazione
|
||||
{
|
||||
if (*ss.cell(r,ss.cid2index( F_AUTOMATICA))=='A')
|
||||
if (*ss.cell(r,ss.cid2index( F_AUTOMATICA))==riga_automatica)
|
||||
return FALSE; // can't remove auto lines directly
|
||||
if (r < ss.items()-1)
|
||||
{
|
||||
if (*ss.cell(r+1,ss.cid2index( F_AUTOMATICA))=='A')
|
||||
if (*ss.cell(r+1,ss.cid2index( F_AUTOMATICA))==riga_automatica)
|
||||
{
|
||||
ss.destroy(r + 1);
|
||||
}
|
||||
@ -175,7 +175,7 @@ bool TMask_movmag::notify_righe(TSheet_field & ss, int r, KEY key)
|
||||
|
||||
} else if (key == K_INS) { // Inserimento
|
||||
{
|
||||
if (*ss.cell(r,ss.cid2index( F_AUTOMATICA))=='A')
|
||||
if (*ss.cell(r,ss.cid2index( F_AUTOMATICA))==riga_automatica)
|
||||
return FALSE; // cannot insert between a row and its generated one
|
||||
}
|
||||
|
||||
@ -218,7 +218,6 @@ bool TMask_movmag::handle_righeprezzo(TMask_field &f, KEY k)
|
||||
bool TMask_movmag::update_rigamov (int r, const char * old_codcaus)
|
||||
{
|
||||
TSheet_field & ss=(TSheet_field & )field(F_RIGHE);
|
||||
TCausale_magazzino cau_riga();
|
||||
|
||||
TString16 new_codcaus(ss.cell(r,ss.cid2index(F_CAUSRIG)));
|
||||
if (new_codcaus.blank())
|
||||
@ -230,7 +229,7 @@ bool TMask_movmag::update_rigamov (int r, const char * old_codcaus)
|
||||
// deve esserci una riga collegata
|
||||
TString16 codmag,coddep;
|
||||
real prezzo(ss.cell(r,ss.cid2index(F_PREZZO)));
|
||||
if (r < ss.items()-1 && *ss.cell(r+1,ss.cid2index( F_AUTOMATICA)) == ' ')
|
||||
if (r < ss.items()-1 && *ss.cell(r+1,ss.cid2index( F_AUTOMATICA)) != riga_automatica)
|
||||
{
|
||||
// manca, la inserisco
|
||||
ss.insert(r+1);
|
||||
@ -244,7 +243,7 @@ bool TMask_movmag::update_rigamov (int r, const char * old_codcaus)
|
||||
ss.row(r+1).add(codmag,ss.cid2index(F_CODMAG));
|
||||
ss.row(r+1).add(coddep,ss.cid2index(F_CODDEP));
|
||||
ss.row(r+1).add(cau.get_collegata(),ss.cid2index(F_CAUSRIG));
|
||||
ss.row(r+1).add("A",ss.cid2index(F_AUTOMATICA));
|
||||
ss.row(r+1).add(TString(1,riga_automatica),ss.cid2index(F_AUTOMATICA));
|
||||
ss.check_row(r+1);
|
||||
ss.force_update(r+1);
|
||||
return TRUE;
|
||||
@ -333,20 +332,17 @@ bool TMask_movmag::handle_datacomp(TMask_field &fld, KEY k)
|
||||
|
||||
|
||||
class TApp_movmag: public TRelation_application {
|
||||
TArray used_files;
|
||||
TMask_movmag *_msk; // maschera principale
|
||||
TMag_livelli * _livelli_giac;// oggetto handler per i livelli di giacenza
|
||||
TRelation * _rel; // relazione contenente il file movimenti
|
||||
TLocalisamfile * _rmovmag; // file aperto per utilizzarne il record
|
||||
|
||||
virtual bool user_create();
|
||||
virtual bool user_destroy();
|
||||
virtual TMask *get_mask(int) { return _msk; }
|
||||
virtual bool changing_mask(int) { return FALSE; }
|
||||
virtual TRelation *get_relation() const { return _rel; }
|
||||
virtual const char *get_next_key();
|
||||
// virtual int read(TMask& m);
|
||||
// virtual bool remove();
|
||||
// virtual int write(const TMask& m);
|
||||
// virtual int rewrite(const TMask& m);
|
||||
|
||||
TString16 _nextcod;
|
||||
public:
|
||||
@ -359,8 +355,12 @@ inline TApp_movmag& app() { return (TApp_movmag&) main_app(); }
|
||||
|
||||
bool TApp_movmag::user_create()
|
||||
{
|
||||
used_files.add(new TLocalisamfile(LF_ANAMAG));
|
||||
used_files.add(new TLocalisamfile(LF_UMART));
|
||||
used_files.add(new TLocalisamfile(LF_MOVMAG));
|
||||
used_files.add(new TLocalisamfile(LF_RMOVMAG));
|
||||
used_files.add(new TTable("%CAU"));
|
||||
|
||||
_rmovmag = new TLocalisamfile(LF_RMOVMAG);
|
||||
TMov_mag * m_m= new TMov_mag(); // record del movimento di magazzino
|
||||
m_m->enable_autoload(LF_RMOVMAG);
|
||||
|
||||
@ -377,7 +377,6 @@ bool TApp_movmag::user_create()
|
||||
|
||||
bool TApp_movmag::user_destroy()
|
||||
{
|
||||
delete _rmovmag;
|
||||
delete _rel;
|
||||
delete _msk;
|
||||
delete _livelli_giac;
|
||||
|
Loading…
x
Reference in New Issue
Block a user