function getCheckPaymentList($trans_id, $check_status = NULL) { $strValues[] = "*"; if ($trans_id == NULL) { $strWhere[TPC_TRANS_ID] = $this->getData(TPC_TRANS_ID); } else { $strWhere[TPC_TRANS_ID] = $trans_id; } if ($check_status != NULL) { $strWhere[TPC_CHECK_STATUS] = $check_status; } $records = ebpls_select_data($this->m_dbLink, TPC_TABLE, $strValues, $strWhere); if (is_array($records)) { for ($i = 0; $i < count($records); $i++) { $clsCheck = new EBPLSTransactionPaymentsCheck($this->m_dbLink); $clsCheck->setData(NULL, $records[$i]); $check_records[$i] = $clsCheck; } return $check_records; } else { $this->setError(-1, "Unable to find Check Payment list with trans id # " . $strWhere[TPC_TRANS_ID] . " Record."); return -1; } }
function getPaymentList($paymentType, $check_status = NULL) { if (!is_numeric($this->getData(TRANS_ID))) { $this->debug("getPaymentList Failed, transaction not loaded, load by invoking loadTransaction."); $this->setError(-1, "getPaymentList Failed, transaction not loaded, load by invoking loadTransaction."); return -1; } /* if ( $this->getData(TRANS_TRANSACTION_STATUS) == TRANS_STATUS_PAYMENT && $user_level != TRANS_LEVEL_PAYMENT_OFFICER && $user_level != TRANS_LEVEL_ADMIN_OFFICER && $user_level != TRANS_LEVEL_ROOT_OFFICER ) { $this->debug("getPaymentList Failed, user level $user_level of $admin is not allowed."); $this->setError( -1, "setPayment mode failed, user level $user_level not allowed."); return -1; } */ if ($paymentType != "CASH" && $paymentType != "CHECK") { $this->debug("getPaymentList Failed, payment type passed {$paymentType} invalid. Valid values payment Type enum('CASH','CHECK')."); $this->setError(-1, "getPaymentList Failed, payment type passed {$paymentType} invalid. Valid values payment Type enum('CASH','CHECK')."); return -1; } if ($paymentType == "CASH") { $clsOR = new EBPLSTransactionPaymentsOR($this->m_dbLink); $records = $clsOR->getPaymentList($this->getData(TRANS_ID)); } else { if ($paymentType == "CHECK") { $clsCheck = new EBPLSTransactionPaymentsCheck($this->m_dbLink); $records = $clsCheck->getCheckPaymentList($this->getData(TRANS_ID), $check_status); } } return $records; }