Patch level : 12.0 382

Files correlati     : mr0.exe mr0400a.uml mr1.exe mr2.exe

Aggiunto un parametro per esplodere o no le distinte con spuntato il campo articolo di acquisto

git-svn-id: svn://10.65.10.50/branches/R_10_00@23767 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
bonazzi 2017-05-02 21:01:22 +00:00
parent 10355e1a40
commit 54367a0d01
11 changed files with 169 additions and 137 deletions

View File

@ -48,6 +48,7 @@
#define F_TIPONUM 145 #define F_TIPONUM 145
#define F_TIPOTIP 146 #define F_TIPOTIP 146
#define F_USE_GIAC_CORRETTA 147 #define F_USE_GIAC_CORRETTA 147
#define F_EXPLODE_ARTACQ 148
#define F_YEAR 201 #define F_YEAR 201
#define F_CALENDAR 202 #define F_CALENDAR 202

View File

@ -437,6 +437,12 @@ BEGIN
FIELD USE_GIAC_CORRETTA FIELD USE_GIAC_CORRETTA
END END
BOOLEAN F_EXPLODE_ARTACQ
BEGIN
PROMPT 2 17 "Esplodi gli articoli di acquisto"
FIELD EXPLODE_ARTACQ
END
ENDPAGE ENDPAGE
PAGE "Calendario" -1 -1 65 15 PAGE "Calendario" -1 -1 65 15

View File

@ -499,37 +499,40 @@ bool TRepgen_mask::elabora() const
// Calcoli per carico // Calcoli per carico
if (ts == carico) if (ts == carico)
{ {
distinta.set_root(riga); if (!is_buy_article(riga.get(RDOC_CODART)))
real ore,tot; {
distinta.set_root(riga);
real ore,tot;
TRiga_esplosione * llav = distinta.first_labor(lav_array, raggr); TRiga_esplosione * llav = distinta.first_labor(lav_array, raggr);
TLavorazione * lavorazione = TDistinta_tree::find_labor(llav); TLavorazione * lavorazione = TDistinta_tree::find_labor(llav);
while (llav) while (llav)
{ {
const int linea = lavorazione->find_linea(lin); const int linea = lavorazione->find_linea(lin);
const real prod_linea = lavorazione->produttiv_linea(linea); const real prod_linea = lavorazione->produttiv_linea(linea);
ore = (llav->val() * lavorazione->um_temporale().converti_in_ore()) / prod_linea; ore = (llav->val() * lavorazione->um_temporale().converti_in_ore()) / prod_linea;
if (carico_uomo) if (carico_uomo)
ore *= lavorazione->numpers_linea(linea); ore *= lavorazione->numpers_linea(linea);
//rep.qta(bucket) += ore; //rep.qta(bucket) += ore;
tot += ore; tot += ore;
llav = distinta.next_labor(lav_array); llav = distinta.next_labor(lav_array);
} }
if (tot > ZERO) if (tot > ZERO)
{ {
TMRP_rep_line& rep = *articles.find(art, liv, imp, lin, ws, TRUE); TMRP_rep_line& rep = *articles.find(art, liv, imp, lin, ws, TRUE);
rep.qta(bucket) += tot; rep.qta(bucket) += tot;
} }
// Sbatte nella cache le linee di cui dopo calcolera' le capacita' minime e massime // Sbatte nella cache le linee di cui dopo calcolera' le capacita' minime e massime
// In modo che il calcolo venga effettuato una volta sola per ogni linea. // In modo che il calcolo venga effettuato una volta sola per ogni linea.
if (capacita.objptr(lin) == NULL) if (capacita.objptr(lin) == NULL)
capacita.add(lin, new _TCapacitaLinea); // Vuoto per ora... lo riempie poco piu' giu' capacita.add(lin, new _TCapacitaLinea); // Vuoto per ora... lo riempie poco piu' giu'
}
} }
else // Produzione articoli nel tempo & scheduling linee else // Produzione articoli nel tempo & scheduling linee
{ {

View File

@ -20,21 +20,6 @@
#define NODIST "NODIST" #define NODIST "NODIST"
///////////////////////////////////////////////////////////
// Utility
///////////////////////////////////////////////////////////
static bool is_production_article(const TCodice_articolo& codart)
{
const TRectype& rec=cache().get(LF_DIST, codart);
bool art_prod = false;
if (rec.empty())
art_prod = cache().get(LF_ANAMAG, codart).get_bool(ANAMAG_ARTPROD);
else
art_prod = rec.get_bool(ANAMAG_ARTPROD);
return art_prod;
}
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
// TMRP_record // TMRP_record
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
@ -1411,8 +1396,8 @@ int TMatResMask::add_order_line(long forn, const TMRP_line& line, int bucket)
TRiga_ordine* r = new TRiga_ordine(datadoc, datacons, forn, line, bucket, ZERO); TRiga_ordine* r = new TRiga_ordine(datadoc, datacons, forn, line, bucket, ZERO);
// Setta un codice numerazione (provvisorio) in base al tipo di ordine // Setta un codice numerazione (provvisorio) in base al tipo di ordine
const char ot = r->get_char(F_ORD_TYPE - FIRST_FIELD); const char ot = r->get_char(F_ORD_TYPE - FIRST_FIELD);
r->add(ot == 'F' ? num_forn : num_prod, F_DOCCODNUM - FIRST_FIELD);
r->add(ot == 'F' ? num_forn : num_prod, F_DOCCODNUM - FIRST_FIELD);
nref--; nref--;
if (nref >= 0) if (nref >= 0)
{ {
@ -2275,61 +2260,66 @@ bool TMatResPlanning::explode_articles()
line.set_imp_lin(imp, lin); line.set_imp_lin(imp, lin);
} }
distinta.set_global("_DISTINTA", line.articolo()); if (!is_buy_article(line.articolo()))
distinta.set_global("_MAGDEP" , line.codmagdep()); {
distinta.set_global("_IMPIANTO", line.codimp()); distinta.set_global("_DISTINTA", line.articolo());
distinta.set_global("_LINEA" , line.codlin()); distinta.set_global("_MAGDEP" , line.codmagdep());
if (distinta.set_root(line.articolo(), "", 1.0 , line.livgiac())) distinta.set_global("_IMPIANTO", line.codimp());
{ distinta.set_global("_LINEA" , line.codlin());
line.set_final_product(FALSE); if (distinta.set_root(line.articolo(), "", 1.0 , line.livgiac()))
distinta.goto_root();
if (distinta.scan_depth_first(cyclic, NULL))
{ {
TToken_string & rdoc = (TToken_string &)line.da_rdoc_key(); line.set_final_product(false);
error_box ("Ordine %s %d/%ld riga n. %d - Distinta %s ciclica", (const char *) rdoc.left(4), atoi(rdoc.mid(4, 4)), atoi(rdoc.mid(9, 7)), atoi(rdoc.mid(16)), (const char *) line.articolo());
continue;
}
distinta.explode(boom, FALSE, RAGGR_EXP_UMBASE, 1, "AV");
for (int i = 0; i < boom.items(); i++)
{
const TRiga_esplosione& riga = (const TRiga_esplosione&)boom[i];
const TCodice_articolo& art = riga.articolo();
const TRectype& articolo=cache().get(LF_ANAMAG,art);
bool add=true;
if (articolo.get(ANAMAG_CODART).full())
{
const char reorder_type=articolo.get_char(ANAMAG_RIORDINO);
if (reorder_type!='F' && reorder_type!=' ' && reorder_type!='\0') // e' a riordino
add=false;
}
if (add)
{
// articolo gestito dall'MRP
TString8 mag = line.codmagdep();
TString8 imp = line.codimp();
TString8 lin = line.codlin();
_artinfo.art2magimpline(art, mag, imp, lin);
// GUY was here with Koki
const long codcli = is_production_article(art) ? line.codclifor() : 0L;
const TString& rdoc_key = line.da_rdoc_key();
TMRP_line* son = _articles.find(art, riga.giacenza(), mag, EMPTY_STRING, imp, lin, codcli, rdoc_key);
if (son == NULL)
{
son = _articles.find(art, riga.giacenza(), mag, EMPTY_STRING, imp, lin, codcli, rdoc_key, true);
son->set_description(distinta.describe(art));
}
const int son_depth = line.explosion_depth()+1;
if (son_depth > son->explosion_depth())
son->set_explosion_depth(son_depth);
line.add_son(riga.val(), son); distinta.goto_root();
distinta.describe(art); if (distinta.scan_depth_first(cyclic, NULL))
} {
TToken_string & rdoc = (TToken_string &)line.da_rdoc_key();
error_box ("Ordine %s %d/%ld riga n. %d - Distinta %s ciclica", (const char *) rdoc.left(4), atoi(rdoc.mid(4, 4)), atoi(rdoc.mid(9, 7)), atoi(rdoc.mid(16)), (const char *) line.articolo());
continue;
}
distinta.explode(boom, FALSE, RAGGR_EXP_UMBASE, 1, "AV");
for (int i = 0; i < boom.items(); i++)
{
const TRiga_esplosione& riga = (const TRiga_esplosione&)boom[i];
const TCodice_articolo& art = riga.articolo();
const TRectype& articolo=cache().get(LF_ANAMAG,art);
bool add=true;
if (articolo.get(ANAMAG_CODART).full())
{
const char reorder_type=articolo.get_char(ANAMAG_RIORDINO);
if (reorder_type!='F' && reorder_type!=' ' && reorder_type!='\0') // e' a riordino
add=false;
}
if (add)
{
// articolo gestito dall'MRP
TString8 mag = line.codmagdep();
TString8 imp = line.codimp();
TString8 lin = line.codlin();
_artinfo.art2magimpline(art, mag, imp, lin);
// GUY was here with Koki
const long codcli = is_production_article(art) ? line.codclifor() : 0L;
const TString& rdoc_key = line.da_rdoc_key();
TMRP_line* son = _articles.find(art, riga.giacenza(), mag, EMPTY_STRING, imp, lin, codcli, rdoc_key);
if (son == NULL)
{
son = _articles.find(art, riga.giacenza(), mag, EMPTY_STRING, imp, lin, codcli, rdoc_key, true);
son->set_description(distinta.describe(art));
}
const int son_depth = line.explosion_depth()+1;
if (son_depth > son->explosion_depth())
son->set_explosion_depth(son_depth);
line.add_son(riga.val(), son);
distinta.describe(art);
}
}
} }
} }
else
line.set_final_product(true);
} }
if (pi != NULL) delete pi; if (pi != NULL) delete pi;
@ -2696,7 +2686,6 @@ bool TMatResPlanning::build_orders()
{ {
pi.addstatus(1); pi.addstatus(1);
const TMRP_line& line = _articles[a]; const TMRP_line& line = _articles[a];
const bool prod = is_production_article(line.articolo()); const bool prod = is_production_article(line.articolo());
long codforn = 0; long codforn = 0;
if (!prod) // Se l'articolo NON e' di produzione ... if (!prod) // Se l'articolo NON e' di produzione ...
@ -2750,19 +2739,9 @@ bool TMatResPlanning::build_orders()
row->get(F_QUANTITA - FIRST_FIELD,qta); row->get(F_QUANTITA - FIRST_FIELD,qta);
row->get(F_ARTICOLO - FIRST_FIELD,codart); row->get(F_ARTICOLO - FIRST_FIELD,codart);
const long codforn=row->get_long(F_FORNITORE - FIRST_FIELD); const long codforn=row->get_long(F_FORNITORE - FIRST_FIELD);
const TRectype& rec=cache().get(LF_DIST, codart); const bool art_prod = is_production_article(codart);
bool art_prod, art_acq; const bool art_acq = is_buy_article(codart) || codforn != 0L;
if (rec.empty())
{
art_acq=TRUE;
art_prod = is_production_article(codart);
}
else
{
art_prod = rec.get_bool("ARTPROD");
art_acq = rec.get_bool("ARTACQ") || codforn != 0L;
}
TString4 tipoord = art_prod ? "P" : "F" ; TString4 tipoord = art_prod ? "P" : "F" ;
row->add(tipoord, F_ORD_TYPE - FIRST_FIELD); row->add(tipoord, F_ORD_TYPE - FIRST_FIELD);
sf.check_row(n); sf.check_row(n);

View File

@ -14,6 +14,10 @@
#include "../ve/veconf.h" #include "../ve/veconf.h"
///////////////////////////////////////////////////////////
// Utility
///////////////////////////////////////////////////////////
class TMSPCheck_mask : public TAutomask class TMSPCheck_mask : public TAutomask
{ {
protected: protected:
@ -1535,6 +1539,8 @@ void TPlanning_mask::review_cell(long mrp_row, int bucket, bool check_machine, b
codlin = row->get(F_CODLIN-FIRST_FIELD); codlin = row->get(F_CODLIN-FIRST_FIELD);
codimp = row->get(F_CODIMP-FIRST_FIELD); codimp = row->get(F_CODIMP-FIRST_FIELD);
} }
if (!is_production_article(mrpline.articolo()))
return;
dist_tree().set_global("_LIVELLO",livello_di_giacenza); dist_tree().set_global("_LIVELLO",livello_di_giacenza);
dist_tree().set_global("_IMPIANTO",codimp); dist_tree().set_global("_IMPIANTO",codimp);
dist_tree().set_global("_LINEA",codlin); dist_tree().set_global("_LINEA",codlin);

View File

@ -790,7 +790,7 @@ END
//BUTTON F_CHECK_MSP 9 2 //BUTTON F_CHECK_MSP 9 2
//BEGIN //BEGIN
// PROMPT 64 3 "Controlla" // PROMPT 64 3 "Controlla"
// PICTURE USER_BMP_CHECK // PICTURE BMP_CHECK
// GROUP G_POSTPROCESS // GROUP G_POSTPROCESS
//END //END
@ -936,7 +936,7 @@ END
BUTTON F_PRIORITY_HI 2 2 BUTTON F_PRIORITY_HI 2 2
BEGIN BEGIN
PROMPT -1 11 "^" PROMPT -1 11 "^"
PICTURE USER_BMP_ARROWUP PICTURE BMP_ARROWUP
END END
BUTTON F_PRIORITY_ST 2 2 BUTTON F_PRIORITY_ST 2 2
@ -948,7 +948,7 @@ END
BUTTON F_PRIORITY_LO 2 2 BUTTON F_PRIORITY_LO 2 2
BEGIN BEGIN
PROMPT -1 15 "v" PROMPT -1 15 "v"
PICTURE USER_BMP_ARROWDOWN PICTURE BMP_ARROWDOWN
END END
BUTTON F_SHRINK_ALL 17 1 BUTTON F_SHRINK_ALL 17 1
@ -2215,7 +2215,7 @@ END
BUTTON F_CHECKLINE 10 2 BUTTON F_CHECKLINE 10 2
BEGIN BEGIN
PROMPT 33 -1 "" PROMPT 33 -1 ""
PICTURE USER_BMP_CHECK PICTURE BMP_CHECK
END END
BUTTON F_DOCUMENTI_OUT 3 2 BUTTON F_DOCUMENTI_OUT 3 2

View File

@ -322,80 +322,80 @@ END
BUTTON FC_RIGHT_BAD 4 2 BUTTON FC_RIGHT_BAD 4 2
BEGIN BEGIN
PROMPT 46 19 "" PROMPT 46 19 ""
PICTURE USER_BMP_ARROWRIGHT_RED PICTURE BMP_DARROWR
GROUP G_MOVIMENTO GROUP G_MOVIMENTO
END END
BUTTON FC_DOWN_BAD 4 2 BUTTON FC_DOWN_BAD 4 2
BEGIN BEGIN
PROMPT 40 20 "" PROMPT 40 20 ""
PICTURE USER_BMP_ARROWDOWN_RED PICTURE BMP_DARROWDR
GROUP G_MOVIMENTO GROUP G_MOVIMENTO
END END
BUTTON FC_LEFT_BAD 4 2 BUTTON FC_LEFT_BAD 4 2
BEGIN BEGIN
PROMPT 34 19 "" PROMPT 34 19 ""
PICTURE USER_BMP_ARROWLEFT_RED PICTURE BMP_DARROWL2
GROUP G_MOVIMENTO GROUP G_MOVIMENTO
END END
BUTTON FC_UP_BAD 4 2 BUTTON FC_UP_BAD 4 2
BEGIN BEGIN
PROMPT 40 18 "" PROMPT 40 18 ""
PICTURE USER_BMP_ARROWUP_RED PICTURE BMP_DARROWU2
GROUP G_MOVIMENTO GROUP G_MOVIMENTO
END END
BUTTON FC_UPLEFT 4 2 BUTTON FC_UPLEFT 4 2
BEGIN BEGIN
PROMPT 4 16 "<" PROMPT 4 16 "<"
PICTURE USER_BMP_ARROWUPLEFT PICTURE BMP_DARROWUL
GROUP G_MOVIMENTO GROUP G_MOVIMENTO
END END
BUTTON FC_UP 4 2 BUTTON FC_UP 4 2
BEGIN BEGIN
PROMPT 10 16 "Su'" PROMPT 10 16 "Su'"
PICTURE USER_BMP_ARROWUP PICTURE BMP_DARROWU
GROUP G_MOVIMENTO GROUP G_MOVIMENTO
END END
BUTTON FC_UPRIGHT 4 2 BUTTON FC_UPRIGHT 4 2
BEGIN BEGIN
PROMPT 16 16 ">" PROMPT 16 16 ">"
PICTURE USER_BMP_ARROWUPRIGHT PICTURE BMP_DARROWUR
GROUP G_MOVIMENTO GROUP G_MOVIMENTO
END END
BUTTON FC_RIGHT 4 2 BUTTON FC_RIGHT 4 2
BEGIN BEGIN
PROMPT 16 18 ">" PROMPT 16 18 ">"
PICTURE USER_BMP_ARROWRIGHT PICTURE BMP_DARROWR
END END
BUTTON FC_DOWNRIGHT 4 2 BUTTON FC_DOWNRIGHT 4 2
BEGIN BEGIN
PROMPT 16 20 ">" PROMPT 16 20 ">"
PICTURE USER_BMP_ARROWDOWNRIGHT PICTURE BMP_DARROWDR
GROUP G_MOVIMENTO GROUP G_MOVIMENTO
END END
BUTTON FC_DOWN 4 2 BUTTON FC_DOWN 4 2
BEGIN BEGIN
PROMPT 10 20 "Giu'" PROMPT 10 20 "Giu'"
PICTURE USER_BMP_ARROWDOWN PICTURE BMP_DARROWD
GROUP G_MOVIMENTO GROUP G_MOVIMENTO
END END
BUTTON FC_DOWNLEFT 4 2 BUTTON FC_DOWNLEFT 4 2
BEGIN BEGIN
PROMPT 4 20 "<" PROMPT 4 20 "<"
PICTURE USER_BMP_ARROWDOWNLEFT PICTURE BMP_DARROWDL
GROUP G_MOVIMENTO GROUP G_MOVIMENTO
END END
BUTTON FC_LEFT 4 2 BUTTON FC_LEFT 4 2
BEGIN BEGIN
PROMPT 4 18 "<" PROMPT 4 18 "<"
PICTURE USER_BMP_ARROWLEFT PICTURE BMP_DARROWL
END END

View File

@ -185,70 +185,70 @@ END
BUTTON FC_RIGHT_BAD 4 2 BUTTON FC_RIGHT_BAD 4 2
BEGIN BEGIN
PROMPT 46 17 "" PROMPT 46 17 ""
PICTURE USER_BMP_ARROWRIGHT_RED PICTURE BMP_DARROWR2
END END
BUTTON FC_DOWN_BAD 4 2 BUTTON FC_DOWN_BAD 4 2
BEGIN BEGIN
PROMPT 40 18 "" PROMPT 40 18 ""
PICTURE USER_BMP_ARROWDOWN_RED PICTURE BMP_DARROWD2
END END
BUTTON FC_LEFT_BAD 4 2 BUTTON FC_LEFT_BAD 4 2
BEGIN BEGIN
PROMPT 34 17 "" PROMPT 34 17 ""
PICTURE USER_BMP_ARROWLEFT_RED PICTURE BMP_DARROWL2
END END
BUTTON FC_UP_BAD 4 2 BUTTON FC_UP_BAD 4 2
BEGIN BEGIN
PROMPT 40 16 "" PROMPT 40 16 ""
PICTURE USER_BMP_ARROWUP_RED PICTUREBMP_DARROWU2
END END
BUTTON FC_UPLEFT 4 2 BUTTON FC_UPLEFT 4 2
BEGIN BEGIN
PROMPT 4 14 "<" PROMPT 4 14 "<"
PICTURE USER_BMP_ARROWUPLEFT PICTURE BMP_DARROWUL
END END
BUTTON FC_UP 4 2 BUTTON FC_UP 4 2
BEGIN BEGIN
PROMPT 10 14 "Su'" PROMPT 10 14 "Su'"
PICTURE USER_BMP_ARROWUP PICTURE BMP_DARROWU
END END
BUTTON FC_UPRIGHT 4 2 BUTTON FC_UPRIGHT 4 2
BEGIN BEGIN
PROMPT 16 14 ">" PROMPT 16 14 ">"
PICTURE USER_BMP_ARROWUPRIGHT PICTURE BMP_DARROWUR
END END
BUTTON FC_RIGHT 4 2 BUTTON FC_RIGHT 4 2
BEGIN BEGIN
PROMPT 16 16 ">" PROMPT 16 16 ">"
PICTURE USER_BMP_ARROWRIGHT PICTURE BMP_DARROWR
END END
BUTTON FC_DOWNRIGHT 4 2 BUTTON FC_DOWNRIGHT 4 2
BEGIN BEGIN
PROMPT 16 18 ">" PROMPT 16 18 ">"
PICTURE USER_BMP_ARROWDOWNRIGHT PICTURE BMP_DARROWDR
END END
BUTTON FC_DOWN 4 2 BUTTON FC_DOWN 4 2
BEGIN BEGIN
PROMPT 10 18 "Giu'" PROMPT 10 18 "Giu'"6
PICTURE USER_BMP_ARROWDOWN PICTURE BMP_DARROWD
END END
BUTTON FC_DOWNLEFT 4 2 BUTTON FC_DOWNLEFT 4 2
BEGIN BEGIN
PROMPT 4 18 "<" PROMPT 4 18 "<"
PICTURE USER_BMP_ARROWDOWNLEFT PICTURE BMP_DARROWDL
END END
BUTTON FC_LEFT 4 2 BUTTON FC_LEFT 4 2
BEGIN BEGIN
PROMPT 4 16 "<" PROMPT 4 16 "<"
PICTURE USER_BMP_ARROWLEFT PICTURE BMP_DARROWL
END END

View File

@ -6,6 +6,7 @@
#include "../mg/mglib.h" #include "../mg/mglib.h"
#include "../ve/veconf.h" #include "../ve/veconf.h"
#include "mrplib.h"
#include "mr2100.h" #include "mr2100.h"
#include "mr2200.h" #include "mr2200.h"
@ -290,9 +291,10 @@ void complete_codlinea(TToken_string &r2, bool ignore_imp)
r2.get(F_SORTCODLIN-FIRST_FIELD, codlin); r2.get(F_SORTCODLIN-FIRST_FIELD, codlin);
// if (codlin.blank()) // if (codlin.blank())
// r2.get(F_CODLIN-FIRST_FIELD, codlin); // F_CODLIN == F_SORTCODLIN // r2.get(F_CODLIN-FIRST_FIELD, codlin); // F_CODLIN == F_SORTCODLIN
if (codlin.blank()) const TString codart = r2.get(F_ARTICOLO-FIRST_FIELD);
if (codlin.blank() && !is_production_article(codart))
{ {
if (dist_tree().set_root(r2.get(F_ARTICOLO-FIRST_FIELD))) if (dist_tree().set_root(codart))
{ {
dist_tree().set_global("_IMPIANTO",codimp); dist_tree().set_global("_IMPIANTO",codimp);
dist_tree().set_global("_LINEA",""); dist_tree().set_global("_LINEA","");
@ -1021,7 +1023,7 @@ int TMSP_constraint::find_distinta_master(const TMSP_constraint & constr, TStrin
dist_tree().set_global("_IMPIANTO",constr.codimp()); dist_tree().set_global("_IMPIANTO",constr.codimp());
dist_tree().set_global("_LINEA",constr.codlin()); dist_tree().set_global("_LINEA",constr.codlin());
dist_tree().set_global("_MAGDEP",constr.codmagdep()); dist_tree().set_global("_MAGDEP",constr.codmagdep());
if (dist_tree().set_root(constr.articolo())) if (dist_tree().set_root(constr.articolo())) // verificare
{ {
TArray sons; TArray sons;
dist_tree().explode(sons, FALSE, RAGGR_EXP_NONE, 1, "AV"); dist_tree().explode(sons, FALSE, RAGGR_EXP_NONE, 1, "AV");

View File

@ -12,6 +12,7 @@
#include <clifo.h> #include <clifo.h>
#include <cfven.h> #include <cfven.h>
#include "..\db\dist.h"
#include "..\mg\anamag.h" #include "..\mg\anamag.h"
@ -1630,3 +1631,30 @@ void TProduzione::copy_contents(const TProduzione& src)
} }
} }
///////////////////////////////////////////////////////////
// Utility
///////////////////////////////////////////////////////////
bool is_production_article(const TCodice_articolo& codart)
{
const TRectype& rec=cache().get(LF_DIST, codart);
bool art_prod = false;
if (rec.empty())
art_prod = cache().get(LF_ANAMAG, codart).get_bool(ANAMAG_ARTPROD);
else
art_prod = rec.get_bool(ANAMAG_ARTPROD) && (!is_buy_article(codart));
return art_prod;
}
bool is_buy_article(const TCodice_articolo& codart)
{
const TRectype& rec=cache().get(LF_DIST, codart);
bool art_acq = false;
if (rec.full())
art_acq = rec.get_bool(DIST_ARTACQ) && !ini_get_bool(CONFIG_DITTA, "mr", "EXPLODE_ARTACQ");
else
art_acq = !cache().get(LF_ANAMAG, codart).get_bool(ANAMAG_ARTPROD);
return art_acq;
}

View File

@ -310,6 +310,13 @@ TLinea_prod* get_linea(const char * codice);
void find_price(const TString &tipocv, const TString &codcv, const TString &codcatven, void find_price(const TString &tipocv, const TString &codcv, const TString &codcatven,
const char * tipocf, long codcf, const char * codice, const real & qta, real & price); const char * tipocf, long codcf, const char * codice, const real & qta, real & price);
///////////////////////////////////////////////////////////
// Utility
///////////////////////////////////////////////////////////
bool is_production_article(const TCodice_articolo& codart);
bool is_buy_article(const TCodice_articolo& codart);
class TProduzione : public TMultiple_rectype class TProduzione : public TMultiple_rectype
{ {