Ejemplo n.º 1
0
 $isdtls = $isdtls[0]['iStatusID'];
 if ($podtls[0]['iBuyerOrganizationID'] != $curORGID && $podtls[0]['iSupplierOrganizationID'] != $curORGID) {
     header("Location: " . SITE_URL_DUM . "polist/all");
     exit;
 } else {
     if ($podtls[0]['iSupplierOrganizationID'] == $curORGID && $podtls[0]['iStatusID'] < $isdtls) {
         header("Location: " . SITE_URL_DUM . "polist/all");
         exit;
     }
 }
 $sorgdtls = $orgObj->select($podtls[0]['iSupplierOrganizationID']);
 if ($podtls[0]['iInvoiceID'] > 0) {
     $invdl = $invOrdObj->select($podtls[0]['iInvoiceID']);
 }
 $asocdtls = $asocObj->getDetails('*', " AND iBuyerOrganizationID={$curORGID} AND iSupplierAssocationID=" . $podtls[0]['iSupplierOrganizationID']);
 $poAttachments = $poAttachmentObj->getDetails('*', ' AND iPurchaseOrderID="' . $iPurchaseOrderID . '"');
 $stsdtls = $statusmasterObj->getDetails('*', " AND eFor='PO' AND vStatus_en='Rejected' ");
 $rjtsts = $stsdtls[0]['iStatusID'];
 if ($podtls[0]['iStatusID'] == $rjtsts) {
     if ($podtls[0]['iSupplierOrganizationID'] == $curORGID) {
         header("Location: " . SITE_URL_DUM . "purchaseorderview/{$iPurchaseOrderID}");
         exit;
     }
     $lang = $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_LANG'];
     $msg = $stsdtls[0]['vStatusMsg_' . $lang];
 } else {
     if ($podtls[0]['eSaved'] == 'Yes') {
         $msg = $smarty->get_template_vars('LBL_SAVED');
     } else {
         if ($poad != 'yes') {
             header("Location: " . SITE_URL_DUM . "purchaseorderview/{$iPurchaseOrderID}");
Ejemplo n.º 2
0
 $dt['iOrganizationID'] = $invdt[0]['iSupplierOrganizationID'];
 $dt['vMailSubject_en'] = $db_email[0]['vSub_en'];
 $dt['vMailSubject_fr'] = $db_email[0]['vSub_fr'];
 $dt['tMailContent_en'] = $emailContent_en;
 $dt['tMailContent_fr'] = $emailContent_fr;
 $dt['eSubject'] = "Invoice";
 $dt['iCreatedBy'] = $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_ID'];
 $dt['eCreatedType'] = $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_USER_TYPE_SHORT'];
 $dt['dActionDate'] = calcGTzTime(date('Y-m-d H:i:s'), 'Y-m-d H:i:s');
 $userActionObj->setAllVar($dt);
 $userActionObj->insert();
 if (!isset($poaObj)) {
     include_once SITE_CLASS_APPLICATION . "user/class.PurchaseOrderAttachment.php";
     $poaObj = new PurchaseOrderAttachment();
 }
 $po_attach = $poaObj->getDetails('*', " AND iPurchaseOrderID={$iPurchaseOrderID}");
 // $po_attach = $poaObj->getDetails('*'," AND iPurchaseOrderID=39");
 //prints($po_attach); exit;
 if (is_array($po_attach) && count($po_attach) > 0) {
     //				$semi_rand = md5(time());
     //				$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
     //				$h_append .= "Content-Type: multipart/mixed;\r\n" . " boundary=\"{$mime_boundary}\"";
     // prints($po_attach); exit;
     for ($l = 0; $l < count($po_attach); $l++) {
         $filepath = $generalobj->GetImagePath(array('section' => 'PO', 'type' => 'docs', 'id' => $iPurchaseOrderID, 'name' => $po_attach[$l]['vFile']));
         // prints($filepath); exit;
         $attachments[$l]['path'] = $filepath;
         $attachments[$l]['name'] = $po_attach[$l]['vFile'];
         // file attachment
         //			$fileatt = $filepath; // Path to the file
         //			$fileatt_type = "application/octet-stream"; // File Type