Changeset 302 for trunk/finance
- Timestamp:
- Jan 20, 2011, 6:37:24 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/finance/manage.php
r297 r302 143 143 } 144 144 145 function InsertLiability($Subject, $Value, $Time , $BillId, $Text, $TimePayment = '')145 function InsertLiability($Subject, $Value, $TimeCreation, $TimeDue, $Text, $DocumentLine) 146 146 { 147 147 global $LastInsertTime; 148 148 149 if($TimePayment != '') $TimePayment = TimeToMysqlDateTime($TimePayment);150 $this->Database->insert('FinanceClaimsLiabilities', array('Text' => $Text, 'Subject' => $Subject, 'TimeCreation' => TimeToMysqlDateTime($Time ), 'TimeDue' => TimeToMysqlDateTime($Time + 3600*24*15), 'TimePayment' => $TimePayment, 'Value' => $Value, 'Bill' => $BillId));149 $BillCode = $this->System->Modules['Finance']->GetNextDocumentLineNumber($DocumentLine); 150 $this->Database->insert('FinanceClaimsLiabilities', array('Text' => $Text, 'Subject' => $Subject, 'TimeCreation' => TimeToMysqlDateTime($TimeCreation), 'TimeDue' => TimeToMysqlDateTime($TimeDue), 'Value' => $Value, 'BillCode' => $BillCode)); 151 151 $Output = '.'; //$this->Database->LastQuery.'<br />'; 152 152 $LastInsertTime = $Time; 153 $this->CheckAdvancesAndLiabilities($Subject);154 return($Output); 155 } 156 157 function InsertMoney($Subject, $Value, $Cash, $Taxable, $Time, $Text )153 //$this->CheckAdvancesAndLiabilities($Subject); 154 return($Output); 155 } 156 157 function InsertMoney($Subject, $Value, $Cash, $Taxable, $Time, $Text, $DocumentLine) 158 158 { 159 159 global $LastInsertTime; 160 160 161 $this->Database->insert('FinanceCashFlow', array('Text' => $Text, 'Subject' => $Subject, 'Cash' => $Cash, 'Value' => $Value, 'Time' => TimeToMysqlDateTime($Time), 'Taxable' => $Taxable)); 162 if($Value >= 0) 161 $BillCode = $this->System->Modules['Finance']->GetNextDocumentLineNumber($DocumentLine); 162 $this->Database->insert('FinanceOperation', array('Text' => $Text, 'Subject' => $Subject, 'Cash' => $Cash, 'Value' => $Value, 'Time' => TimeToMysqlDateTime($Time), 'Taxable' => $Taxable, 'BillCode' => $BillCode)); 163 /*if($Value >= 0) 163 164 { 164 165 $this->Database->insert('FinanceAdvances', array('Subject' => $Subject, 'Value' => $Value, 'TimeCreation' => TimeToMysqlDateTime($Time), 'CashFlowId' => $this->Database->insert_id, 'Direction' => 'In')); 165 166 } 166 167 $LastInsertTime = $Time; 167 $this->CheckAdvancesAndLiabilities($Subject); 168 */ 169 //$this->CheckAdvancesAndLiabilities($Subject); 168 170 } 169 171 … … 216 218 $Form = new Form('NewPayment'); 217 219 $Form->LoadValuesFromForm(); 218 $this->InsertMoney($Form->Values['Subject'], $Form->Values['Value'], $Form->Values['Cash'], $Form->Values['Taxable'], $Form->Values['Time'], $Form->Values['Text'] );220 $this->InsertMoney($Form->Values['Subject'], $Form->Values['Value'], $Form->Values['Cash'], $Form->Values['Taxable'], $Form->Values['Time'], $Form->Values['Text'], $Form->Values['DocumentLine']); 219 221 $Output = $this->SystemMessage('Finance', 'Platba vložena.'); 220 222 $this->System->Modules['Log']->NewRecord('Finance', 'NewPaymentInserted'); … … 235 237 $Form->LoadvaluesFromForm(); 236 238 //print_r($Form->Values); 237 //$this->InsertLiability($Form->Values['Subject'], $Form->Values['Value'], $Form->Values['Time'], $BillId, $Text, $TimePayment = '')239 $this->InsertLiability($Form->Values['Subject'], $Form->Values['Value'], $Form->Values['TimeCreation'], $Form->Values['TimeDue'], $Form->Values['Text'], $Form->Values['DocumentLine']); 238 240 $Output = $this->SystemMessage('Finance', 'Faktura vložena..'); 239 241 $this->System->Modules['Log']->NewRecord('Finance', 'NewInvoiceInserted');
Note:
See TracChangeset
for help on using the changeset viewer.