Correzioni per DBService: creazione righe vuote indesiderate

git-svn-id: svn://10.65.10.50/branches/R_10_00@22962 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2014-06-24 12:42:42 +00:00
parent 94d1f9bf28
commit 0b7472f1db
4 changed files with 146 additions and 136 deletions

View File

@ -849,7 +849,7 @@ TMSP_constraint* TPlanning_mask::find_constraint(const TMSP_line& l, bool force_
} }
} }
TString da_rdoc_key(l.da_rdoc_key()); const TString da_rdoc_key = l.da_rdoc_key();
// cerca il vincolo con - stesso magazzino , impianto e linea // cerca il vincolo con - stesso magazzino , impianto e linea
TMSP_constraint* c = _constraints.find(codcli, l.articolo(), l.livgiac(), codimp, codlin, codmag, EMPTY_STRING, da_rdoc_key); TMSP_constraint* c = _constraints.find(codcli, l.articolo(), l.livgiac(), codimp, codlin, codmag, EMPTY_STRING, da_rdoc_key);
@ -1153,7 +1153,7 @@ bool TPlanning_mask::remove_propose(bool verbose)
bool remove_all = false; bool remove_all = false;
bool some = _proposed_articles.items() > 0L; // proposte attuali bool some = _proposed_articles.items() > 0L; // proposte attuali
if (some) if (some)
remove = (!verbose || yesno_box(TR("Vuoi annullare le nuove proposte?"))); remove = (!verbose || yesno_box(TR("Si desiderano annullare le nuove proposte?")));
if (!some && verbose) if (!some && verbose)
{ {
if (load_MRP_lines(_actual_plan)) if (load_MRP_lines(_actual_plan))
@ -1161,8 +1161,8 @@ bool TPlanning_mask::remove_propose(bool verbose)
some = _mrp_articles.items() > 0L; some = _mrp_articles.items() > 0L;
if (some) if (some)
{ {
remove = (noyes_box(TR("Vuoi annullare tutte le pianificazioni non confermate?"))); remove = (delete_box(TR("Si desiderano annullare tutte le pianificazioni non confermate?")));
if (remove && get_bool(F_RESCHEDULING) && noyes_box(TR("Vuoi annullare anche le pianificazioni confermate?"))) if (remove && get_bool(F_RESCHEDULING) && delete_box(TR("Vuoi annullare anche le pianificazioni confermate?")))
remove_all = true; remove_all = true;
} }
if (!remove) if (!remove)
@ -1211,7 +1211,7 @@ void TPlanning_mask::add_or_sub_propose(char sign, bool scheduled)
TSheet_field& sf = sfield(F_ARTICOLI); TSheet_field& sf = sfield(F_ARTICOLI);
for (long new_row=0; new_row < new_rows; new_row++) for (long new_row=0; new_row < new_rows; new_row++)
{ {
const TMRP_line & a=_proposed_articles[new_row]; const TMRP_line& a = _proposed_articles[new_row];
TMSP_line line(a.codclifor(), a.articolo(), a.livgiac(), a.codimp(), a.codlin(), a.codmagdep(), a.codmagdep_coll(), a.da_rdoc_key()); TMSP_line line(a.codclifor(), a.articolo(), a.livgiac(), a.codimp(), a.codlin(), a.codmagdep(), a.codmagdep_coll(), a.da_rdoc_key());
bool line_found = false; bool line_found = false;
@ -1247,12 +1247,15 @@ void TPlanning_mask::add_or_sub_propose(char sign, bool scheduled)
if (!sf.cell_disabled(art_row, F_BUCKET1-FIRST_FIELD)) if (!sf.cell_disabled(art_row, F_BUCKET1-FIRST_FIELD))
{ {
line_found=(a.codclifor()==codcli && a.articolo()==codart && a.livgiac()==liv line_found=(a.codclifor()==codcli && a.articolo()==codart && a.livgiac()==liv &&
&& a.codimp()==codimp && a.codlin()==codlin && a.codmagdep()==mag && a.da_rdoc_key() == da_rdoc_key); a.codimp()==codimp && a.codlin()==codlin && a.codmagdep()==mag &&
(a.da_rdoc_key() == da_rdoc_key) || (a.da_rdoc_key().blank() && da_rdoc_key.blank()));
if (line_found) if (line_found)
break; break;
} else { }
TMSP_constraint* currcons=_constraints.find(codcli, codart, liv, codimp, codlin, mag, magc, da_rdoc_key); else
{
TMSP_constraint* currcons = _constraints.find(codcli, codart, liv, codimp, codlin, mag, magc, da_rdoc_key);
if (constraint == currcons) if (constraint == currcons)
break; break;
} }
@ -1485,7 +1488,8 @@ void TPlanning_mask::propose_1stJIT(TMSP_logic logic, bool check_machine, bool c
TDate dbuck(starting_date()); TDate dbuck(starting_date());
dbuck +=buck*days_per_bucket(); dbuck +=buck*days_per_bucket();
round_date(dbuck); round_date(dbuck);
message_box(FR("Quantita' proposte a partire dal %s (colonna %d)"), (const char *)dbuck.string(),buck); message_box(FR("Quantità proposte a partire dal %s (colonna %d)"),
(const char *)dbuck.string(),buck);
} }
else else
message_box(TR("Nessuna nuova proposta")); message_box(TR("Nessuna nuova proposta"));
@ -1501,7 +1505,9 @@ void TPlanning_mask::propose_1stJIT(TMSP_logic logic, bool check_machine, bool c
} }
void TPlanning_mask::review_cell(long mrp_row, int bucket, 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 firstfitxbucket) void TPlanning_mask::review_cell(long mrp_row, int bucket, 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 firstfitxbucket)
{ {
const bool ignore_mag = get_bool(F_NOMAG_IN); const bool ignore_mag = get_bool(F_NOMAG_IN);
const bool ignore_imp = get_bool(F_NOIMP_IN); const bool ignore_imp = get_bool(F_NOIMP_IN);
@ -1618,7 +1624,9 @@ void TPlanning_mask::review_cell(long mrp_row, int bucket, bool check_machine, b
} }
} }
} else { }
else
{
nlinea= curr_labor->find_linea(codlin); nlinea= curr_labor->find_linea(codlin);
if (nlinea<0) if (nlinea<0)
{ {
@ -1906,8 +1914,7 @@ bool TPlanning_mask::general_review(bool check_machine, bool check_human, bool u
pi.addstatus(1); pi.addstatus(1);
for (long mrp_row=0; mrp_row < max_mrp_rows; mrp_row++) for (long mrp_row=0; mrp_row < max_mrp_rows; mrp_row++)
{ {
pi.addstatus(1); if (!pi.addstatus(1))
if (pi.iscancelled())
return false; return false;
review_cell(mrp_row, bucket, check_machine, check_human, useextralines, useextrahours, lotsizing, no_outcapacity, anticipomin, anticipomax, mode, logic, msg, false); review_cell(mrp_row, bucket, check_machine, check_human, useextralines, useextrahours, lotsizing, no_outcapacity, anticipomin, anticipomax, mode, logic, msg, false);
} }
@ -2062,12 +2069,15 @@ void TPlanning_mask::msprow2codes(TToken_string &row,long &clifor, TCodice_artic
lin = row.get(F_CODLIN-FIRST_FIELD); lin.trim(); lin = row.get(F_CODLIN-FIRST_FIELD); lin.trim();
um = row.get(F_UM-FIRST_FIELD); um.trim(); um = row.get(F_UM-FIRST_FIELD); um.trim();
const TString val = row.get(F_DESCART-FIRST_FIELD); const TFixed_string val = row.get(F_DESCART-FIRST_FIELD);
const int pos = val.find('¦'); const int pos = val.find('¦');
if (pos >= 0) if (pos >= 0)
{
da_rdoc_key = val.mid(pos+1); da_rdoc_key = val.mid(pos+1);
da_rdoc_key.trim();
}
else else
da_rdoc_key = EMPTY_STRING; da_rdoc_key.cut(0);
} }
void TPlanning_mask::crprow2codes(TToken_string &row, TString & imp, TString & lin, long &clifor, TCodice_articolo &art , void TPlanning_mask::crprow2codes(TToken_string &row, TString & imp, TString & lin, long &clifor, TCodice_articolo &art ,
@ -3560,9 +3570,7 @@ bool TPlanning_mask::on_field_event(TOperable_field& o, TField_event e, long jol
break; break;
case F_CANCEL_MSP: case F_CANCEL_MSP:
if (e == fe_button) if (e == fe_button)
{
remove_propose(true); remove_propose(true);
}
break; break;
case F_RECALC_MSP: case F_RECALC_MSP:
if (e == fe_button && check_fields()) if (e == fe_button && check_fields())

View File

@ -3,7 +3,6 @@
#include <applicat.h> #include <applicat.h>
#include <colmask.h> #include <colmask.h>
#include "mrplib.h"
#include "mr2100.h" #include "mr2100.h"
#include "mr2201.h" #include "mr2201.h"
@ -147,7 +146,7 @@ public:
bool sortMSPsheet(); bool sortMSPsheet();
bool sortCRPsheet(); bool sortCRPsheet();
virtual bool is_acq_planning() { return FALSE;} virtual bool is_acq_planning() { return false;}
TSelect_color_mask & sel() { return _sel_color; } TSelect_color_mask & sel() { return _sel_color; }
TPlanning_mask(); TPlanning_mask();
virtual ~TPlanning_mask() { } virtual ~TPlanning_mask() { }
@ -162,12 +161,11 @@ protected:
void openfiles() ; void openfiles() ;
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); virtual bool TPlanning_app::menu(MENU_TAG mt);
public: public:
TPlanning_app() : _m(NULL) {} TPlanning_app() : _m(NULL) {}
}; };
#endif // __MR2200_H #endif // __MR2200_H

View File

@ -486,7 +486,7 @@ END
LIST F_RECALC_TYPE 35 LIST F_RECALC_TYPE 35
BEGIN BEGIN
PROMPT 2 1 "Logica propositiva " PROMPT 2 1 "Logica proposte "
#ifndef _IS_ACQ #ifndef _IS_ACQ
ITEM "1|FirstFit " ITEM "1|FirstFit "
MESSAGE ENABLE,G_FINITE@ MESSAGE ENABLE,G_FINITE@
@ -525,12 +525,12 @@ END
BOOL F_FFBUCKET_MSP BOOL F_FFBUCKET_MSP
BEGIN BEGIN
PROMPT 60 1 "First Fit sui bucket" PROMPT 58 1 "Bucket First Fit"
END END
STRING F_PRIORITY 60 STRING F_PRIORITY 60
BEGIN BEGIN
PROMPT 2 2 "Priorita' " PROMPT 2 2 "Prioritŕ "
END END
BOOL F_LOTSIZING BOOL F_LOTSIZING
@ -779,7 +779,7 @@ END
BOOL F_MSP_SORT_PRILIN BOOL F_MSP_SORT_PRILIN
BEGIN BEGIN
PROMPT 52 3 "Prioritŕ di linea" PROMPT 55 3 "Prioritŕ di linea"
END END
BUTTON F_MSP_RESORT 9 BUTTON F_MSP_RESORT 9

View File

@ -1219,6 +1219,7 @@ void TMSP_constraint::init()
__userflds = new TToken_string(c.get("USERFLDS")); __userflds = new TToken_string(c.get("USERFLDS"));
__sep = c.get_char("FLDSEP", NULL, -1, ';'); __sep = c.get_char("FLDSEP", NULL, -1, ';');
} }
_da_rdoc_key.trim();
} }
TMSP_constraint::TMSP_constraint(long cliente, TMSP_constraint::TMSP_constraint(long cliente,
@ -1347,7 +1348,10 @@ TMSP_constraint* TMSP_constraints::find(const TToken_string& row, bool create)
const int pos = str.find('¦'); const int pos = str.find('¦');
if (pos >= 0) if (pos >= 0)
{
_key.add(str.mid(pos +1)); _key.add(str.mid(pos +1));
_key.rtrim();
}
else else
_key.add(""); _key.add("");