Patch level : 12.0 412
Files correlati : mr2.exe mr2100a.msk Corretto caricamento prezzi. Aggiunto flag ignora l'ultimo costo git-svn-id: svn://10.65.10.50/branches/R_10_00@23900 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
		
							parent
							
								
									aa27477b11
								
							
						
					
					
						commit
						a250aef70a
					
				@ -1269,8 +1269,10 @@ bool TMatResMask::on_field_event(TOperable_field& o, TField_event e, long jolly)
 | 
			
		||||
            {
 | 
			
		||||
              row.get(F_QUANTITA - FIRST_FIELD, qta);
 | 
			
		||||
              row.get(F_ARTICOLO - FIRST_FIELD, codart);
 | 
			
		||||
							if (codart == "01.50.40.0114")
 | 
			
		||||
								int i = 1;
 | 
			
		||||
              find_price(get(F_TIPOCV),get(F_CODCONDV),get(F_CATVEN_CV),
 | 
			
		||||
                  "F", codfor, codart, qta, price);
 | 
			
		||||
                  "F", codfor, codart, qta, price, get_bool(F_IGNORE_ULTCOS));
 | 
			
		||||
              row.add(price.string(), F_PREZZO - FIRST_FIELD);
 | 
			
		||||
							so.force_update(so.selected());
 | 
			
		||||
            }
 | 
			
		||||
@ -3001,10 +3003,11 @@ bool TMatResPlanning::build_orders()
 | 
			
		||||
 | 
			
		||||
	if (orders==0)
 | 
			
		||||
    message_box(TR("Nessun ordine da emettere"));
 | 
			
		||||
  real price, qta;
 | 
			
		||||
  TCodice_articolo codart;
 | 
			
		||||
  FOR_EACH_SHEET_ROW(sf,n,row)
 | 
			
		||||
  {
 | 
			
		||||
	  real price, qta;
 | 
			
		||||
 | 
			
		||||
		row->get(F_QUANTITA - FIRST_FIELD,qta);
 | 
			
		||||
    row->get(F_ARTICOLO - FIRST_FIELD,codart);
 | 
			
		||||
    const long codforn=row->get_long(F_FORNITORE - FIRST_FIELD);
 | 
			
		||||
@ -3019,8 +3022,10 @@ bool TMatResPlanning::build_orders()
 | 
			
		||||
      tipoord = " ";
 | 
			
		||||
    else
 | 
			
		||||
      tipoord = "F";
 | 
			
		||||
									if (codart == "01.50.40.0114")
 | 
			
		||||
								int i = 1;
 | 
			
		||||
    find_price(m.get(F_TIPOCV),m.get(F_CODCONDV),m.get(F_CATVEN_CV),
 | 
			
		||||
        tipoord, codforn, codart, qta,  price);
 | 
			
		||||
        tipoord, codforn, codart, qta,  price, m.get_bool(F_IGNORE_ULTCOS));
 | 
			
		||||
    row->add(price.string(), F_PREZZO - FIRST_FIELD);
 | 
			
		||||
 | 
			
		||||
    if (!art_prod || !art_acq)
 | 
			
		||||
 | 
			
		||||
@ -63,6 +63,7 @@
 | 
			
		||||
#define F_DA_ART             258 
 | 
			
		||||
#define F_A_ART              259
 | 
			
		||||
#define F_SPLIT_SONS         260
 | 
			
		||||
#define F_IGNORE_ULTCOS      261
 | 
			
		||||
 | 
			
		||||
// campi senza default sul profilo
 | 
			
		||||
#define F_YEAR        301
 | 
			
		||||
 | 
			
		||||
@ -383,6 +383,11 @@ BEGIN
 | 
			
		||||
  ITEM "F|Fornitore"
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
BOOLEAN F_IGNORE_ULTCOS
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 2 9 "Ignora gli ultimi costi"
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
BOOLEAN F_DIVIDEBYART
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 2 10  "Suddividi gli ordini per articolo"
 | 
			
		||||
 | 
			
		||||
@ -794,8 +794,11 @@ bool TPlanning_mask::carica_documenti()
 | 
			
		||||
              line->qta(buck) += q.val();
 | 
			
		||||
              }
 | 
			
		||||
              real price;
 | 
			
		||||
														if (art == "01.50.40.0114")
 | 
			
		||||
								int i = 1;
 | 
			
		||||
 | 
			
		||||
              find_price(get(F_TIPOCV),get(F_CODCONDV),get(F_CATVEN_CV),
 | 
			
		||||
		                     get(F_TIPOCF), clifor, art, line->qta(buck), price);
 | 
			
		||||
		                     get(F_TIPOCF), clifor, art, line->qta(buck), price, get_bool(F_IGNORE_ULTCOS));
 | 
			
		||||
              line->price(buck) = price;
 | 
			
		||||
            }
 | 
			
		||||
          }
 | 
			
		||||
@ -1314,12 +1317,15 @@ void TPlanning_mask::add_or_sub_propose(char sign, bool scheduled)
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      highlight(art_row, F_BUCKET1 + b*2, prop != ZERO && art_per_buck != ZERO, special);
 | 
			
		||||
										if (a.articolo() == "01.50.40.0114")
 | 
			
		||||
								int i = 1;
 | 
			
		||||
 | 
			
		||||
      artrow.add(art_per_buck.string(), F_BUCKET1 + b*2 - FIRST_FIELD);
 | 
			
		||||
      real price;
 | 
			
		||||
      if (!art_per_buck.is_zero())
 | 
			
		||||
        find_price(get(F_TIPOCV),get(F_CODCONDV),get(F_CATVEN_CV),
 | 
			
		||||
              get(F_TIPOCF), a.codclifor(), a.articolo(), 
 | 
			
		||||
                art_per_buck, price);
 | 
			
		||||
                art_per_buck, price, get_bool(F_IGNORE_ULTCOS));
 | 
			
		||||
      artrow.add(price.string(), F_BUCKET1 + b*2 + 1 - FIRST_FIELD);
 | 
			
		||||
    }
 | 
			
		||||
    test_art_row(art_row,false);
 | 
			
		||||
@ -3517,10 +3523,14 @@ bool TPlanning_mask::on_field_event(TOperable_field& o, TField_event e, long jol
 | 
			
		||||
				TMask_field &fprice=m.field(o.dlg()+1);
 | 
			
		||||
				real qta(o.get());
 | 
			
		||||
				real price(fprice.get());
 | 
			
		||||
 | 
			
		||||
														if (m.get(F_ARTICOLO) == "01.50.40.0114")
 | 
			
		||||
								int i = 1;
 | 
			
		||||
 | 
			
		||||
				if (!qta.is_zero() && price.is_zero())
 | 
			
		||||
					find_price(get(F_TIPOCV),get(F_CODCONDV),get(F_CATVEN_CV),
 | 
			
		||||
							m.get(F_TIPOCF_SHEET), m.get_long(F_CLIENTE), m.get(F_ARTICOLO),
 | 
			
		||||
								qta , price);
 | 
			
		||||
								qta , price, get_bool(F_IGNORE_ULTCOS));
 | 
			
		||||
				fprice.set(price.string());
 | 
			
		||||
				if (qta != ZERO)
 | 
			
		||||
					highlight(s.selected(), o.dlg(), true, false);
 | 
			
		||||
 | 
			
		||||
@ -99,6 +99,7 @@
 | 
			
		||||
#define F_IMP              267
 | 
			
		||||
#define F_IGNORE_PREC      268
 | 
			
		||||
#define F_SINGLE_DOC       269
 | 
			
		||||
#define F_IGNORE_ULTCOS    270
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#define F_MSP_SORT_PRILIN  290
 | 
			
		||||
 | 
			
		||||
@ -470,9 +470,14 @@ BEGIN
 | 
			
		||||
  CHECKTYPE REQUIRED
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
BOOLEAN F_IGNORE_ULTCOS
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 2 18 "Ignora gli ultimi costi"
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
BOOLEAN F_IGNORE_PREC
 | 
			
		||||
BEGIN
 | 
			
		||||
  PROMPT 2 18 "Ignora le pianificazioni precedenti alla data iniziale"
 | 
			
		||||
  PROMPT 2 19 "Ignora le pianificazioni precedenti alla data iniziale"
 | 
			
		||||
END
 | 
			
		||||
 | 
			
		||||
ENDPAGE
 | 
			
		||||
 | 
			
		||||
@ -1421,7 +1421,7 @@ TImpianto * TLinea_prod::get_impianto() const
 | 
			
		||||
 | 
			
		||||
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 * codice, const real & qta, real & price, bool ignore_ultcos)
 | 
			
		||||
{
 | 
			
		||||
  static TCondizione_vendita *_condv =NULL;
 | 
			
		||||
 | 
			
		||||
@ -1450,17 +1450,20 @@ void find_price(const TString &tipocv, const TString &codcv, const TString &codc
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
      _condv->put_condv(tipocv,cod,codcatven, tipocf, strcodcf);
 | 
			
		||||
      if (_condv->ricerca(codice, qta))
 | 
			
		||||
      if (_condv->ricerca(codice, qta, true))
 | 
			
		||||
        price = _condv->get_prezzo();
 | 
			
		||||
    }
 | 
			
		||||
    break;
 | 
			
		||||
  default:
 | 
			
		||||
    break;
 | 
			
		||||
  }
 | 
			
		||||
	if (!ignore_ultcos)
 | 
			
		||||
	{
 | 
			
		||||
		if (price == ZERO)
 | 
			
		||||
			price = cache().get(LF_ANAMAG,codice).get_real(ANAMAG_ULTCOS1);
 | 
			
		||||
		if (price == ZERO)
 | 
			
		||||
			price = cache().get(LF_ANAMAG,codice).get_real(ANAMAG_ULTCOS2);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void TProduzione::init()
 | 
			
		||||
 | 
			
		||||
@ -308,7 +308,7 @@ TImpianto  * get_impianto(const char * codice);
 | 
			
		||||
TLinea_prod* get_linea(const char * codice);
 | 
			
		||||
 | 
			
		||||
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, bool ignore_ultcos = false);
 | 
			
		||||
 | 
			
		||||
///////////////////////////////////////////////////////////
 | 
			
		||||
// Utility
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user