if(trim($postatus) != '') { $postatus = @explode(',',$postatus); sort($postatus); $invdt['iStatusID'] = $postatus[0]; } } */ $pcstsdtls = $statusmasterObj->getDetails('*', " AND eFor='PO' AND vStatus_en='Create' "); $invdt['iStatusID'] = $pcstsdtls[0]['iStatusID']; /* } else { $poisusts = $statusmasterObj->getDetails('*'," AND eFor='PO' AND vStatus_en='Issued' "); $invdt['iStatusID'] = $poisusts[0]; } */ // prints($invdt); exit; $pohObj->setAllVar($invdt); $po = $pohObj->insert(); $poitems = $invLineObj->getDetails('*', " AND iInvoiceID={$iInvoiceID}"); // prints($poitems); exit; for ($l = 0; $l < count($poitems); $l++) { $invItems = $poitems[$l]; $invItems['iRelatedInvoiceLineID'] = $invItems['iInvoiceLineID']; unset($invItems['iInvoiceLineID']); unset($invItems['dCreatedDate']); unset($invItems['iRelatedPurchaseOrderLineID']); // $vItemCode = $invItems['vItemCode']; // prints($vItemCode); exit; // $invitmdtl = $invLineObj->getDetails('*'," AND vItemCode=$vItemCode"); /* if(count($invitmdtl) > 0) { $vItemCode = $generalobj->getUniqueCode(PRJ_DB_PREFIX."_invoice_detail_line","vItemCode"); } */ $vItemCode = $poLineObj->getUniqueCode(); $vPOItemLineNumber = $generalobj->UniqueID("", PRJ_DB_PREFIX . "_purchase_order_line", "iLineNumber", $charlimit = "10");
$RequiredFiledArr = array('invoiceType' => $smarty->get_template_vars('LBL_SELECT') . " " . $smarty->get_template_vars('LBL_INVOICE_TYPE'), 'vUnitOfMeasure' => $smarty->get_template_vars('LBL_ENTER') . " " . $smarty->get_template_vars('LBL_UNIT_MEASURE'), 'fPrice' => $smarty->get_template_vars('LBL_ENTER') . " " . $smarty->get_template_vars('LBL_PRICE'), 'fAmount' => $smarty->get_template_vars('LBL_ENTER') . " " . $smarty->get_template_vars('LBL_AMOUNT'), 'fVAT' => $smarty->get_template_vars('LBL_ENTER') . " " . $smarty->get_template_vars('LBL_VAT'), 'fWithHoldingTax' => $smarty->get_template_vars('LBL_ENTER') . " " . $smarty->get_template_vars('LBL_WITH_HOLDING_TAX')); $resArr = $validation->isEmptyMul($RequiredFiledArr); $nvldmsg = array('iQuantity' => $smarty->get_template_vars('LBL_QUANTITY') . " " . $smarty->get_template_vars('LBL_MUST_BE_NUMERIC'), 'fPrice' => $smarty->get_template_vars('LBL_PRICE') . " " . $smarty->get_template_vars('LBL_MUST_BE_NUMERIC'), 'fAmount' => $smarty->get_template_vars('LBL_PRICE') . " " . $smarty->get_template_vars('LBL_MUST_BE_NUMERIC'), 'fVAT' => $smarty->get_template_vars('LBL_VAT') . " " . $smarty->get_template_vars('LBL_MUST_BE_NUMERIC'), 'fWithHoldingTax' => $smarty->get_template_vars('LBL_WITH_HOLDING_TAX') . " " . $smarty->get_template_vars('LBL_MUST_BE_NUMERIC')); if (count($nvldmsg) > 0) { $nvld_ary = $validation->isNumMul($nvldmsg, 'empty'); } // prints($nvld_ary); exit; // prints($_SESSION['SESS_'.PRJ_CONST_PREFIX.'_VALIDATION']); exit; // $resArr = $validation->isEmpty($RequiredFiledArr); if ($resArr || $nvld_ary == 'er') { header("Location:" . $_SERVER['HTTP_REFERER'] . ""); exit; } ### ENDS HERE ### $invdt = $invOrdObj->select($iInvoiceID); $cnitm = $invLineObj->getDetails("*", " AND iInvoiceID={$iInvoiceID} "); $subt = 0; $dist = 0; $chgt = 0; $tvat = 0; $otax = 0; $whtax = 0; $ltl = 0; $ilineItemCode = array(); $ilineItemCode = $vItemCode; // pr($_POST); for ($i = 0; $i < count($eInvoiceType); $i++) { $Data = array(); $Data['eInvoiceType'] = trim($eInvoiceType[$i]); $Data['vItemCode'] = $vItemCode[$i]; $Data['tDescription'] = $_POST['tDescription'][$i];
if($sess_usertype == 'securitymanager') $where=" AND bom.iASMID='".$sess_id."'"; else $where = " AND bom.iOrganizationID = '".$sess_id."'"; */ $where = ""; if ($key != '') { $where .= ' AND vItemCode LIKE "%' . $key . '%" '; } // echo $curORGID; exit; //if($iOrganizationID != '') //{ $where .= " AND iInvoiceID={$iInvId} "; //} // echo $where; exit; $res = $InvOrderLineObj->getDetails("vItemCode as vTitle,iInvoiceLineID as Id", $where); //prints($res);exit; unset($res['tot']); $html = ''; if (count($res) > 0 && is_array($res)) { $i = 0; foreach ($res as $arr) { $html .= "<span style='display:none'>" . $arr['Id'] . "</span>" . $arr['vTitle']; if ($i < count($res)) { $html .= "\n"; } } } else { $html .= "<span style='display:none'></span>No record found"; } echo $html;
$iInvoiceID = $_GET['id']; if (!isset($InvLineObj)) { include_once SITE_CLASS_APPLICATION . "user/class.InvoiceDetailLine.php"; $InvLineObj = new InvoiceDetailLine(); } if (!isset($orgUserObj)) { include_once SITE_CLASS_APPLICATION . "user/class.InvoiceOrderHeading.php"; $invOrdObj = new InvoiceOrderHeading(); } if ($msg != 'pop') { $msg = ''; } if (trim($iInvoiceID) != '' && is_numeric($iInvoiceID)) { $view = 'edit'; $where = ' AND iInvoiceID = "' . $iInvoiceID . '"'; $invoiceData = $InvLineObj->getDetails('*', $where); $invdtls = $invOrdObj->select($iInvoiceID); $isdtls = $statusmasterObj->getDetails('*', " AND eFor='Invoice' AND vStatus_en='Issued' "); $isdtls = $isdtls[0]['iStatusID']; if (!(is_array($invoiceData) && count($invoiceData) > 0)) { // header("Location: ".SITE_URL_DUM."invoicelist"); // exit; } if ($uorg_type == 'Buyer2') { $b2us = $invOrdObj->getInvoiceRfq2Buyer2OrgIds($iInvoiceID); if (!in_array($curORGID, $b2us)) { header("Location: " . SITE_URL_DUM . "invoicelist"); exit; } } else { if ($invdtls[0]['iBuyerOrganizationID'] != $curORGID && $invdtls[0]['iSupplierOrganizationID'] != $curORGID) {