Example #1
0
void dspInventoryHistoryByOrderNumber::sViewTransInfo()
{
  QString transtype(((XTreeWidgetItem *)_invhist->currentItem())->text(_invhist->column("invhist_transtype")));

  ParameterList params;
  params.append("mode", "view");
  params.append("invhist_id", _invhist->id());

  if (transtype == "AD")
  {
    adjustmentTrans *newdlg = new adjustmentTrans();
    newdlg->set(params);
    omfgThis->handleNewWindow(newdlg);
  }
  else if (transtype == "TW")
  {
    transferTrans *newdlg = new transferTrans();
    newdlg->set(params);
    omfgThis->handleNewWindow(newdlg);
  }
  else if (transtype == "SI")
  {
    scrapTrans *newdlg = new scrapTrans();
    newdlg->set(params);
    omfgThis->handleNewWindow(newdlg);
  }
  else if (transtype == "EX")
  {
    expenseTrans *newdlg = new expenseTrans();
    newdlg->set(params);
    omfgThis->handleNewWindow(newdlg);
  }
  else if (transtype == "RX")
  {
    materialReceiptTrans *newdlg = new materialReceiptTrans();
    newdlg->set(params);
    omfgThis->handleNewWindow(newdlg);
  }
  else if (transtype == "CC")
  {
    countTag newdlg(this, "", TRUE);
    newdlg.set(params);
    newdlg.exec();
  }
  else
  {
    transactionInformation newdlg(this, "", TRUE);
    newdlg.set(params);
    newdlg.exec();
  }
}
Example #2
0
 BOOST_FORCEINLINE static void doit2(const T& a, value_type& b, Out0& r)
 {
   r.resize(extent(a));
   typedef typename A0::index_type        index_type;
   typedef table<value_type, index_type> result_type;
   typedef table<cplx_type>                  ct_type;
   bool is_ltz_b = is_ltz(b);
   if(is_ltz(b)) b = -b;
   value_type m = nt2::trunc(b);
   value_type f = b-m;
   ct_type q, t;
   nt2::tie(q, t) = schur(nt2::complexify(a),'N'); // t is complex schur form.        result_type e, v;
   if (isdiagonal(t))
   {
     t = nt2::from_diag(nt2::pow(diag_of(t), m));
     if(is_ltz_b) t = nt2::inv(t);
     BOOST_AUTO_TPL(z, nt2::mtimes(q, nt2::mtimes(t, nt2::trans(nt2::conj(q)))));
     transtype(r, z, typename nt2::meta::is_complex<value_type>::type());
     return;
   }
   else
   { //use iterative method
     r = nt2::eye(nt2::size(a), meta::as_<value_type>());
     result_type rf = r;
     if (m)
     {
       result_type a00 = a;
       while (m >= nt2::One<value_type>())
       {
         if (nt2::is_odd(m))
         {
           r =  nt2::mtimes(a00, r);
         }
         a00 =  nt2::mtimes(a00, a00);
         m =  nt2::trunc(m/2); //Half<value_type>(); or >> 1
       }
     }
     if(!f)
     {
       if(is_ltz_b) r = nt2::inv(r);
       return;
     }
     else
     {
       result_type a00 = nt2::sqrtm(a);
       value_type thresh = nt2::Half<value_type>();
       while (f > Zero<value_type>())
       {
         if (f >= thresh)
         {
           rf = nt2::mtimes(rf, a00);
           f -= thresh;
         }
         thresh *= nt2::Half<value_type>();
         a00 =  nt2::sqrtm(a00);
       }
     }
     r= nt2::mtimes(r, rf);
     if(is_ltz_b) r = nt2::inv(r);
   }
 }