Ejemplo n.º 1
0
 /**
  * @param ContentInterface $content
  * @param $orderNumber
  * @param $logisticCountNumber
  * @return LogisticLabel
  */
 public function buildLabel(ContentInterface $content, $orderNumber, $logisticCountNumber)
 {
     $label = new LogisticLabel();
     $label->setCompany($this->company);
     $label->setContent($content);
     $label->setSscc($this->buildSscc($logisticCountNumber));
     $label->orderNumber = $orderNumber;
     //validate!
     $label->type = $content->isCase() ? "B" : "A";
     $label->barcode = $this->generateBarcode($label);
     return $label;
 }
Ejemplo n.º 2
0
 /**
  * Builds barcode as code string
  *
  * @param Model\LogisticLabel $logisticLabel
  * @return string
  */
 private function generateBarcode(Model\LogisticLabel $logisticLabel)
 {
     $builder = new Builder();
     if ($logisticLabel->getContent()->getQuantity() === 1) {
         $rules = new TypeA();
     } else {
         $rules = new TypeB();
     }
     return $builder->build($rules->getRules($logisticLabel));
 }