Changeset 747 for trunk/Modules/FinanceBankAPI
- Timestamp:
- Sep 21, 2015, 12:12:26 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/FinanceBankAPI/FileImport.php
r740 r747 40 40 } 41 41 $Year = date('Y', MysqlDateToTime($DbRow['Time'])); 42 $BillCode = $this->System->Modules['Finance']->GetNextDocumentLineNumber ($FinanceGroup['DocumentLine'], $Year);42 $BillCode = $this->System->Modules['Finance']->GetNextDocumentLineNumberId($FinanceGroup['DocumentLine'], $Year); 43 43 $DbResult3 = $this->Database->insert('FinanceOperation', array('Subject' => $DbRow2['Id'], 'Cash' => 0, 44 'Value' => Abs($DbRow['Value']), ' ValueSign' => $FinanceGroup['ValueSign'], 'Taxable' => 1, 'BankAccount' => $DbRow['BankAccount'], 'Network' => 1,44 'Value' => Abs($DbRow['Value']), 'Taxable' => 1, 'BankAccount' => $DbRow['BankAccount'], 'Network' => 1, 45 45 'Time' => $DbRow['Time'], 'Text' => $DbRow['Description'], 'BillCode' => $BillCode, 'Group' => $FinanceGroup['Id'])); 46 46 $this->Database->update('FinanceBankImport', 'Id='.$DbRow['Id'], array('FinanceOperation' => $this->Database->insert_id)); … … 136 136 } 137 137 138 function InsertMoney($Subject, $Value, $ ValueSign, $Cash, $Taxable, $Time, $Text, $Group)138 function InsertMoney($Subject, $Value, $Cash, $Taxable, $Time, $Text, $Group) 139 139 { 140 140 $Year = date('Y', $Time); 141 $BillCode = $this->System->Modules['Finance']->GetNextDocumentLineNumber($Group['DocumentLine'], $Year); 141 $BillCode = $this->System->Modules['Finance']->GetNextDocumentLineNumberId( 142 $Group['DocumentLine'], $Year); 142 143 $this->Database->insert('FinanceOperation', array('Text' => $Text, 143 'Subject' => $Subject, 'Cash' => $Cash, 'Value ' => $Value, 'ValueSign' => $ValueSign,144 'Subject' => $Subject, 'Cash' => $Cash, 'ValueUser' => $Value, 'Value' => $Value * $Group['ValueSign'], 144 145 'Time' => TimeToMysqlDateTime($Time), 'Taxable' => $Taxable, 'BillCode' => $BillCode)); 145 146 } … … 153 154 { 154 155 if($_POST['Money'.$I] >= 0) { 155 $FinanceGroup = $Finance->GetFinanceGroupById(OPERATION_GROUP_ACCOUNT_IN, 'FinanceOperationGroup'); 156 $FinanceGroup = $Finance->GetFinanceGroupById(OPERATION_GROUP_ACCOUNT_IN, 157 'FinanceOperationGroup'); 156 158 } else { 157 $FinanceGroup = $Finance->GetFinanceGroupById(OPERATION_GROUP_ACCOUNT_OUT, 'FinanceOperationGroup'); 159 $FinanceGroup = $Finance->GetFinanceGroupById(OPERATION_GROUP_ACCOUNT_OUT, 160 'FinanceOperationGroup'); 158 161 } 159 162 $Date = explode('-', $_POST['Date'.$I]); 160 163 $Date = mktime(0, 0, 0, $Date[1], $Date[2], $Date[0]); 161 $this->InsertMoney($_POST['Subject'.$I], Abs($_POST['Money'.$I]), $FinanceGroup['ValueSign'],164 $this->InsertMoney($_POST['Subject'.$I], Abs($_POST['Money'.$I]), 162 165 0, $_POST['Taxable'.$I], $Date, $_POST['Text'.$I], $FinanceGroup); 163 166 $Output .= $I.', ';
Note:
See TracChangeset
for help on using the changeset viewer.