'.
$Subject['AddressStreet'].'
'.
$Subject['AddressPSC'].' '.$Subject['AddressTown'].'
';
if (($Subject['IC'] != '') and ($Subject['IC'] != 0)) $Output .= 'IČ: '.$Subject['IC'].'
';
if ($Subject['DIC'] != '') $Output .= 'DIČ: '.$Subject['DIC'].'
';
if ($Subject['Account'] != '') $Output .= 'Účet: '.$Subject['Account'].'
';
if ($Subject['PayVAT'] != '') $Output .= 'Plátce DPH: '.$BooleanText[$Subject['PayVAT']].'
';
return $Output;
}
function GenerateHTML(): string
{
$Finance = &ModuleFinance::Cast($this->System->GetModule('Finance'))->Finance;
$Finance->LoadMonthParameters(0);
$DbResult = $this->Database->query('SELECT `FinanceInvoice`.*, `FinanceInvoiceGroup`.`Direction`, `DocumentLineCode`.`Name` AS `BillName` FROM `FinanceInvoice` '.
'LEFT JOIN `FinanceInvoiceGroup` ON `FinanceInvoiceGroup`.`Id`=`FinanceInvoice`.`Group` '.
'LEFT JOIN `DocumentLineCode` ON `DocumentLineCode`.`Id`=`FinanceInvoice`.`BillCode` '.
'WHERE `FinanceInvoice`.`Id`='.$this->InvoiceId);
$Invoice = $DbResult->fetch_assoc();
$DbResult = $this->Database->select('Subject', '*', '`Id`='.$Invoice['Subject']);
$SubjectTo = $DbResult->fetch_assoc();
$SubjectTo['Account'] = '';
$SubjectTo['PayVAT'] = '';
$VarSym = $SubjectTo['Id'];
$DbResult = $this->Database->select('Subject', '*', '`Id`='.$this->System->Config['Finance']['MainSubjectId']);
$SubjectFrom = $DbResult->fetch_assoc();
$DbResult = $this->Database->query('SELECT FinanceBankAccount.*, CONCAT(FinanceBankAccount.Number, "/", FinanceBank.Code) AS NumberFull FROM FinanceBankAccount '.
'JOIN FinanceBank ON FinanceBank.Id=FinanceBankAccount.Bank '.
'WHERE (FinanceBankAccount.`Subject`='.$this->System->Config['Finance']['MainSubjectId'].') AND (FinanceBankAccount.`Use`=1)');
$SubjectFromAccount = $DbResult->fetch_assoc();
$SubjectFrom['Account'] = $SubjectFromAccount['NumberFull'];
$InvoiceItems = array();
$DbResult = $this->Database->select('FinanceInvoiceItem', '*, ROUND(`Price` * `Quantity`, '.$Finance->Rounding.') AS `Total`', '`FinanceInvoice`='.$this->InvoiceId);
while ($Item = $DbResult->fetch_assoc())
{
$InvoiceItems[$Item['Id']] = $Item;
}
// If direction is in => switch sides
if ($Invoice['Direction'] == FINANCE_DIRECTION_OUT)
{
}
else if ($Invoice['Direction'] == FINANCE_DIRECTION_IN)
{
$Subject = $SubjectTo;
$SubjectTo = $SubjectFrom;
$SubjectFrom = $Subject;
}
else throw new Exception('Wrong finance direction');
$PaymentType = array('převodem', 'hotově');
$BooleanText = array('Ne', 'Ano');
$Output = '
'.
' Faktura - daňový doklad '.
' | |||||||||||||||||
Dodavatel: '. $this->ShowSubjectInfo($SubjectFrom). ' | '.
'Odběratel: '. $this->ShowSubjectInfo($SubjectTo); $Output .= ' | ||||||||||||||||
'.
'Platební podmínky: '. 'Číslo dokladu: '.$Invoice['BillName'].' '. 'Variabilní symbol: '.$VarSym.' '. 'Specifický symbol: '.$this->SpecificSymbol.' '. 'Konstantní symbol: '. 'Způsob úhrady: '.$PaymentType[$Invoice['Cash']]. ' | '.
' '. 'Datum vystavení: '.HumanDate($Invoice['Time']).' '. 'Datum zdanitel. plnění: '.HumanDate($Invoice['Time']).' '. 'Datum splatnosti: '.HumanDate($Invoice['TimeDue']).' '; if (($Invoice['PeriodFrom'] != '') and ($Invoice['PeriodTo'] != '')) $Output .= 'Fakturované období: '.HumanDate($Invoice['PeriodFrom']).' - '. HumanDate($Invoice['PeriodTo']).' '; $Output .= ' | ||||||||||||||||
'.
' '. ' '. '
| |||||||||||||||||
'.
'Firma: '. $MainSubject['Name'].' '. $MainSubject['AddressStreet'].' '. $MainSubject['AddressPSC'].' '.$MainSubject['AddressTown'].' '. 'IČ: '.$MainSubject['IC'].' '. 'DIČ: '.$MainSubject['DIC'].' '. 'Účet: '.$MainSubjectAccount['NumberFull'].' '. 'Plátce DPH: '.$BooleanText[$MainSubject['PayVAT']]. ' | '.
''.$Desc['Type'].' POKLADNÍ DOKLAD '. 'Číslo dokladu: '.$Operation['BillName'].' '. 'Datum vystavení: '.HumanDate($Operation['Time']).' '. ' |
'.$Desc['Target'].': '. $Subject['Name'].' '. $Subject['AddressStreet'].' '. $Subject['AddressPSC'].' '.$Subject['AddressTown'].' '; if ($Subject['IC'] != 0) $Output .= 'IČ: '.$Subject['IC'].' '; if ($Subject['DIC'] != '') $Output .= 'DIČ: '.$Subject['DIC'].' '; $Description = $Operation['Text']; $Output .= ' | |
Částka: '.$Operation['Value'].' Kč '. ' | |
Účel platby: '.$Description.' | |
'.$Desc['Signature'].': |