Example #1
0
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
require "include/invoice_top.php";
$section = 'payed_not';
require "include/invoice_menu.php";
if (isset($_GET['debug']) && isset($_GET['invoice_id'])) {
    $invoice = new invoice($_GET['invoice_id']);
    $invoice->get();
    $invoice->createPDF();
    echo 'Jau...';
}
echo '<h1>' . _('Not payed') . '</h1>' . chr(10) . chr(10);
$Q_invoice = mysql_query("select invoice_id from `invoice` where invoice_payed = 0 order by invoice_id");
invoicelist_payed_not($Q_invoice);
if (isset($_GET['debug'])) {
    $Q_invoice = mysql_query("select invoice_id from `invoice` where invoice_payed = 0 order by invoice_id");
    echo '<br><br>';
    if (!mysql_num_rows($Q_invoice)) {
        echo '<i>' . _('There are no invoices that are registered as not payed.') . '</i>';
    } else {
        echo '<table>';
        while ($R_invoice = mysql_fetch_assoc($Q_invoice)) {
            $invoice = new invoice($R_invoice['invoice_id']);
            $invoice->get();
            //templateAssignInvoice('smarty', $invoice);
            echo '<tr><td>' . '<a href="' . $_SERVER['PHP_SELF'] . '?invoice_id=' . $invoice->invoice_id . '&debug=1">' . $invoice->invoice_id . '</a></td>' . '<td>' . '<a href="invoice_view.php?invoice_id=' . $invoice->invoice_id . '">' . $invoice->invoice_id . '</a></td>' . '<td>' . str_replace("  ", "&nbsp; ", nl2br(print_r($invoice, true))) . '</td></tr>';
        }
        echo '</table>';
    }
}
Example #2
0
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
require "include/invoice_top.php";
if (!isset($_GET['invoice_id']) || !is_numeric($_GET['invoice_id'])) {
    echo _('Can\'t find invoice.');
    exit;
}
$invoice = new invoice($_GET['invoice_id']);
if (!$invoice->get()) {
    echo _('Can\'t find invoice.');
    exit;
}
$section = 'payed_not';
require "include/invoice_menu.php";
$smarty = new Smarty();
templateAssignInvoice('smarty', $invoice);
templateAssignSystemvars('smarty');
//$smarty->debugging = true;
$smarty->display('file:invoice_view.tpl');
Example #3
0
function invoicelist_payed($Q)
{
    //$Q = mysql_query($SQL);
    if (!mysql_num_rows($Q)) {
        echo '<i>Ingen fakturaer er registert som betalt.</i>';
    } else {
        echo '<font color="red">' . mysql_num_rows($Q) . '</font> fakturaer funnet';
        echo '<br>' . chr(10) . chr(10);
        echo '<table style="border-collapse: collapse;">' . chr(10);
        echo ' <tr>' . chr(10);
        echo '  <td style="border: 1px solid black;"><b class="hiddenprint">Vis mer</b><b class="print">Fakturaid</b></td>' . chr(10);
        echo '  <td style="border: 1px solid black;"><b>Fakturadato</b></td>' . chr(10);
        echo '  <td style="border: 1px solid black;"><b>Betalt</b></td>' . chr(10);
        echo '  <td style="border: 1px solid black;"><b>Beløp</b></td>' . chr(10);
        echo '  <td style="border: 1px solid black;"><b>Kunde</b></td>' . chr(10);
        echo '  <td style="border: 1px solid black;">&nbsp;</td>' . chr(10);
        echo ' </tr>' . chr(10);
        while ($R = mysql_fetch_assoc($Q)) {
            $invoice = new invoice($R['invoice_id']);
            $invoice->get();
            echo ' <tr>' . chr(10);
            // invoice_id
            echo '  <td style="border: 1px solid black;">';
            echo '<a href="invoice_view.php?invoice_id=' . $invoice->invoice_id . '" class="hiddenprint">' . iconHTML('coins') . ' Faktura ' . $invoice->invoice_id . '</a>';
            echo '<b class="print">' . $invoice->invoice_id . '</b>';
            echo '</td>' . chr(10);
            // time
            echo '  <td style="border: 1px solid black;">';
            echo $invoice->invoice_time2['year'] . '-' . $invoice->invoice_time2['month'] . '-' . $invoice->invoice_time2['day'];
            echo '</td>' . chr(10);
            // time_payed
            echo '  <td style="border: 1px solid black;">';
            echo nl2br($invoice->invoice_payment_time);
            echo '</td>' . chr(10);
            // sum
            echo '  <td style="border: 1px solid black;">kr&nbsp;' . smarty_modifier_commify($invoice->invoice_payed_amount, 2, ",", " ") . '</td>' . chr(10);
            // Customer
            echo '  <td style="border: 1px solid black;">';
            if ($invoice->invoice_to_customer_name != '') {
                echo '<a href="customer.php?customer_id=' . $invoice->invoice_to_customer_id . '">' . $invoice->invoice_to_customer_name . '</a>';
            } else {
                echo $invoice->invoice_to_line1;
            }
            echo '</td>' . chr(10);
            // Options
            echo '  <td style="border: 1px solid black;">';
            echo nl2br($invoice->invoice_payment_comment);
            echo '</td>' . chr(10);
            echo ' </tr>' . chr(10);
        }
        echo '</table>';
    }
}