Revamping invoice PDF rendering and standardisation work

This commit is contained in:
Deon George
2016-08-10 16:07:00 +10:00
parent a560c5f4fa
commit 24bb4a701b
27 changed files with 229 additions and 475 deletions

View File

@@ -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());

View File

@@ -44,6 +44,10 @@ class Model_Payment extends ORM_OSB {
'payment_item'=>FALSE,
);
/** REQUIRED ABSTRACT METHODS **/
/** LOCAL METHODS **/
/**
* Add an item to an payment
*/