Beispiel #1
0
 public function testBarcode()
 {
     $location = new Location(0, 0);
     $location->setAltitude(100)->setRelevantText('text');
     $this->assertEquals($location->getLatitude(), 0);
     $this->assertEquals($location->getLongitude(), 0);
     $array = $location->toArray();
 }
 public function generatePassAction($id)
 {
     $em = $this->getDoctrine()->getManager();
     $task1 = $em->getRepository('KamranPassbookBundle:mgeneral')->findOneBy(array('couponId' => $id));
     $task2 = $em->getRepository('KamranPassbookBundle:mappearance')->findOneBy(array('couponId' => $id));
     $task3 = $em->getRepository('KamranPassbookBundle:mdatasetting')->findOneBy(array('couponId' => $id));
     $task4 = $em->getRepository('KamranPassbookBundle:mheader')->findOneBy(array('couponId' => $id));
     $task5 = $em->getRepository('KamranPassbookBundle:mprimary')->findOneBy(array('couponId' => $id));
     $task6 = $em->getRepository('KamranPassbookBundle:msecondary')->findOneBy(array('couponId' => $id));
     $task7 = $em->getRepository('KamranPassbookBundle:mauxiliary')->findOneBy(array('couponId' => $id));
     $task8 = $em->getRepository('KamranPassbookBundle:mbackfields')->findOneBy(array('couponId' => $id));
     $task9 = $em->getRepository('KamranPassbookBundle:mrelevance')->findOneBy(array('couponId' => $id));
     $task10 = $em->getRepository('KamranPassbookBundle:mdistribution')->findOneBy(array('couponId' => $id));
     $passid = $task1->getPassKey();
     $category = $task1->getCategoryName();
     $taskid = $task2->getId();
     $mainlogo = $task2->getLogoName();
     $mainicon = $task2->getIconName();
     $genericthumbnail = $task2->getGenericThumbnail();
     $boardingpassfooter = $task2->getBoardingPassFooter();
     $couponstrip = $task2->getCouponStrip();
     $storecardstrip = $task2->getStoreCardStrip();
     $etstrip = $task2->getEventTicketStrip();
     $etthumbnail = $task2->getEventTicketThumbnail();
     $etbackground = $task2->getEventTicketBackground();
     $barcodestatus = $task3->getCouponBarcodeStatus();
     $root = $this->get('kernel')->getRootDir();
     /////path to root
     $pkPassFile = $root . '/logs/pkpass/' . $id . '.pkpass';
     $zip = new \ZipArchive();
     if (file_exists($pkPassFile)) {
         if ($zip->open($pkPassFile) === TRUE) {
             $zip->deleteName('thumbnail.png');
             $zip->deleteName('*****@*****.**');
             $zip->deleteName('strip.png');
             $zip->deleteName('*****@*****.**');
             $zip->deleteName('logo.png');
             $zip->deleteName('*****@*****.**');
             $zip->deleteName('footer.png');
             $zip->deleteName('*****@*****.**');
             $zip->deleteName('background.png');
             $zip->deleteName('*****@*****.**');
             $zip->close();
         }
     }
     $imagedir = __DIR__ . "/../../../../web/upload/";
     if (!$task2 && !$task3 && !$task4 && !$task5 && !$task6 && !$task7 && !$task8 && !$task9 && !$task10) {
         throw $this->createNotFoundException('No pass found for id ' . $id);
     }
     /////////////////////////pass generation/////////////////////////
     /////////////////////////////////////////////////////////////////
     //echo $task3->getCouponAutoGenerateValue();
     // setting pass type and images
     switch ($task1->getCategoryName()) {
         case "Generic":
             $pass = new Generic($id, $task1->getTemplateName());
             if ($genericthumbnail) {
                 $thumbnail = new Image($imagedir . $taskid . "/" . $genericthumbnail . "", 'thumbnail');
                 $pass->addImage($thumbnail);
                 $thumbnail = new Image($imagedir . $taskid . "/" . $genericthumbnail . "", 'thumbnail@2x');
                 $pass->addImage($thumbnail);
             }
             break;
         case "Boarding Pass":
             switch ($task1->getBoardingPassTransit()) {
                 case "PKTransitTypeAir":
                     $pass = new BoardingPass($id, $task1->getTemplateName(), BoardingPass::TYPE_AIR);
                     break;
                 case "PKTransitTypeBus":
                     $pass = new BoardingPass($id, $task1->getTemplateName(), BoardingPass::TYPE_BUS);
                     break;
                 case "PKTransitTypeTrain":
                     $pass = new BoardingPass($id, $task1->getTemplateName(), BoardingPass::TYPE_TRAIN);
                     break;
                 case "PKTransitTypeBoat":
                     $pass = new BoardingPass($id, $task1->getTemplateName(), BoardingPass::TYPE_BOAT);
                     break;
                 case "PKTransitTypeGeneric":
                     $pass = new BoardingPass($id, $task1->getTemplateName(), BoardingPass::TYPE_GENERIC);
                     break;
             }
             if ($boardingpassfooter) {
                 $footer = new Image($imagedir . $taskid . "/" . $boardingpassfooter . "", 'footer');
                 $pass->addImage($footer);
                 $footer = new Image($imagedir . $taskid . "/" . $boardingpassfooter . "", 'footer@2x');
                 $pass->addImage($footer);
             }
             break;
         case "Coupon":
             $pass = new Coupon($id, $task1->getTemplateName());
             if ($couponstrip) {
                 $strip = new Image($imagedir . $taskid . "/" . $couponstrip . "", 'strip');
                 $pass->addImage($strip);
                 $strip = new Image($imagedir . $taskid . "/" . $couponstrip . "", 'strip@2x');
                 $pass->addImage($strip);
             }
             break;
         case "Event Ticket":
             $pass = new EventTicket($id, $task1->getTemplateName());
             switch ($task2->getEventTicketStatus()) {
                 case "Layout 1: Strip":
                     if ($etstrip) {
                         $strip = new Image($imagedir . $taskid . "/" . $etstrip . "", 'strip');
                         $pass->addImage($strip);
                         $strip = new Image($imagedir . $taskid . "/" . $etstrip . "", 'strip@2x');
                         $pass->addImage($strip);
                     }
                     break;
                 case "Layout 2: Background/Thumbnail":
                     if ($etbackground) {
                         $background = new Image($imagedir . $taskid . "/" . $etbackground . "", 'background');
                         $pass->addImage($background);
                         $background = new Image($imagedir . $taskid . "/" . $etbackground . "", 'background@2x');
                         $pass->addImage($background);
                     }
                     if ($etthumbnail) {
                         $thumbnail = new Image($imagedir . $taskid . "/" . $etthumbnail . "", 'thumbnail');
                         $pass->addImage($thumbnail);
                         $thumbnail = new Image($imagedir . $taskid . "/" . $etthumbnail . "", 'thumbnail@2x');
                         $pass->addImage($thumbnail);
                     }
                     break;
             }
             break;
         case "Store Card":
             $pass = new StoreCard($id, $task1->getTemplateName());
             if ($storecardstrip) {
                 $strip = new Image($imagedir . $taskid . "/" . $storecardstrip . "", 'strip');
                 $pass->addImage($strip);
                 $strip = new Image($imagedir . $taskid . "/" . $storecardstrip . "", 'strip@2x');
                 $pass->addImage($strip);
             }
             break;
     }
     $pass->setBackgroundColor($task2->getBackgroundColorCode());
     $pass->setForegroundColor($task2->getFieldValueColorCode());
     $pass->setLabelColor($task2->getFieldLabelColorCode());
     $pass->setLogoText($task2->getLogoText());
     // Add icon image
     if ($mainicon == "") {
         $icon = new Image($root . '/Resources/Images/LogoIcon58x58.png', 'icon');
         $pass->addImage($icon);
         $icon = new Image($root . '/Resources/Images/LogoIcon58x58@2x.png', 'icon@2x');
         $pass->addImage($icon);
     } else {
         $icon = new Image($imagedir . $taskid . "/" . $mainicon . "", 'icon');
         $pass->addImage($icon);
         $icon = new Image($imagedir . $taskid . "/" . $mainicon . "", 'icon@2x');
         $pass->addImage($icon);
     }
     if ($mainlogo) {
         $logo = new Image($imagedir . $taskid . "/" . $mainlogo . "", 'logo');
         $pass->addImage($logo);
         $logo = new Image($imagedir . $taskid . "/" . $mainlogo . "", 'logo@2x');
         $pass->addImage($logo);
     }
     // Create pass structure
     $structure = new Structure();
     // Add header field
     switch ($task4->getCouponHeaderValueType()) {
         case "text":
             $header = new Field($task4->getCouponHeaderValueType() . "h1", " ");
             if ($task4->getCouponHeaderTextValue()) {
                 $header->setValue($task4->getCouponHeaderTextValue());
             }
             if ($task4->getCouponHeaderLabel()) {
                 $header->setLabel(strtoupper($task4->getCouponHeaderLabel()));
             }
             $header->setTextAlignment($task4->getCouponHeaderAlignmnet());
             $structure->addHeaderField($header);
             break;
         case "datentime":
             $header = new DateField($task4->getCouponHeaderValueType() . "h1", " ");
             if ($task4->getCouponHeaderValueDate()) {
                 $header->setValue($task4->getCouponHeaderValueDate());
                 $header->setDateStyle($task4->getcouponHeaderValueDateFormate());
                 $header->setTimeStyle($task4->getcouponHeaderValueTimeFormate());
             }
             if ($task4->getCouponHeaderLabel()) {
                 $header->setLabel(strtoupper($task4->getCouponHeaderLabel()));
             }
             $header->setTextAlignment($task4->getCouponHeaderAlignmnet());
             $structure->addHeaderField($header);
             break;
         case "number":
             $header = new NumberField($task4->getCouponHeaderValueType() . "h1", " ");
             if ($task4->getCouponHeaderNumberValue()) {
                 $header->setValue($task4->getCouponHeaderNumberValue());
                 $header->setNumberStyle($task4->getCouponHeaderNumberFormate());
             }
             if ($task4->getCouponHeaderLabel()) {
                 $header->setLabel(strtoupper($task4->getCouponHeaderLabel()));
             }
             $header->setTextAlignment($task4->getCouponHeaderAlignmnet());
             $structure->addHeaderField($header);
             break;
         case "currency":
             $header = new NumberField($task4->getCouponHeaderValueType() . "h1", " ");
             if ($task4->getCouponHeaderCurrencyValue()) {
                 $header->setValue($task4->getCouponHeaderCurrencyValue());
                 $header->setCurrencyCode($task4->getCouponHeaderCurrencyCode());
             }
             if ($task4->getCouponHeaderLabel()) {
                 $header->setLabel(strtoupper($task4->getCouponHeaderLabel()));
             }
             $header->setTextAlignment($task4->getCouponHeaderAlignmnet());
             $structure->addHeaderField($header);
             break;
     }
     // Add primary field
     switch ($task5->getCouponPrimaryFieldValueType()) {
         case "text":
             $primary = new Field($task5->getCouponPrimaryFieldValueType() . "p1", " ");
             if ($task5->getCouponPrimaryFieldTextValue()) {
                 $primary->setValue($task5->getCouponPrimaryFieldTextValue());
             }
             if ($task5->getCouponPrimaryFieldLabel()) {
                 $primary->setLabel(strtoupper($task5->getCouponPrimaryFieldLabel()));
             }
             $structure->addPrimaryField($primary);
             break;
         case "datentime":
             $primary = new DateField($task5->getCouponPrimaryFieldValueType() . "p1", " ");
             if ($task5->getCouponPrimaryFieldValueDate()) {
                 $primary->setValue($task5->getCouponPrimaryFieldValueDate());
                 $primary->setDateStyle($task5->getCouponPrimaryFieldValueDateFormate());
                 $primary->setTimeStyle($task5->getCouponPrimaryFieldValueTimeFormate());
             }
             if ($task5->getCouponPrimaryFieldLabel()) {
                 $primary->setLabel(strtoupper($task5->getCouponPrimaryFieldLabel()));
             }
             $structure->addPrimaryField($primary);
             break;
         case "number":
             $primary = new NumberField($task5->getCouponPrimaryFieldValueType() . "p1", " ");
             if ($task5->getCouponPrimaryFieldNumberValue()) {
                 $primary->setValue($task5->getCouponPrimaryFieldNumberValue());
                 $primary->setNumberStyle($task5->getCouponPrimaryFieldNumberFormate());
             }
             if ($task5->getCouponPrimaryFieldLabel()) {
                 $primary->setLabel(strtoupper($task5->getCouponPrimaryFieldLabel()));
             }
             $structure->addPrimaryField($primary);
             break;
         case "currency":
             $primary = new NumberField($task5->getCouponPrimaryFieldValueType() . "p1", " ");
             if ($task5->getCouponPrimaryFieldCurrencyValue()) {
                 $primary->setValue($task5->getCouponPrimaryFieldCurrencyValue());
                 $primary->setCurrencyCode($task5->getCouponPrimaryFieldCurrencyCode());
             }
             if ($task5->getCouponPrimaryFieldLabel()) {
                 $primary->setLabel(strtoupper($task5->getCouponPrimaryFieldLabel()));
             }
             $structure->addPrimaryField($primary);
             break;
     }
     // Add secondary field
     switch ($task6->getCouponSecondaryFieldTotalFields()) {
         case 0:
             break;
         case 1:
             switch ($task6->getCouponSecondaryFieldValueTypeOne()) {
                 case "text":
                     $secondary1 = new Field($task6->getCouponSecondaryFieldValueTypeOne() . "s11", " ");
                     if ($task6->getCouponSecondaryFieldTextValueOne()) {
                         $secondary1->setValue($task6->getCouponSecondaryFieldTextValueOne());
                     }
                     if ($task6->getCouponSecondaryFieldLabelOne()) {
                         $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                     }
                     $secondary1->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetOne());
                     $structure->addSecondaryField($secondary1);
                     break;
                 case "datentime":
                     $secondary1 = new DateField($task6->getCouponSecondaryFieldValueTypeOne() . "s11", " ");
                     if ($task6->getCouponSecondaryFieldValueDateOne()) {
                         $secondary1->setValue($task6->getCouponSecondaryFieldValueDateOne());
                         $secondary1->setDateStyle($task6->getCouponSecondaryFieldValueDateFormateOne());
                         $secondary1->setTimeStyle($task6->getCouponSecondaryFieldValueTimeFormateOne());
                     }
                     if ($task6->getCouponSecondaryFieldLabelOne()) {
                         $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                     }
                     $secondary1->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetOne());
                     $structure->addSecondaryField($secondary1);
                     break;
                 case "number":
                     $secondary1 = new NumberField($task6->getCouponSecondaryFieldValueTypeOne() . "s11", " ");
                     if ($task6->getCouponSecondaryFieldNumberValueOne()) {
                         $secondary1->setValue($task6->getCouponSecondaryFieldNumberValueOne());
                         $secondary1->setNumberStyle($task6->getCouponSecondaryFieldNumberFormateOne());
                     }
                     if ($task6->getCouponSecondaryFieldLabelOne()) {
                         $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                     }
                     $secondary1->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetOne());
                     $structure->addSecondaryField($secondary1);
                     break;
                 case "currency":
                     $secondary1 = new NumberField($task6->getCouponSecondaryFieldValueTypeOne() . "s11", " ");
                     if ($task6->getCouponSecondaryFieldCurrencyValueOne()) {
                         $secondary1->setValue($task6->getCouponSecondaryFieldCurrencyValueOne());
                         $secondary1->setCurrencyCode($task6->getCouponSecondaryFieldCurrencyCodeOne());
                     }
                     if ($task6->getCouponSecondaryFieldLabelOne()) {
                         $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                     }
                     $secondary1->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetOne());
                     $structure->addSecondaryField($secondary1);
                     break;
             }
             break;
         case 2:
             switch ($task6->getCouponSecondaryFieldValueTypeOne()) {
                 case "text":
                     $secondary1 = new Field($task6->getCouponSecondaryFieldValueTypeOne() . "s11", " ");
                     if ($task6->getCouponSecondaryFieldTextValueOne()) {
                         $secondary1->setValue($task6->getCouponSecondaryFieldTextValueOne());
                     }
                     if ($task6->getCouponSecondaryFieldLabelOne()) {
                         $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                     }
                     $secondary1->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetOne());
                     $structure->addSecondaryField($secondary1);
                     break;
                 case "datentime":
                     $secondary1 = new DateField($task6->getCouponSecondaryFieldValueTypeOne() . "s11", " ");
                     if ($task6->getCouponSecondaryFieldValueDateOne()) {
                         $secondary1->setValue($task6->getCouponSecondaryFieldValueDateOne());
                         $secondary1->setDateStyle($task6->getCouponSecondaryFieldValueDateFormateOne());
                         $secondary1->setTimeStyle($task6->getCouponSecondaryFieldValueTimeFormateOne());
                     }
                     if ($task6->getCouponSecondaryFieldLabelOne()) {
                         $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                     }
                     $secondary1->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetOne());
                     $structure->addSecondaryField($secondary1);
                     break;
                 case "number":
                     $secondary1 = new NumberField($task6->getCouponSecondaryFieldValueTypeOne() . "s11", " ");
                     if ($task6->getCouponSecondaryFieldNumberValueOne()) {
                         $secondary1->setValue($task6->getCouponSecondaryFieldNumberValueOne());
                         $secondary1->setNumberStyle($task6->getCouponSecondaryFieldNumberFormateOne());
                     }
                     if ($task6->getCouponSecondaryFieldLabelOne()) {
                         $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                     }
                     $secondary1->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetOne());
                     $structure->addSecondaryField($secondary1);
                     break;
                 case "currency":
                     $secondary1 = new NumberField($task6->getCouponSecondaryFieldValueTypeOne() . "s11", " ");
                     if ($task6->getCouponSecondaryFieldCurrencyValueOne()) {
                         $secondary1->setValue($task6->getCouponSecondaryFieldCurrencyValueOne());
                         $secondary1->setCurrencyCode($task6->getCouponSecondaryFieldCurrencyCodeOne());
                     }
                     if ($task6->getCouponSecondaryFieldLabelOne()) {
                         $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                     }
                     $secondary1->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetOne());
                     $structure->addSecondaryField($secondary1);
                     break;
             }
             switch ($task6->getCouponSecondaryFieldValueTypeTwo()) {
                 case "text":
                     $secondary2 = new Field($task6->getCouponSecondaryFieldValueTypeTwo() . "s21", " ");
                     if ($task6->getCouponSecondaryFieldTextValueTwo()) {
                         $secondary2->setValue($task6->getCouponSecondaryFieldTextValueTwo());
                     }
                     if ($task6->getCouponSecondaryFieldLabelTwo()) {
                         $secondary2->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelTwo()));
                     }
                     $secondary2->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetTwo());
                     $structure->addSecondaryField($secondary2);
                     break;
                 case "datentime":
                     $secondary2 = new DateField($task6->getCouponSecondaryFieldValueTypeTwo() . "s21", " ");
                     if ($task6->getCouponSecondaryFieldValueDateTwo()) {
                         $secondary2->setValue($task6->getCouponSecondaryFieldValueDateTwo());
                         $secondary2->setDateStyle($task6->getCouponSecondaryFieldValueDateFormateTwo());
                         $secondary2->setTimeStyle($task6->getCouponSecondaryFieldValueTimeFormateTwo());
                     }
                     if ($task6->getCouponSecondaryFieldLabelTwo()) {
                         $secondary2->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelTwo()));
                     }
                     $secondary2->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetTwo());
                     $structure->addSecondaryField($secondary2);
                     break;
                 case "number":
                     $secondary2 = new NumberField($task6->getCouponSecondaryFieldValueTypeTwo() . "s21", " ");
                     if ($task6->getCouponSecondaryFieldNumberValueTwo()) {
                         $secondary2->setValue($task6->getCouponSecondaryFieldNumberValueTwo());
                         $secondary2->setNumberStyle($task6->getCouponSecondaryFieldNumberFormateTwo());
                     }
                     if ($task6->getCouponSecondaryFieldLabelTwo()) {
                         $secondary2->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelTwo()));
                     }
                     $secondary2->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetTwo());
                     $structure->addSecondaryField($secondary2);
                     break;
                 case "currency":
                     $secondary2 = new NumberField($task6->getCouponSecondaryFieldValueTypeTwo() . "s21", " ");
                     if ($task6->getCouponSecondaryFieldCurrencyValueTwo()) {
                         $secondary2->setValue($task6->getCouponSecondaryFieldCurrencyValueTwo());
                         $secondary2->setCurrencyCode($task6->getCouponSecondaryFieldCurrencyCodeTwo());
                     }
                     if ($task6->getCouponSecondaryFieldLabelTwo()) {
                         $secondary2->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelTwo()));
                     }
                     $secondary2->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetTwo());
                     $structure->addSecondaryField($secondary2);
                     break;
             }
             break;
         case 3:
             if ($task1->getCategoryName() == 'Coupon') {
                 switch ($task6->getCouponSecondaryFieldValueTypeOne()) {
                     case "text":
                         $secondary1 = new Field($task6->getCouponSecondaryFieldValueTypeOne() . "s11", " ");
                         if ($task6->getCouponSecondaryFieldTextValueOne()) {
                             $secondary1->setValue($task6->getCouponSecondaryFieldTextValueOne());
                         }
                         if ($task6->getCouponSecondaryFieldLabelOne()) {
                             $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                         }
                         $secondary1->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetOne());
                         $structure->addSecondaryField($secondary1);
                         break;
                     case "datentime":
                         $secondary1 = new DateField($task6->getCouponSecondaryFieldValueTypeOne() . "s11", " ");
                         if ($task6->getCouponSecondaryFieldValueDateOne()) {
                             $secondary1->setValue($task6->getCouponSecondaryFieldValueDateOne());
                             $secondary1->setDateStyle($task6->getCouponSecondaryFieldValueDateFormateOne());
                             $secondary1->setTimeStyle($task6->getCouponSecondaryFieldValueTimeFormateOne());
                         }
                         if ($task6->getCouponSecondaryFieldLabelOne()) {
                             $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                         }
                         $secondary1->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetOne());
                         $structure->addSecondaryField($secondary1);
                         break;
                     case "number":
                         $secondary1 = new NumberField($task6->getCouponSecondaryFieldValueTypeOne() . "s11", " ");
                         if ($task6->getCouponSecondaryFieldNumberValueOne()) {
                             $secondary1->setValue($task6->getCouponSecondaryFieldNumberValueOne());
                             $secondary1->setNumberStyle($task6->getCouponSecondaryFieldNumberFormateOne());
                         }
                         if ($task6->getCouponSecondaryFieldLabelOne()) {
                             $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                         }
                         $secondary1->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetOne());
                         $structure->addSecondaryField($secondary1);
                         break;
                     case "currency":
                         $secondary1 = new NumberField($task6->getCouponSecondaryFieldValueTypeOne() . "s11", " ");
                         if ($task6->getCouponSecondaryFieldCurrencyValueOne()) {
                             $secondary1->setValue($task6->getCouponSecondaryFieldCurrencyValueOne());
                             $secondary1->setCurrencyCode($task6->getCouponSecondaryFieldCurrencyCodeOne());
                         }
                         $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                         if ($task6->getCouponSecondaryFieldLabelOne()) {
                             $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                         }
                         $secondary1->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetOne());
                         $structure->addSecondaryField($secondary1);
                         break;
                 }
                 switch ($task6->getCouponSecondaryFieldValueTypeTwo()) {
                     case "text":
                         $secondary2 = new Field($task6->getCouponSecondaryFieldValueTypeTwo() . "s21", " ");
                         if ($task6->getCouponSecondaryFieldTextValueTwo()) {
                             $secondary2->setValue($task6->getCouponSecondaryFieldTextValueTwo());
                         }
                         if ($task6->getCouponSecondaryFieldLabelTwo()) {
                             $secondary2->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelTwo()));
                         }
                         $secondary2->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetTwo());
                         $structure->addSecondaryField($secondary2);
                         break;
                     case "datentime":
                         $secondary2 = new DateField($task6->getCouponSecondaryFieldValueTypeTwo() . "s21", " ");
                         if ($task6->getCouponSecondaryFieldValueDateTwo()) {
                             $secondary2->setValue($task6->getCouponSecondaryFieldValueDateTwo());
                             $secondary2->setDateStyle($task6->getCouponSecondaryFieldValueDateFormateTwo());
                             $secondary2->setTimeStyle($task6->getCouponSecondaryFieldValueTimeFormateTwo());
                         }
                         if ($task6->getCouponSecondaryFieldLabelTwo()) {
                             $secondary2->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelTwo()));
                         }
                         $secondary2->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetTwo());
                         $structure->addSecondaryField($secondary2);
                         break;
                     case "number":
                         $secondary2 = new NumberField($task6->getCouponSecondaryFieldValueTypeTwo() . "s21", " ");
                         if ($task6->getCouponSecondaryFieldNumberValueTwo()) {
                             $secondary2->setValue($task6->getCouponSecondaryFieldNumberValueTwo());
                             $secondary2->setNumberStyle($task6->getCouponSecondaryFieldNumberFormateTwo());
                         }
                         if ($task6->getCouponSecondaryFieldLabelTwo()) {
                             $secondary2->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelTwo()));
                         }
                         $secondary2->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetTwo());
                         $structure->addSecondaryField($secondary2);
                         break;
                     case "currency":
                         $secondary2 = new NumberField($task6->getCouponSecondaryFieldValueTypeTwo() . "s21", " ");
                         if ($task6->getCouponSecondaryFieldCurrencyValueTwo()) {
                             $secondary2->setValue($task6->getCouponSecondaryFieldCurrencyValueTwo());
                             $secondary2->setCurrencyCode($task6->getCouponSecondaryFieldCurrencyCodeTwo());
                         }
                         if ($task6->getCouponSecondaryFieldLabelTwo()) {
                             $secondary2->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelTwo()));
                         }
                         $secondary2->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetTwo());
                         $structure->addSecondaryField($secondary2);
                         break;
                 }
             } else {
                 switch ($task6->getCouponSecondaryFieldValueTypeOne()) {
                     case "text":
                         $secondary1 = new Field($task6->getCouponSecondaryFieldValueTypeOne() . "s11", " ");
                         if ($task6->getCouponSecondaryFieldTextValueOne()) {
                             $secondary1->setValue($task6->getCouponSecondaryFieldTextValueOne());
                         }
                         if ($task6->getCouponSecondaryFieldLabelOne()) {
                             $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                         }
                         $secondary1->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetOne());
                         $structure->addSecondaryField($secondary1);
                         break;
                     case "datentime":
                         $secondary1 = new DateField($task6->getCouponSecondaryFieldValueTypeOne() . "s11", " ");
                         if ($task6->getCouponSecondaryFieldValueDateOne()) {
                             $secondary1->setValue($task6->getCouponSecondaryFieldValueDateOne());
                             $secondary1->setDateStyle($task6->getCouponSecondaryFieldValueDateFormateOne());
                             $secondary1->setTimeStyle($task6->getCouponSecondaryFieldValueTimeFormateOne());
                         }
                         if ($task6->getCouponSecondaryFieldLabelOne()) {
                             $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                         }
                         $secondary1->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetOne());
                         $structure->addSecondaryField($secondary1);
                         break;
                     case "number":
                         $secondary1 = new NumberField($task6->getCouponSecondaryFieldValueTypeOne() . "s11", " ");
                         if ($task6->getCouponSecondaryFieldNumberValueOne()) {
                             $secondary1->setValue($task6->getCouponSecondaryFieldNumberValueOne());
                             $secondary1->setNumberStyle($task6->getCouponSecondaryFieldNumberFormateOne());
                         }
                         if ($task6->getCouponSecondaryFieldLabelOne()) {
                             $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                         }
                         $secondary1->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetOne());
                         $structure->addSecondaryField($secondary1);
                         break;
                     case "currency":
                         $secondary1 = new NumberField($task6->getCouponSecondaryFieldValueTypeOne() . "s11", " ");
                         if ($task6->getCouponSecondaryFieldCurrencyValueOne()) {
                             $secondary1->setValue($task6->getCouponSecondaryFieldCurrencyValueOne());
                             $secondary1->setCurrencyCode($task6->getCouponSecondaryFieldCurrencyCodeOne());
                         }
                         if ($task6->getCouponSecondaryFieldLabelOne()) {
                             $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                         }
                         $secondary1->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetOne());
                         $structure->addSecondaryField($secondary1);
                         break;
                 }
                 switch ($task6->getCouponSecondaryFieldValueTypeTwo()) {
                     case "text":
                         $secondary2 = new Field($task6->getCouponSecondaryFieldValueTypeTwo() . "s21", " ");
                         if ($task6->getCouponSecondaryFieldTextValueTwo()) {
                             $secondary2->setValue($task6->getCouponSecondaryFieldTextValueTwo());
                         }
                         if ($task6->getCouponSecondaryFieldLabelTwo()) {
                             $secondary2->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelTwo()));
                         }
                         $secondary2->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetTwo());
                         $structure->addSecondaryField($secondary2);
                         break;
                     case "datentime":
                         $secondary2 = new DateField($task6->getCouponSecondaryFieldValueTypeTwo() . "s21", " ");
                         if ($task6->getCouponSecondaryFieldValueDateTwo()) {
                             $secondary2->setValue($task6->getCouponSecondaryFieldValueDateTwo());
                             $secondary2->setDateStyle($task6->getCouponSecondaryFieldValueDateFormateTwo());
                             $secondary2->setTimeStyle($task6->getCouponSecondaryFieldValueTimeFormateTwo());
                         }
                         if ($task6->getCouponSecondaryFieldLabelTwo()) {
                             $secondary2->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelTwo()));
                         }
                         $secondary2->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetTwo());
                         $structure->addSecondaryField($secondary2);
                         break;
                     case "number":
                         $secondary2 = new NumberField($task6->getCouponSecondaryFieldValueTypeTwo() . "s21", " ");
                         if ($task6->getCouponSecondaryFieldNumberValueTwo()) {
                             $secondary2->setValue($task6->getCouponSecondaryFieldNumberValueTwo());
                             $secondary2->setNumberStyle($task6->getCouponSecondaryFieldNumberFormateTwo());
                         }
                         if ($task6->getCouponSecondaryFieldLabelTwo()) {
                             $secondary2->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelTwo()));
                         }
                         $secondary2->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetTwo());
                         $structure->addSecondaryField($secondary2);
                         break;
                     case "currency":
                         $secondary2 = new NumberField($task6->getCouponSecondaryFieldValueTypeTwo() . "s21", " ");
                         if ($task6->getCouponSecondaryFieldCurrencyValueTwo()) {
                             $secondary2->setValue($task6->getCouponSecondaryFieldCurrencyValueTwo());
                             $secondary2->setCurrencyCode($task6->getCouponSecondaryFieldCurrencyCodeTwo());
                         }
                         if ($task6->getCouponSecondaryFieldLabelTwo()) {
                             $secondary2->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelTwo()));
                         }
                         $secondary2->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetTwo());
                         $structure->addSecondaryField($secondary2);
                         break;
                 }
                 switch ($task6->getCouponSecondaryFieldValueTypeThree()) {
                     case "text":
                         $secondary3 = new Field($task6->getCouponSecondaryFieldValueTypeThree() . "s31", " ");
                         if ($task6->getCouponSecondaryFieldTextValueThree()) {
                             $secondary3->setValue($task6->getCouponSecondaryFieldTextValueThree());
                         }
                         if ($task6->getCouponSecondaryFieldLabelThree()) {
                             $secondary3->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelThree()));
                         }
                         $secondary3->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetThree());
                         $structure->addSecondaryField($secondary3);
                         break;
                     case "datentime":
                         $secondary3 = new DateField($task6->getCouponSecondaryFieldValueTypeThree() . "s31", " ");
                         if ($task6->getCouponSecondaryFieldValueDateThree()) {
                             $secondary3->setValue($task6->getCouponSecondaryFieldValueDateThree());
                             $secondary3->setDateStyle($task6->getCouponSecondaryFieldValueDateFormateThree());
                             $secondary3->setTimeStyle($task6->getCouponSecondaryFieldValueTimeFormateThree());
                         }
                         if ($task6->getCouponSecondaryFieldLabelThree()) {
                             $secondary3->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelThree()));
                         }
                         $secondary3->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetThree());
                         $structure->addSecondaryField($secondary3);
                         break;
                     case "number":
                         $secondary3 = new NumberField($task6->getCouponSecondaryFieldValueTypeThree() . "s31", " ");
                         if ($task6->getCouponSecondaryFieldNumberValueThree()) {
                             $secondary3->setValue($task6->getCouponSecondaryFieldNumberValueThree());
                             $secondary3->setNumberStyle($task6->getCouponSecondaryFieldNumberFormateThree());
                         }
                         if ($task6->getCouponSecondaryFieldLabelThree()) {
                             $secondary3->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelThree()));
                         }
                         $secondary3->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetThree());
                         $structure->addSecondaryField($secondary3);
                         break;
                     case "currency":
                         $secondary3 = new NumberField($task6->getCouponSecondaryFieldValueTypeThree() . "s31", " ");
                         if ($task6->getCouponSecondaryFieldCurrencyValueThree()) {
                             $secondary3->setValue($task6->getCouponSecondaryFieldCurrencyValueThree());
                             $secondary3->setCurrencyCode($task6->getCouponSecondaryFieldCurrencyCodeThree());
                         }
                         if ($task6->getCouponSecondaryFieldLabelThree()) {
                             $secondary3->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelThree()));
                         }
                         $secondary3->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetThree());
                         $structure->addSecondaryField($secondary3);
                         break;
                 }
             }
             break;
         case 4:
             if ($task1->getCategoryName() == 'Coupon') {
                 switch ($task6->getCouponSecondaryFieldValueTypeOne()) {
                     case "text":
                         $secondary1 = new Field($task6->getCouponSecondaryFieldValueTypeOne() . "s11", " ");
                         if ($task6->getCouponSecondaryFieldTextValueOne()) {
                             $secondary1->setValue($task6->getCouponSecondaryFieldTextValueOne());
                         }
                         if ($task6->getCouponSecondaryFieldLabelOne()) {
                             $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                         }
                         $secondary1->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetOne());
                         $structure->addSecondaryField($secondary1);
                         break;
                     case "datentime":
                         $secondary1 = new DateField($task6->getCouponSecondaryFieldValueTypeOne() . "s11", " ");
                         if ($task6->getCouponSecondaryFieldValueDateOne()) {
                             $secondary1->setValue($task6->getCouponSecondaryFieldValueDateOne());
                             $secondary1->setDateStyle($task6->getCouponSecondaryFieldValueDateFormateOne());
                             $secondary1->setTimeStyle($task6->getCouponSecondaryFieldValueTimeFormateOne());
                         }
                         if ($task6->getCouponSecondaryFieldLabelOne()) {
                             $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                         }
                         $secondary1->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetOne());
                         $structure->addSecondaryField($secondary1);
                         break;
                     case "number":
                         $secondary1 = new NumberField($task6->getCouponSecondaryFieldValueTypeOne() . "s11", " ");
                         if ($task6->getCouponSecondaryFieldNumberValueOne()) {
                             $secondary1->setValue($task6->getCouponSecondaryFieldNumberValueOne());
                             $secondary1->setNumberStyle($task6->getCouponSecondaryFieldNumberFormateOne());
                         }
                         if ($task6->getCouponSecondaryFieldLabelOne()) {
                             $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                         }
                         $secondary1->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetOne());
                         $structure->addSecondaryField($secondary1);
                         break;
                     case "currency":
                         $secondary1 = new NumberField($task6->getCouponSecondaryFieldValueTypeOne() . "s11", " ");
                         if ($task6->getCouponSecondaryFieldCurrencyValueOne()) {
                             $secondary1->setValue($task6->getCouponSecondaryFieldCurrencyValueOne());
                             $secondary1->setCurrencyCode($task6->getCouponSecondaryFieldCurrencyCodeOne());
                         }
                         if ($task6->getCouponSecondaryFieldLabelOne()) {
                             $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                         }
                         $secondary1->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetOne());
                         $structure->addSecondaryField($secondary1);
                         break;
                 }
                 switch ($task6->getCouponSecondaryFieldValueTypeTwo()) {
                     case "text":
                         $secondary2 = new Field($task6->getCouponSecondaryFieldValueTypeTwo() . "s21", " ");
                         if ($task6->getCouponSecondaryFieldTextValueTwo()) {
                             $secondary2->setValue($task6->getCouponSecondaryFieldTextValueTwo());
                         }
                         if ($task6->getCouponSecondaryFieldLabelTwo()) {
                             $secondary2->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelTwo()));
                         }
                         $secondary2->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetTwo());
                         $structure->addSecondaryField($secondary2);
                         break;
                     case "datentime":
                         $secondary2 = new DateField($task6->getCouponSecondaryFieldValueTypeTwo() . "s21", " ");
                         if ($task6->getCouponSecondaryFieldValueDateTwo()) {
                             $secondary2->setValue($task6->getCouponSecondaryFieldValueDateTwo());
                             $secondary2->setDateStyle($task6->getCouponSecondaryFieldValueDateFormateTwo());
                             $secondary2->setTimeStyle($task6->getCouponSecondaryFieldValueTimeFormateTwo());
                         }
                         if ($task6->getCouponSecondaryFieldLabelTwo()) {
                             $secondary2->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelTwo()));
                         }
                         $secondary2->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetTwo());
                         $structure->addSecondaryField($secondary2);
                         break;
                     case "number":
                         $secondary2 = new NumberField($task6->getCouponSecondaryFieldValueTypeTwo() . "s21", " ");
                         if ($task6->getCouponSecondaryFieldNumberValueTwo()) {
                             $secondary2->setValue($task6->getCouponSecondaryFieldNumberValueTwo());
                             $secondary2->setNumberStyle($task6->getCouponSecondaryFieldNumberFormateTwo());
                         }
                         if ($task6->getCouponSecondaryFieldLabelTwo()) {
                             $secondary2->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelTwo()));
                         }
                         $secondary2->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetTwo());
                         $structure->addSecondaryField($secondary2);
                         break;
                     case "currency":
                         $secondary2 = new NumberField($task6->getCouponSecondaryFieldValueTypeTwo() . "s21", " ");
                         if ($task6->getCouponSecondaryFieldCurrencyValueTwo()) {
                             $secondary2->setValue($task6->getCouponSecondaryFieldCurrencyValueTwo());
                             $secondary2->setCurrencyCode($task6->getCouponSecondaryFieldCurrencyCodeTwo());
                         }
                         if ($task6->getCouponSecondaryFieldLabelTwo()) {
                             $secondary2->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelTwo()));
                         }
                         $secondary2->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetTwo());
                         $structure->addSecondaryField($secondary2);
                         break;
                 }
             } else {
                 switch ($task6->getCouponSecondaryFieldValueTypeOne()) {
                     case "text":
                         $secondary1 = new Field($task6->getCouponSecondaryFieldValueTypeOne() . "s11", " ");
                         if ($task6->getCouponSecondaryFieldTextValueOne()) {
                             $secondary1->setValue($task6->getCouponSecondaryFieldTextValueOne());
                         }
                         if ($task6->getCouponSecondaryFieldLabelOne()) {
                             $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                         }
                         $secondary1->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetOne());
                         $structure->addSecondaryField($secondary1);
                         break;
                     case "datentime":
                         $secondary1 = new DateField($task6->getCouponSecondaryFieldValueTypeOne() . "s11", " ");
                         if ($task6->getCouponSecondaryFieldValueDateOne()) {
                             $secondary1->setValue($task6->getCouponSecondaryFieldValueDateOne());
                             $secondary1->setDateStyle($task6->getCouponSecondaryFieldValueDateFormateOne());
                             $secondary1->setTimeStyle($task6->getCouponSecondaryFieldValueTimeFormateOne());
                         }
                         if ($task6->getCouponSecondaryFieldLabelOne()) {
                             $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                         }
                         $secondary1->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetOne());
                         $structure->addSecondaryField($secondary1);
                         break;
                     case "number":
                         $secondary1 = new NumberField($task6->getCouponSecondaryFieldValueTypeOne() . "s11", " ");
                         if ($task6->getCouponSecondaryFieldNumberValueOne()) {
                             $secondary1->setValue($task6->getCouponSecondaryFieldNumberValueOne());
                             $secondary1->setNumberStyle($task6->getCouponSecondaryFieldNumberFormateOne());
                         }
                         if ($task6->getCouponSecondaryFieldLabelOne()) {
                             $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                         }
                         $secondary1->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetOne());
                         $structure->addSecondaryField($secondary1);
                         break;
                     case "currency":
                         $secondary1 = new NumberField($task6->getCouponSecondaryFieldValueTypeOne() . "s11", " ");
                         if ($task6->getCouponSecondaryFieldCurrencyValueOne()) {
                             $secondary1->setValue($task6->getCouponSecondaryFieldCurrencyValueOne());
                             $secondary1->setCurrencyCode($task6->getCouponSecondaryFieldCurrencyCodeOne());
                         }
                         if ($task6->getCouponSecondaryFieldLabelOne()) {
                             $secondary1->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelOne()));
                         }
                         $secondary1->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetOne());
                         $structure->addSecondaryField($secondary1);
                         break;
                 }
                 switch ($task6->getCouponSecondaryFieldValueTypeTwo()) {
                     case "text":
                         $secondary2 = new Field($task6->getCouponSecondaryFieldValueTypeTwo() . "s21", " ");
                         if ($task6->getCouponSecondaryFieldTextValueTwo()) {
                             $secondary2->setValue($task6->getCouponSecondaryFieldTextValueTwo());
                         }
                         if ($task6->getCouponSecondaryFieldLabelTwo()) {
                             $secondary2->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelTwo()));
                         }
                         $secondary2->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetTwo());
                         $structure->addSecondaryField($secondary2);
                         break;
                     case "datentime":
                         $secondary2 = new DateField($task6->getCouponSecondaryFieldValueTypeTwo() . "s21", " ");
                         if ($task6->getCouponSecondaryFieldValueDateTwo()) {
                             $secondary2->setValue($task6->getCouponSecondaryFieldValueDateTwo());
                             $secondary2->setDateStyle($task6->getCouponSecondaryFieldValueDateFormateTwo());
                             $secondary2->setTimeStyle($task6->getCouponSecondaryFieldValueTimeFormateTwo());
                         }
                         if ($task6->getCouponSecondaryFieldLabelTwo()) {
                             $secondary2->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelTwo()));
                         }
                         $secondary2->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetTwo());
                         $structure->addSecondaryField($secondary2);
                         break;
                     case "number":
                         $secondary2 = new NumberField($task6->getCouponSecondaryFieldValueTypeTwo() . "s21", " ");
                         if ($task6->getCouponSecondaryFieldNumberValueTwo()) {
                             $secondary2->setValue($task6->getCouponSecondaryFieldNumberValueTwo());
                             $secondary2->setNumberStyle($task6->getCouponSecondaryFieldNumberFormateTwo());
                         }
                         if ($task6->getCouponSecondaryFieldLabelTwo()) {
                             $secondary2->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelTwo()));
                         }
                         $secondary2->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetTwo());
                         $structure->addSecondaryField($secondary2);
                         break;
                     case "currency":
                         $secondary2 = new NumberField($task6->getCouponSecondaryFieldValueTypeTwo() . "s21", " ");
                         if ($task6->getCouponSecondaryFieldCurrencyValueTwo()) {
                             $secondary2->setValue($task6->getCouponSecondaryFieldCurrencyValueTwo());
                             $secondary2->setCurrencyCode($task6->getCouponSecondaryFieldCurrencyCodeTwo());
                         }
                         if ($task6->getCouponSecondaryFieldLabelTwo()) {
                             $secondary2->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelTwo()));
                         }
                         $secondary2->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetTwo());
                         $structure->addSecondaryField($secondary2);
                         break;
                 }
                 switch ($task6->getCouponSecondaryFieldValueTypeThree()) {
                     case "text":
                         $secondary3 = new Field($task6->getCouponSecondaryFieldValueTypeThree() . "s31", " ");
                         if ($task6->getCouponSecondaryFieldTextValueThree()) {
                             $secondary3->setValue($task6->getCouponSecondaryFieldTextValueThree());
                         }
                         if ($task6->getCouponSecondaryFieldLabelThree()) {
                             $secondary3->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelThree()));
                         }
                         $secondary3->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetThree());
                         $structure->addSecondaryField($secondary3);
                         break;
                     case "datentime":
                         $secondary3 = new DateField($task6->getCouponSecondaryFieldValueTypeThree() . "s31", " ");
                         if ($task6->getCouponSecondaryFieldValueDateThree()) {
                             $secondary3->setValue($task6->getCouponSecondaryFieldValueDateThree());
                             $secondary3->setDateStyle($task6->getCouponSecondaryFieldValueDateFormateThree());
                             $secondary3->setTimeStyle($task6->getCouponSecondaryFieldValueTimeFormateThree());
                         }
                         if ($task6->getCouponSecondaryFieldLabelThree()) {
                             $secondary3->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelThree()));
                         }
                         $secondary3->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetThree());
                         $structure->addSecondaryField($secondary3);
                         break;
                     case "number":
                         $secondary3 = new NumberField($task6->getCouponSecondaryFieldValueTypeThree() . "s31", " ");
                         if ($task6->getCouponSecondaryFieldNumberValueThree()) {
                             $secondary3->setValue($task6->getCouponSecondaryFieldNumberValueThree());
                             $secondary3->setNumberStyle($task6->getCouponSecondaryFieldNumberFormateThree());
                         }
                         if ($task6->getCouponSecondaryFieldLabelThree()) {
                             $secondary3->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelThree()));
                         }
                         $secondary3->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetThree());
                         $structure->addSecondaryField($secondary3);
                         break;
                     case "currency":
                         $secondary3 = new NumberField($task6->getCouponSecondaryFieldValueTypeThree() . "s31", " ");
                         if ($task6->getCouponSecondaryFieldCurrencyValueThree()) {
                             $secondary3->setValue($task6->getCouponSecondaryFieldCurrencyValueThree());
                             $secondary3->setCurrencyCode($task6->getCouponSecondaryFieldCurrencyCodeThree());
                         }
                         if ($task6->getCouponSecondaryFieldLabelThree()) {
                             $secondary3->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelThree()));
                         }
                         $secondary3->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetThree());
                         $structure->addSecondaryField($secondary3);
                         break;
                 }
                 switch ($task6->getCouponSecondaryFieldValueTypeFour()) {
                     case "text":
                         $secondary4 = new Field($task6->getCouponSecondaryFieldValueTypeFour() . "s41", " ");
                         if ($task6->getCouponSecondaryFieldTextValueFour()) {
                             $secondary4->setValue($task6->getCouponSecondaryFieldTextValueFour());
                         }
                         if ($task6->getCouponSecondaryFieldLabelFour()) {
                             $secondary4->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelFour()));
                         }
                         $secondary4->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetFour());
                         $structure->addSecondaryField($secondary4);
                         break;
                     case "datentime":
                         $secondary4 = new DateField($task6->getCouponSecondaryFieldValueTypeFour() . "s41", " ");
                         if ($task6->getCouponSecondaryFieldValueDateFour()) {
                             $secondary4->setValue($task6->getCouponSecondaryFieldValueDateFour());
                             $secondary4->setDateStyle($task6->getCouponSecondaryFieldValueDateFormateFour());
                             $secondary4->setTimeStyle($task6->getCouponSecondaryFieldValueTimeFormateFour());
                         }
                         if ($task6->getCouponSecondaryFieldLabelFour()) {
                             $secondary4->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelFour()));
                         }
                         $secondary4->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetFour());
                         $structure->addSecondaryField($secondary4);
                         break;
                     case "number":
                         $secondary4 = new NumberField($task6->getCouponSecondaryFieldValueTypeFour() . "s41", " ");
                         if ($task6->getCouponSecondaryFieldNumberValueFour()) {
                             $secondary4->setValue($task6->getCouponSecondaryFieldNumberValueFour());
                             $secondary4->setNumberStyle($task6->getCouponSecondaryFieldNumberFormateFour());
                         }
                         if ($task6->getCouponSecondaryFieldLabelFour()) {
                             $secondary4->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelFour()));
                         }
                         $secondary4->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetFour());
                         $structure->addSecondaryField($secondary4);
                         break;
                     case "currency":
                         $secondary4 = new NumberField($task6->getCouponSecondaryFieldValueTypeFour() . "s41", " ");
                         if ($task6->getCouponSecondaryFieldCurrencyValueFour()) {
                             $secondary4->setValue($task6->getCouponSecondaryFieldCurrencyValueFour());
                             $secondary4->setCurrencyCode($task6->getCouponSecondaryFieldCurrencyCodeFour());
                         }
                         if ($task6->getCouponSecondaryFieldLabelFour()) {
                             $secondary4->setLabel(strtoupper($task6->getCouponSecondaryFieldLabelFour()));
                         }
                         $secondary4->setTextAlignment($task6->getCouponSecondaryFieldAlignmnetFour());
                         $structure->addSecondaryField($secondary4);
                         break;
                 }
             }
             break;
     }
     // Add auxiliary field
     if ($task1->getCategoryName() == "Generic" && $task3->getCouponBarcodeType() == "Aztec") {
     } else {
         if ($task1->getCategoryName() == "Generic" && $task3->getCouponBarcodeType() == "QRCode") {
         } else {
             switch ($task7->getCouponAuxiliaryFieldTotalFields()) {
                 case 0:
                     break;
                 case 1:
                     switch ($task7->getCouponAuxiliaryFieldValueTypeOne()) {
                         case "text":
                             $auxiliary1 = new Field($task7->getCouponAuxiliaryFieldValueTypeOne() . "a11", " ");
                             if ($task7->getCouponAuxiliaryFieldTextValueOne()) {
                                 $auxiliary1->setValue($task7->getCouponAuxiliaryFieldTextValueOne());
                             }
                             if ($task7->getCouponAuxiliaryFieldLabelOne()) {
                                 $auxiliary1->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelOne()));
                             }
                             $structure->addAuxiliaryField($auxiliary1);
                             break;
                         case "datentime":
                             $auxiliary1 = new DateField($task7->getCouponAuxiliaryFieldValueTypeOne() . "a11", " ");
                             if ($task7->getCouponAuxiliaryFieldValueDateOne()) {
                                 $auxiliary1->setValue($task7->getCouponAuxiliaryFieldValueDateOne());
                                 $auxiliary1->setDateStyle($task7->getCouponAuxiliaryFieldValueDateFormateOne());
                                 $auxiliary1->setTimeStyle($task7->getCouponAuxiliaryFieldValueTimeFormateOne());
                             }
                             if ($task7->getCouponAuxiliaryFieldLabelOne()) {
                                 $auxiliary1->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelOne()));
                             }
                             $structure->addAuxiliaryField($auxiliary1);
                             break;
                         case "number":
                             $auxiliary1 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeOne() . "a11", " ");
                             if ($task7->getCouponAuxiliaryFieldNumberValueOne()) {
                                 $auxiliary1->setValue($task7->getCouponAuxiliaryFieldNumberValueOne());
                                 $auxiliary1->setNumberStyle($task7->getCouponAuxiliaryFieldNumberFormateOne());
                             }
                             if ($task7->getCouponAuxiliaryFieldLabelOne()) {
                                 $auxiliary1->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelOne()));
                             }
                             $structure->addAuxiliaryField($auxiliary1);
                             break;
                         case "currency":
                             $auxiliary1 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeOne() . "a11", " ");
                             if ($task7->getCouponAuxiliaryFieldCurrencyValueOne()) {
                                 $auxiliary1->setValue($task7->getCouponAuxiliaryFieldCurrencyValueOne());
                                 $auxiliary1->setCurrencyCode($task7->getCouponAuxiliaryFieldCurrencyCodeOne());
                             }
                             if ($task7->getCouponAuxiliaryFieldLabelOne()) {
                                 $auxiliary1->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelOne()));
                             }
                             $structure->addAuxiliaryField($auxiliary1);
                             break;
                     }
                     break;
                 case 2:
                     switch ($task7->getCouponAuxiliaryFieldValueTypeOne()) {
                         case "text":
                             $auxiliary1 = new Field($task7->getCouponAuxiliaryFieldValueTypeOne() . "a11", " ");
                             if ($task7->getCouponAuxiliaryFieldTextValueOne()) {
                                 $auxiliary1->setValue($task7->getCouponAuxiliaryFieldTextValueOne());
                             }
                             if ($task7->getCouponAuxiliaryFieldLabelOne()) {
                                 $auxiliary1->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelOne()));
                             }
                             $structure->addAuxiliaryField($auxiliary1);
                             break;
                         case "datentime":
                             $auxiliary1 = new DateField($task7->getCouponAuxiliaryFieldValueTypeOne() . "a11", " ");
                             if ($task7->getCouponAuxiliaryFieldValueDateOne()) {
                                 $auxiliary1->setValue($task7->getCouponAuxiliaryFieldValueDateOne());
                                 $auxiliary1->setDateStyle($task7->getCouponAuxiliaryFieldValueDateFormateOne());
                                 $auxiliary1->setTimeStyle($task7->getCouponAuxiliaryFieldValueTimeFormateOne());
                             }
                             if ($task7->getCouponAuxiliaryFieldLabelOne()) {
                                 $auxiliary1->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelOne()));
                             }
                             $structure->addAuxiliaryField($auxiliary1);
                             break;
                         case "number":
                             $auxiliary1 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeOne() . "a11", " ");
                             if ($task7->getCouponAuxiliaryFieldNumberValueOne()) {
                                 $auxiliary1->setValue($task7->getCouponAuxiliaryFieldNumberValueOne());
                                 $auxiliary1->setNumberStyle($task7->getCouponAuxiliaryFieldNumberFormateOne());
                             }
                             if ($task7->getCouponAuxiliaryFieldLabelOne()) {
                                 $auxiliary1->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelOne()));
                             }
                             $structure->addAuxiliaryField($auxiliary1);
                             break;
                         case "currency":
                             $auxiliary1 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeOne() . "a11", " ");
                             if ($task7->getCouponAuxiliaryFieldCurrencyValueOne()) {
                                 $auxiliary1->setValue($task7->getCouponAuxiliaryFieldCurrencyValueOne());
                                 $auxiliary1->setCurrencyCode($task7->getCouponAuxiliaryFieldCurrencyCodeOne());
                             }
                             if ($task7->getCouponAuxiliaryFieldLabelOne()) {
                                 $auxiliary1->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelOne()));
                             }
                             $structure->addAuxiliaryField($auxiliary1);
                             break;
                     }
                     switch ($task7->getCouponAuxiliaryFieldValueTypeTwo()) {
                         case "text":
                             $auxiliary2 = new Field($task7->getCouponAuxiliaryFieldValueTypeTwo() . "a21", " ");
                             if ($task7->getCouponAuxiliaryFieldTextValueTwo()) {
                                 $auxiliary2->setValue($task7->getCouponAuxiliaryFieldTextValueTwo());
                             }
                             if ($task7->getCouponAuxiliaryFieldLabelTwo()) {
                                 $auxiliary2->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelTwo()));
                             }
                             $structure->addAuxiliaryField($auxiliary2);
                             break;
                         case "datentime":
                             $auxiliary2 = new DateField($task7->getCouponAuxiliaryFieldValueTypeTwo() . "a21", " ");
                             if ($task7->getCouponAuxiliaryFieldValueDateTwo()) {
                                 $auxiliary2->setValue($task7->getCouponAuxiliaryFieldValueDateTwo());
                                 $auxiliary2->setDateStyle($task7->getCouponAuxiliaryFieldValueDateFormateTwo());
                                 $auxiliary2->setTimeStyle($task7->getCouponAuxiliaryFieldValueTimeFormateTwo());
                             }
                             if ($task7->getCouponAuxiliaryFieldLabelTwo()) {
                                 $auxiliary2->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelTwo()));
                             }
                             $structure->addAuxiliaryField($auxiliary2);
                             break;
                         case "number":
                             $auxiliary2 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeTwo() . "a21", " ");
                             if ($task7->getCouponAuxiliaryFieldNumberValueTwo()) {
                                 $auxiliary2->setValue($task7->getCouponAuxiliaryFieldNumberValueTwo());
                                 $auxiliary2->setNumberStyle($task7->getCouponAuxiliaryFieldNumberFormateTwo());
                             }
                             if ($task7->getCouponAuxiliaryFieldLabelTwo()) {
                                 $auxiliary2->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelTwo()));
                             }
                             $structure->addAuxiliaryField($auxiliary2);
                             break;
                         case "currency":
                             $auxiliary2 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeTwo() . "a21", " ");
                             if ($task7->getCouponAuxiliaryFieldCurrencyValueTwo()) {
                                 $auxiliary2->setValue($task7->getCouponAuxiliaryFieldCurrencyValueTwo());
                                 $auxiliary2->setCurrencyCode($task7->getCouponAuxiliaryFieldCurrencyCodeTwo());
                             }
                             if ($task7->getCouponAuxiliaryFieldLabelTwo()) {
                                 $auxiliary2->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelTwo()));
                             }
                             $structure->addAuxiliaryField($auxiliary2);
                             break;
                     }
                     break;
                 case 3:
                     if ($task1->getCategoryName() == 'Coupon') {
                         switch ($task7->getCouponAuxiliaryFieldValueTypeOne()) {
                             case "text":
                                 $auxiliary1 = new Field($task7->getCouponAuxiliaryFieldValueTypeOne() . "a11", " ");
                                 if ($task7->getCouponAuxiliaryFieldTextValueOne()) {
                                     $auxiliary1->setValue($task7->getCouponAuxiliaryFieldTextValueOne());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelOne()) {
                                     $auxiliary1->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelOne()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary1);
                                 break;
                             case "datentime":
                                 $auxiliary1 = new DateField($task7->getCouponAuxiliaryFieldValueTypeOne() . "a11", " ");
                                 if ($task7->getCouponAuxiliaryFieldValueDateOne()) {
                                     $auxiliary1->setValue($task7->getCouponAuxiliaryFieldValueDateOne());
                                     $auxiliary1->setDateStyle($task7->getCouponAuxiliaryFieldValueDateFormateOne());
                                     $auxiliary1->setTimeStyle($task7->getCouponAuxiliaryFieldValueTimeFormateOne());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelOne()) {
                                     $auxiliary1->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelOne()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary1);
                                 break;
                             case "number":
                                 $auxiliary1 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeOne() . "a11", " ");
                                 if ($task7->getCouponAuxiliaryFieldNumberValueOne()) {
                                     $auxiliary1->setValue($task7->getCouponAuxiliaryFieldNumberValueOne());
                                     $auxiliary1->setNumberStyle($task7->getCouponAuxiliaryFieldNumberFormateOne());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelOne()) {
                                     $auxiliary1->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelOne()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary1);
                                 break;
                             case "currency":
                                 $auxiliary1 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeOne() . "a11", " ");
                                 if ($task7->getCouponAuxiliaryFieldCurrencyValueOne()) {
                                     $auxiliary1->setValue($task7->getCouponAuxiliaryFieldCurrencyValueOne());
                                     $auxiliary1->setCurrencyCode($task7->getCouponAuxiliaryFieldCurrencyCodeOne());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelOne()) {
                                     $auxiliary1->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelOne()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary1);
                                 break;
                         }
                         switch ($task7->getCouponAuxiliaryFieldValueTypeTwo()) {
                             case "text":
                                 $auxiliary2 = new Field($task7->getCouponAuxiliaryFieldValueTypeTwo() . "a21", " ");
                                 if ($task7->getCouponAuxiliaryFieldTextValueTwo()) {
                                     $auxiliary2->setValue($task7->getCouponAuxiliaryFieldTextValueTwo());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelTwo()) {
                                     $auxiliary2->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelTwo()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary2);
                                 break;
                             case "datentime":
                                 $auxiliary2 = new DateField($task7->getCouponAuxiliaryFieldValueTypeTwo() . "a21", " ");
                                 if ($task7->getCouponAuxiliaryFieldValueDateTwo()) {
                                     $auxiliary2->setValue($task7->getCouponAuxiliaryFieldValueDateTwo());
                                     $auxiliary2->setDateStyle($task7->getCouponAuxiliaryFieldValueDateFormateTwo());
                                     $auxiliary2->setTimeStyle($task7->getCouponAuxiliaryFieldValueTimeFormateTwo());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelTwo()) {
                                     $auxiliary2->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelTwo()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary2);
                                 break;
                             case "number":
                                 $auxiliary2 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeTwo() . "a21", " ");
                                 if ($task7->getCouponAuxiliaryFieldNumberValueTwo()) {
                                     $auxiliary2->setValue($task7->getCouponAuxiliaryFieldNumberValueTwo());
                                     $auxiliary2->setNumberStyle($task7->getCouponAuxiliaryFieldNumberFormateTwo());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelTwo()) {
                                     $auxiliary2->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelTwo()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary2);
                                 break;
                             case "currency":
                                 $auxiliary2 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeTwo() . "a21", " ");
                                 if ($task7->getCouponAuxiliaryFieldCurrencyValueTwo()) {
                                     $auxiliary2->setValue($task7->getCouponAuxiliaryFieldCurrencyValueTwo());
                                     $auxiliary2->setCurrencyCode($task7->getCouponAuxiliaryFieldCurrencyCodeTwo());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelTwo()) {
                                     $auxiliary2->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelTwo()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary2);
                                 break;
                         }
                         break;
                     } else {
                         switch ($task7->getCouponAuxiliaryFieldValueTypeOne()) {
                             case "text":
                                 $auxiliary1 = new Field($task7->getCouponAuxiliaryFieldValueTypeOne() . "a11", " ");
                                 if ($task7->getCouponAuxiliaryFieldTextValueOne()) {
                                     $auxiliary1->setValue($task7->getCouponAuxiliaryFieldTextValueOne());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelOne()) {
                                     $auxiliary1->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelOne()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary1);
                                 break;
                             case "datentime":
                                 $auxiliary1 = new DateField($task7->getCouponAuxiliaryFieldValueTypeOne() . "a11", " ");
                                 if ($task7->getCouponAuxiliaryFieldValueDateOne()) {
                                     $auxiliary1->setValue($task7->getCouponAuxiliaryFieldValueDateOne());
                                     $auxiliary1->setDateStyle($task7->getCouponAuxiliaryFieldValueDateFormateOne());
                                     $auxiliary1->setTimeStyle($task7->getCouponAuxiliaryFieldValueTimeFormateOne());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelOne()) {
                                     $auxiliary1->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelOne()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary1);
                                 break;
                             case "number":
                                 $auxiliary1 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeOne() . "a11", " ");
                                 if ($task7->getCouponAuxiliaryFieldNumberValueOne()) {
                                     $auxiliary1->setValue($task7->getCouponAuxiliaryFieldNumberValueOne());
                                     $auxiliary1->setNumberStyle($task7->getCouponAuxiliaryFieldNumberFormateOne());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelOne()) {
                                     $auxiliary1->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelOne()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary1);
                                 break;
                             case "currency":
                                 $auxiliary1 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeOne() . "a11", " ");
                                 if ($task7->getCouponAuxiliaryFieldCurrencyValueOne()) {
                                     $auxiliary1->setValue($task7->getCouponAuxiliaryFieldCurrencyValueOne());
                                     $auxiliary1->setCurrencyCode($task7->getCouponAuxiliaryFieldCurrencyCodeOne());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelOne()) {
                                     $auxiliary1->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelOne()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary1);
                                 break;
                         }
                         switch ($task7->getCouponAuxiliaryFieldValueTypeTwo()) {
                             case "text":
                                 $auxiliary2 = new Field($task7->getCouponAuxiliaryFieldValueTypeTwo() . "a21", " ");
                                 if ($task7->getCouponAuxiliaryFieldTextValueTwo()) {
                                     $auxiliary2->setValue($task7->getCouponAuxiliaryFieldTextValueTwo());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelTwo()) {
                                     $auxiliary2->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelTwo()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary2);
                                 break;
                             case "datentime":
                                 $auxiliary2 = new DateField($task7->getCouponAuxiliaryFieldValueTypeTwo() . "a21", " ");
                                 if ($task7->getCouponAuxiliaryFieldValueDateTwo()) {
                                     $auxiliary2->setValue($task7->getCouponAuxiliaryFieldValueDateTwo());
                                     $auxiliary2->setDateStyle($task7->getCouponAuxiliaryFieldValueDateFormateTwo());
                                     $auxiliary2->setTimeStyle($task7->getCouponAuxiliaryFieldValueTimeFormateTwo());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelTwo()) {
                                     $auxiliary2->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelTwo()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary2);
                                 break;
                             case "number":
                                 $auxiliary2 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeTwo() . "a21", " ");
                                 if ($task7->getCouponAuxiliaryFieldNumberValueTwo()) {
                                     $auxiliary2->setValue($task7->getCouponAuxiliaryFieldNumberValueTwo());
                                     $auxiliary2->setNumberStyle($task7->getCouponAuxiliaryFieldNumberFormateTwo());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelTwo()) {
                                     $auxiliary2->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelTwo()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary2);
                                 break;
                             case "currency":
                                 $auxiliary2 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeTwo() . "a21", " ");
                                 if ($task7->getCouponAuxiliaryFieldCurrencyValueTwo()) {
                                     $auxiliary2->setValue($task7->getCouponAuxiliaryFieldCurrencyValueTwo());
                                     $auxiliary2->setCurrencyCode($task7->getCouponAuxiliaryFieldCurrencyCodeTwo());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelTwo()) {
                                     $auxiliary2->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelTwo()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary2);
                                 break;
                         }
                         switch ($task7->getCouponAuxiliaryFieldValueTypeThree()) {
                             case "text":
                                 $auxiliary3 = new Field($task7->getCouponAuxiliaryFieldValueTypeThree() . "a31", " ");
                                 if ($task7->getCouponAuxiliaryFieldTextValueThree()) {
                                     $auxiliary3->setValue($task7->getCouponAuxiliaryFieldTextValueThree());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelThree()) {
                                     $auxiliary3->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelThree()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary3);
                                 break;
                             case "datentime":
                                 $auxiliary3 = new DateField($task7->getCouponAuxiliaryFieldValueTypeThree() . "a31", " ");
                                 if ($task7->getCouponAuxiliaryFieldValueDateThree()) {
                                     $auxiliary3->setValue($task7->getCouponAuxiliaryFieldValueDateThree());
                                     $auxiliary3->setDateStyle($task7->getCouponAuxiliaryFieldValueDateFormateThree());
                                     $auxiliary3->setTimeStyle($task7->getCouponAuxiliaryFieldValueTimeFormateThree());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelThree()) {
                                     $auxiliary3->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelThree()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary3);
                                 break;
                             case "number":
                                 $auxiliary3 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeThree() . "a31", " ");
                                 if ($task7->getCouponAuxiliaryFieldNumberValueThree()) {
                                     $auxiliary3->setValue($task7->getCouponAuxiliaryFieldNumberValueThree());
                                     $auxiliary3->setNumberStyle($task7->getCouponAuxiliaryFieldNumberFormateThree());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelThree()) {
                                     $auxiliary3->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelThree()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary3);
                                 break;
                             case "currency":
                                 $auxiliary3 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeThree() . "a31", " ");
                                 if ($task7->getCouponAuxiliaryFieldCurrencyValueThree()) {
                                     $auxiliary3->setValue($task7->getCouponAuxiliaryFieldCurrencyValueThree());
                                     $auxiliary3->setCurrencyCode($task7->getCouponAuxiliaryFieldCurrencyCodeThree());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelThree()) {
                                     $auxiliary3->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelThree()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary3);
                                 break;
                         }
                         break;
                     }
                 case 4:
                     if ($task1->getCategoryName() == 'Coupon') {
                         switch ($task7->getCouponAuxiliaryFieldValueTypeOne()) {
                             case "text":
                                 $auxiliary1 = new Field($task7->getCouponAuxiliaryFieldValueTypeOne() . "a11", " ");
                                 if ($task7->getCouponAuxiliaryFieldTextValueOne()) {
                                     $auxiliary1->setValue($task7->getCouponAuxiliaryFieldTextValueOne());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelOne()) {
                                     $auxiliary1->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelOne()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary1);
                                 break;
                             case "datentime":
                                 $auxiliary1 = new DateField($task7->getCouponAuxiliaryFieldValueTypeOne() . "a11", " ");
                                 if ($task7->getCouponAuxiliaryFieldValueDateOne()) {
                                     $auxiliary1->setValue($task7->getCouponAuxiliaryFieldValueDateOne());
                                     $auxiliary1->setDateStyle($task7->getCouponAuxiliaryFieldValueDateFormateOne());
                                     $auxiliary1->setTimeStyle($task7->getCouponAuxiliaryFieldValueTimeFormateOne());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelOne()) {
                                     $auxiliary1->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelOne()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary1);
                                 break;
                             case "number":
                                 $auxiliary1 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeOne() . "a11", " ");
                                 if ($task7->getCouponAuxiliaryFieldNumberValueOne()) {
                                     $auxiliary1->setValue($task7->getCouponAuxiliaryFieldNumberValueOne());
                                     $auxiliary1->setNumberStyle($task7->getCouponAuxiliaryFieldNumberFormateOne());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelOne()) {
                                     $auxiliary1->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelOne()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary1);
                                 break;
                             case "currency":
                                 $auxiliary1 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeOne() . "a11", " ");
                                 if ($task7->getCouponAuxiliaryFieldCurrencyValueOne()) {
                                     $auxiliary1->setValue($task7->getCouponAuxiliaryFieldCurrencyValueOne());
                                     $auxiliary1->setCurrencyCode($task7->getCouponAuxiliaryFieldCurrencyCodeOne());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelOne()) {
                                     $auxiliary1->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelOne()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary1);
                                 break;
                         }
                         switch ($task7->getCouponAuxiliaryFieldValueTypeTwo()) {
                             case "text":
                                 $auxiliary2 = new Field($task7->getCouponAuxiliaryFieldValueTypeTwo() . "a21", " ");
                                 if ($task7->getCouponAuxiliaryFieldTextValueTwo()) {
                                     $auxiliary2->setValue($task7->getCouponAuxiliaryFieldTextValueTwo());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelTwo()) {
                                     $auxiliary2->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelTwo()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary2);
                                 break;
                             case "datentime":
                                 $auxiliary2 = new DateField($task7->getCouponAuxiliaryFieldValueTypeTwo() . "a21", " ");
                                 if ($task7->getCouponAuxiliaryFieldValueDateTwo()) {
                                     $auxiliary2->setValue($task7->getCouponAuxiliaryFieldValueDateTwo());
                                     $auxiliary2->setDateStyle($task7->getCouponAuxiliaryFieldValueDateFormateTwo());
                                     $auxiliary2->setTimeStyle($task7->getCouponAuxiliaryFieldValueTimeFormateTwo());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelTwo()) {
                                     $auxiliary2->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelTwo()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary2);
                                 break;
                             case "number":
                                 $auxiliary2 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeTwo() . "a21", " ");
                                 if ($task7->getCouponAuxiliaryFieldNumberValueTwo()) {
                                     $auxiliary2->setValue($task7->getCouponAuxiliaryFieldNumberValueTwo());
                                     $auxiliary2->setNumberStyle($task7->getCouponAuxiliaryFieldNumberFormateTwo());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelTwo()) {
                                     $auxiliary2->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelTwo()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary2);
                                 break;
                             case "currency":
                                 $auxiliary2 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeTwo() . "a21", " ");
                                 if ($task7->getCouponAuxiliaryFieldCurrencyValueTwo()) {
                                     $auxiliary2->setValue($task7->getCouponAuxiliaryFieldCurrencyValueTwo());
                                     $auxiliary2->setCurrencyCode($task7->getCouponAuxiliaryFieldCurrencyCodeTwo());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelTwo()) {
                                     $auxiliary2->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelTwo()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary2);
                                 break;
                         }
                         break;
                     } else {
                         switch ($task7->getCouponAuxiliaryFieldValueTypeOne()) {
                             case "text":
                                 $auxiliary1 = new Field($task7->getCouponAuxiliaryFieldValueTypeOne() . "a11", " ");
                                 if ($task7->getCouponAuxiliaryFieldTextValueOne()) {
                                     $auxiliary1->setValue($task7->getCouponAuxiliaryFieldTextValueOne());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelOne()) {
                                     $auxiliary1->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelOne()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary1);
                                 break;
                             case "datentime":
                                 $auxiliary1 = new DateField($task7->getCouponAuxiliaryFieldValueTypeOne() . "a11", " ");
                                 if ($task7->getCouponAuxiliaryFieldValueDateOne()) {
                                     $auxiliary1->setValue($task7->getCouponAuxiliaryFieldValueDateOne());
                                     $auxiliary1->setDateStyle($task7->getCouponAuxiliaryFieldValueDateFormateOne());
                                     $auxiliary1->setTimeStyle($task7->getCouponAuxiliaryFieldValueTimeFormateOne());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelOne()) {
                                     $auxiliary1->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelOne()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary1);
                                 break;
                             case "number":
                                 $auxiliary1 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeOne() . "a11", " ");
                                 if ($task7->getCouponAuxiliaryFieldNumberValueOne()) {
                                     $auxiliary1->setValue($task7->getCouponAuxiliaryFieldNumberValueOne());
                                     $auxiliary1->setNumberStyle($task7->getCouponAuxiliaryFieldNumberFormateOne());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelOne()) {
                                     $auxiliary1->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelOne()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary1);
                                 break;
                             case "currency":
                                 $auxiliary1 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeOne() . "a11", " ");
                                 if ($task7->getCouponAuxiliaryFieldCurrencyValueOne()) {
                                     $auxiliary1->setValue($task7->getCouponAuxiliaryFieldCurrencyValueOne());
                                     $auxiliary1->setCurrencyCode($task7->getCouponAuxiliaryFieldCurrencyCodeOne());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelOne()) {
                                     $auxiliary1->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelOne()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary1);
                                 break;
                         }
                         switch ($task7->getCouponAuxiliaryFieldValueTypeTwo()) {
                             case "text":
                                 $auxiliary2 = new Field($task7->getCouponAuxiliaryFieldValueTypeTwo() . "a21", " ");
                                 if ($task7->getCouponAuxiliaryFieldTextValueTwo()) {
                                     $auxiliary2->setValue($task7->getCouponAuxiliaryFieldTextValueTwo());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelTwo()) {
                                     $auxiliary2->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelTwo()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary2);
                                 break;
                             case "datentime":
                                 $auxiliary2 = new DateField($task7->getCouponAuxiliaryFieldValueTypeTwo() . "a21", " ");
                                 if ($task7->getCouponAuxiliaryFieldValueDateTwo()) {
                                     $auxiliary2->setValue($task7->getCouponAuxiliaryFieldValueDateTwo());
                                     $auxiliary2->setDateStyle($task7->getCouponAuxiliaryFieldValueDateFormateTwo());
                                     $auxiliary2->setTimeStyle($task7->getCouponAuxiliaryFieldValueTimeFormateTwo());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelTwo()) {
                                     $auxiliary2->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelTwo()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary2);
                                 break;
                             case "number":
                                 $auxiliary2 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeTwo() . "a21", " ");
                                 if ($task7->getCouponAuxiliaryFieldNumberValueTwo()) {
                                     $auxiliary2->setValue($task7->getCouponAuxiliaryFieldNumberValueTwo());
                                     $auxiliary2->setNumberStyle($task7->getCouponAuxiliaryFieldNumberFormateTwo());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelTwo()) {
                                     $auxiliary2->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelTwo()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary2);
                                 break;
                             case "currency":
                                 $auxiliary2 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeTwo() . "a21", " ");
                                 if ($task7->getCouponAuxiliaryFieldCurrencyValueTwo()) {
                                     $auxiliary2->setValue($task7->getCouponAuxiliaryFieldCurrencyValueTwo());
                                     $auxiliary2->setCurrencyCode($task7->getCouponAuxiliaryFieldCurrencyCodeTwo());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelTwo()) {
                                     $auxiliary2->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelTwo()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary2);
                                 break;
                         }
                         switch ($task7->getCouponAuxiliaryFieldValueTypeThree()) {
                             case "text":
                                 $auxiliary3 = new Field($task7->getCouponAuxiliaryFieldValueTypeThree() . "a31", " ");
                                 if ($task7->getCouponAuxiliaryFieldTextValueThree()) {
                                     $auxiliary3->setValue($task7->getCouponAuxiliaryFieldTextValueThree());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelThree()) {
                                     $auxiliary3->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelThree()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary3);
                                 break;
                             case "datentime":
                                 $auxiliary3 = new DateField($task7->getCouponAuxiliaryFieldValueTypeThree() . "a31", " ");
                                 if ($task7->getCouponAuxiliaryFieldValueDateThree()) {
                                     $auxiliary3->setValue($task7->getCouponAuxiliaryFieldValueDateThree());
                                     $auxiliary3->setDateStyle($task7->getCouponAuxiliaryFieldValueDateFormateThree());
                                     $auxiliary3->setTimeStyle($task7->getCouponAuxiliaryFieldValueTimeFormateThree());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelThree()) {
                                     $auxiliary3->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelThree()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary3);
                                 break;
                             case "number":
                                 $auxiliary3 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeThree() . "a31", " ");
                                 if ($task7->getCouponAuxiliaryFieldNumberValueThree()) {
                                     $auxiliary3->setValue($task7->getCouponAuxiliaryFieldNumberValueThree());
                                     $auxiliary3->setNumberStyle($task7->getCouponAuxiliaryFieldNumberFormateThree());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelThree()) {
                                     $auxiliary3->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelThree()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary3);
                                 break;
                             case "currency":
                                 $auxiliary3 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeThree() . "a31", " ");
                                 if ($task7->getCouponAuxiliaryFieldCurrencyValueThree()) {
                                     $auxiliary3->setValue($task7->getCouponAuxiliaryFieldCurrencyValueThree());
                                     $auxiliary3->setCurrencyCode($task7->getCouponAuxiliaryFieldCurrencyCodeThree());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelThree()) {
                                     $auxiliary3->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelThree()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary3);
                                 break;
                         }
                         switch ($task7->getCouponAuxiliaryFieldValueTypeFour()) {
                             case "text":
                                 $auxiliary4 = new Field($task7->getCouponAuxiliaryFieldValueTypeFour() . "a41", " ");
                                 if ($task7->getCouponAuxiliaryFieldTextValueFour()) {
                                     $auxiliary4->setValue($task7->getCouponAuxiliaryFieldTextValueFour());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelFour()) {
                                     $auxiliary4->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelFour()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary4);
                                 break;
                             case "datentime":
                                 $auxiliary4 = new DateField($task7->getCouponAuxiliaryFieldValueTypeFour() . "a41", " ");
                                 if ($task7->getCouponAuxiliaryFieldValueDateFour()) {
                                     $auxiliary4->setValue($task7->getCouponAuxiliaryFieldValueDateFour());
                                     $auxiliary4->setDateStyle($task7->getCouponAuxiliaryFieldValueDateFormateFour());
                                     $auxiliary4->setTimeStyle($task7->getCouponAuxiliaryFieldValueTimeFormateFour());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelFour()) {
                                     $auxiliary4->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelFour()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary4);
                                 break;
                             case "number":
                                 $auxiliary4 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeFour() . "a41", " ");
                                 if ($task7->getCouponAuxiliaryFieldNumberValueFour()) {
                                     $auxiliary4->setValue($task7->getCouponAuxiliaryFieldNumberValueFour());
                                     $auxiliary4->setNumberStyle($task7->getCouponAuxiliaryFieldNumberFormateFour());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelFour()) {
                                     $auxiliary4->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelFour()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary4);
                                 break;
                             case "currency":
                                 $auxiliary4 = new NumberField($task7->getCouponAuxiliaryFieldValueTypeFour() . "a41", " ");
                                 if ($task7->getCouponAuxiliaryFieldCurrencyValueFour()) {
                                     $auxiliary4->setValue($task7->getCouponAuxiliaryFieldCurrencyValueFour());
                                     $auxiliary4->setCurrencyCode($task7->getCouponAuxiliaryFieldCurrencyCodeFour());
                                 }
                                 if ($task7->getCouponAuxiliaryFieldLabelFour()) {
                                     $auxiliary4->setLabel(strtoupper($task7->getCouponAuxiliaryFieldLabelFour()));
                                 }
                                 $structure->addAuxiliaryField($auxiliary4);
                                 break;
                         }
                     }
                     break;
             }
         }
     }
     // Add Back Fields
     switch ($task8->getCouponBackFieldTotalFields()) {
         case 0:
             break;
         case 1:
             $backfield1 = new Field("Textb11", " ");
             if ($task8->getCouponBackFieldTextValueOne()) {
                 $backfield1->setValue($task8->getCouponBackFieldTextValueOne());
             }
             if ($task8->getCouponBackFieldLabelOne()) {
                 $backfield1->setLabel($task8->getCouponBackFieldLabelOne());
             }
             $structure->addBackField($backfield1);
             break;
         case 2:
             $backfield1 = new Field("Textb11", " ");
             if ($task8->getCouponBackFieldTextValueOne()) {
                 $backfield1->setValue($task8->getCouponBackFieldTextValueOne());
             }
             if ($task8->getCouponBackFieldLabelOne()) {
                 $backfield1->setLabel($task8->getCouponBackFieldLabelOne());
             }
             $structure->addBackField($backfield1);
             $backfield2 = new Field("Textb21", " ");
             if ($task8->getCouponBackFieldTextValueTwo()) {
                 $backfield2->setValue($task8->getCouponBackFieldTextValueTwo());
             }
             if ($task8->getCouponBackFieldLabelTwo()) {
                 $backfield2->setLabel($task8->getCouponBackFieldLabelTwo());
             }
             $structure->addBackField($backfield2);
             break;
         case 3:
             $backfield1 = new Field("Textb11", " ");
             if ($task8->getCouponBackFieldTextValueOne()) {
                 $backfield1->setValue($task8->getCouponBackFieldTextValueOne());
             }
             if ($task8->getCouponBackFieldLabelOne()) {
                 $backfield1->setLabel($task8->getCouponBackFieldLabelOne());
             }
             $structure->addBackField($backfield1);
             $backfield2 = new Field("Textb21", " ");
             if ($task8->getCouponBackFieldTextValueTwo()) {
                 $backfield2->setValue($task8->getCouponBackFieldTextValueTwo());
             }
             if ($task8->getCouponBackFieldLabelTwo()) {
                 $backfield2->setLabel($task8->getCouponBackFieldLabelTwo());
             }
             $structure->addBackField($backfield2);
             $backfield3 = new Field("Textb31", " ");
             if ($task8->getCouponBackFieldTextValueThree()) {
                 $backfield3->setValue($task8->getCouponBackFieldTextValueThree());
             }
             if ($task8->getCouponBackFieldLabelThree()) {
                 $backfield3->setLabel($task8->getCouponBackFieldLabelThree());
             }
             $structure->addBackField($backfield3);
             break;
         case 4:
             $backfield1 = new Field("Textb11", " ");
             if ($task8->getCouponBackFieldTextValueOne()) {
                 $backfield1->setValue($task8->getCouponBackFieldTextValueOne());
             }
             if ($task8->getCouponBackFieldLabelOne()) {
                 $backfield1->setLabel($task8->getCouponBackFieldLabelOne());
             }
             $structure->addBackField($backfield1);
             $backfield2 = new Field("Textb21", " ");
             if ($task8->getCouponBackFieldTextValueTwo()) {
                 $backfield2->setValue($task8->getCouponBackFieldTextValueTwo());
             }
             if ($task8->getCouponBackFieldLabelTwo()) {
                 $backfield2->setLabel($task8->getCouponBackFieldLabelTwo());
             }
             $structure->addBackField($backfield2);
             $backfield3 = new Field("Textb31", " ");
             if ($task8->getCouponBackFieldTextValueThree()) {
                 $backfield3->setValue($task8->getCouponBackFieldTextValueThree());
             }
             if ($task8->getCouponBackFieldLabelThree()) {
                 $backfield3->setLabel($task8->getCouponBackFieldLabelThree());
             }
             $structure->addBackField($backfield3);
             $backfield4 = new Field("Textb41", " ");
             if ($task8->getCouponBackFieldTextValueFour()) {
                 $backfield4->setValue($task8->getCouponBackFieldTextValueFour());
             }
             if ($task8->getCouponBackFieldLabelFour()) {
                 $backfield4->setLabel($task8->getCouponBackFieldLabelFour());
             }
             $structure->addBackField($backfield4);
             break;
         case 5:
             $backfield1 = new Field("Textb11", " ");
             if ($task8->getCouponBackFieldTextValueOne()) {
                 $backfield1->setValue($task8->getCouponBackFieldTextValueOne());
             }
             if ($task8->getCouponBackFieldLabelOne()) {
                 $backfield1->setLabel($task8->getCouponBackFieldLabelOne());
             }
             $structure->addBackField($backfield1);
             $backfield2 = new Field("Textb21", " ");
             if ($task8->getCouponBackFieldTextValueTwo()) {
                 $backfield2->setValue($task8->getCouponBackFieldTextValueTwo());
             }
             if ($task8->getCouponBackFieldLabelTwo()) {
                 $backfield2->setLabel($task8->getCouponBackFieldLabelTwo());
             }
             $structure->addBackField($backfield2);
             $backfield3 = new Field("Textb31", " ");
             if ($task8->getCouponBackFieldTextValueThree()) {
                 $backfield3->setValue($task8->getCouponBackFieldTextValueThree());
             }
             if ($task8->getCouponBackFieldLabelThree()) {
                 $backfield3->setLabel($task8->getCouponBackFieldLabelThree());
             }
             $structure->addBackField($backfield3);
             $backfield4 = new Field("Textb41", " ");
             if ($task8->getCouponBackFieldTextValueFour()) {
                 $backfield4->setValue($task8->getCouponBackFieldTextValueFour());
             }
             if ($task8->getCouponBackFieldLabelFour()) {
                 $backfield4->setLabel($task8->getCouponBackFieldLabelFour());
             }
             $structure->addBackField($backfield4);
             $backfield5 = new Field("Textb51", " ");
             if ($task8->getCouponBackFieldTextValueFive()) {
                 $backfield5->setValue($task8->getCouponBackFieldTextValueFive());
             }
             if ($task8->getCouponBackFieldLabelFive()) {
                 $backfield5->setLabel($task8->getCouponBackFieldLabelFive());
             }
             $structure->addBackField($backfield5);
             break;
         case 6:
             $backfield1 = new Field("Textb11", " ");
             if ($task8->getCouponBackFieldTextValueOne()) {
                 $backfield1->setValue($task8->getCouponBackFieldTextValueOne());
             }
             if ($task8->getCouponBackFieldLabelOne()) {
                 $backfield1->setLabel($task8->getCouponBackFieldLabelOne());
             }
             $structure->addBackField($backfield1);
             $backfield2 = new Field("Textb21", " ");
             if ($task8->getCouponBackFieldTextValueTwo()) {
                 $backfield2->setValue($task8->getCouponBackFieldTextValueTwo());
             }
             if ($task8->getCouponBackFieldLabelTwo()) {
                 $backfield2->setLabel($task8->getCouponBackFieldLabelTwo());
             }
             $structure->addBackField($backfield2);
             $backfield3 = new Field("Textb31", " ");
             if ($task8->getCouponBackFieldTextValueThree()) {
                 $backfield3->setValue($task8->getCouponBackFieldTextValueThree());
             }
             if ($task8->getCouponBackFieldLabelThree()) {
                 $backfield3->setLabel($task8->getCouponBackFieldLabelThree());
             }
             $structure->addBackField($backfield3);
             $backfield4 = new Field("Textb41", " ");
             if ($task8->getCouponBackFieldTextValueFour()) {
                 $backfield4->setValue($task8->getCouponBackFieldTextValueFour());
             }
             if ($task8->getCouponBackFieldLabelFour()) {
                 $backfield4->setLabel($task8->getCouponBackFieldLabelFour());
             }
             $structure->addBackField($backfield4);
             $backfield5 = new Field("Textb51", " ");
             if ($task8->getCouponBackFieldTextValueFive()) {
                 $backfield5->setValue($task8->getCouponBackFieldTextValueFive());
             }
             if ($task8->getCouponBackFieldLabelFive()) {
                 $backfield5->setLabel($task8->getCouponBackFieldLabelFive());
             }
             $structure->addBackField($backfield5);
             $backfield6 = new Field("Textb61", " ");
             if ($task8->getCouponBackFieldTextValueSix()) {
                 $backfield6->setValue($task8->getCouponBackFieldTextValueSix());
             }
             if ($task8->getCouponBackFieldLabelSix()) {
                 $backfield6->setLabel($task8->getCouponBackFieldLabelSix());
             }
             $structure->addBackField($backfield6);
             break;
         case 7:
             $backfield1 = new Field("Textb11", " ");
             if ($task8->getCouponBackFieldTextValueOne()) {
                 $backfield1->setValue($task8->getCouponBackFieldTextValueOne());
             }
             if ($task8->getCouponBackFieldLabelOne()) {
                 $backfield1->setLabel($task8->getCouponBackFieldLabelOne());
             }
             $structure->addBackField($backfield1);
             $backfield2 = new Field("Textb21", " ");
             if ($task8->getCouponBackFieldTextValueTwo()) {
                 $backfield2->setValue($task8->getCouponBackFieldTextValueTwo());
             }
             if ($task8->getCouponBackFieldLabelTwo()) {
                 $backfield2->setLabel($task8->getCouponBackFieldLabelTwo());
             }
             $structure->addBackField($backfield2);
             $backfield3 = new Field("Textb31", " ");
             if ($task8->getCouponBackFieldTextValueThree()) {
                 $backfield3->setValue($task8->getCouponBackFieldTextValueThree());
             }
             if ($task8->getCouponBackFieldLabelThree()) {
                 $backfield3->setLabel($task8->getCouponBackFieldLabelThree());
             }
             $structure->addBackField($backfield3);
             $backfield4 = new Field("Textb41", " ");
             if ($task8->getCouponBackFieldTextValueFour()) {
                 $backfield4->setValue($task8->getCouponBackFieldTextValueFour());
             }
             if ($task8->getCouponBackFieldLabelFour()) {
                 $backfield4->setLabel($task8->getCouponBackFieldLabelFour());
             }
             $structure->addBackField($backfield4);
             $backfield5 = new Field("Textb51", " ");
             if ($task8->getCouponBackFieldTextValueFive()) {
                 $backfield5->setValue($task8->getCouponBackFieldTextValueFive());
             }
             if ($task8->getCouponBackFieldLabelFive()) {
                 $backfield5->setLabel($task8->getCouponBackFieldLabelFive());
             }
             $structure->addBackField($backfield5);
             $backfield6 = new Field("Textb61", " ");
             if ($task8->getCouponBackFieldTextValueSix()) {
                 $backfield6->setValue($task8->getCouponBackFieldTextValueSix());
             }
             if ($task8->getCouponBackFieldLabelSix()) {
                 $backfield6->setLabel($task8->getCouponBackFieldLabelSix());
             }
             $structure->addBackField($backfield6);
             $backfield7 = new Field("Textb71", " ");
             if ($task8->getCouponBackFieldTextValueSeven()) {
                 $backfield7->setValue($task8->getCouponBackFieldTextValueSeven());
             }
             if ($task8->getCouponBackFieldLabelSeven()) {
                 $backfield7->setLabel($task8->getCouponBackFieldLabelSeven());
             }
             $structure->addBackField($backfield7);
             break;
         case 8:
             $backfield1 = new Field("Textb11", " ");
             if ($task8->getCouponBackFieldTextValueOne()) {
                 $backfield1->setValue($task8->getCouponBackFieldTextValueOne());
             }
             if ($task8->getCouponBackFieldLabelOne()) {
                 $backfield1->setLabel($task8->getCouponBackFieldLabelOne());
             }
             $structure->addBackField($backfield1);
             $backfield2 = new Field("Textb21", " ");
             if ($task8->getCouponBackFieldTextValueTwo()) {
                 $backfield2->setValue($task8->getCouponBackFieldTextValueTwo());
             }
             if ($task8->getCouponBackFieldLabelTwo()) {
                 $backfield2->setLabel($task8->getCouponBackFieldLabelTwo());
             }
             $structure->addBackField($backfield2);
             $backfield3 = new Field("Textb31", " ");
             if ($task8->getCouponBackFieldTextValueThree()) {
                 $backfield3->setValue($task8->getCouponBackFieldTextValueThree());
             }
             if ($task8->getCouponBackFieldLabelThree()) {
                 $backfield3->setLabel($task8->getCouponBackFieldLabelThree());
             }
             $structure->addBackField($backfield3);
             $backfield4 = new Field("Textb41", " ");
             if ($task8->getCouponBackFieldTextValueFour()) {
                 $backfield4->setValue($task8->getCouponBackFieldTextValueFour());
             }
             if ($task8->getCouponBackFieldLabelFour()) {
                 $backfield4->setLabel($task8->getCouponBackFieldLabelFour());
             }
             $structure->addBackField($backfield4);
             $backfield5 = new Field("Textb51", " ");
             if ($task8->getCouponBackFieldTextValueFive()) {
                 $backfield5->setValue($task8->getCouponBackFieldTextValueFive());
             }
             if ($task8->getCouponBackFieldLabelFive()) {
                 $backfield5->setLabel($task8->getCouponBackFieldLabelFive());
             }
             $structure->addBackField($backfield5);
             $backfield6 = new Field("Textb61", " ");
             if ($task8->getCouponBackFieldTextValueSix()) {
                 $backfield6->setValue($task8->getCouponBackFieldTextValueSix());
             }
             if ($task8->getCouponBackFieldLabelSix()) {
                 $backfield6->setLabel($task8->getCouponBackFieldLabelSix());
             }
             $structure->addBackField($backfield6);
             $backfield7 = new Field("Textb71", " ");
             if ($task8->getCouponBackFieldTextValueSeven()) {
                 $backfield7->setValue($task8->getCouponBackFieldTextValueSeven());
             }
             if ($task8->getCouponBackFieldLabelSeven()) {
                 $backfield7->setLabel($task8->getCouponBackFieldLabelSeven());
             }
             $structure->addBackField($backfield7);
             $backfield8 = new Field("Textb81", " ");
             if ($task8->getCouponBackFieldTextValueEight()) {
                 $backfield8->setValue($task8->getCouponBackFieldTextValueEight());
             }
             if ($task8->getCouponBackFieldLabelEight()) {
                 $backfield8->setLabel($task8->getCouponBackFieldLabelEight());
             }
             $structure->addBackField($backfield8);
             break;
         case 9:
             $backfield1 = new Field("Textb11", " ");
             if ($task8->getCouponBackFieldTextValueOne()) {
                 $backfield1->setValue($task8->getCouponBackFieldTextValueOne());
             }
             if ($task8->getCouponBackFieldLabelOne()) {
                 $backfield1->setLabel($task8->getCouponBackFieldLabelOne());
             }
             $structure->addBackField($backfield1);
             $backfield2 = new Field("Textb21", " ");
             if ($task8->getCouponBackFieldTextValueTwo()) {
                 $backfield2->setValue($task8->getCouponBackFieldTextValueTwo());
             }
             if ($task8->getCouponBackFieldLabelTwo()) {
                 $backfield2->setLabel($task8->getCouponBackFieldLabelTwo());
             }
             $structure->addBackField($backfield2);
             $backfield3 = new Field("Textb31", " ");
             if ($task8->getCouponBackFieldTextValueThree()) {
                 $backfield3->setValue($task8->getCouponBackFieldTextValueThree());
             }
             if ($task8->getCouponBackFieldLabelThree()) {
                 $backfield3->setLabel($task8->getCouponBackFieldLabelThree());
             }
             $structure->addBackField($backfield3);
             $backfield4 = new Field("Textb41", " ");
             if ($task8->getCouponBackFieldTextValueFour()) {
                 $backfield4->setValue($task8->getCouponBackFieldTextValueFour());
             }
             if ($task8->getCouponBackFieldLabelFour()) {
                 $backfield4->setLabel($task8->getCouponBackFieldLabelFour());
             }
             $structure->addBackField($backfield4);
             $backfield5 = new Field("Textb51", " ");
             if ($task8->getCouponBackFieldTextValueFive()) {
                 $backfield5->setValue($task8->getCouponBackFieldTextValueFive());
             }
             if ($task8->getCouponBackFieldLabelFive()) {
                 $backfield5->setLabel($task8->getCouponBackFieldLabelFive());
             }
             $structure->addBackField($backfield5);
             $backfield6 = new Field("Textb61", " ");
             if ($task8->getCouponBackFieldTextValueSix()) {
                 $backfield6->setValue($task8->getCouponBackFieldTextValueSix());
             }
             if ($task8->getCouponBackFieldLabelSix()) {
                 $backfield6->setLabel($task8->getCouponBackFieldLabelSix());
             }
             $structure->addBackField($backfield6);
             $backfield7 = new Field("Textb71", " ");
             if ($task8->getCouponBackFieldTextValueSeven()) {
                 $backfield7->setValue($task8->getCouponBackFieldTextValueSeven());
             }
             if ($task8->getCouponBackFieldLabelSeven()) {
                 $backfield7->setLabel($task8->getCouponBackFieldLabelSeven());
             }
             $structure->addBackField($backfield7);
             $backfield8 = new Field("Textb81", " ");
             if ($task8->getCouponBackFieldTextValueEight()) {
                 $backfield8->setValue($task8->getCouponBackFieldTextValueEight());
             }
             if ($task8->getCouponBackFieldLabelEight()) {
                 $backfield8->setLabel($task8->getCouponBackFieldLabelEight());
             }
             $structure->addBackField($backfield8);
             $backfield9 = new Field("Textb91", " ");
             if ($task8->getCouponBackFieldTextValueNine()) {
                 $backfield9->setValue($task8->getCouponBackFieldTextValueNine());
             }
             if ($task8->getCouponBackFieldLabelNine()) {
                 $backfield9->setLabel($task8->getCouponBackFieldLabelNine());
             }
             $structure->addBackField($backfield9);
             break;
         case 10:
             $backfield1 = new Field("Textb11", " ");
             if ($task8->getCouponBackFieldTextValueOne()) {
                 $backfield1->setValue($task8->getCouponBackFieldTextValueOne());
             }
             if ($task8->getCouponBackFieldLabelOne()) {
                 $backfield1->setLabel($task8->getCouponBackFieldLabelOne());
             }
             $structure->addBackField($backfield1);
             $backfield2 = new Field("Textb21", " ");
             if ($task8->getCouponBackFieldTextValueTwo()) {
                 $backfield2->setValue($task8->getCouponBackFieldTextValueTwo());
             }
             if ($task8->getCouponBackFieldLabelTwo()) {
                 $backfield2->setLabel($task8->getCouponBackFieldLabelTwo());
             }
             $structure->addBackField($backfield2);
             $backfield3 = new Field("Textb31", " ");
             if ($task8->getCouponBackFieldTextValueThree()) {
                 $backfield3->setValue($task8->getCouponBackFieldTextValueThree());
             }
             if ($task8->getCouponBackFieldLabelThree()) {
                 $backfield3->setLabel($task8->getCouponBackFieldLabelThree());
             }
             $structure->addBackField($backfield3);
             $backfield4 = new Field("Textb41", " ");
             if ($task8->getCouponBackFieldTextValueFour()) {
                 $backfield4->setValue($task8->getCouponBackFieldTextValueFour());
             }
             if ($task8->getCouponBackFieldLabelFour()) {
                 $backfield4->setLabel($task8->getCouponBackFieldLabelFour());
             }
             $structure->addBackField($backfield4);
             $backfield5 = new Field("Textb51", " ");
             if ($task8->getCouponBackFieldTextValueFive()) {
                 $backfield5->setValue($task8->getCouponBackFieldTextValueFive());
             }
             if ($task8->getCouponBackFieldLabelFive()) {
                 $backfield5->setLabel($task8->getCouponBackFieldLabelFive());
             }
             $structure->addBackField($backfield5);
             $backfield6 = new Field("Textb61", " ");
             if ($task8->getCouponBackFieldTextValueSix()) {
                 $backfield6->setValue($task8->getCouponBackFieldTextValueSix());
             }
             if ($task8->getCouponBackFieldLabelSix()) {
                 $backfield6->setLabel($task8->getCouponBackFieldLabelSix());
             }
             $structure->addBackField($backfield6);
             $backfield7 = new Field("Textb71", " ");
             if ($task8->getCouponBackFieldTextValueSeven()) {
                 $backfield7->setValue($task8->getCouponBackFieldTextValueSeven());
             }
             if ($task8->getCouponBackFieldLabelSeven()) {
                 $backfield7->setLabel($task8->getCouponBackFieldLabelSeven());
             }
             $structure->addBackField($backfield7);
             $backfield8 = new Field("Textb81", " ");
             if ($task8->getCouponBackFieldTextValueEight()) {
                 $backfield8->setValue($task8->getCouponBackFieldTextValueEight());
             }
             if ($task8->getCouponBackFieldLabelEight()) {
                 $backfield8->setLabel($task8->getCouponBackFieldLabelEight());
             }
             $structure->addBackField($backfield8);
             $backfield9 = new Field("Textb91", " ");
             if ($task8->getCouponBackFieldTextValueNine()) {
                 $backfield9->setValue($task8->getCouponBackFieldTextValueNine());
             }
             if ($task8->getCouponBackFieldLabelNine()) {
                 $backfield9->setLabel($task8->getCouponBackFieldLabelNine());
             }
             $structure->addBackField($backfield9);
             $backfield10 = new Field("Textb10", " ");
             if ($task8->getCouponBackFieldTextValueTen()) {
                 $backfield10->setValue($task8->getCouponBackFieldTextValueTen());
             }
             if ($task8->getCouponBackFieldLabelTen()) {
                 $backfield10->setLabel($task8->getCouponBackFieldLabelTen());
             }
             $structure->addBackField($backfield10);
             break;
     }
     $backfielddefault = new Field("Textb12", " ");
     $backfielddefault->setValue("This pass has been created and issued by a Company user from " . $task1->getOrganizationName() . " with the following e-mail : " . $task1->getUserEmail() . " (the 'Pass Issuer') " . "\n\t\t\t\n\t\t\tPut your email text here\n\n\t\t");
     $backfielddefault->setLabel("About this Pass:"******" ".$lng;
             }
             break;
         case 2:
             if ($task9->getCouponRelevanceLocationAddressOne()) {
                 $lat = floatval($task9->getCouponRelevanceLocationAddressOneLatitude());
                 $lng = floatval($task9->getCouponRelevanceLocationAddressOneLongitude());
                 $relevance1 = new Location($lat, $lng);
                 $relevance1->setRelevantText($task9->getCouponRelevanceLocationTextOne());
                 $pass->addLocation($relevance1);
             }
             if ($task9->getCouponRelevanceLocationAddressTwo()) {
                 $lat = floatval($task9->getCouponRelevanceLocationAddressTwoLatitude());
                 $lng = floatval($task9->getCouponRelevanceLocationAddressTwoLongitude());
                 $relevance2 = new Location($lat, $lng);
                 $relevance2->setRelevantText($task9->getCouponRelevanceLocationTextTwo());
                 $pass->addLocation($relevance2);
             }
             break;
         case 3:
             if ($task9->getCouponRelevanceLocationAddressOne()) {
                 $lat = floatval($task9->getCouponRelevanceLocationAddressOneLatitude());
                 $lng = floatval($task9->getCouponRelevanceLocationAddressOneLongitude());
                 $relevance1 = new Location($lat, $lng);
                 $relevance1->setRelevantText($task9->getCouponRelevanceLocationTextOne());
                 $pass->addLocation($relevance1);
             }
             if ($task9->getCouponRelevanceLocationAddressTwo()) {
                 $lat = $task9->getCouponRelevanceLocationAddressTwoLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressTwoLongitude();
                 $relevance2 = new Location($lat, $lng);
                 $relevance2->setRelevantText($task9->getCouponRelevanceLocationTextTwo());
                 $pass->addLocation($relevance2);
             }
             if ($task9->getCouponRelevanceLocationAddressThree()) {
                 $lat = $task9->getCouponRelevanceLocationAddressThreeLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressThreeLongitude();
                 $relevance3 = new Location($lat, $lng);
                 $relevance3->setRelevantText($task9->getCouponRelevanceLocationTextThree());
                 $pass->addLocation($relevance3);
             }
             break;
         case 4:
             if ($task9->getCouponRelevanceLocationAddressOne()) {
                 $lat = $task9->getCouponRelevanceLocationAddressOneLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressOneLongitude();
                 $relevance1 = new Location($lat, $lng);
                 $relevance1->setRelevantText($task9->getCouponRelevanceLocationTextOne());
                 $pass->addLocation($relevance1);
             }
             if ($task9->getCouponRelevanceLocationAddressTwo()) {
                 $lat = $task9->getCouponRelevanceLocationAddressTwoLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressTwoLongitude();
                 $relevance2 = new Location($lat, $lng);
                 $relevance2->setRelevantText($task9->getCouponRelevanceLocationTextTwo());
                 $pass->addLocation($relevance2);
             }
             if ($task9->getCouponRelevanceLocationAddressThree()) {
                 $lat = $task9->getCouponRelevanceLocationAddressThreeLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressThreeLongitude();
                 $relevance3 = new Location($lat, $lng);
                 $relevance3->setRelevantText($task9->getCouponRelevanceLocationTextThree());
                 $pass->addLocation($relevance3);
             }
             if ($task9->getCouponRelevanceLocationAddressFour()) {
                 $lat = $task9->getCouponRelevanceLocationAddressFourLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressFourLongitude();
                 $relevance4 = new Location($lat, $lng);
                 $relevance4->setRelevantText($task9->getCouponRelevanceLocationTextFour());
                 $pass->addLocation($relevance4);
             }
             break;
         case 5:
             if ($task9->getCouponRelevanceLocationAddressOne()) {
                 $lat = $task9->getCouponRelevanceLocationAddressOneLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressOneLongitude();
                 $relevance1 = new Location($lat, $lng);
                 $relevance1->setRelevantText($task9->getCouponRelevanceLocationTextOne());
                 $pass->addLocation($relevance1);
             }
             if ($task9->getCouponRelevanceLocationAddressTwo()) {
                 $lat = $task9->getCouponRelevanceLocationAddressTwoLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressTwoLongitude();
                 $relevance2 = new Location($lat, $lng);
                 $relevance2->setRelevantText($task9->getCouponRelevanceLocationTextTwo());
                 $pass->addLocation($relevance2);
             }
             if ($task9->getCouponRelevanceLocationAddressThree()) {
                 $lat = $task9->getCouponRelevanceLocationAddressThreeLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressThreeLongitude();
                 $relevance3 = new Location($lat, $lng);
                 $relevance3->setRelevantText($task9->getCouponRelevanceLocationTextThree());
                 $pass->addLocation($relevance3);
             }
             if ($task9->getCouponRelevanceLocationAddressFour()) {
                 $lat = $task9->getCouponRelevanceLocationAddressFourLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressFourLongitude();
                 $relevance4 = new Location($lat, $lng);
                 $relevance4->setRelevantText($task9->getCouponRelevanceLocationTextFour());
                 $pass->addLocation($relevance4);
             }
             if ($task9->getCouponRelevanceLocationAddressFive()) {
                 $lat = $task9->getCouponRelevanceLocationAddressFiveLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressFiveLongitude();
                 $relevance5 = new Location($lat, $lng);
                 $relevance5->setRelevantText($task9->getCouponRelevanceLocationTextFive());
                 $pass->addLocation($relevance5);
             }
             break;
         case 6:
             if ($task9->getCouponRelevanceLocationAddressOne()) {
                 $lat = $task9->getCouponRelevanceLocationAddressOneLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressOneLongitude();
                 $relevance1 = new Location($lat, $lng);
                 $relevance1->setRelevantText($task9->getCouponRelevanceLocationTextOne());
                 $pass->addLocation($relevance1);
             }
             if ($task9->getCouponRelevanceLocationAddressTwo()) {
                 $lat = $task9->getCouponRelevanceLocationAddressTwoLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressTwoLongitude();
                 $relevance2 = new Location($lat, $lng);
                 $relevance2->setRelevantText($task9->getCouponRelevanceLocationTextTwo());
                 $pass->addLocation($relevance2);
             }
             if ($task9->getCouponRelevanceLocationAddressThree()) {
                 $lat = $task9->getCouponRelevanceLocationAddressThreeLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressThreeLongitude();
                 $relevance3 = new Location($lat, $lng);
                 $relevance3->setRelevantText($task9->getCouponRelevanceLocationTextThree());
                 $pass->addLocation($relevance3);
             }
             if ($task9->getCouponRelevanceLocationAddressFour()) {
                 $lat = $task9->getCouponRelevanceLocationAddressFourLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressFourLongitude();
                 $relevance4 = new Location($lat, $lng);
                 $relevance4->setRelevantText($task9->getCouponRelevanceLocationTextFour());
                 $pass->addLocation($relevance4);
             }
             if ($task9->getCouponRelevanceLocationAddressFive()) {
                 $lat = $task9->getCouponRelevanceLocationAddressFiveLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressFiveLongitude();
                 $relevance5 = new Location($lat, $lng);
                 $relevance5->setRelevantText($task9->getCouponRelevanceLocationTextFive());
                 $pass->addLocation($relevance5);
             }
             if ($task9->getCouponRelevanceLocationAddressSix()) {
                 $lat = $task9->getCouponRelevanceLocationAddressSixLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressSixLongitude();
                 $relevance6 = new Location($lat, $lng);
                 $relevance6->setRelevantText($task9->getCouponRelevanceLocationTextSix());
                 $pass->addLocation($relevance6);
             }
             break;
         case 7:
             if ($task9->getCouponRelevanceLocationAddressOne()) {
                 $lat = $task9->getCouponRelevanceLocationAddressOneLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressOneLongitude();
                 $relevance1 = new Location($lat, $lng);
                 $relevance1->setRelevantText($task9->getCouponRelevanceLocationTextOne());
                 $pass->addLocation($relevance1);
             }
             if ($task9->getCouponRelevanceLocationAddressTwo()) {
                 $lat = $task9->getCouponRelevanceLocationAddressTwoLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressTwoLongitude();
                 $relevance2 = new Location($lat, $lng);
                 $relevance2->setRelevantText($task9->getCouponRelevanceLocationTextTwo());
                 $pass->addLocation($relevance2);
             }
             if ($task9->getCouponRelevanceLocationAddressThree()) {
                 $lat = $task9->getCouponRelevanceLocationAddressThreeLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressThreeLongitude();
                 $relevance3 = new Location($lat, $lng);
                 $relevance3->setRelevantText($task9->getCouponRelevanceLocationTextThree());
                 $pass->addLocation($relevance3);
             }
             if ($task9->getCouponRelevanceLocationAddressFour()) {
                 $lat = $task9->getCouponRelevanceLocationAddressFourLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressFourLongitude();
                 $relevance4 = new Location($lat, $lng);
                 $relevance4->setRelevantText($task9->getCouponRelevanceLocationTextFour());
                 $pass->addLocation($relevance4);
             }
             if ($task9->getCouponRelevanceLocationAddressFive()) {
                 $lat = $task9->getCouponRelevanceLocationAddressFiveLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressFiveLongitude();
                 $relevance5 = new Location($lat, $lng);
                 $relevance5->setRelevantText($task9->getCouponRelevanceLocationTextFive());
                 $pass->addLocation($relevance5);
             }
             if ($task9->getCouponRelevanceLocationAddressSix()) {
                 $lat = $task9->getCouponRelevanceLocationAddressSixLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressSixLongitude();
                 $relevance6 = new Location($lat, $lng);
                 $relevance6->setRelevantText($task9->getCouponRelevanceLocationTextSix());
                 $pass->addLocation($relevance6);
             }
             if ($task9->getCouponRelevanceLocationAddressSeven()) {
                 $lat = $task9->getCouponRelevanceLocationAddressSevenLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressSevenLongitude();
                 $relevance7 = new Location($lat, $lng);
                 $relevance7->setRelevantText($task9->getCouponRelevanceLocationTextSeven());
                 $pass->addLocation($relevance7);
             }
             break;
         case 8:
             if ($task9->getCouponRelevanceLocationAddressOne()) {
                 $lat = $task9->getCouponRelevanceLocationAddressOneLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressOneLongitude();
                 $relevance1 = new Location($lat, $lng);
                 $relevance1->setRelevantText($task9->getCouponRelevanceLocationTextOne());
                 $pass->addLocation($relevance1);
             }
             if ($task9->getCouponRelevanceLocationAddressTwo()) {
                 $lat = $task9->getCouponRelevanceLocationAddressTwoLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressTwoLongitude();
                 $relevance2 = new Location($lat, $lng);
                 $relevance2->setRelevantText($task9->getCouponRelevanceLocationTextTwo());
                 $pass->addLocation($relevance2);
             }
             if ($task9->getCouponRelevanceLocationAddressThree()) {
                 $lat = $task9->getCouponRelevanceLocationAddressThreeLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressThreeLongitude();
                 $relevance3 = new Location($lat, $lng);
                 $relevance3->setRelevantText($task9->getCouponRelevanceLocationTextThree());
                 $pass->addLocation($relevance3);
             }
             if ($task9->getCouponRelevanceLocationAddressFour()) {
                 $lat = $task9->getCouponRelevanceLocationAddressFourLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressFourLongitude();
                 $relevance4 = new Location($lat, $lng);
                 $relevance4->setRelevantText($task9->getCouponRelevanceLocationTextFour());
                 $pass->addLocation($relevance4);
             }
             if ($task9->getCouponRelevanceLocationAddressFive()) {
                 $lat = $task9->getCouponRelevanceLocationAddressFiveLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressFiveLongitude();
                 $relevance5 = new Location($lat, $lng);
                 $relevance5->setRelevantText($task9->getCouponRelevanceLocationTextFive());
                 $pass->addLocation($relevance5);
             }
             if ($task9->getCouponRelevanceLocationAddressSix()) {
                 $lat = $task9->getCouponRelevanceLocationAddressSixLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressSixLongitude();
                 $relevance6 = new Location($lat, $lng);
                 $relevance6->setRelevantText($task9->getCouponRelevanceLocationTextSix());
                 $pass->addLocation($relevance6);
             }
             if ($task9->getCouponRelevanceLocationAddressSeven()) {
                 $lat = $task9->getCouponRelevanceLocationAddressSevenLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressSevenLongitude();
                 $relevance7 = new Location($lat, $lng);
                 $relevance7->setRelevantText($task9->getCouponRelevanceLocationTextSeven());
                 $pass->addLocation($relevance7);
             }
             if ($task9->getCouponRelevanceLocationAddressEight()) {
                 $lat = $task9->getCouponRelevanceLocationAddressEightLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressEightLongitude();
                 $relevance8 = new Location($lat, $lng);
                 $relevance8->setRelevantText($task9->getCouponRelevanceLocationTextEight());
                 $pass->addLocation($relevance8);
             }
             break;
         case 9:
             if ($task9->getCouponRelevanceLocationAddressOne()) {
                 $lat = $task9->getCouponRelevanceLocationAddressOneLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressOneLongitude();
                 $relevance1 = new Location($lat, $lng);
                 $relevance1->setRelevantText($task9->getCouponRelevanceLocationTextOne());
                 $pass->addLocation($relevance1);
             }
             if ($task9->getCouponRelevanceLocationAddressTwo()) {
                 $lat = $task9->getCouponRelevanceLocationAddressTwoLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressTwoLongitude();
                 $relevance2 = new Location($lat, $lng);
                 $relevance2->setRelevantText($task9->getCouponRelevanceLocationTextTwo());
                 $pass->addLocation($relevance2);
             }
             if ($task9->getCouponRelevanceLocationAddressThree()) {
                 $lat = $task9->getCouponRelevanceLocationAddressThreeLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressThreeLongitude();
                 $relevance3 = new Location($lat, $lng);
                 $relevance3->setRelevantText($task9->getCouponRelevanceLocationTextThree());
                 $pass->addLocation($relevance3);
             }
             if ($task9->getCouponRelevanceLocationAddressFour()) {
                 $lat = $task9->getCouponRelevanceLocationAddressFourLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressFourLongitude();
                 $relevance4 = new Location($lat, $lng);
                 $relevance4->setRelevantText($task9->getCouponRelevanceLocationTextFour());
                 $pass->addLocation($relevance4);
             }
             if ($task9->getCouponRelevanceLocationAddressFive()) {
                 $lat = $task9->getCouponRelevanceLocationAddressFiveLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressFiveLongitude();
                 $relevance5 = new Location($lat, $lng);
                 $relevance5->setRelevantText($task9->getCouponRelevanceLocationTextFive());
                 $pass->addLocation($relevance5);
             }
             if ($task9->getCouponRelevanceLocationAddressSix()) {
                 $lat = $task9->getCouponRelevanceLocationAddressSixLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressSixLongitude();
                 $relevance6 = new Location($lat, $lng);
                 $relevance6->setRelevantText($task9->getCouponRelevanceLocationTextSix());
                 $pass->addLocation($relevance6);
             }
             if ($task9->getCouponRelevanceLocationAddressSeven()) {
                 $lat = $task9->getCouponRelevanceLocationAddressSevenLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressSevenLongitude();
                 $relevance7 = new Location($lat, $lng);
                 $relevance7->setRelevantText($task9->getCouponRelevanceLocationTextSeven());
                 $pass->addLocation($relevance7);
             }
             if ($task9->getCouponRelevanceLocationAddressEight()) {
                 $lat = $task9->getCouponRelevanceLocationAddressEightLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressEightLongitude();
                 $relevance8 = new Location($lat, $lng);
                 $relevance8->setRelevantText($task9->getCouponRelevanceLocationTextEight());
                 $pass->addLocation($relevance8);
             }
             if ($task9->getCouponRelevanceLocationAddressNine()) {
                 $lat = $task9->getCouponRelevanceLocationAddressNineLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressNineLongitude();
                 $relevance9 = new Location($lat, $lng);
                 $relevance9->setRelevantText($task9->getCouponRelevanceLocationTextNine());
                 $pass->addLocation($relevance9);
             }
             break;
         case 10:
             if ($task9->getCouponRelevanceLocationAddressOne()) {
                 $lat = $task9->getCouponRelevanceLocationAddressOneLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressOneLongitude();
                 $relevance1 = new Location($lat, $lng);
                 $relevance1->setRelevantText($task9->getCouponRelevanceLocationTextOne());
                 $pass->addLocation($relevance1);
             }
             if ($task9->getCouponRelevanceLocationAddressTwo()) {
                 $lat = $task9->getCouponRelevanceLocationAddressTwoLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressTwoLongitude();
                 $relevance2 = new Location($lat, $lng);
                 $relevance2->setRelevantText($task9->getCouponRelevanceLocationTextTwo());
                 $pass->addLocation($relevance2);
             }
             if ($task9->getCouponRelevanceLocationAddressThree()) {
                 $lat = $task9->getCouponRelevanceLocationAddressThreeLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressThreeLongitude();
                 $relevance3 = new Location($lat, $lng);
                 $relevance3->setRelevantText($task9->getCouponRelevanceLocationTextThree());
                 $pass->addLocation($relevance3);
             }
             if ($task9->getCouponRelevanceLocationAddressFour()) {
                 $lat = $task9->getCouponRelevanceLocationAddressFourLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressFourLongitude();
                 $relevance4 = new Location($lat, $lng);
                 $relevance4->setRelevantText($task9->getCouponRelevanceLocationTextFour());
                 $pass->addLocation($relevance4);
             }
             if ($task9->getCouponRelevanceLocationAddressFive()) {
                 $lat = $task9->getCouponRelevanceLocationAddressFiveLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressFiveLongitude();
                 $relevance5 = new Location($lat, $lng);
                 $relevance5->setRelevantText($task9->getCouponRelevanceLocationTextFive());
                 $pass->addLocation($relevance5);
             }
             if ($task9->getCouponRelevanceLocationAddressSix()) {
                 $lat = $task9->getCouponRelevanceLocationAddressSixLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressSixLongitude();
                 $relevance6 = new Location($lat, $lng);
                 $relevance6->setRelevantText($task9->getCouponRelevanceLocationTextSix());
                 $pass->addLocation($relevance6);
             }
             if ($task9->getCouponRelevanceLocationAddressSeven()) {
                 $lat = $task9->getCouponRelevanceLocationAddressSevenLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressSevenLongitude();
                 $relevance7 = new Location($lat, $lng);
                 $relevance7->setRelevantText($task9->getCouponRelevanceLocationTextSeven());
                 $pass->addLocation($relevance7);
             }
             if ($task9->getCouponRelevanceLocationAddressEight()) {
                 $lat = $task9->getCouponRelevanceLocationAddressEightLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressEightLongitude();
                 $relevance8 = new Location($lat, $lng);
                 $relevance8->setRelevantText($task9->getCouponRelevanceLocationTextEight());
                 $pass->addLocation($relevance8);
             }
             if ($task9->getCouponRelevanceLocationAddressNine()) {
                 $lat = $task9->getCouponRelevanceLocationAddressNineLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressNineLongitude();
                 $relevance9 = new Location($lat, $lng);
                 $relevance9->setRelevantText($task9->getCouponRelevanceLocationTextNine());
                 $pass->addLocation($relevance9);
             }
             if ($task9->getCouponRelevanceLocationAddressTen()) {
                 $lat = $task9->getCouponRelevanceLocationAddressTenLatitude();
                 $lng = $task9->getCouponRelevanceLocationAddressTenLongitude();
                 $relevance10 = new Location($lat, $lng);
                 $relevance10->setRelevantText($task9->getCouponRelevanceLocationTextTen());
                 $pass->addLocation($relevance10);
             }
             break;
     }
     $pass->setRelevantDate($task9->getCouponRelevanceLocationDate());
     // Set pass structure
     $pass->setStructure($structure);
     // Add barcode
     switch ($barcodestatus) {
         case "hide":
             break;
         case "show":
             $barcode = new Barcode($task3->getCouponBarcodeType(), $task3->getCouponAutoGenerateValue(), 'iso-8859-1');
             if ($task3->getBarcodeAlternateText() == 'same') {
                 $barcode->setAltText($task3->getCouponAutoGenerateValue());
             } else {
                 //if($task3->getBarcodeAlternateTextValue()){
                 $barcode->setAltText($task3->getBarcodeAlternateTextValue());
                 //}
             }
             $pass->setBarcode($barcode);
             break;
     }
     //$helper = $this->get('passbook.passhelper');
     // Create pass factory instance
     $factory = new PassFactory('name', 'key', $task1->getOrganizationName(), $root . '/Resources/certificates/certificate_name.p12', '', $root . '/Resources/certificates/apple_certificate.pem');
     $factory->setOutputPath($root . '/logs/pkpass');
     //$factory->setOutputPath($helper->absolutePath($helper->pkPassDir));
     $factory->package($pass);
     return $id;
 }
 private function validateLocation(Location $location)
 {
     if ($this->isBlankOrNull($location->getLatitude())) {
         $this->addError(self::LOCATION_LATITUDE_REQUIRED);
     }
     if (!is_numeric($location->getLatitude())) {
         $this->addError(self::LOCATION_LATITUDE_INVALID);
     }
     if ($this->isBlankOrNull($location->getLongitude())) {
         $this->addError(self::LOCATION_LONGITUDE_REQUIRED);
     }
     if (!is_numeric($location->getLongitude())) {
         $this->addError(self::LOCATION_LONGITUDE_INVALID);
     }
     if (!is_numeric($location->getAltitude()) && null !== $location->getAltitude()) {
         $this->addError(self::LOCATION_ALTITUDE_INVALID);
     }
 }