/**
  * Set Quotation Line unit
  * by unit number
  * @param  mixed $QuotationLineHandle [description]
  * @param  integer $unit
  * @return boolean
  */
 public function unit($QuotationLineHandle, $unit)
 {
     $units = new Unit($this->client_raw);
     $unitHandle = $units->getHandle($unit);
     $this->client->QuotationLine_SetUnit(array('quotationLineHandle' => $QuotationLineHandle, 'valueHandle' => $unitHandle));
     return true;
 }
Esempio n. 2
0
 /**
  * Update an existion Product
  * @param  integer $no
  * @param  array   $data
  * @return object
  */
 public function update($no, array $data)
 {
     $handle = $this->getHandle($no);
     foreach ($data as $field => $value) {
         $request = array('productHandle' => $handle, "value" => $value);
         switch (strtolower($field)) {
             case 'cost':
                 $this->client->Product_SetCostPrice($request);
                 break;
             case 'description':
                 $this->client->Product_SetDescription($request);
                 break;
             case 'name':
                 $this->client->Product_SetName($request);
                 break;
             case 'group':
                 unset($request["value"]);
                 $group = new Group($this->client_raw);
                 $groupHandle = $group->getHandle($value);
                 $request["valueHandle"] = $groupHandle;
                 $this->client->Product_SetProductGroup($request);
                 break;
             case 'price':
                 $this->client->Product_SetSalesPrice($request);
                 break;
             case 'rrp':
                 $this->client->Product_SetRecommendedPrice($request);
                 break;
             case 'unit':
                 unset($request["value"]);
                 $unit = new Unit($this->client_raw);
                 $unitHandle = $unit->getHandle($value);
                 $request["valueHandle"] = $unitHandle;
                 $this->client->Product_SetUnit($request);
                 break;
         }
     }
     return $this->getArrayFromHandles($handle);
 }
Esempio n. 3
0
 /**
  * Set Quotation Line unit
  * by unit number
  * @param  mixed $QuotationLineHandle [description]
  * @param  integer $unit
  * @return boolean
  */
 public function unit($invoiceLineHandle, $unit)
 {
     $units = new Unit($this->client_raw);
     $unitHandle = $units->getHandle($unit);
     $this->client->CurrentInvoiceLine_SetUnit(array('currentInvoiceLineHandle' => $invoiceLineHandle, 'valueHandle' => $unitHandle));
     return true;
 }
 /**
  * Set Quotation Line unit by unit number
  *
  * @param object $orderLineHandle
  * @param $unit
  * @return bool
  */
 public function unit($orderLineHandle, $unit)
 {
     $units = new Unit($this->client_raw);
     $unitHandle = $units->getHandle($unit);
     $this->client->OrderLine_SetUnit(['orderLineHandle' => $orderLineHandle, 'valueHandle' => $unitHandle]);
     return true;
 }