Example #1
0
     $poid = $po->getValue('poid');
     $i = 0;
     $j = count($description);
     while ($i < $j) {
         if ($description[$i] != '') {
             if (isset($poitemid[$i])) {
                 $po->setValue('poitemid', $poitemid[$i]);
             } else {
                 $po->setValue('poitemid', '');
             }
             $po->setValue('poid', $poid);
             $po->setValue('description', $description[$i]);
             $po->setValue('itemqty', $itemqty[$i]);
             $po->setValue('price', $price[$i]);
             $po->setValue('discount', $discount[$i]);
             $po->savePOItem();
         }
         $i++;
     }
     $name = $popath . $poid . '.pdf';
     if (file_exists($name)) {
         if (unlink($name)) {
             $pdf->Output($name, 'F');
         } else {
             echo '<p>Unable to Delete Old PO PDF</p>';
         }
     } else {
         $pdf->Output($name, 'F');
     }
 } else {
     $dpath = $popath . 'temppo.pdf';