コード例 #1
0
ファイル: invoice.php プロジェクト: ClixLtd/pccupload
 public function action_pay_invoice($invoiceID = 0)
 {
     if ($invoiceID == 0) {
         return;
     }
     $invoice = \Crm\Invoice\Invoice_class::forge($invoiceID);
     $invoice->setInvoiceAsPaid();
     $this->response(array('status' => 'done', 'message' => $invoiceID));
 }
コード例 #2
0
ファイル: index.php プロジェクト: ClixLtd/pccupload
 /**
  * View PPI Claim
  * 
  * @author David Stansfield
  * @public
  */
 public function action_view_claim($clientID, $claimID)
 {
     $data = array();
     $data['clientID'] = $clientID;
     // -- Get the current Claim
     // ------------------------
     $currentClaim = \Crm\Ppi\Ppi_claims::forge((int) $claimID);
     $data['currentClaim'] = $currentClaim->getDetails();
     $ppiDetails = \Crm\Ppi\Ppi_class::forge($clientID);
     $data['company_name'] = $ppiDetails->company_name;
     $signatory = 0;
     $partnerID = 0;
     if ((int) $currentClaim->signatory > 0) {
         $signatory = (int) $currentClaim->signatory;
         $partnerID = (int) ($partnerID = $ppiDetails->partner_id);
     }
     $client = \Crm\ClientClass::forge($clientID, $signatory, $partnerID);
     $data['client'] = $client->getDetails();
     $data['client']['fullName'] = $client->fullName();
     $data['client']['address'] = $client->address();
     $data['stageDetails'] = $currentClaim->getClaimStageStatus();
     $data['ppiStages'] = \Crm\Ppi\Ppi_class::listStages();
     #\Crm\Ppi\Ppi_class::loadLettersList(1);
     // -- Creditor Information
     // -----------------------
     $creditor = \Crm\Creditor\Creditor_class::forge($currentClaim->creditor_id);
     $data['creditor'] = $creditor->getDetails();
     $data['creditor']['address'] = $creditor->address();
     // -- For Invoice
     // --------------
     $data['invoiceFee'] = 25;
     //%
     $data['productTypeID'] = 1;
     $data['clientProductID'] = \Crm\Product\Product_class::getClientProductID($ppiDetails->referral_id);
     $data['refundList'] = array();
     $data['refundList'] = \Crm\Ppi\Ppi_class::refundMethodList();
     // -- Debt Types List
     // ------------------
     $data['debtTypeList'] = \Crm\Ppi\Ppi_class::getDebtList();
     // -- Load up the invoice if there is one
     // --------------------------------------
     $refund = \Crm\Ppi\Ppi_refund_class::forge($claimID);
     if ($refund->refundCreated()) {
         $data['refundMethod'] = $refund->getDetails();
         $invoice = \Crm\Invoice\Invoice_class::forge($refund->invoice_id);
         $data['invoice'] = $invoice->getDetails();
     }
     // -- Get Correspondences for the claim
     // ------------------------------------
     $data['correspondences'] = \Crm\Ppi\Ppi_correspondence::getClaimCorrespondences((int) $claimID);
     // -- Disposition List
     // -------------------
     $data['disposisionList'] = \Crm\Referrals\Referrals_class::loadStaticDispositionList();
     // -- Letters
     // ----------
     $letterConfig = \Crm\Ppi\Ppi_class::loadLettersList((int) $ppiDetails->company_id);
     $data['letters'] = array();
     $data['letters'][] = array('id' => $letterConfig['creditor_inital_complaint'], 'details' => \Crm\Letter\Letter::letterDetails($letterConfig['creditor_inital_complaint']), 'freeText' => false, 'tray' => 2);
     $data['letters'][] = array('id' => $letterConfig['client_free_text'], 'details' => \Crm\Letter\Letter::letterDetails($letterConfig['client_free_text']), 'freeText' => true, 'tray' => 2);
     $data['letters'][] = array('id' => $letterConfig['client_chase_acceptance'], 'details' => \Crm\Letter\Letter::letterDetails($letterConfig['client_chase_acceptance']), 'freeText' => false, 'tray' => 2);
     $data['letters'][] = array('id' => $letterConfig['client_chase_fos_quest'], 'details' => \Crm\Letter\Letter::letterDetails($letterConfig['client_chase_fos_quest']), 'freeText' => false, 'tray' => 2);
     $data['letters'][] = array('id' => $letterConfig['client_complaints_issued'], 'details' => \Crm\Letter\Letter::letterDetails($letterConfig['client_complaints_issued']), 'freeText' => false, 'tray' => 2);
     $data['letters'][] = array('id' => $letterConfig['client_4_week_update'], 'details' => \Crm\Letter\Letter::letterDetails($letterConfig['client_4_week_update']), 'freeText' => false, 'tray' => 2);
     $data['letters'][] = array('id' => $letterConfig['client_creditor_acknowledgment'], 'details' => \Crm\Letter\Letter::letterDetails($letterConfig['client_creditor_acknowledgment']), 'freeText' => false, 'tray' => 2);
     $data['letters'][] = array('id' => $letterConfig['client_creditor_req_info'], 'details' => \Crm\Letter\Letter::letterDetails($letterConfig['client_creditor_req_info']), 'freeText' => false, 'tray' => 2);
     $data['letters'][] = array('id' => $letterConfig['client_no_ppi'], 'details' => \Crm\Letter\Letter::letterDetails($letterConfig['client_no_ppi']), 'freeText' => true, 'tray' => 2);
     $data['letters'][] = array('id' => $letterConfig['client_ppi_declined'], 'details' => \Crm\Letter\Letter::letterDetails($letterConfig['client_ppi_declined']), 'freeText' => false, 'tray' => 2);
     $data['letters'][] = array('id' => $letterConfig['client_ppi_win'], 'details' => \Crm\Letter\Letter::letterDetails($letterConfig['client_ppi_win']), 'freeText' => false, 'tray' => 2);
     $data['letters'][] = array('id' => $letterConfig['creditor_chase_4_week_update'], 'details' => \Crm\Letter\Letter::letterDetails($letterConfig['creditor_chase_4_week_update']), 'freeText' => false, 'tray' => 2);
     $data['letters'][] = array('id' => $letterConfig['creditor_request_policy_sale'], 'details' => \Crm\Letter\Letter::letterDetails($letterConfig['creditor_request_policy_sale']), 'freeText' => false, 'tray' => 2);
     $data['letters'][] = array('id' => $letterConfig['creditor_chase_acknowledgement'], 'details' => \Crm\Letter\Letter::letterDetails($letterConfig['creditor_chase_acknowledgement']), 'freeText' => false, 'tray' => 2);
     $data['letters'][] = array('id' => $letterConfig['creditor_creditor_chase_final'], 'details' => \Crm\Letter\Letter::letterDetails($letterConfig['creditor_creditor_chase_final']), 'freeText' => false, 'tray' => 2);
     $data['letters'][] = array('id' => $letterConfig['creditor_refund_method'], 'details' => \Crm\Letter\Letter::letterDetails($letterConfig['creditor_refund_method']), 'freeText' => false, 'tray' => 2);
     $data['letters'][] = array('id' => $letterConfig['creditor_return_further_info'], 'details' => \Crm\Letter\Letter::letterDetails($letterConfig['creditor_return_further_info']), 'freeText' => false, 'tray' => 2);
     $data['letters'][] = array('id' => $letterConfig['fos_cover_letter'], 'details' => \Crm\Letter\Letter::letterDetails($letterConfig['fos_cover_letter']), 'freeText' => false, 'tray' => 2);
     $data['letters'][] = array('id' => $letterConfig['creditor_free_text'], 'details' => \Crm\Letter\Letter::letterDetails($letterConfig['creditor_free_text']), 'freeText' => true, 'tray' => 2);
     $this->template->title = "PPI Claim";
     $this->template->content = View::forge(static::$_viewPath . '/view_claim.php', $data);
 }