Revamping invoice PDF rendering and standardisation work
This commit is contained in:
@@ -22,7 +22,7 @@ class Controller_Admin_Payment extends Controller_Payment {
|
||||
Block::factory()
|
||||
->type('form-horizontal')
|
||||
->title('Add/View Payment')
|
||||
->title_icon('icon-wrench')
|
||||
->title_icon($this->icon)
|
||||
->body($this->add_edit());
|
||||
}
|
||||
|
||||
@@ -56,10 +56,10 @@ class Controller_Admin_Payment extends Controller_Payment {
|
||||
$invoices = array();
|
||||
|
||||
// Get our invoices paid by this payment ID
|
||||
$po = ORM::factory('Payment',$this->request->query('pid'));
|
||||
$po = ORM::factory('Payment',$this->request->post('pid'));
|
||||
|
||||
// Get all our other outstanding invoices
|
||||
foreach (ORM::factory('Account',$this->request->query('key'))->invoices_due() as $io) {
|
||||
foreach (ORM::factory('Account',$this->request->post('key'))->invoices_due() as $io) {
|
||||
$pio = $po->payment_item;
|
||||
$pio->invoice_id = $io->id;
|
||||
|
||||
@@ -73,7 +73,7 @@ class Controller_Admin_Payment extends Controller_Payment {
|
||||
public function action_ajaxlist() {
|
||||
$result = array();
|
||||
|
||||
if ($this->request->query('term'))
|
||||
if ($this->request->query('term')) {
|
||||
$result = Arr::merge($result,ORM::factory('Account')->list_autocomplete($this->request->query('term'),'id','id',array('ACC %s: %s'=>array('id','name()'))));
|
||||
$result = Arr::merge($result,ORM::factory('Invoice')->list_autocomplete($this->request->query('term'),'id','account_id',array('INV %s: %s'=>array('id','account->name()'))));
|
||||
}
|
||||
@@ -88,13 +88,15 @@ class Controller_Admin_Payment extends Controller_Payment {
|
||||
Block::factory()
|
||||
->type('form-horizontal')
|
||||
->title(sprintf('%s: %s',_('View Payments Received'),$id))
|
||||
->title_icon('icon-wrench')
|
||||
->title_icon($this->icon)
|
||||
->body($this->add_edit($id,$output));
|
||||
}
|
||||
|
||||
private function add_edit($id=NULL,$output='') {
|
||||
$po = ORM::factory('Payment',$id);
|
||||
|
||||
$this->meta->title = 'Payment: '.$po->refnum(TRUE);
|
||||
|
||||
if ($this->request->post()) {
|
||||
$po->values($this->request->post());
|
||||
|
||||
|
@@ -44,6 +44,10 @@ class Model_Payment extends ORM_OSB {
|
||||
'payment_item'=>FALSE,
|
||||
);
|
||||
|
||||
/** REQUIRED ABSTRACT METHODS **/
|
||||
|
||||
/** LOCAL METHODS **/
|
||||
|
||||
/**
|
||||
* Add an item to an payment
|
||||
*/
|
||||
|
@@ -1,10 +1,10 @@
|
||||
<div class="col-md-11">
|
||||
<div class="col-md-12">
|
||||
<fieldset>
|
||||
<legend>Payment Details</legend>
|
||||
|
||||
<label for="date_payment_label">Date Paid</label>
|
||||
<div class="input-group col-md-3">
|
||||
<input type="text" id="date_payment_label" value="<?php echo $o->display('date_payment') ?>" xisabled="disabled" class="form-control" placeholder="Date Paid">
|
||||
<div class="input-group col-md-2">
|
||||
<input type="text" id="date_payment_label" value="<?php echo date('d-m-Y',$o->date_payment); ?>" 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',$o->date_payment); ?>
|
||||
@@ -17,13 +17,15 @@
|
||||
<?php echo Form::input('notes',$o->notes,array('label'=>'Notes','placeholder'=>'Any notes about this payment?')); ?>
|
||||
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div class="col-md-11">
|
||||
<div class="col-md-8" id="items"></div>
|
||||
</div>
|
||||
<fieldset class="col-md-8">
|
||||
<legend>Invoice Details</legend>
|
||||
|
||||
<div class="row">
|
||||
<button type="submit" class="btn btn-primary">Save changes</button>
|
||||
<button type="button" class="btn">Cancel</button>
|
||||
</div>
|
||||
</div> <!-- /col-md-11 -->
|
||||
<div id="items"></div>
|
||||
</fieldset>
|
||||
|
||||
<div class="row col-md-12">
|
||||
<button type="submit" class="btn btn-primary">Save changes</button>
|
||||
<button type="button" class="btn">Cancel</button>
|
||||
</div>
|
||||
|
@@ -14,19 +14,19 @@
|
||||
<tbody>
|
||||
<?php $c=0;foreach ($o->subitems('ALLOC') as $pio) : ?>
|
||||
<tr>
|
||||
<td><?php echo HTML::anchor(URL::link('user','invoice/view/'.$pio->invoice_id),$pio->invoice->id()); ?></td>
|
||||
<td><?php echo HTML::anchor(URL::link('user','invoice/view/'.$pio->invoice_id),$pio->invoice->refnum(TRUE)); ?></td>
|
||||
<td><?php echo $pio->invoice->display('date_orig'); ?></td>
|
||||
<td><?php echo $pio->invoice->display('due_date'); ?></td>
|
||||
<td class="text-right"><?php echo $pio->invoice->total(TRUE); ?></td>
|
||||
<td class="text-right"><?php echo $pio->invoice->payments_total(TRUE); ?></td>
|
||||
<td class="text-right"><?php echo $pio->invoice->due(TRUE); ?></td>
|
||||
<td class="text-right"><?php echo Form::input('payment_item['.$pio->invoice_id.']',$pio->display('alloc_amt'),array('class'=>'span1','nocg'=>TRUE,'tabindex'=>++$c)); ?></td>
|
||||
<td class="text-right"><?php echo Form::input('payment_item['.$pio->invoice_id.']',$pio->display('alloc_amt'),array('nocg'=>TRUE,'class'=>'text-right','tabindex'=>++$c)); ?></td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
|
||||
<tr>
|
||||
<td class="text-right" colspan="6">Unapplied</td>
|
||||
<td class="text-right"><?php echo Form::input('invoice_item[excess]',$o->balance(TRUE),array('class'=>'span1','nocg'=>TRUE,'disabled'=>'disabled')); ?></td>
|
||||
<td class="text-right"><?php echo Form::input('invoice_item[excess]',$o->balance(TRUE),array('nocg'=>TRUE,'class'=>'text-right','disabled'=>'disabled')); ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
Reference in New Issue
Block a user