W załączeniu diff wrzucający bilans finansowy do FV może się komuś przyda. Można włączyć lub wyłączyć
[invoice] cust_balance = 1 lub 0
-- ReYu
--- invoice_pdf.php.org 2006-01-06 10:00:24.000000000 +0100 +++ invoice_pdf.php 2006-01-16 21:10:56.000000000 +0100 @@ -412,6 +412,12 @@ $y = $y - text_align_left($x,$y,10,iconv("UTF-8","ISO-8859-2",trans('In words:')).' '.iconv("UTF-8","ISO-8859-2",trans('$0 dollars $1 cents',to_words(floor($invoice['value'])),to_words(round(($invoice['value']-floor($invoice['value']))*100))))); return $y; } +function invoice_cust_balance($x,$y) +{ + global $pdf, $invoice; + $y = $y - text_align_left($x,$y,8,iconv("UTF-8","ISO-8859-2",trans('Balance:')).' '.iconv("UTF-8","ISO-8859-2",moneyf($invoice['balance'])).' '.iconv("UTF-8","ISO-8859-2",trans('Balance date:')).' '.date('Y/m/d')); + return $y; +}
function invoice_expositor ($x,$y) { @@ -441,9 +447,9 @@ $template = $CONFIG['invoices']['cnote_template_file']; else $template = $CONFIG['invoices']['template_file']; - +if ($_GET['sinvt']=="standard" or $_GET['sinvt']=="FT-0100") $template = $_GET['sinvt']; switch ($template) - { + { case "standard": $top=800; invoice_dates(500,800); @@ -458,10 +464,15 @@ invoice_expositor(30,$return[1]-20); $top=$return[2]-20; $top=invoice_to_pay(30,$top); + if ($CONFIG['invoices']['cust_balance']) + $top=invoice_cust_balance(30,$top); $top=$top-20; invoice_footnote(30,$top,530,10); break; case "FT-0100": + + $pdf->addJpegFromFile($CONFIG['invoices']['ft0100_bg_pic'],0,0,600,840); + $top=800; invoice_dates(500,800); invoice_address_box(400,700); @@ -475,7 +486,10 @@ invoice_footnote(470,$top,90,8); invoice_expositor(30,$return[1]-20); $top=$return[2]-10; - invoice_to_pay(30,$top); + $top=invoice_to_pay(30,$top)-10; + if ($CONFIG['invoices']['cust_balance']) + invoice_cust_balance(30,$top); + invoice_main_form_fill(187,3,0.4); invoice_simple_form_fill(14,3,0.4); break; @@ -552,6 +566,7 @@ { $invoice = $LMS->GetInvoiceContent($invoiceid); $invoice['serviceaddr'] = $LMS->GetCustomerServiceAddress($invoice['customerid']); + $invoice['balance'] = $LMS->GetCustomerBalance($invoice['customerid']); foreach($which as $type) { $i++; @@ -586,6 +601,7 @@ { $invoice = $LMS->GetInvoiceContent($invoiceid); $invoice['serviceaddr'] = $LMS->GetCustomerServiceAddress($invoice['customerid']); + $invoice['balance'] = $LMS->GetCustomerBalance($invoice['customerid']); foreach($which as $type) { $i++; @@ -599,12 +615,14 @@ $invoice = $LMS->GetInvoiceContent($_GET['id']); $invoice['last'] = TRUE; $invoice['serviceaddr'] = $LMS->GetCustomerServiceAddress($invoice['customerid']); + $invoice['balance'] = $LMS->GetCustomerBalance($invoice['customerid']); $type = trans('ORIGINAL'); invoice_body(); } elseif($invoice = $LMS->GetInvoiceContent($_GET['id'])) { $invoice['serviceaddr'] = $LMS->GetCustomerServiceAddress($invoice['customerid']); + $invoice['balance'] = $LMS->GetCustomerBalance($invoice['customerid']); $type = trans('ORIGINAL'); invoice_body(); $type = trans('COPY');