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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user