$ext = stripcslashes(PostVar('ext')); $dflt = stripcslashes(PostVar('dflt')); if (!isset($invOrdObj)) { include_once SITE_CLASS_APPLICATION . "user/class.InvoiceOrderHeading.php"; $invOrdObj = new InvoiceOrderHeading(); } if (!isset($purOrdObj)) { include_once SITE_CLASS_APPLICATION . "user/class.PurchaseOrderHeading.php"; $purOrdObj = new PurchaseOrderHeading(); } $orgas = ""; if ($eType == "Invoice") { $invdtls = $invOrdObj->getDetails('iBuyerOrganizationID,iSupplierOrganizationID', " AND iInvoiceID={$iInvoiceID} "); } else { if ($eType == "PO") { $invdtls = $purOrdObj->getDetails('iBuyerOrganizationID,iSupplierOrganizationID', " AND iPurchaseOrderID={$iPurchaseOrderID} "); } } if ($invdtls[0]['iBuyerOrganizationID'] == $curORGID) { $orgas = "Buyer"; } else { if ($invdtls[0]['iSupplierOrganizationID'] == $curORGID) { $orgas = "Supplier"; } } $orgas = trim($orgas) != '' ? $orgas : $uorg_type; $dtls = array(); if ($curORGID > 0 && $orgas != '') { if ($orgas == 'Buyer') { $ipids = preg_replace('/\\w-/', '', $iProductId); // $dtls = $orgObj->getDetails("iOrganizationID, vCompanyName, vOrganizationCode"," AND eOrganizationType='Buyer2' AND eStatus='Active' AND iOrganizationID IN (Select iBuyer2Id from ".PRJ_DB_PREFIX."_buyer2_buyer_bproduct_association where iBuyerId=$curORGID AND iProductId IN ($ipids) ) ");
if (in_array($nxtstatus['iStatusID'], $uioact) && $invoiceData['iModifiedByID'] != $sess_id) { $permitted = 'Yes'; } } } } } // prints($nxtstatus); // prints ($invoiceData); exit; if ($invoiceData['iModifiedByID'] == $_SESSION['SESS_' . PRJ_CONST_PREFIX . '_ID'] && $invoiceData['eDelete'] == 'Yes') { $nxtstatus['vStatusMsg'] = $smarty->get_template_vars('MSG_OTHER_VERIFICATION_NEED'); } $crt_inv = ''; if ($invoiceData['iStatusID'] == $acptsts[0]['iStatusID'] && (trim($invoiceData['iPurchaseOrderID']) < 1 || trim($invoiceData['iPurchaseOrderID']) == '')) { if ($curORGID == $invoiceData['iBuyerOrganizationID']) { $po = $pohObj->getDetails('iInvoiceID', " AND iInvoiceID={$iInvoiceID} "); if (count($po) == 0) { $crt_inv = 'yes'; } } // echo "hi"; exit; } $postat = ''; if ($invoiceData['iSupplierOrganizationID'] == $curORGID) { if ($isusts[0]['iStatusID'] == $invoiceData['iStatusID'] && (trim($invoiceData['iPurchaseOrderID']) == '' || trim($invoiceData['iPurchaseOrderID']) < 1)) { // $postat = 'ureview'; } else { $rlpo = $pohObj->getDetails('*', " AND iInvoiceID={$iInvoiceID} ", " iPurchaseOrderID DESC "); if (is_array($rlpo) && count($rlpo) > 0) { if ($rlpo[0]['iStatusID'] == 0 && isset($rlpo[0]['iStatusID'])) { $postat = 'ureview';
} phoneCode('vBillToContactTelephone'); phoneCode('vShipToContactTelephone'); # Invoice Code DropDownBox Data [START] $stsdtls = $statusmasterObj->getDetails('*', " AND vStatus_en='Accepted' AND eFor='Invoice' "); $sid = $sts = $stsdtls[0]['iStatusID']; $where = " AND iStatusID={$sts} "; $where .= " AND iBuyerOrganizationID={$curORGID} "; $invoiceCodeData = $invOrdObj->getDetails("vInvoiceCode as vTitle,iInvoiceID as Id", $where); # Invoice Code DropDownBox Data [END] # PO Code DropDownBox Data [START] //$stsdtls = $statusmasterObj->getDetails('*'," AND vStatus_en='Accepted' AND eFor='PO' "); //$sts = $stsdtls[0]['iStatusID']; //$where = " AND iStatusID=$sts "; $where = " AND iBuyerOrganizationID={$curORGID} "; $POCodeData = $pohObj->getDetails("vPOCode as vTitle,iPurchaseOrderID as Id", $where); # PO Code DropDownBox Data [END] // prints($podtls);exit; $smarty->assign('poad', $poad); $smarty->assign('podtls', $podtls); $smarty->assign('asocdtls', $asocdtls); $smarty->assign('lineItemTax', $lineItemTax); $smarty->assign('stateArr', $stateArr); $smarty->assign('OrgCode', $OrgCode); $smarty->assign('orgname', $orgname); $smarty->assign('orgdtls', $orgdtls); $smarty->assign('sorgdtls', $sorgdtls); $smarty->assign('invdl', $invdl); if (isset($var_msg)) { $smarty->assign('var_msg', $var_msg); }
if ($parameter == "inv") { $res = $invoiceObj->getDetails('iInvoiceID,vInvSupplierCode', "and iInvoiceID={$iID} AND (iSupplierOrganizationID = {$curORGID} OR iBuyerOrganizationID = {$curORGID})"); $inv_combo = $res[0]['vInvSupplierCode']; $inv_combo = "<span class='pinv' style='display:inline-block;'>" . $inv_combo . "</span><input type='hidden' name='promptinvoice_id' id='promptinvoice_id' value='" . $res[0]['iInvoiceID'] . "'>"; } else { $inv_combo = $gdbobj->DynamicDropDown($invcary); $inv_combo = str_replace('"', '\\"', $inv_combo); $inv_combo = "<span class='pinv' style='display:inline-block;'>" . $inv_combo . "</span><span style='float:right; padding-right:70px;'>" . $smarty->get_template_vars('LBL_FILTER_LIST_BY') . " : <input type='text' name='invfilter' id='invfilter' style='width:100px;' /></span>"; } } // if ($sess_usertype_short != 'SM') { $wh = "(iSupplierOrganizationID = {$curORGID} OR iBuyerOrganizationID = {$curORGID})"; $pocary = array("ID" => "promptpo_id", "Name" => "promptpo_id", "Type" => "Query", "tableName" => PRJ_DB_PREFIX . "_purchase_order_heading", "fieldId" => "iPurchaseOrderID", "fieldName" => "vPoBuyerCode", "extVal" => '', "selectedVal" => '', "width" => '230px', "height" => '', "onchange" => '', "selectText" => "--- " . $smarty->get_template_vars('LBL_SELECT') . ' ' . $smarty->get_template_vars('LBL_PURCHASE_ORDER') . " ---", "where" => " {$wh} ", "multiple_select" => "", "orderby" => '', "extra" => "title='" . $smarty->get_template_vars('LBL_SELECT') . ' ' . $smarty->get_template_vars('LBL_PURCHASE_ORDER') . "'", "validationmsg" => "", "class" => "required"); if ($parameter == "po") { $res = $pursesordObj->getDetails('iPurchaseOrderID,vPoBuyerCode', "and iPurchaseOrderID={$iID} AND (iSupplierOrganizationID = {$curORGID} OR iBuyerOrganizationID = {$curORGID})"); $po_combo = $res[0]['vPoBuyerCode']; $po_combo = "<span class='pinv' style='display:inline-block;'>" . $po_combo . "</span><input type='hidden' name='promptpo_id' id='promptpo_id' value='" . $res[0]['iPurchaseOrderID'] . "'>"; } else { $po_combo = $gdbobj->DynamicDropDown($pocary); $po_combo = str_replace('"', '\\"', $po_combo); $po_combo = "<span class='ppo' style='display:inline-block;'>" . $po_combo . "</span><span style='float:right; padding-right:70px;'>" . $smarty->get_template_vars('LBL_FILTER_LIST_BY') . " : <input type='text' name='pofilter' id='pofilter' style='width:100px;' /></span>"; } } // for ($l = 0; $l < count($rptfiles); $l++) { // if(is_file(SPATH_ROOT.$inetreportsfiles.'/'.$rptfiles[$l])) { // && file_exists(SPATH_ROOT.$inetreportsfiles.'/'.$rptfiles[$l]) // if(is_file($rptfiles[$l]['tPath']) && file_exists($rptfiles[$l]['tPath'])) { // && file_exists(SPATH_ROOT.$inetreportsfiles.'/'.$rptfiles[$l]) $params = @explode(',', $rptfiles[$l]['tParameters']); $params = array_filter($params); $params = array_unique($params);