Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.9k views
in Technique[技术] by (71.8m points)

A PHP Error was encountered:Message: Undefined variable: openInvoice

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...