Esempio n. 1
0
 /**
  * Dump logical record contents (including segments)
  * @return string
  */
 public function dump()
 {
     // Logical Record Type
     $value = $this->getLogicalRecordTypeId();
     // Logical Record Count
     $value .= $this->getLogicalRecordCount();
     // Originator Account Number
     $value .= $this->getOriginatorAccountNumber();
     // File Creation Number
     $value .= $this->getFileCreationNumber();
     // Dump segments
     $value .= $this->dumpSegments();
     // Fillers
     $value .= Fillers::generate($value);
     return $value;
 }
Esempio n. 2
0
 /**
  * Dump Logical Record Content
  *
  * @return string
  */
 public function dump()
 {
     // Logical Record Type
     $value = $this->getLogicalRecordTypeId();
     // Logical Record Count
     $value .= $this->getLogicalRecordCount();
     // Originator Account Number
     $value .= $this->getOriginatorAccountNumber();
     // File Creation Number (FCN)
     $value .= $this->getFileCreationNumber();
     switch ($this->getType()) {
         case 'C':
             if (empty($this->getTotalAmountOfCredits())) {
                 throw new \Exception('Empty or invalid total amount of credits, set total amount of credits using ' . __CLASS__ . '::setTotalAmountOfCredits()');
             }
             if (empty($this->getTotalNumberOfCredits())) {
                 throw new \Exception('Empty or invalid total number of credits, set total number of credits using ' . __CLASS__ . '::setTotalNumberOfCredits');
             }
             $value .= Fillers::generate(null, 14, Fillers::ZERO_FILLER);
             $value .= Fillers::generate(null, 8, Fillers::ZERO_FILLER);
             $value .= $this->getTotalAmountOfCredits();
             $value .= $this->getTotalNumberOfCredits();
             break;
         case 'D':
             if (empty($this->getTotalAmountOfDebits())) {
                 throw new \Exception('Empty or invalid total amount of debits, set total amount of debits using ' . __CLASS__ . '::setTotalAmountOfDebits()');
             }
             if (empty($this->getTotalNumberOfDebits())) {
                 throw new \Exception('Empty or invalid total number of debits, set total number of debits using ' . __CLASS__ . '::setTotalNumberOfDebits()');
             }
             $value .= $this->getTotalAmountOfDebits();
             $value .= $this->getTotalNumberOfDebits();
             $value .= Fillers::generate(null, 14, Fillers::ZERO_FILLER);
             $value .= Fillers::generate(null, 8, Fillers::ZERO_FILLER);
             break;
     }
     // Total Value of Error Corrections "E"
     $value .= $this->getTotalValueOfErrorCorrectionsForE();
     // Total Number of Error Corrections "E"
     $value .= $this->getTotalNumberOfErrorCorrectionsForE();
     // Total Value of Error Corrections "F"
     $value .= $this->getTotalValueOfErrorCorrectionsForF();
     // Total Number of Error Corrections "F"
     $value .= $this->getTotalNumberOfErrorCorrectionsForF();
     // Fillers
     $value .= Fillers::generate($value);
     return $value;
 }
Esempio n. 3
0
 /**
  * Get Invalid Data Element Id
  *
  * @return integer|string
  */
 public function getInvalidDataElementId()
 {
     return Fillers::truncateOrFill($this->invalidDataElementId, 11, Fillers::ZERO_FILLER);
 }
Esempio n. 4
0
 /**
  * Dump Logical Record Content
  *
  * @return string
  */
 public function dump()
 {
     // Logical Record Type
     $value = $this->getLogicalRecordTypeId();
     // Logical Record Count
     $value .= $this->getLogicalRecordCount();
     // Originator Account Number
     $value .= $this->getOriginatorAccountNumber();
     // File Creation Number
     $value .= $this->getFileCreationNumber();
     // File Creation Date
     $value .= $this->getFileCreationDate();
     // File Processing Centre
     $value .= $this->getFileProcessingCentre();
     // Fillers
     $value .= Fillers::generate($value);
     return $value;
 }