Fixed some more bootstrap rendering

This commit is contained in:
Deon George
2016-07-25 00:44:17 +10:00
parent c29819b6bd
commit 21d204f605
16 changed files with 239 additions and 270 deletions

View File

@@ -75,7 +75,7 @@ class Controller_User_Invoice extends Controller_Invoice {
public function action_list() {
Block::factory()
->title(sprintf('Invoices for Account: %s',$this->ao->accnum()))
->title_icon('icon-th-list')
->title_icon('fa fa-list')
->body(Table::factory()
->jssort('invoices')
->data($this->ao->invoice->find_all())
@@ -107,64 +107,8 @@ class Controller_User_Invoice extends Controller_Invoice {
$output .= Invoice::instance($io)->render('html','all');
$output .= '<br>';
$output .= HTML::anchor(URL::link('user','invoice/email/'.$io->id),'Email',array('class'=>'btn pull-right'));
$output .= HTML::anchor(URL::link('user','invoice/download/'.$io->id),'Download',array('class'=>'btn pull-right'));
if ($io->due() AND ! $io->cart_exists())
$output .= View::factory('invoice/user/view/pay')
->set('mid',$io->mid())
->set('o',$io);
if (! $io->status) {
Style::factory()
->type('file')
->data('media/css/pages/invoice.css');
$output .= '<div id="watermark">Invoice CANCELLED.</div>';
}
Block::factory()
->title(sprintf('%s: %s - %s',_('Invoice'),$io->refnum(),$io->account->name()))
->title_icon('icon-list-alt')
->body($output);
$x = $io->invoice_memo->find_all();
if ($x->count())
Block::factory()
->title('Invoice Memos')
->title_icon('icon-list-alt')
->span(6)
->body(Table::factory()
->data($x)
->columns(array(
'id'=>'ID',
'date_orig'=>'Date',
'account->name()'=>'Account',
'memo'=>'Memo',
)));
$x = $io->email()->find_all();
if ($x->count())
Block::factory()
->title('Invoice Emails')
->title_icon('icon-list-alt')
->span(6)
->body(Table::factory()
->data($x)
->columns(array(
'id'=>'ID',
'date_orig'=>'Date',
'resolve("subject")'=>'Subject',
))
->prepend(array(
'id'=>array('url'=>URL::link('user','email/view/')),
))
->postproc(array(
'resolve("subject")'=>array('trim'=>55),
))
);
$this->template->content = View::factory('invoice/user/view')->set('o',$io)->set('output',$output);
}
}
?>

View File

@@ -214,7 +214,7 @@ class Invoice {
* Renders the invoice in HTML
*/
private function render_html() {
return View::factory('invoice/user/view')
return View::factory('invoice/render')
->set('o',$this->_io);
}

View File

@@ -0,0 +1,104 @@
<div class="row">
<div class="col-md-5">
<table>
<tr>
<td style="vertical-align: top"><?php echo HTML::image('http://www.gth.bgo.co/logo-blue'); ?></td>
<td style="text-align: right; font-weight: bold">
<?php echo Company::instance()->name(); ?><br/>
<?php echo Company::instance()->taxid(); ?><br/>
<br/>
<?php echo Company::instance()->address(); ?><br/>
<br/>
<?php echo Company::instance()->contacts(); ?>
</td>
</tr>
</table>
</div> <!-- /span -->
<div class="col-md-5 col-md-offset-1">
<div class="dl-horizontal pull-right">
<dt>Tax Invoice</dt>
<dd><?php echo $o->id(); ?></dd>
<dt>Issue Date</dt>
<dd><?php echo $o->display('date_orig'); ?></dd>
<dt>Due Date</dt>
<dd><?php echo $o->display('due_date'); ?></dd>
<dt>Current Charges</dt>
<dd><?php echo $o->total_charges(TRUE); ?></dd>
<dt>Payments Received</dt>
<dd><?php echo $o->payments_total(TRUE); ?></dd>
<dt>Credits Applied</dt>
<dd><?php echo $o->total_credits(TRUE); ?></dd>
<dt>Still Due</dt>
<dd><?php echo $o->due(TRUE); ?></dd>
</div>
</div> <!-- /span -->
</div>
<div class="row">
<div class="col-md-12">
<h4>Charge Details</h4>
<?php echo Invoice::instance($o)->render('html','body'); ?>
</div> <!-- /span -->
</div>
<div class="row">
<div class="col-md-5">
<h5>Reminder Details</h5>
<div class="dl-horizontal pull-left">
<?php foreach ($o->reminders() as $eto) : ?>
<dt><?php echo $o->reminders($eto->name,TRUE); ?></dt>
<dd><?php echo $eto->name(); ?></dd>
<?php endforeach ?>
</div>
</div> <!-- /span -->
<div class="col-md-5 col-md-offset-1">
<div class="dl-horizontal pull-right">
<!-- Sub Total -->
<dt>Sub Total</dt>
<dd><?php echo $o->subtotal(TRUE); ?></dd>
<!-- END Invoice Sub Total -->
<!-- Invoice Credits -->
<?php if ($o->total_credits()) : ?>
<dt>Credits</dt>
<dd><?php echo $o->total_credits(TRUE); ?></dd>
<?php endif ?>
<!-- END Invoice Credits -->
<!-- Invoice Discounts Total -->
<?php if ($o->total_discounts()) : ?>
<dt>Discounts</dt>
<dd><?php echo $o->total_discounts(TRUE); ?></dd>
<?php endif ?>
<!-- END Invoice Discounts Total -->
<!-- Invoice Taxes Total -->
<dt>Taxes Included:</dt>
<?php foreach ($o->tax_summary() as $tid => $amount) :
$m = ORM::factory('Tax',$tid); ?>
<dd><?php printf('%s (%s)',Currency::display($amount),$m->description); ?><dd>
<?php endforeach ?>
<!-- END Invoice Taxes Total -->
<!-- Invoice Total -->
<dt>Total Invoice:</dt>
<dd><?php echo $o->total(TRUE); ?></dd>
<!-- END Invoice Total -->
<!-- Account Total Due -->
<dt>Account Due:</dt>
<dd><?php echo $o->account->invoices_due_total(NULL,TRUE); ?></dd>
<!-- END Account Total Due -->
</div>
</div> <!-- /span -->
</div>

View File

@@ -0,0 +1,19 @@
<!-- o = Model Invoice -->
<?php echo Block::factory()
->title('Invoice Emails')
->title_icon('fa fa-list')
->span(6)
->body(Table::factory()
->data($o->email()->find_all())
->columns(array(
'id'=>'ID',
'date_orig'=>'Date',
'resolve("subject")'=>'Subject',
))
->prepend(array(
'id'=>array('url'=>URL::link('user','email/view/')),
))
->postproc(array(
'resolve("subject")'=>array('trim'=>52),
))
);

View File

@@ -0,0 +1,14 @@
<!-- o = Model Invoice -->
<?php echo Block::factory()
->title('Invoice Memos')
->title_icon('fa fa-list')
->span(6)
->body(Table::factory()
->data($o->invoice_memo->find_all())
->columns(array(
'id'=>'ID',
'date_orig'=>'Date',
'account->name()'=>'Account',
'memo'=>'Memo',
))
);

View File

@@ -0,0 +1,12 @@
<!-- o = Model_Account -->
<?php
$i = Invoice::instance();
foreach ($o->service->list_active() as $io)
if (! $io->suspend_billing AND ! $io->external_billing)
$i->add_service($io);
echo Block::factory()
->title(sprintf('Next Invoice Items for Account: %s',$o->accnum()))
->title_icon('fa fa-shopping-cart')
->span(6)
->body($i->render('html','body',array('noid'=>TRUE)));

View File

@@ -1,104 +1,29 @@
<div class="row">
<div class="span5">
<table>
<tr>
<td style="vertical-align: top"><?php echo HTML::image('http://www.gth.bgo.co/logo-blue'); ?></td>
<td style="text-align: right; font-weight: bold">
<?php echo Company::instance()->name(); ?><br/>
<?php echo Company::instance()->taxid(); ?><br/>
<br/>
<?php echo Company::instance()->address(); ?><br/>
<br/>
<?php echo Company::instance()->contacts(); ?>
</td>
</tr>
</table>
</div> <!-- /span -->
<!-- o = Model_Invoice -->
<!-- output = HTML Invoice -->
<?php
$output .= '<br>';
<div class="span5">
<div class="dl-horizontal pull-right">
<dt>Tax Invoice</dt>
<dd><?php echo $o->id(); ?></dd>
$output .= HTML::anchor(URL::link('user','invoice/email/'.$o->id),'Email',array('class'=>'btn pull-right'));
$output .= HTML::anchor(URL::link('user','invoice/download/'.$o->id),'Download',array('class'=>'btn pull-right'));
<dt>Issue Date</dt>
<dd><?php echo $o->display('date_orig'); ?></dd>
if ($o->due() AND ! $o->cart_exists())
$output .= View::factory('invoice/user/view/pay')
->set('mid',$o->mid())
->set('o',$o);
<dt>Due Date</dt>
<dd><?php echo $o->display('due_date'); ?></dd>
if (! $o->status) {
Style::factory()
->type('file')
->data('media/css/pages/invoice.css');
<dt>Current Charges</dt>
<dd><?php echo $o->total_charges(TRUE); ?></dd>
$output .= '<div id="watermark">Invoice CANCELLED.</div>';
}
<dt>Payments Received</dt>
<dd><?php echo $o->payments_total(TRUE); ?></dd>
echo Block::factory()
->title(sprintf('%s: %s - %s',_('Invoice'),$o->refnum(),$o->account->name()))
->title_icon('fa fa-edit')
->body($output);
?>
<dt>Credits Applied</dt>
<dd><?php echo $o->total_credits(TRUE); ?></dd>
<dt>Still Due</dt>
<dd><?php echo $o->due(TRUE); ?></dd>
</div>
</div> <!-- /span -->
</div>
<div class="row">
<div class="span11">
<h4>Charge Details</h4>
<?php echo Invoice::instance($o)->render('html','body'); ?>
</div> <!-- /span -->
</div>
<div class="row">
<div class="span5">
<h5>Reminder Details</h5>
<div class="dl-horizontal pull-left">
<?php foreach ($o->reminders() as $eto) : ?>
<dt><?php echo $o->reminders($eto->name,TRUE); ?></dt>
<dd><?php echo $eto->name(); ?></dd>
<?php endforeach ?>
</div>
</div> <!-- /span -->
<div class="span5">
<div class="dl-horizontal pull-right">
<!-- Sub Total -->
<dt>Sub Total</dt>
<dd><?php echo $o->subtotal(TRUE); ?></dd>
<!-- END Invoice Sub Total -->
<!-- Invoice Credits -->
<?php if ($o->total_credits()) : ?>
<dt>Credits</dt>
<dd><?php echo $o->total_credits(TRUE); ?></dd>
<?php endif ?>
<!-- END Invoice Credits -->
<!-- Invoice Discounts Total -->
<?php if ($o->total_discounts()) : ?>
<dt>Discounts</dt>
<dd><?php echo $o->total_discounts(TRUE); ?></dd>
<?php endif ?>
<!-- END Invoice Discounts Total -->
<!-- Invoice Taxes Total -->
<dt>Taxes Included:</dt>
<?php foreach ($o->tax_summary() as $tid => $amount) :
$m = ORM::factory('Tax',$tid); ?>
<dd><?php printf('%s (%s)',Currency::display($amount),$m->description); ?><dd>
<?php endforeach ?>
<!-- END Invoice Taxes Total -->
<!-- Invoice Total -->
<dt>Total Invoice:</dt>
<dd><?php echo $o->total(TRUE); ?></dd>
<!-- END Invoice Total -->
<!-- Account Total Due -->
<dt>Account Due:</dt>
<dd><?php echo $o->account->invoices_due_total(NULL,TRUE); ?></dd>
<!-- END Account Total Due -->
</div>
</div> <!-- /span -->
</div>
<?php echo View::factory('invoice/user/memo')->set('o',$o); ?>
<?php echo View::factory('invoice/user/email')->set('o',$o); ?>