Patch level : 10.0 109
Files correlati : Ricompilazione Demo : [ ] Commento : Riportata la versione 3.2 1208 git-svn-id: svn://10.65.10.50/trunk@17103 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
8e52b23e0d
commit
bf646b21c5
115
mr/mr2200.cpp
115
mr/mr2200.cpp
@ -5,6 +5,7 @@
|
|||||||
#include <defmask.h>
|
#include <defmask.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
#include <tabutil.h>
|
#include <tabutil.h>
|
||||||
|
#include <urldefid.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
|
|
||||||
#include "../ve/veconf.h"
|
#include "../ve/veconf.h"
|
||||||
@ -432,6 +433,13 @@ int TPlanning_mask::test_status(const TRectype& doc, int s) const
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TPlanning_mask::test_special(const TString & num) const
|
||||||
|
{
|
||||||
|
const TRectype & rec = cache().get("%NUM", num);
|
||||||
|
|
||||||
|
return rec.get_bool("B8");
|
||||||
|
}
|
||||||
|
|
||||||
bool TPlanning_mask::has_confirmed_status(const TRectype &doc, TToken_string &riga) const
|
bool TPlanning_mask::has_confirmed_status(const TRectype &doc, TToken_string &riga) const
|
||||||
{
|
{
|
||||||
const char statodoc = doc.get_char(DOC_STATO);
|
const char statodoc = doc.get_char(DOC_STATO);
|
||||||
@ -675,17 +683,19 @@ bool TPlanning_mask::carica_documenti()
|
|||||||
if (skip)
|
if (skip)
|
||||||
{
|
{
|
||||||
const long p = riga.get_long(RDOC_PRIORITY);
|
const long p = riga.get_long(RDOC_PRIORITY);
|
||||||
line = _constraints.find(cli, art, liv, imp, ignore_lin ? "" : lin, mag, magc, da_rdoc_key, false);
|
TMSP_constraint* linec = _constraints.find(cli, art, liv, imp, ignore_lin ? "" : lin, mag, magc, da_rdoc_key, false);
|
||||||
if ( line != NULL)
|
|
||||||
|
if (linec != NULL)
|
||||||
{
|
{
|
||||||
|
if (p > linec->priority())
|
||||||
if (p > line->priority())
|
{
|
||||||
line->priority(p);
|
linec->priority(p);
|
||||||
else
|
line = _articles.find(cli, art, liv, imp, lin, mag, magc, da_rdoc_key, true);
|
||||||
continue;
|
if (line->description().blank())
|
||||||
|
line->set_description(riga.get(RDOC_DESCR));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
continue;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
line = _articles.find(cli, art, liv, imp, lin, mag, magc, da_rdoc_key, true);
|
line = _articles.find(cli, art, liv, imp, lin, mag, magc, da_rdoc_key, true);
|
||||||
}
|
}
|
||||||
@ -753,8 +763,8 @@ bool TPlanning_mask::carica_documenti()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (p > line->priority())
|
if (p > line->priority())
|
||||||
line->priority(p);
|
line->priority(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!skip)
|
if (!skip)
|
||||||
@ -914,16 +924,22 @@ int TPlanning_mask::find_constr_row(TMSP_constraint& cons)
|
|||||||
}
|
}
|
||||||
// aggiunge le tre linee
|
// aggiunge le tre linee
|
||||||
TToken_string& row = sf.row(-1);
|
TToken_string& row = sf.row(-1);
|
||||||
|
TString8 codnum = cons.da_rdoc_key().left(4);
|
||||||
|
codnum.trim();
|
||||||
|
const bool special = test_special(codnum);
|
||||||
|
|
||||||
|
highlight_row(sf.items() - 1, special);
|
||||||
cons.fill_sheet_row(row, *this, TR("** Ordini "));
|
cons.fill_sheet_row(row, *this, TR("** Ordini "));
|
||||||
cons.set_on_sheet();
|
cons.set_on_sheet();
|
||||||
sf.disable_cell(sf.items()-1, -1);
|
sf.disable_cell(sf.items()-1, -1);
|
||||||
//linea della giacenza prog
|
//linea della giacenza prog
|
||||||
TToken_string& rowgiac = sf.row(-1);
|
TToken_string& rowgiac = sf.row(-1);
|
||||||
copy_sheet_row(rowgiac,row, TR("** Giacenza teorica"));
|
copy_sheet_row(rowgiac,row, TR("** Giacenza teorica"));
|
||||||
|
highlight_row(sf.items() - 1, special);
|
||||||
sf.disable_cell(sf.items()-1, -1);
|
sf.disable_cell(sf.items()-1, -1);
|
||||||
//linea articolo (vuota)
|
//linea articolo (vuota)
|
||||||
TMSP_line line(cons);
|
TMSP_line line(cons);
|
||||||
line.fill_sheet_row(sf.row(-1), *this, "");
|
highlight_row(sf.items() - 1, special);
|
||||||
r = sf.items()-3+2; // vacca
|
r = sf.items()-3+2; // vacca
|
||||||
|
|
||||||
if (cons.codclifor())
|
if (cons.codclifor())
|
||||||
@ -1008,6 +1024,7 @@ void TPlanning_mask::fill_sheet()
|
|||||||
TMSP_constraint* last_constraint = NULL;
|
TMSP_constraint* last_constraint = NULL;
|
||||||
|
|
||||||
TWait_cursor hourglass;
|
TWait_cursor hourglass;
|
||||||
|
bool special = false;
|
||||||
// *************
|
// *************
|
||||||
// parte 1: introduce gli articoli ed i loro vincoli associati
|
// parte 1: introduce gli articoli ed i loro vincoli associati
|
||||||
const long totart = _articles.sort();
|
const long totart = _articles.sort();
|
||||||
@ -1015,6 +1032,10 @@ void TPlanning_mask::fill_sheet()
|
|||||||
{
|
{
|
||||||
TMSP_line& line = _articles[i];
|
TMSP_line& line = _articles[i];
|
||||||
TMSP_constraint* curr_constraint = find_constraint(line,true);
|
TMSP_constraint* curr_constraint = find_constraint(line,true);
|
||||||
|
TString8 codnum = curr_constraint->da_rdoc_key().left(4);
|
||||||
|
|
||||||
|
codnum.trim();
|
||||||
|
const bool special = test_special(codnum);
|
||||||
int new_row = -1;
|
int new_row = -1;
|
||||||
|
|
||||||
for (int nrow = sf.items() - 1; nrow >=0; nrow--)
|
for (int nrow = sf.items() - 1; nrow >=0; nrow--)
|
||||||
@ -1036,10 +1057,12 @@ void TPlanning_mask::fill_sheet()
|
|||||||
TToken_string& consrow = sf.row(-1);
|
TToken_string& consrow = sf.row(-1);
|
||||||
curr_constraint->fill_sheet_row(consrow, *this, TR("** Ordini "));
|
curr_constraint->fill_sheet_row(consrow, *this, TR("** Ordini "));
|
||||||
|
|
||||||
|
highlight_row(sf.items()-1, special);
|
||||||
sf.disable_cell(sf.items()-1, -1);
|
sf.disable_cell(sf.items()-1, -1);
|
||||||
// aggiunge la linea della giacenza prog
|
// aggiunge la linea della giacenza prog
|
||||||
TToken_string& rowgiac = sf.row(-1);
|
TToken_string& rowgiac = sf.row(-1);
|
||||||
copy_sheet_row(rowgiac,consrow, TR("** Giacenza teorica"));
|
copy_sheet_row(rowgiac,consrow, TR("** Giacenza teorica"));
|
||||||
|
highlight_row(sf.items()-1, special);
|
||||||
sf.disable_cell(sf.items()-1, -1);
|
sf.disable_cell(sf.items()-1, -1);
|
||||||
// last_constraint = curr_constraint;
|
// last_constraint = curr_constraint;
|
||||||
curr_constraint->set_on_sheet();
|
curr_constraint->set_on_sheet();
|
||||||
@ -1048,6 +1071,7 @@ void TPlanning_mask::fill_sheet()
|
|||||||
sf.insert(new_row);
|
sf.insert(new_row);
|
||||||
TToken_string& row = sf.row(new_row);
|
TToken_string& row = sf.row(new_row);
|
||||||
line.fill_sheet_row(row, *this, "");
|
line.fill_sheet_row(row, *this, "");
|
||||||
|
highlight_row(new_row, special);
|
||||||
disable_codes(new_row);
|
disable_codes(new_row);
|
||||||
if (curr_constraint->codclifor())
|
if (curr_constraint->codclifor())
|
||||||
sf.disable_cell(new_row,sf.cid2index(F_CLIENTE));
|
sf.disable_cell(new_row,sf.cid2index(F_CLIENTE));
|
||||||
@ -1061,19 +1085,27 @@ void TPlanning_mask::fill_sheet()
|
|||||||
if (!cons.is_on_sheet())
|
if (!cons.is_on_sheet())
|
||||||
{
|
{
|
||||||
// aggiunge le tre linee
|
// aggiunge le tre linee
|
||||||
|
TString8 codnum = cons.da_rdoc_key().left(4);
|
||||||
|
|
||||||
|
codnum.trim();
|
||||||
|
const bool special = test_special(codnum);
|
||||||
TToken_string& consrow = sf.row(-1);
|
TToken_string& consrow = sf.row(-1);
|
||||||
cons.fill_sheet_row(consrow, *this, TR("** Ordini "));
|
cons.fill_sheet_row(consrow, *this, TR("** Ordini "));
|
||||||
cons.set_on_sheet();
|
cons.set_on_sheet();
|
||||||
|
highlight_row(sf.items()-1, special);
|
||||||
sf.disable_cell(sf.items()-1, -1);
|
sf.disable_cell(sf.items()-1, -1);
|
||||||
//linea della giacenza prog
|
//linea della giacenza prog
|
||||||
TToken_string& rowgiac = sf.row(-1);
|
TToken_string& rowgiac = sf.row(-1);
|
||||||
copy_sheet_row(rowgiac,consrow, TR("** Giacenza teorica"));
|
copy_sheet_row(rowgiac,consrow, TR("** Giacenza teorica"));
|
||||||
|
highlight_row(sf.items()-1, special);
|
||||||
sf.disable_cell(sf.items()-1, -1);
|
sf.disable_cell(sf.items()-1, -1);
|
||||||
//linea articolo (vuota)
|
//linea articolo (vuota)
|
||||||
TMSP_line line(cons);
|
TMSP_line line(cons);
|
||||||
line.fill_sheet_row(sf.row(-1), *this, "");
|
line.fill_sheet_row(sf.row(-1), *this, "");
|
||||||
if (consrow.get_long(sf.cid2index(F_CLIENTE)))
|
if (consrow.get_long(sf.cid2index(F_CLIENTE)))
|
||||||
sf.disable_cell(sf.items()-1,sf.cid2index(F_CLIENTE));
|
sf.disable_cell(sf.items()-1,sf.cid2index(F_CLIENTE));
|
||||||
|
|
||||||
|
highlight_row(sf.items()-1, special);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TArticolo_giacenza art;
|
TArticolo_giacenza art;
|
||||||
@ -1143,11 +1175,29 @@ bool TPlanning_mask::remove_propose(bool verbose)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TPlanning_mask::highlight(int row, int col, bool on)
|
void TPlanning_mask::highlight_row(int row, bool on)
|
||||||
{
|
{
|
||||||
COLOR back = on ? _sel_color.get_back_color(_npr_pos) : NORMAL_BACK_COLOR;
|
COLOR back = on ? _sel_color.get_back_color(_con_pos) : NORMAL_BACK_COLOR;
|
||||||
COLOR fore = on ? _sel_color.get_fore_color(_npr_pos) : NORMAL_COLOR;
|
COLOR fore = on ? _sel_color.get_fore_color(_con_pos) : NORMAL_COLOR;
|
||||||
|
|
||||||
|
sfield(F_ARTICOLI).set_back_and_fore_color(back, fore, row);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TPlanning_mask::highlight(int row, int col, bool on, bool special)
|
||||||
|
{
|
||||||
|
COLOR back;
|
||||||
|
COLOR fore;
|
||||||
|
|
||||||
|
if (special)
|
||||||
|
{
|
||||||
|
back = on ? _sel_color.get_back_color(_npr_pos) : _sel_color.get_back_color(_con_pos);
|
||||||
|
fore = on ? _sel_color.get_fore_color(_npr_pos) : _sel_color.get_fore_color(_con_pos);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
back = on ? _sel_color.get_back_color(_npr_pos) : NORMAL_BACK_COLOR;
|
||||||
|
fore = on ? _sel_color.get_fore_color(_npr_pos) : NORMAL_COLOR;
|
||||||
|
}
|
||||||
sfield(F_ARTICOLI).set_back_and_fore_color(back, fore, row, col);
|
sfield(F_ARTICOLI).set_back_and_fore_color(back, fore, row, col);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1228,7 +1278,12 @@ void TPlanning_mask::add_or_sub_propose(char sign, bool scheduled)
|
|||||||
}
|
}
|
||||||
TToken_string& artrow = sf.row(art_row);
|
TToken_string& artrow = sf.row(art_row);
|
||||||
const int lastbuck = _proposed_articles[new_row].last_bucket();
|
const int lastbuck = _proposed_articles[new_row].last_bucket();
|
||||||
|
TString8 codnum = constraint->da_rdoc_key().left(4);
|
||||||
|
|
||||||
|
codnum.trim();
|
||||||
|
const bool special = test_special(codnum);
|
||||||
|
|
||||||
|
highlight_row(art_row, special);
|
||||||
for (int nbucket=0; nbucket<=lastbuck ; nbucket++)
|
for (int nbucket=0; nbucket<=lastbuck ; nbucket++)
|
||||||
{
|
{
|
||||||
int b = bucket( _proposed_articles[new_row].time(nbucket).date() );
|
int b = bucket( _proposed_articles[new_row].time(nbucket).date() );
|
||||||
@ -1249,7 +1304,7 @@ void TPlanning_mask::add_or_sub_propose(char sign, bool scheduled)
|
|||||||
art_per_buck = ZERO;
|
art_per_buck = ZERO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
highlight(art_row, F_BUCKET1 + b*2, prop != ZERO && art_per_buck != ZERO);
|
highlight(art_row, F_BUCKET1 + b*2, prop != ZERO && art_per_buck != ZERO, special);
|
||||||
artrow.add(art_per_buck.string(), F_BUCKET1 + b*2 - FIRST_FIELD);
|
artrow.add(art_per_buck.string(), F_BUCKET1 + b*2 - FIRST_FIELD);
|
||||||
real price;
|
real price;
|
||||||
if (!art_per_buck.is_zero())
|
if (!art_per_buck.is_zero())
|
||||||
@ -2674,7 +2729,7 @@ void TPlanning_mask::copy_sheet_row(TToken_string & newrow, const TToken_string
|
|||||||
newrow.get(F_DESCART - FIRST_FIELD, str);
|
newrow.get(F_DESCART - FIRST_FIELD, str);
|
||||||
|
|
||||||
const int pos = str.find('¦');
|
const int pos = str.find('¦');
|
||||||
TString80 val(desc);
|
TString val(desc);
|
||||||
|
|
||||||
if (pos >= 0)
|
if (pos >= 0)
|
||||||
val << '¦' << str.mid(pos + 1);
|
val << '¦' << str.mid(pos + 1);
|
||||||
@ -2841,11 +2896,10 @@ int TPlanning_mask::salva_cella(int r, int b, TPlan_docs &doc_rows, TToken_strin
|
|||||||
riga.put(RDOC_IMPIANTO, line.codimp());
|
riga.put(RDOC_IMPIANTO, line.codimp());
|
||||||
riga.put(RDOC_UMQTA, row.get(sf.cid2index(F_UM)));
|
riga.put(RDOC_UMQTA, row.get(sf.cid2index(F_UM)));
|
||||||
riga.put(RDOC_DATACONS, datacons);
|
riga.put(RDOC_DATACONS, datacons);
|
||||||
TString descr(row.get(sf.cid2index(F_DESCART)));
|
TString descr(line.description());
|
||||||
const int pos = descr.find('¦');
|
|
||||||
|
|
||||||
if (pos >= 0)
|
if (descr.blank())
|
||||||
descr = descr.left(pos);
|
descr = cache().get(LF_ANAMAG, line.articolo(), ANAMAG_DESCR);
|
||||||
riga.put(RDOC_DESCR, descr);
|
riga.put(RDOC_DESCR, descr);
|
||||||
|
|
||||||
TMSP_constraint *c = find_constraint(line);
|
TMSP_constraint *c = find_constraint(line);
|
||||||
@ -3363,7 +3417,8 @@ bool TPlanning_mask::on_field_event(TOperable_field& o, TField_event e, long jol
|
|||||||
m.get(F_TIPOCF_SHEET), m.get_long(F_CLIENTE), m.get(F_ARTICOLO),
|
m.get(F_TIPOCF_SHEET), m.get_long(F_CLIENTE), m.get(F_ARTICOLO),
|
||||||
qta , price);
|
qta , price);
|
||||||
fprice.set(price.string());
|
fprice.set(price.string());
|
||||||
highlight(s.selected(), o.dlg(), qta != ZERO);
|
if (qta != ZERO)
|
||||||
|
highlight(s.selected(), o.dlg(), true, false);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DLG_CANCEL:
|
case DLG_CANCEL:
|
||||||
@ -3971,6 +4026,7 @@ void TPlanning_mask::init()
|
|||||||
|
|
||||||
load_profile();
|
load_profile();
|
||||||
_npr_pos =_sel_color.add_color_def("PROP", TR("Nuove proposte"), COLOR_YELLOW, COLOR_BLACK);
|
_npr_pos =_sel_color.add_color_def("PROP", TR("Nuove proposte"), COLOR_YELLOW, COLOR_BLACK);
|
||||||
|
_con_pos =_sel_color.add_color_def("CONST", TR("Vincoli speciali"), blend_colors(COLOR_WHITE, COLOR_YELLOW, 0.60), COLOR_BLACK);
|
||||||
|
|
||||||
TCalendar_field & cf = (TCalendar_field &) field(F_CALENDAR);
|
TCalendar_field & cf = (TCalendar_field &) field(F_CALENDAR);
|
||||||
|
|
||||||
@ -4474,6 +4530,19 @@ int TCRPCheck_mask::fill_mask(const bool show_fields)
|
|||||||
// Applicazione principale
|
// Applicazione principale
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
bool TPlanning_app::menu(MENU_TAG mt)
|
||||||
|
{
|
||||||
|
bool ok = TRUE;
|
||||||
|
if (mt == MENU_ITEM(1))
|
||||||
|
{
|
||||||
|
TSelect_color_mask & s = _m->sel();
|
||||||
|
s.run();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ok = TSkeleton_application::menu(mt);
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
void TPlanning_app ::openfiles()
|
void TPlanning_app ::openfiles()
|
||||||
{
|
{
|
||||||
open_files(LF_TABCOM, LF_TAB, LF_DOC, LF_RIGHEDOC, LF_CLIFO, LF_CFVEN, LF_OCCAS, LF_INDSP, LF_CONDV,
|
open_files(LF_TABCOM, LF_TAB, LF_DOC, LF_RIGHEDOC, LF_CLIFO, LF_CFVEN, LF_OCCAS, LF_INDSP, LF_CONDV,
|
||||||
|
@ -41,6 +41,7 @@ class TPlanning_mask : public TCalendar_mask
|
|||||||
|
|
||||||
TSelect_color_mask _sel_color;
|
TSelect_color_mask _sel_color;
|
||||||
int _npr_pos;
|
int _npr_pos;
|
||||||
|
int _con_pos;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
enum Categoria_doc {_Doc_vincoli=1, _Doc_planning=2};
|
enum Categoria_doc {_Doc_vincoli=1, _Doc_planning=2};
|
||||||
@ -58,7 +59,8 @@ protected:
|
|||||||
bool general_review(bool check_machine, bool check_human, bool useextralines, bool useextrahours,bool lotsizing, bool no_outcapacity, int anticipomin,int anticipomax, TMSP_mode mode, TMSP_logic logic, const char *msg );
|
bool general_review(bool check_machine, bool check_human, bool useextralines, bool useextrahours,bool lotsizing, bool no_outcapacity, int anticipomin,int anticipomax, TMSP_mode mode, TMSP_logic logic, const char *msg );
|
||||||
int insert_propose(bool verbose=FALSE) ;
|
int insert_propose(bool verbose=FALSE) ;
|
||||||
bool remove_propose(bool verbose=FALSE) ;
|
bool remove_propose(bool verbose=FALSE) ;
|
||||||
void highlight(int row, int col, bool on) ;
|
void highlight_row(int row, bool on);
|
||||||
|
void highlight(int row, int col, bool on, bool special) ;
|
||||||
void add_or_sub_propose(char sign, bool scheduled=FALSE);
|
void add_or_sub_propose(char sign, bool scheduled=FALSE);
|
||||||
|
|
||||||
void propose(int row = -1);
|
void propose(int row = -1);
|
||||||
@ -129,6 +131,7 @@ public:
|
|||||||
bool test_tipodoc_num( const TSheet_field &sheet_num , const TSheet_field &sheet_type) ;
|
bool test_tipodoc_num( const TSheet_field &sheet_num , const TSheet_field &sheet_type) ;
|
||||||
|
|
||||||
int test_status(const TRectype& doc, int tipo) const;
|
int test_status(const TRectype& doc, int tipo) const;
|
||||||
|
bool test_special(const TString & tipodoc) const;
|
||||||
bool has_confirmed_status(const TRectype& doc, TToken_string &riga) const;
|
bool has_confirmed_status(const TRectype& doc, TToken_string &riga) const;
|
||||||
bool has_confirmed_status(const TRectype &doc) const;
|
bool has_confirmed_status(const TRectype &doc) const;
|
||||||
bool has_confirmed_status(const char * codnum, const char *tipodoc, char stato) const;
|
bool has_confirmed_status(const char * codnum, const char *tipodoc, char stato) const;
|
||||||
@ -162,6 +165,8 @@ protected:
|
|||||||
virtual TPlanning_mask& mask() {return *_m;}
|
virtual TPlanning_mask& mask() {return *_m;}
|
||||||
virtual void main_loop();
|
virtual void main_loop();
|
||||||
virtual bool firm_change_enabled() const { return FALSE; }
|
virtual bool firm_change_enabled() const { return FALSE; }
|
||||||
|
virtual bool TPlanning_app::menu(MENU_TAG mt);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TPlanning_app() : _m(NULL) {}
|
TPlanning_app() : _m(NULL) {}
|
||||||
};
|
};
|
||||||
|
@ -1558,7 +1558,7 @@ BEGIN
|
|||||||
FLAGS "U"
|
FLAGS "U"
|
||||||
END
|
END
|
||||||
|
|
||||||
STRING F_DESCART 70 50
|
STRING F_DESCART 150 50
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 1 2 "Descrizione "
|
PROMPT 1 2 "Descrizione "
|
||||||
FLAGS "DG"
|
FLAGS "DG"
|
||||||
|
@ -858,18 +858,58 @@ void TMSP_constraint::fill_sheet_row(TToken_string& row, const TMask & m, const
|
|||||||
const TString80 da_rdoc_key(da_rdoc_key());
|
const TString80 da_rdoc_key(da_rdoc_key());
|
||||||
|
|
||||||
if (da_rdoc_key.full())
|
if (da_rdoc_key.full())
|
||||||
|
{
|
||||||
|
TDocumento d('D', atoi(da_rdoc_key.smid(4,4)), da_rdoc_key.sleft(4).trim(), atoi(da_rdoc_key.smid(9,7)));
|
||||||
|
TDate cons(d.get_date("DATAORIG"));
|
||||||
|
|
||||||
|
if (!cons.ok())
|
||||||
|
cons = d.get_date(DOC_DATACONS);
|
||||||
|
|
||||||
|
if (cons.ok())
|
||||||
|
val << ' ' << cons.string() << ' ';
|
||||||
val << '¦' << da_rdoc_key;
|
val << '¦' << da_rdoc_key;
|
||||||
|
}
|
||||||
|
|
||||||
if ((descr == NULL || *descr == '\0') && __userflds != NULL && __userflds->full())
|
if ((descr == NULL || *descr == '\0') && __userflds != NULL && __userflds->full())
|
||||||
{
|
{
|
||||||
TString userdesc;
|
TString userdesc;
|
||||||
TString16 fldname;
|
TString16 fldname;
|
||||||
|
TString16 codnum;
|
||||||
|
TString fldval;
|
||||||
const TRectype & anamag = cache().get(LF_ANAMAG, articolo());
|
const TRectype & anamag = cache().get(LF_ANAMAG, articolo());
|
||||||
|
TToken_string fld("", '#');
|
||||||
|
|
||||||
for (int n = __userflds->get_int(0); n > 0; n = __userflds->get_int())
|
for (fld = __userflds->get(0); fld.full(); fld = __userflds->get())
|
||||||
{
|
{
|
||||||
fldname.format("USER%d", n);
|
|
||||||
const TString & fldval = anamag.get(fldname);
|
fldname = fld.get(0);
|
||||||
|
codnum = fld.get();
|
||||||
|
|
||||||
|
if (codnum.blank())
|
||||||
|
fldval = anamag.get(fldname);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fldval.cut(0);
|
||||||
|
TRelation rel(LF_RIGHEDOC);
|
||||||
|
TRectype& curr = rel.curr();
|
||||||
|
|
||||||
|
curr.put(RDOC_DAPROVV, 'D');
|
||||||
|
curr.put(RDOC_DAANNO, da_rdoc_key.smid(4,4));
|
||||||
|
curr.put(RDOC_DACODNUM, da_rdoc_key.sleft(4));
|
||||||
|
curr.put(RDOC_DANDOC, da_rdoc_key.smid(9,7));
|
||||||
|
curr.put(RDOC_DAIDRIGA, da_rdoc_key.smid(16));
|
||||||
|
|
||||||
|
TRectype filter_fr(curr), filter_to(curr);
|
||||||
|
TCursor cur(&rel, "", 4, &filter_fr, &filter_to);
|
||||||
|
const int items = cur.items();
|
||||||
|
|
||||||
|
for (cur = 0L; cur.pos() < items; ++cur)
|
||||||
|
if (cur.curr().get(RDOC_CODNUM) == codnum)
|
||||||
|
{
|
||||||
|
fldval = cur.curr().get(fldname);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (fldval.full())
|
if (fldval.full())
|
||||||
{
|
{
|
||||||
@ -1264,7 +1304,8 @@ TMSP_constraint* TMSP_constraints::find(long cliente,
|
|||||||
|
|
||||||
TMSP_constraint* TMSP_constraints::find(const TToken_string& row, bool create)
|
TMSP_constraint* TMSP_constraints::find(const TToken_string& row, bool create)
|
||||||
{
|
{
|
||||||
TString80 str,giaclev;
|
TString80 giaclev;
|
||||||
|
TString str;
|
||||||
_key.cut(0);
|
_key.cut(0);
|
||||||
|
|
||||||
for (int i = 0; i <= 11; i++)
|
for (int i = 0; i <= 11; i++)
|
||||||
@ -1398,7 +1439,8 @@ TMSP_line* TMSP_lines::find(const TToken_string& row, bool create)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TString80 str,giaclev;
|
TString str;
|
||||||
|
TString80 giaclev;
|
||||||
_key.cut(0);
|
_key.cut(0);
|
||||||
|
|
||||||
for (int i = 0; i <= 13; i++)
|
for (int i = 0; i <= 13; i++)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user