Esempio n. 1
0
 /**
  * Create a new Quotaion to a specific Debtor
  * @param  integer  $debtorNumber
  * @param  Closure $callback
  * @return object
  */
 public function create($debtorNumber, Closure $callback)
 {
     $debtor = new Debtor($this->client_raw);
     $debtorHandle = $debtor->getHandle($debtorNumber);
     $quotationHandle = $this->client->Quotation_Create(array('debtorHandle' => $debtorHandle))->Quotation_CreateResult;
     if (!$quotationHandle->Id) {
         throw new Exception("Error: creating Quotation.");
     }
     $this->lines = new QuotationLines($this->client_raw, $quotationHandle);
     call_user_func($callback, $this->lines);
     return $this->get($quotationHandle);
 }