Changeset 477 for trunk/finance/bills.php
- Timestamp:
- Jan 1, 2013, 11:01:51 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/finance/bills.php
r396 r477 9 9 function GenerateBill($BillId) 10 10 { 11 global $SpecificSymbol ;11 global $SpecificSymbol, $Config; 12 12 13 $DbResult = $this->Database->select('FinanceBills', '*', ' Id='.$BillId);13 $DbResult = $this->Database->select('FinanceBills', '*', '`Id`='.$BillId); 14 14 $Bill = $DbResult->fetch_assoc(); 15 15 16 $DbResult = $this->Database->select('Subject', '*', ' Id='.$Bill['Subject']);16 $DbResult = $this->Database->select('Subject', '*', '`Id`='.$Bill['Subject']); 17 17 $Subject = $DbResult->fetch_assoc(); 18 19 $DbResult = $this->Database->select('Subject', '*', '`Id`='.$Config['Finance']['MainSubjectId']); 20 $MainSubject = $DbResult->fetch_assoc(); 21 22 $DbResult = $this->Database->select('FinanceBankAccount', '*', '(`Subject`='. 23 $Config['Finance']['MainSubjectId'].') AND (`Use`=1)'); 24 $MainSubjectAccount = $DbResult->fetch_assoc(); 18 25 19 26 $Dodavka = array(); … … 25 32 26 33 $PaymentType = array('převodem', 'hotově'); 34 $BooleanText = array('Ne', 'Ano'); 27 35 28 36 switch($Bill['Type']) … … 33 41 '<hr></td></tr>'. 34 42 '<tr><td valign="top" width="50%"><strong>Dodavatel:</strong><br>'. 35 'Ing. Jiří Hajda<br>'.36 'Zděchov 208<br>'.37 '75607 Zděchov<br>'.38 'IČ: 75904535<br>'.39 'DIČ: CZ8303255884<br>'.40 'Účet: 218098370 / 0300<br>'.41 ' Neplátce DPH<br>'.43 $MainSubject['Name'].'<br>'. 44 $MainSubject['AddressStreet'].'<br>'. 45 $MainSubject['AddressPSC'].' '.$MainSubject['AddressTown'].'<br>'. 46 'IČ: '.$MainSubject['IC'].'<br>'. 47 'DIČ: '.$MainSubject['DIC'].'<br>'. 48 'Účet: '.$MainSubjectAccount['Number'].'<br>'. 49 'Plátce DPH: '.$BooleanText[$MainSubject['PayVAT']].'<br>'. 42 50 '</td><td valign="top">'. 43 51 '<strong>Odběratel:</strong><br>'. … … 62 70 'Datum zdanitel. plnění: '.HumanDate($Bill['TimeCreate']).'<br>'. 63 71 'Datum splatnosti: '.HumanDate($Bill['TimeDue']).'<br>'; 72 if(($Bill['PeriodFrom'] != '') and ($Bill['PeriodTo'] != '')) 73 $Output .= 'Fakturované období: '.HumanDate($Bill['PeriodFrom']).' - '.HumanDate($Bill['PeriodTo']).'<br>'; 64 74 $Output .= '</td></tr>'. 65 75 '<tr><td colspan="2">'. … … 85 95 $Output = '<table width="100%" border="1" cellspacing="0" cellpadding="3"><tr><td width="50%">'. 86 96 '<strong>Firma:</strong><br>'. 87 'Ing. Jiří Hajda<br>'. 88 'Zděchov 208<br>'. 89 '75607 Zděchov<br>'. 90 'IČ: 75904535<br>'. 91 'DIČ: CZ8303255884<br>'. 92 'Účet: 218098370 / 0300<br>'. 93 'Neplátce DPH</td><td width="50%" valign="top">'. 97 $MainSubject['Name'].'<br>'. 98 $MainSubject['AddressStreet'].'<br>'. 99 $MainSubject['AddressPSC'].' '.$MainSubject['AddressTown'].'<br>'. 100 'IČ: '.$MainSubject['IC'].'<br>'. 101 'DIČ: '.$MainSubject['DIC'].'<br>'. 102 'Účet: '.$MainSubjectAccount['Number'].'<br>'. 103 'Plátce DPH: '.$BooleanText[$MainSubject['PayVAT']]. 104 '</td><td width="50%" valign="top">'. 94 105 '<font size="5"><strong>PŘÍJMOVÝ POKLADNÍ DOKLAD</strong></font><br><br>'. 95 106 'Číslo dokladu: '.$Bill['BillCode'].'<br>'. … … 120 131 } 121 132 122 function CreateBill($SubjectId, $Items, $TimeCreate, $TimeDue, $BillCode = '', $Type = 'invoice') 123 { 124 $this->Database->insert('FinanceBills', array('TimeCreate' => TimeToMysqlDateTime($TimeCreate), 'Subject' => $SubjectId, 'TimeDue' => TimeToMysqlDateTime($TimeDue), 'BillCode' => $BillCode, 'Type' => $Type)); 133 function CreateBill($SubjectId, $Items, $TimeCreate, $TimeDue, $BillCode = '', $Type = 'invoice', 134 $PeriodFrom, $PeriodTo) 135 { 136 $this->Database->insert('FinanceBills', array('TimeCreate' => TimeToMysqlDateTime($TimeCreate), 137 'Subject' => $SubjectId, 'TimeDue' => TimeToMysqlDateTime($TimeDue), 138 'BillCode' => $BillCode, 'Type' => $Type, 'PeriodFrom' => TimeToMysqlDate($PeriodFrom), 139 'PeriodTo' => TimeToMysqlDate($PeriodTo))); 125 140 $BillId = $this->Database->insert_id; 126 141 foreach($Items as $Item) 127 142 { 128 $this->Database->insert('FinanceBillsItems', array('Bill' => $BillId, 'Description' => $Item['Description'], 'Price' => $Item['Price'], 'Quantity' => $Item['Quantity'])); 143 $this->Database->insert('FinanceBillsItems', array('Bill' => $BillId, 144 'Description' => $Item['Description'], 'Price' => $Item['Price'], 'Quantity' => $Item['Quantity'])); 129 145 } 130 146 //Header('Content-Type: application/pdf');
Note:
See TracChangeset
for help on using the changeset viewer.