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

@ -22,7 +22,7 @@ class Controller_Reseller_Account extends Controller_Account {
public function action_list() {
Block::factory()
->title(_('Customer List'))
->title_icon('icon-th-list')
->title_icon('fa fa-list')
->body(Table::factory()
->data(ORM::factory('Account')->where_authorised($this->ao,'id')->find_all())
->jssort('customer')
@ -33,7 +33,7 @@ class Controller_Reseller_Account extends Controller_Account {
'name(TRUE)'=>'Account',
'email'=>'Email',
'invoices_due_total(NULL,TRUE)'=>'Invoices',
'service->list_count()'=>'Services',
'service->find_all()->count()'=>'Services',
))
->prepend(array(
'id'=>array('url'=>URL::link('reseller','account/view/')),
@ -45,20 +45,7 @@ class Controller_Reseller_Account extends Controller_Account {
* Show a list of account logins
*/
public function action_listlog() {
Block::factory()
->title(_('Customer Login Activity'))
->title_icon('icon-eye-open')
->body(Table::factory()
->data(ORM::factory('Account_Log')->where_authorised($this->ao)->find_all())
->page_items(25)
->columns(array(
'id'=>'ID',
'date_orig'=>'Date',
'account->name()'=>'Account',
'ip'=>'IP Address',
'details'=>'Details',
))
);
$this->template->content = View::factory('account/reseller/listlog');
}
public function action_view() {
@ -67,80 +54,7 @@ class Controller_Reseller_Account extends Controller_Account {
if (! $ao->loaded() OR ! $ao->status OR ! Auth::instance()->authorised($ao))
throw HTTP_Exception::factory(403,'Account either doesnt exist, or you are not authorised to see it');
Block::factory()
->title(sprintf('Active Service for Account: %s',$ao->accnum()))
->title_icon('icon-info-sign')
->span(6)
->body(Table::factory()
->data($ao->service->list_active())
->columns(array(
'id'=>'ID',
'service_name()'=>'Service',
))
->prepend(array(
'id'=>array('url'=>URL::link('user','service/view/')),
))
);
Block::factory()
->title(sprintf('Invoices Due Account: %s (%s)',$ao->accnum(),$ao->invoice->list_due_total(TRUE)))
->title_icon('icon-info-sign')
->span(6)
->body(Table::factory()
->data($ao->invoice->list_due())
->columns(array(
'id'=>'ID',
'due_date'=>'Date Due',
'total(TRUE)'=>'Invoice Total',
'due(TRUE)'=>'Amount Due',
))
->prepend(array(
'id'=>array('url'=>URL::link('user','invoice/view/')),
))
);
Block::factory()
->title(sprintf('Services Expiring for Account: %s',$ao->accnum()))
->title_icon('icon-info-sign')
->span(6)
->body(Table::factory()
->data($ao->service->list_expiring())
->columns(array(
'id'=>'ID',
'service_name()'=>'Service',
'expire(TRUE)'=>'Date',
))
->prepend(array(
'id'=>array('url'=>URL::link('user','service/view/')),
))
);
$i = Invoice::instance();
foreach ($ao->service->list_active() as $io)
if (! $io->suspend_billing AND ! $io->external_billing)
$i->add_service($io);
Block::factory()
->title(sprintf('Next Invoice Items for Account: %s',$ao->accnum()))
->title_icon('icon-info-sign')
->span(6)
->body($i->render('html','body',array('noid'=>TRUE)));
Block::factory()
->title(sprintf('InActive Services for Account: %s',$ao->accnum()))
->title_icon('icon-info-sign')
->span(6)
->body(Table::factory()
->data($ao->service->where('status','!=',1)->or_where('status','IS',null)->find_all())
->columns(array(
'id'=>'ID',
'service_name()'=>'Service',
'date_end'=>'Date',
))
->prepend(array(
'id'=>array('url'=>URL::link('user','service/view/')),
))
);
$this->template->content = View::factory('account/reseller/view')->set('o',$ao);
}
}
?>

View File

@ -0,0 +1,15 @@
<?php $o = Auth::instance()->get_user();
echo Block::factory()
->title(_('Customer Login Activity'))
->title_icon('fa fa-eye')
->body(Table::factory()
->data(ORM::factory('Account_Log')->where_authorised($o)->find_all())
->page_items(25)
->columns(array(
'id'=>'ID',
'date_orig'=>'Date',
'account->name()'=>'Account',
'ip'=>'IP Address',
'details'=>'Details',
))
);

View File

@ -1,3 +1,6 @@
<!-- o = Model_Account -->
<?php echo View::factory('service/user/list')->set('o',$o); ?>
<?php echo View::factory('invoice/user/list/due')->set('o',$o); ?>
<?php echo View::factory('service/user/list/expiring')->set('o',$o); ?>
<?php echo View::factory('service/user/list/inactive')->set('o',$o); ?>
<?php echo View::factory('invoice/user/next')->set('o',$o); ?>

View File

@ -19,24 +19,7 @@ class Controller_User_Email extends Controller_Email {
* Show a list of emails
*/
public function action_list() {
Block::factory()
->title(sprintf(_('System Emails Sent for %s: %s'),$this->ao->accnum(),$this->ao->name(TRUE)))
->title_icon('icon-th')
->body(Table::factory()
->page_items(25)
->data($this->ao->email_log->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'=>60),
))
);
$this->template->content = View::factory('email/user/list');
}
public function action_view() {

View File

@ -0,0 +1,19 @@
<?php $o = Auth::instance()->get_user();
echo Block::factory()
->title(sprintf(_('System Emails Sent for %s: %s'),$o->accnum(),$o->name(TRUE)))
->title_icon('fa fa-list')
->body(Table::factory()
->page_items(25)
->data($o->email_log->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'=>60),
))
);

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); ?>

@ -1 +1 @@
Subproject commit 8f659c50c675c427e60a103a19fd3415d0cbbd07
Subproject commit 3bbab271e75e079e8c3d5371064153cabdd3c98d

View File

@ -4,10 +4,10 @@
<label for="date_payment_label">Date Paid</label>
<div class="input-group col-md-3">
<input type="text" id="date_payment_label" value="" xisabled="disabled" class="form-control" placeholder="Date Paid">
<input type="text" id="date_payment_label" value="<?php echo $o->display('date_payment') ?>" xisabled="disabled" class="form-control" placeholder="Date Paid">
<span class="input-group-addon" id="basic-addon1"><i class="fa fa-calendar"></i></span>
</div>
<?php echo Form::hidden('date_payment',''); ?>
<?php echo Form::hidden('date_payment',$o->date_payment); ?>
<?php echo Form::select('checkout_id',ORM::factory('Checkout')->list_select(),$o->checkout_id,array('label'=>'Payment Method','required')); ?>
<?php echo Form::input('total_amt',$o->total_amt,array('label'=>'Amount','placeholder'=>'Total','help-block'=>sprintf('Credits: %s, Balance: %s',$o->credit(),$o->total()))); ?>
@ -26,4 +26,4 @@
<button type="submit" class="btn btn-primary">Save changes</button>
<button type="button" class="btn">Cancel</button>
</div>
</div> <!-- /span -->
</div> <!-- /col-md-11 -->

View File

@ -7,7 +7,7 @@
->data($o->service->list_expiring())
->columns(array(
'id'=>'ID',
'service_name(60)'=>'Service',
'service_name(59)'=>'Service',
'expire(TRUE)'=>'Date',
))
->prepend(array(

View File

@ -0,0 +1,17 @@
<!-- o = Model Account -->
<?php echo Block::factory()
->title(sprintf('InActive Services for Account: %s',$o->accnum()))
->title_icon('fa fa-stop')
->span(6)
->body(Table::factory()
->data($o->service->where('status','!=',1)->or_where('status','IS',null)->find_all())
->columns(array(
'id'=>'ID',
'service_name(60)'=>'Service',
'date_end'=>'Date',
))
->prepend(array(
'id'=>array('url'=>URL::link('user','service/view/')),
))
);
?>