Invoice

JBosir

Member
Hello. I need just the idea to start. I need to see the invoice on my website similar to how you have it in fabrikar with print option. Is an html module joomla + a view with a different css?
Thanks
 
It's a custom details template, with default.php like this:

PHP:
<?php $form = $this->form;
//echo "<pre>";print_r(array_keys($this->groups));echo "</pre>";
$group = $this->groups['Fabub My Invoices'];
$subGroup = $this->groups['Fabsub My Invoices- [jos_fabrik_subs_subscriptions]'];
$elements = $group->elements;
$subElements = $subGroup->elements;
 
//print_r($subElements['userid']);exit;
//$thisUser = JFactory::getUser($subElements['userid']->value);
 
$thisUser = JFactory::getUser($subElements['userid']->element_raw);
//print_r($thisUser);exit;
?>
<form method="post" <?php echo $form->attribs?>>
<?php
echo $this->plugintop;
 
$active = ($form->error != '') ? '' : ' fabrikHide';
echo "<div class='fabrikMainError fabrikError$active'>" . $form->error . "</div>";?>
    <?php
    if ($this->showEmail) {
        echo $this->emailLink;
    }
    if ($this->showPDF) {
        echo $this->pdfLink;
    }
?>
 
<div class="page-header">
<h1>Invoice <small><button class="btn pull-right" onclick="window.print();return false;"><i class="icon-print"></i> Print</button></small></h1>
</div>
<div class="row-fluid">
    <div class="span12" id="addresswidget">
        <p><i class="icon-info-sign"></i> Please enter your address below and press 'Update address' to insert your address into your invoice</p>
        <textarea id="newaddress" cols="30" rows="4"><?php echo $thisUser->get('name'); ?></textarea>
        <br /><button type="button" class="btn" id="addaddress" ><i class="icon-home"></i> Update address</button>
 
    </div>
</div>
<div class="row-fluid">
    <div class="span9">
 
        <dl>
    <dt>To:<a href="#" id="editAddress"><small>[edit]</small></a></dt>
    <dd>
    <div id="address"><?php echo $thisUser->get('name'); ?></div></dd>
        <dt>Invoice number</dt>
        <dd><?php echo $elements['invoice_number']->element_ro?></dd>
        <dt>Date</dt>
        <dd><?php echo $elements['created_date']->element_ro?></dd>
    </dl>
    </div>
 
    <div class="span3">
        <img src="http://fabrikar.com/templates/fabrik4/images/logo.png" alt="Fabrikar" />
 
        <ul>
        <li>Fabrikar</li>
        <li>22 Rue De Vautreuil</li>
        <li>17000</li>
        <li>La Rochelle</li>
        <li>France</li>
        <li>Numero Siret: 48413910000024</li>
    </ul>
 
    </div>
</div>
 
 
 
<table class="invoice_details">
    <tbody>
        <tr>
            <td>1</td>
            <td>
                Fabrik Subscription:
                <?php echo $subElements['plan']->element_ro ." (" .$subElements['type']->element_ro . ")"?>
            <td>
                <?php echo money_format('%i',$elements['amount']->element_ro)?> <?php echo $elements['currency']->element_ro?>
            </td>
        </tr>
    </tbody>
    <thead>
        <tr>
            <td>Quantity</td>
            <td>Item</td>
            <td>Amount</td>
        </tr>
    </thead>
    <tfoot>
        <tr>
        <td colspan="2" style="text-align:right">
            Total Net:
        </td>
    <td>
        <?php echo money_format('%i',$elements['amount']->element_ro)?> <?php echo $elements['currency']->element_ro?>
    </td>
    </tr>
    <tr>
        <td colspan="2" style="text-align:right">
            Total VAT Amount:
        </td>
    <td>
        0.00
    </td>
    </tr>
    <tr>
        <td colspan="2" style="text-align:right">
            Invoice total:
        </td>
    <td>
        <?php echo money_format('%i',$elements['amount']->element_ro)?> <?php echo $elements['currency']->element_ro?>
    </td>
    </tr>
    </tfoot>
</table>
<?php
 
    echo $this->hiddenFields;
    ?>
    <?php echo $this->pluginbottom; ?>
    <div class="fabrikActions"><?php echo $form->resetButton;?> <?php echo $form->submitButton;?>
    <?php echo $form->copyButton  . " " . $form->gobackButton . ' ' .$this->message ?>
    </div>
</form>
<?php
echo FabrikHelperHTML::keepalive();?>

... and a template_css of this:

Code:
<?php
 
header('Content-type: text/css');
 
$c = (int)$_REQUEST['c'];
 
$view = isset($_REQUEST['view']) ? $_REQUEST['view'] : 'form';
 
echo ".invoice_details td{
padding:5px;
}
 
.invoice_details{
    clear:both;
    width:100%;
    border:1px solid #999;
}
 
.invoice_details thead td{
background-color:#999;
color:#fff;
}
 
.invoice_details{
border-collapse:collapse;
}
 
.invoice_details tfoot td{
background-color:#efefef;
}
.fabrikForm {
    background-color:#fff;
    padding:10px;
}
 
.fabrikForm ul{
list-style:none;
}
 
 
 
.fabrikForm dt{
width:150px;
 
float:left;
clear:left;
}
 
.fabrikForm dt,
.fabrikForm dd,
.fabrikForm li{
padding:2px 0;
}
 
@media print{
  #addresswidget, #header, .moduletable, #footer, #footer2{
      display:none;
  }
}";?>
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top