I'm navigate to purchasing list Page it is going fine. But i received error Undefined variable: openInvoice.
in my controller code. What is happening with my code?
Here is Controller code
function openInvoice(){
$today = date('Y/m/d');
$crud = new grocery_CRUD();
//$crud = $this->generate_crud('sales_order');
$crud->columns('date','id','customer_name','due_date','grand_total','amount_received', 'due_payment','delivery_status', 'actions');
$crud->order_by('id','desc');
$crud->where('status','Open');
$crud->where('type','Invoice');
$crud->display_as('date', lang('date'));
$crud->display_as('id', lang('order_no'));
$crud->display_as('customer_name', lang('customer'));
$crud->display_as('due_date', lang('due_date'));
$crud->display_as('grand_total', lang('grand_total'));
$crud->display_as('due_payment', lang('balance'));
$crud->display_as('amount_received', lang('paid'));
$crud->display_as('delivery_status',lang('order_status'));
$crud->display_as('actions', lang('actions'));
$crud->set_table('sales_order');
$crud->callback_column('date',array($this->crud,'_callback_action_date'));
$crud->callback_column('id',array($this->crud,'_callback_action_orderNo'));
$crud->callback_column('due_date',array($this->crud,'_callback_action_dueDate'));
$crud->callback_column('due_payment',array($this->crud,'_callback_action_due_payment'));
$crud->callback_column('grand_total',array($this->crud,'_callback_action_grand_total'));
$crud->callback_column('delivery_status',array($this->crud,'_callback_action_order_status'));
$crud->callback_column('actions',array($this->crud,'_callback_action_all_order'));
$crud->unset_add();
$crud->unset_edit();
$crud->unset_delete();
$crud->unset_read();
$this->mViewData['crud'] = $crud->render();
$this->mViewData['title'] = lang('open_invoice_list');
$this->mTitle .= lang('open_invoice_list');
$this->render('sales/crud');
}
View Code in purchaseList.php
<div class="col-sm-6 col-md-3">
<a class="block block-rounded block-link-hover2 text-center" >
<div class="block-content block-content-full">
<div class="h2 font-w700"><?php echo get_option('currency_symbol').' '.$this->localization->currencyFormat($paid->paid_amount) ?></div>
</div>
<div class="block-content block-content-full block-content-mini bg-danger text-white h4 font-w600"> <span class="h6 badge bg-white-op"><?php echo $openInvoice->invoice_qty ?></span> <?php echo strtoupper(lang('lifetime_paid')) ?></div>
</a>
</div>
Error recieved
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: openInvoice
Filename: purchase/purchase_list.php
Line Number: 31
question from:
https://stackoverflow.com/questions/65834783/a-php-error-was-encounteredmessage-undefined-variable-openinvoice