/**
  * @return array
  */
 public function prepare()
 {
     $data = ['payment_type' => $this->paymentType, 'date' => $this->date->format('d.m.Y'), 'mark_prepaid' => DataFormat::formatBool($this->markPrepaid)];
     if ($this->amount) {
         $data['amount'] = $this->amount;
     }
     return $data;
 }
Beispiel #2
0
 /**
  * @return array
  */
 public function prepare()
 {
     $data = ['count_code' => $this->countCode, 'code' => $this->code, 'name' => $this->name, 'name_desc' => $this->nameDesc, 'unit' => $this->unit, 'service' => DataFormat::formatBool($this->service), 'sales' => DataFormat::formatBool($this->sales), 'purchasing' => DataFormat::formatBool($this->purchasing), 'height' => $this->height, 'width' => $this->width, 'depth' => $this->depth, 'weight' => $this->weight, 'amount' => $this->amount, 'price' => $this->price, 'discount' => $this->discount, 'tax' => $this->tax];
     if ($this->mkId) {
         $data['mk_id'] = $this->mkId;
     }
     return $data;
 }
 /**
  * @return array
  */
 public function prepare()
 {
     $data = ['business_entity' => DataFormat::formatBool($this->businessEntity), 'taxpayer' => DataFormat::formatBool($this->taxpayer), 'foreign_county' => DataFormat::formatBool($this->foreignCountry), 'tax_id_number' => $this->taxIdNumber, 'customer' => $this->customer, 'street' => $this->street, 'post_number' => $this->postNumber, 'place' => $this->place, 'country' => $this->country];
     if ($this->partnerContact) {
         $data['partner_contact'] = $this->partnerContact->prepare();
     }
     if ($this->partnerDeliveryAddress) {
         $data['partner_delivery_address'] = $this->partnerDeliveryAddress->prepare();
     }
     return $data;
 }
Beispiel #4
0
 /**
  * @param \stdClass $data
  */
 public function parse(\stdClass $data)
 {
     $this->limit = (int) (isset($data->limit) ? $data->limit : 0);
     $this->offset = (int) (isset($data->offset) ? $data->offset : 0);
     $this->productListCount = (int) (isset($data->product_list_count) ? $data->product_list_count : 0);
     $this->returnWarehauseStock = DataFormat::parseBool(isset($data->return_warehause_stock) ? $data->return_warehause_stock : '');
     $this->sales = DataFormat::parseBool($data->sales);
     $productList = isset($data->product_list) ? $data->product_list : [];
     foreach ($productList as $product) {
         $productItem = new ListItemResponse($product);
         $this->productList[] = $productItem;
     }
 }
 /**
  * @param \stdClass $data
  * @return ResponseInterface
  */
 public function parse(\stdClass $data)
 {
     $this->mkId = (int) (isset($data->mk_id) ? $data->mk_id : 0);
     $this->countCode = isset($data->count_code) ? $data->count_code : '';
     $this->code = isset($data->code) ? $data->code : '';
     $this->name = isset($data->name) ? $data->name : '';
     $this->unit = isset($data->unit) ? $data->unit : '';
     $this->service = DataFormat::parseBool(isset($data->unit) ? $data->unit : '');
     $this->sales = DataFormat::parseBool(isset($data->sales) ? $data->sales : '');
     $this->purchasing = DataFormat::parseBool(isset($data->purchasing) ? $data->purchasing : '');
     $this->asset = DataFormat::parseBool(isset($data->asset) ? $data->asset : '');
     $this->work = DataFormat::parseBool(isset($data->work) ? $data->work : '');
     $this->amount = DataFormat::parseBool(isset($data->amount) ? $data->amount : '');
 }
Beispiel #6
0
 /**
  * @return array
  */
 public function prepare()
 {
     $data = ['foreign' => DataFormat::formatBool($this->foreign), 'bill_date' => $this->billDate->format('d.m.Y'), 'payment_date' => $this->paymentDate->format('d.m.Y'), 'buyer_order' => $this->buyerOrder, 'partner' => $this->partner->prepare(), 'send_to_furs' => DataFormat::formatBool($this->sendToFurs)];
     // only add if set, else leave empty and MK automatic ID will be set
     if (!empty($this->countCode)) {
         $data['count_code'] = $this->countCode;
     }
     // MK automatic if not set
     if (!empty($this->locationOfService)) {
         $data['location_of_service'] = $this->locationOfService;
     }
     $payments = $this->preparePayments();
     if (!empty($payments)) {
         $data['mark_paid'] = $this->preparePayments();
     }
     $products = $this->prepareProducts();
     if (!empty($products)) {
         $data['product_list'] = $this->prepareProducts();
     }
     return $data;
 }
 /**
  * @return array
  */
 public function prepare()
 {
     $data = ['count_code' => $this->countCode, 'country' => $this->country, 'locale' => $this->locale, 'hide_code' => DataFormat::formatBool($this->hideCode)];
     return $data;
 }
Beispiel #8
0
 /**
  * @return array
  */
 public function prepare()
 {
     return ['sales' => DataFormat::formatBool($this->sales), 'return_warehause_stock' => DataFormat::formatBool($this->returnWarehauseStock), 'limit' => $this->limit, 'offset' => $this->offset];
 }