Esempio n. 1
0
 /**
  * Sets the order shipping costs
  * 
  * @since 1.0.0
  * @param string $amount Contains the shipping costs in cents
  * @param int $vat Contains the VAT category in percentages
  * @param string $name Contains the shipping name
  * @return Order
  */
 public function setShippingCosts($amount, $vat = -1, $name = 'Shipping Costs')
 {
     $obj = OrderProduct::create()->setProductID('01')->setProductName($name)->setDescription('')->setQuantity('1')->setUnitPrice($amount)->setVATCategory(OrderVAT::getCategoryForPercentage($vat));
     $this->addProduct($obj);
     return $this;
 }
 function newOrderAdd()
 {
     $order = Order::create(array('strOrdersID' => Input::get('orderID'), 'strSupplID' => Input::get('supplierID'), 'dtOrdDate' => date('Y-m-d'), 'strPlacedBy' => Input::get('empID')));
     $order->save();
     $ids = DB::table('tblOrdNotes')->select('strOrdNotesID')->orderBy('updated_at', 'desc')->orderBy('strOrdNotesID', 'desc')->take(1)->get();
     $ID = $ids["0"]->strOrdNotesID;
     $newID = $this->smart($ID);
     $notes = OrderNotes::create(array('strOrdNotesID' => $newID, 'strOrderID' => Input::get('orderID'), 'strOrdNotesStat' => 'Pending'));
     $notes->save();
     $item = Input::get('itemsOrd');
     // 'strOPOrdersID', 'strOPProdID', 'intOPQuantity'
     for ($i = 0; $i < count($item); $i++) {
         $ordItem = OrderProduct::create(array('strOPOrdersID' => Input::get('orderID'), 'strOPProdID' => $item[$i][0], 'intOPQuantity' => $item[$i][2]));
         $ordItem->save();
     }
 }