Changeset 552 for trunk/Modules/Finance/Manage.php
- Timestamp:
- Jul 7, 2013, 10:41:07 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Finance/Manage.php
r551 r552 99 99 $Output .= '<a href="?Operation=ProcessMonthlyPayment">Generovat faktury</a>'; 100 100 return($Output); 101 } 102 103 function InsertInvoice($Subject, $TimeCreation, $TimeDue, $Items, 104 $DocumentLine, $PeriodFrom, $PeriodTo) 105 { 106 global $LastInsertTime; 107 108 $BillCode = $this->System->Modules['Finance']->GetNextDocumentLineNumber($DocumentLine); 109 $SumValue = 0; 110 foreach($Items as $Item) 111 $SumValue = $SumValue + $Item['Price']; 112 $this->Database->insert('FinanceInvoice', array( 113 'Subject' => $Subject, 'TimeCreation' => TimeToMysqlDateTime($TimeCreation), 114 'TimeDue' => TimeToMysqlDateTime($TimeDue), 'Value' => $SumValue, 'BillCode' => $BillCode, 115 'PeriodFrom' => TimeToMysqlDate($PeriodFrom), 'PeriodTo' => TimeToMysqlDate($PeriodTo), 116 'Generate' => 1)); 117 $InvoiceId = $this->Database->insert_id; 118 foreach($Items as $Item) 119 $this->Database->insert('FinanceInvoiceItem', array('FinanceInvoice' => $InvoiceId, 120 'Description' => $Item['Description'], 'Price' => $Item['Price'], 'Quantity' => $Item['Quantity'], 'VAT' => $Item['VAT'])); 121 //$LastInsertTime = $Time; 122 //$this->CheckAdvancesAndLiabilities($Subject); 123 return($InvoiceId); 101 124 } 102 125
Note:
See TracChangeset
for help on using the changeset viewer.