Patch level : 10.0 856
Files correlati : mr2.exe Ricompilazione Demo : [ ] Commento : Aggiunta funzionwe per spostare una cella o una colonna ad una certa data con F8 sulla cella git-svn-id: svn://10.65.10.50/branches/R_10_00@21274 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
b8aa565c09
commit
06c1fcbeae
@ -18,6 +18,8 @@
|
|||||||
#include "mr2100a.h"
|
#include "mr2100a.h"
|
||||||
#include "mr2100c.h"
|
#include "mr2100c.h"
|
||||||
|
|
||||||
|
#define NODIST "NODIST"
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Utility
|
// Utility
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
@ -1513,10 +1515,10 @@ int TMatResMask::add_order_line(long forn, const TMRP_line& line, int bucket)
|
|||||||
} while (nref >= 0 /*&& q > ZERO*/);
|
} while (nref >= 0 /*&& q > ZERO*/);
|
||||||
if (line.final_product())
|
if (line.final_product())
|
||||||
{
|
{
|
||||||
COLOR back;
|
COLOR back = NORMAL_BACK_COLOR;
|
||||||
COLOR fore;
|
COLOR fore = NORMAL_COLOR;
|
||||||
|
|
||||||
_sel_color.get_color("NODIST", back, fore);
|
_sel_color.get_color(NODIST, back, fore);
|
||||||
s.set_back_and_fore_color(back, fore, pos);
|
s.set_back_and_fore_color(back, fore, pos);
|
||||||
}
|
}
|
||||||
return pos;
|
return pos;
|
||||||
@ -1681,7 +1683,7 @@ TMatResMask::TMatResMask() : TCalendar_mask("mr2100a"), _sel_color("mr2100a")
|
|||||||
disable(F_NOIMP); // Forza l'ignoramento degli impianti
|
disable(F_NOIMP); // Forza l'ignoramento degli impianti
|
||||||
set(F_NOIMP, "X");
|
set(F_NOIMP, "X");
|
||||||
}
|
}
|
||||||
_sel_color.add_color_def("NODIST", TR("Art.pianificati senza distinta"), COLOR_YELLOW, COLOR_BLACK);
|
_sel_color.add_color_def(NODIST, TR("Art.pianificati senza distinta"), COLOR_YELLOW, COLOR_BLACK);
|
||||||
set_handler(F_DADATA, handle_interval);
|
set_handler(F_DADATA, handle_interval);
|
||||||
set_handler(F_ADATA, handle_interval);
|
set_handler(F_ADATA, handle_interval);
|
||||||
|
|
||||||
|
@ -9,6 +9,9 @@
|
|||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
|
|
||||||
|
#define PROP "PROP"
|
||||||
|
#define CONST "CONST"
|
||||||
|
|
||||||
#include "../ve/veconf.h"
|
#include "../ve/veconf.h"
|
||||||
|
|
||||||
class TMSPCheck_mask : public TAutomask
|
class TMSPCheck_mask : public TAutomask
|
||||||
@ -940,6 +943,7 @@ int TPlanning_mask::find_constr_row(TMSP_constraint& cons)
|
|||||||
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);
|
highlight_row(sf.items() - 1, special);
|
||||||
r = sf.items()-3+2; // vacca
|
r = sf.items()-3+2; // vacca
|
||||||
|
|
||||||
@ -1182,7 +1186,7 @@ void TPlanning_mask::highlight_row(int row, bool on)
|
|||||||
COLOR fore = NORMAL_COLOR;
|
COLOR fore = NORMAL_COLOR;
|
||||||
|
|
||||||
if (on)
|
if (on)
|
||||||
_sel_color.get_color("CONST", back, fore);
|
_sel_color.get_color(CONST, back, fore);
|
||||||
|
|
||||||
sfield(F_ARTICOLI).set_back_and_fore_color(back, fore, row);
|
sfield(F_ARTICOLI).set_back_and_fore_color(back, fore, row);
|
||||||
}
|
}
|
||||||
@ -1193,10 +1197,10 @@ void TPlanning_mask::highlight(int row, int col, bool on, bool special)
|
|||||||
COLOR fore = NORMAL_COLOR;
|
COLOR fore = NORMAL_COLOR;
|
||||||
|
|
||||||
if (on)
|
if (on)
|
||||||
_sel_color.get_color("PROP", back, fore);
|
_sel_color.get_color(PROP, back, fore);
|
||||||
else
|
else
|
||||||
if (special)
|
if (special)
|
||||||
_sel_color.get_color("CONST", back, fore);
|
_sel_color.get_color(CONST, back, fore);
|
||||||
sfield(F_ARTICOLI).set_back_and_fore_color(back, fore, row, col);
|
sfield(F_ARTICOLI).set_back_and_fore_color(back, fore, row, col);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2116,7 +2120,7 @@ bool TPlanning_mask::load_MRP_lines(TMSP_mode mode, int level, int numriga)
|
|||||||
is_second_level=(atoi(row->get(F_PRIORITA-FIRST_FIELD))>=prior);
|
is_second_level=(atoi(row->get(F_PRIORITA-FIRST_FIELD))>=prior);
|
||||||
else
|
else
|
||||||
is_second_level=(row->get_char(F_MASTERCODE-FIRST_FIELD)==MASTERCODE_CHAR);
|
is_second_level=(row->get_char(F_MASTERCODE-FIRST_FIELD)==MASTERCODE_CHAR);
|
||||||
skip = (level == 1 && !is_second_level) || (level == 2 && is_second_level);
|
skip = (level == 1 && !is_second_level) || (level == 2 && is_second_level );
|
||||||
}
|
}
|
||||||
if (!skip)
|
if (!skip)
|
||||||
{
|
{
|
||||||
@ -3404,7 +3408,7 @@ bool TPlanning_mask::on_field_event(TOperable_field& o, TField_event e, long jol
|
|||||||
case F_BUCKET28:
|
case F_BUCKET28:
|
||||||
case F_BUCKET29:
|
case F_BUCKET29:
|
||||||
case F_BUCKET30:
|
case F_BUCKET30:
|
||||||
if (e == fe_magic)
|
if (e == fe_magic)
|
||||||
{
|
{
|
||||||
TMask m("mr2200g");
|
TMask m("mr2200g");
|
||||||
|
|
||||||
@ -3415,25 +3419,82 @@ bool TPlanning_mask::on_field_event(TOperable_field& o, TField_event e, long jol
|
|||||||
|
|
||||||
TSheet_field& s = sfield(F_ARTICOLI);
|
TSheet_field& s = sfield(F_ARTICOLI);
|
||||||
const bool all = m.get_bool(F_ALL);
|
const bool all = m.get_bool(F_ALL);
|
||||||
const short from_bucket = o.dlg();
|
const bool vincoli = m.get_bool(F_VINCOLI);
|
||||||
const short to_bucket = (bucket(m.get_date(F_TODATE)) + 1) * 2 + F_BUCKET0;
|
const bool pian = m.get_bool(F_PIAN);
|
||||||
|
const short from_id = o.dlg();
|
||||||
|
const short from_bucket = (from_id - F_BUCKET0) / 2;
|
||||||
|
const short from_col = s.cid2index(from_id);
|
||||||
|
const TDate to(m.get_date(F_TODATE));
|
||||||
|
const short to_bucket = bucket(to) + 1;
|
||||||
|
const short to_id = (to_bucket) * 2 + F_BUCKET0;
|
||||||
|
const short to_col = s.cid2index(to_id);
|
||||||
const int from_row = all ? 0 : s.selected();
|
const int from_row = all ? 0 : s.selected();
|
||||||
const int to_row = all ? s.items() - 1 : s.selected();
|
const int to_row = all ? s.items() - 1 : s.selected();
|
||||||
|
|
||||||
for (int r = from_row; r <= to_row; r++)
|
for (int r = from_row; r <= to_row; r++)
|
||||||
{
|
{
|
||||||
TToken_string & row = s.row(r);
|
TToken_string & row = s.row(r);
|
||||||
const real qtafrom(row.get(s.cid2index(from_bucket)));
|
|
||||||
real qtato(row.get(s.cid2index(to_bucket)));
|
if (!s.cell_disabled(r,F_BUCKET1-FIRST_FIELD))
|
||||||
|
{
|
||||||
|
if (pian)
|
||||||
|
{
|
||||||
|
const real qtafrom(row.get(from_col));
|
||||||
|
real qtato(row.get(to_col));
|
||||||
|
|
||||||
qtato += qtafrom;
|
qtato += qtafrom;
|
||||||
row.add("", s.cid2index(from_bucket));
|
row.add("", from_col);
|
||||||
row.add(qtato.string(), s.cid2index(to_bucket));
|
row.add(qtato.string(), to_col);
|
||||||
s.update_mask(r);
|
s.update_mask(r);
|
||||||
|
}
|
||||||
|
if (vincoli)
|
||||||
|
{
|
||||||
|
real qta_vincoli;
|
||||||
|
TMSP_constraint *c = _constraints.find(s.row(r - 1));
|
||||||
|
|
||||||
|
if (c != NULL)
|
||||||
|
{
|
||||||
|
int items = c->rigarefs(from_bucket);
|
||||||
|
|
||||||
|
for (int rc = 0; rc < items; rc++)
|
||||||
|
{
|
||||||
|
TMRP_docref * rdr= c->rigaref(from_bucket,(int)rc);
|
||||||
|
if (rdr)
|
||||||
|
{
|
||||||
|
TDocumento doc('D', rdr->annodoc(), rdr->codnumdoc(), rdr->numdoc());
|
||||||
|
const int numrig = rdr->numrig();
|
||||||
|
qta_vincoli += rdr->qta_residua();
|
||||||
|
|
||||||
|
if (numrig > 0)
|
||||||
|
{
|
||||||
|
TRiga_documento & row = doc[rdr->numrig()];
|
||||||
|
|
||||||
|
row.put(RDOC_DATACONS, to);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
doc.put(DOC_DATACONS, to);
|
||||||
|
doc.rewrite();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (r > 1)
|
||||||
|
{
|
||||||
|
TToken_string & row_vincoli = s.row(r - 2);
|
||||||
|
real qtato(row_vincoli.get(to_col));
|
||||||
|
real qtafrom(row_vincoli.get(from_col));
|
||||||
|
|
||||||
|
qtafrom -= qta_vincoli;
|
||||||
|
qtato += qta_vincoli;
|
||||||
|
row_vincoli.add(qtafrom.string(), from_col);
|
||||||
|
row_vincoli.add(qtato.string(), to_col);
|
||||||
|
// s.update_mask(r - 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
s.force_update();
|
s.force_update();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (e == fe_modify)
|
if (e == fe_modify)
|
||||||
{
|
{
|
||||||
const TSheet_field& s = sfield(F_ARTICOLI);
|
const TSheet_field& s = sfield(F_ARTICOLI);
|
||||||
@ -4054,8 +4115,8 @@ void TPlanning_mask::init()
|
|||||||
// sfield(F_TESTE).disable();
|
// sfield(F_TESTE).disable();
|
||||||
|
|
||||||
load_profile();
|
load_profile();
|
||||||
_sel_color.add_color_def("PROP", TR("Nuove proposte"), COLOR_YELLOW, COLOR_BLACK);
|
_sel_color.add_color_def(PROP, TR("Nuove proposte"), COLOR_YELLOW, COLOR_BLACK);
|
||||||
_sel_color.add_color_def("CONST", TR("Vincoli speciali"), blend_colors(COLOR_WHITE, COLOR_YELLOW, 0.60), COLOR_BLACK);
|
_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);
|
||||||
|
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
#define __MR2100G_H
|
#define __MR2100G_H
|
||||||
|
|
||||||
#define F_TODATE 201
|
#define F_TODATE 201
|
||||||
#define F_ALL 202
|
#define F_VINCOLI 202
|
||||||
|
#define F_PIAN 203
|
||||||
|
#define F_ALL 204
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,15 +1,25 @@
|
|||||||
#include "mr2200g.h"
|
#include "mr2200g.h"
|
||||||
|
|
||||||
PAGE "Spostamento quantita'" -1 -1 76 8
|
PAGE "Spostamento quantita'" -1 -1 76 10
|
||||||
|
|
||||||
DATA F_TODATE
|
DATA F_TODATE
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 2 "Sposta al "
|
PROMPT 2 2 "Sposta al "
|
||||||
END
|
END
|
||||||
|
|
||||||
|
BOOLEAN F_VINCOLI
|
||||||
|
BEGIN
|
||||||
|
PROMPT 2 4 "Sposta i vincoli"
|
||||||
|
END
|
||||||
|
|
||||||
|
BOOLEAN F_PIAN
|
||||||
|
BEGIN
|
||||||
|
PROMPT 33 4 "Sposta il pianificato"
|
||||||
|
END
|
||||||
|
|
||||||
BOOLEAN F_ALL
|
BOOLEAN F_ALL
|
||||||
BEGIN
|
BEGIN
|
||||||
PROMPT 2 4 "Sposta tutta la la colonna"
|
PROMPT 2 6 "Sposta tutta la la colonna"
|
||||||
END
|
END
|
||||||
|
|
||||||
BUTTON DLG_OK 10 2
|
BUTTON DLG_OK 10 2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user