Changeset 738 for trunk/Modules/FinanceBankAPI/GPC.php
- Timestamp:
- Apr 14, 2015, 10:20:16 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/FinanceBankAPI/GPC.php
r550 r738 1 1 <?php 2 2 3 3 define('GPC_TYPE_REPORT', '074'); 4 4 define('GPC_TYPE_ITEM', '075'); 5 5 6 6 class GPC 7 7 { 8 8 function ParseLine($Line) 9 { 9 { 10 10 $Line = ' '.$Line; 11 $Type = mb_substr($Line, 1, 3); 12 11 $Type = mb_substr($Line, 1, 3); 12 13 13 if($Type == GPC_TYPE_REPORT) 14 14 { … … 19 19 'AccountName' => trim(mb_substr($Line, 20, 20)), 20 20 'OldBalanceDate' => mktime(0, 0, 0, mb_substr($Line, 42, 2), mb_substr($Line, 40, 2), '20'.mb_substr($Line, 44, 2)), 21 'OldBalanceValue' => (mb_substr($Line, 60, 1).mb_substr($Line, 46, 14)) / 100, 21 'OldBalanceValue' => (mb_substr($Line, 60, 1).mb_substr($Line, 46, 14)) / 100, 22 22 'NewBalanceValue' => (mb_substr($Line, 75, 1).mb_substr($Line, 61, 14)) / 100, 23 'DebitValue' => (mb_substr($Line, 90, 1).mb_substr($Line, 76, 14)) / 100, 24 'CreditValue' => (mb_substr($Line, 105, 1).mb_substr($Line, 91, 14)) / 100, 23 'DebitValue' => (mb_substr($Line, 90, 1).mb_substr($Line, 76, 14)) / 100, 24 'CreditValue' => (mb_substr($Line, 105, 1).mb_substr($Line, 91, 14)) / 100, 25 25 'SequenceNumber' => intval(mb_substr($Line, 106, 3)), 26 26 'Date' => mktime(0, 0, 0, mb_substr($Line, 111, 2), mb_substr($Line, 109, 2), '20'.mb_substr($Line, 113, 2)), … … 28 28 'CheckSum' => sha1(md5($Line).$Line), 29 29 ); 30 } else 30 } else 31 31 if($Type == GPC_TYPE_ITEM) 32 { 32 { 33 33 $GPCLine = array 34 34 ( 35 35 'Type' => GPC_TYPE_ITEM, 36 36 'AccountNumber' => mb_substr($Line, 4, 16), 37 'OffsetAccount' => mb_substr($Line, 20, 16), 38 'RecordNumber' => mb_substr($Line, 36, 13), 37 'OffsetAccount' => mb_substr($Line, 20, 16), 38 'RecordNumber' => mb_substr($Line, 36, 13), 39 39 'Value' => mb_substr($Line, 49, 12) / 100, 40 'Code' => mb_substr($Line, 61, 1), 40 'Code' => mb_substr($Line, 61, 1), 41 41 'VariableSymbol' => intval(mb_substr($Line, 62, 10)), 42 42 'BankCode' => mb_substr($Line, 74, 4), 43 43 'ConstantSymbol' => intval(mb_substr($Line, 78, 4)), 44 'SpecificSymbol' => intval(mb_substr($Line, 82, 10)), 44 'SpecificSymbol' => intval(mb_substr($Line, 82, 10)), 45 45 'Valut' => mb_substr($Line, 92, 6), 46 'ClientName' => mb_substr($Line, 98, 20), 46 'ClientName' => mb_substr($Line, 98, 20), 47 47 //'Zero' => substr($Line, 118, 1), 48 48 'CurrencyCode' => mb_substr($Line, 119, 4), … … 50 50 'CheckSum' => sha1(md5($Line).$Line), 51 51 ); 52 } else 52 } else 53 53 $GPCLine = NULL; 54 54 55 55 return($GPCLine); 56 56 }
Note:
See TracChangeset
for help on using the changeset viewer.