Open Source Billing

This commit is contained in:
Deon George
2013-10-10 13:44:53 +11:00
commit b02d70adf0
2344 changed files with 392978 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
<!-- @todo NEEDS TO BE TRANSLATED -->
<?php echo Form::open(); ?>
<table width="100%">
<tr>
<td style="width: 50%; vertical-align: top;">
<table width="100%">
<tr>
<td style="width: 40%;">Service Active</td>
<td style="width: 60%;" class="data"><?php echo StaticList_YesNo::form('status',$so->status); ?></td>
</tr>
<tr>
<td>Queue</td>
<td class="data"><?php echo $so->display('queue'); ?></td>
</tr>
<tr>
<td>Billing Period</td>
<td class="data"><?php echo StaticList_RecurSchedule::form('recure_schedule',$so->product,$so->recur_schedule);?></td>
</tr>
<tr>
<td>Date Last Invoice</td>
<td class="data"><?php echo $so->display('date_last_invoice'); ?></td>
</tr>
<tr>
<td>Date Next Invoice</td>
<td class="data">
<?php echo Form::input('date_next_invoice',$so->date_next_invoice,array('id'=>'date_next_invoice')); ?>
<?php echo HTML::anchor('#',
HTML::image($mediapath->uri(array('file'=>'img/calendar.png')),array('alt'=>_('Calendar'),'style'=>'cursor: pointer;')),
array('title'=>'Click to popup a dialog to select a date graphically','onclick'=>"dateSelector('date_next_invoice')")); ?>
<script type="text/javascript">defaults['date_next_invoice'] = '%s';</script>
</td>
</tr>
<tr>
<td>Taxable</td>
<td class="data"><?php echo StaticList_YesNo::form('taxable',$so->taxable); ?></td>
</tr>
<tr>
<td>Type</td>
<td class="data"><?php echo StaticList_RecurType::display($so->recur_type); ?></td>
</tr>
<tr>
<td>User Can Change Schedule</td>
<td class="data"><?php echo StaticList_YesNo::form('recur_schedule_change',$so->recur_schedule_change); ?></td>
</tr>
<tr>
<td>User Can Cancel</td>
<td class="data"><?php echo StaticList_YesNo::form('recur_cancel',$so->recur_cancel); ?></td>
</tr>
<tr>
<td>User Can Modify</td>
<td class="data"><?php echo StaticList_YesNo::form('recur_modify',$so->recur_modify); ?></td>
</tr>
<tr>
<td>Suspend Billing</td>
<td class="data"><?php echo StaticList_YesNo::form('suspend_billing',$so->suspend_billing); ?></td>
</tr>
</table>
<?php if ($plugin_form) { echo '<br/>'.$plugin_form; } ?>
<!-- END Service Information -->
</td>
</tr>
</table>
<?php echo Form::submit('submit',_('Update'),array('class'=>'form_button')); ?>
<?php echo Form::close(); ?>

View File

@@ -0,0 +1,40 @@
<?php if ($so->pending_change()) {?>
Pending change to: <?php echo $so->service_change->list_details(); ?>
<?php } ?>
<br/>
<!-- @todo NEEDS TO BE TRANSLATED -->
<table class="list-box-left">
<tr class="list-head">
<th>ID</th>
<th>Invoice</th>
<th>Product</th>
<th>IT</th>
<th>RS</th>
<th>Start</th>
<th>Stop</th>
<th>Desc</th>
<th>Quantity</th>
<th>Charge</th>
</tr>
<?php $lp=NULL; foreach ($so->transactions()->find_all() as $iio) { ?>
<?php if (! is_null($iio->product_id) AND $lp != $iio->product_id) {
$lp = $iio->product_id; ?>
<tr class="list-sub-head">
<th class="id"><?php echo $iio->product_id; ?></th>
<th colspan="9"><?php echo $iio->product->name(); ?></th>
</tr>
<?php } ?>
<tr class="list-data">
<td class="id"><?php echo $iio->id; ?></td>
<td><?php echo HTML::anchor(URL::link('user','invoice/view/'.$iio->invoice_id),$iio->invoice_id); ?></td>
<td><?php echo $iio->display('product_id'); ?></td>
<td><?php echo $iio->display('item_type'); ?></td>
<td><?php echo $iio->display('recurring_schedule'); ?></td>
<td><?php echo $iio->display('date_start'); ?></td>
<td><?php echo $iio->display('date_stop'); ?></td>
<td><?php echo $iio->display('product_name'); ?></td>
<td><?php echo $iio->display('quantity'); ?></td>
<td class="right"><?php echo $iio->display('price_base'); ?></td>
</tr>
<?php } ?>
</table>

View File

@@ -0,0 +1,80 @@
<!-- @todo NEEDS TO BE TRANSLATED -->
<table width="100%">
<tr>
<td>
<!-- Service Information -->
<table class="box-full">
<tr>
<td style="width: 40%;">Account</td>
<td style="width: 60%;" class="data"><?php printf('%s (%s)',$so->account->name(),$so->account->accnum()); ?></td>
</tr>
<tr>
<td>Service Active</td>
<td class="data"><?php echo $so->display('status'); ?></td>
</tr>
<tr>
<td>Billing Period</td>
<td class="data"><?php echo $so->display('recur_schedule');?></td>
</tr>
<tr>
<td>Cost</td>
<td class="data"><?php echo $so->price(TRUE,TRUE); if ($so->pending_change()) echo ' *'; ?></td>
</tr>
<?php if (is_null($so->price) OR ($so->price<=$so->product->price($so->price_group,$so->recur_schedule,'price_base'))) { ?>
<tr>
<td>Service</td>
<td class="data"><?php echo HTML::anchor('product/view/'.$so->product_id,$so->product->name()); ?></td>
</tr>
<?php } ?>
<tr>
<td>Date Next Invoice</td>
<td class="data"><?php echo $so->display('date_next_invoice'); ?></td>
</tr>
<tr>
<td>Current Invoices Due</td>
<td class="data"><?php echo Currency::display($so->account->invoices_due_total()); ?></td>
</tr>
<?php if ($so->service_billing->loaded()) { ?>
<tr>
<td>Direct Debit</td>
<td class="data"><?php echo $so->service_billing->checkout->name; ?></td>
</tr>
<?php } ?>
</table>
<!-- END Service Information -->
</td>
<td style="vertical-align: top;">
<!-- Product Summary Info -->
<?php echo $so->product_feature_summary(); ?>
<!-- END Product Summary Info -->
</td>
</tr>
</table>
<br/>
<?php echo $so->service_view(); ?>
<br/>
<table class="box-left" width="50%">
<tr>
<td class="head" colspan="2">Invoices for this service</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="2">Number</td>
<td>Invoice Date</td>
<td>Due Date</td>
<td>Total</td>
<td>Balance</td>
</tr>
<?php $i=0; foreach ($so->invoice->distinct('id')->order_by('id DESC')->find_all() as $io) { ?>
<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
<td class="icon" width="20px"><?php echo HTML::anchor(URL::link('user','invoice/download/'.$io->id),HTML::image('media/img/gnome-pdf.png',array('alt'=>_('Download'),'width'=>20))); ?></td>
<td class="data"><?php echo HTML::anchor(URL::link('user','invoice/view/'.$io->id),$io->id()); ?></td>
<td class="data"><?php echo $io->display('date_orig'); ?></td>
<td class="data"><?php echo $io->display('due_date'); ?></td>
<td class="data"><?php echo $io->total(TRUE); ?></td>
<td class="data"><?php echo $io->due(TRUE); ?></td>
</tr>
<?php } ?>
</table>