当前位置: 首页>>代码示例>>PHP>>正文


PHP OrderInvoice::getByStatus方法代码示例

本文整理汇总了PHP中OrderInvoice::getByStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP OrderInvoice::getByStatus方法的具体用法?PHP OrderInvoice::getByStatus怎么用?PHP OrderInvoice::getByStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OrderInvoice的用法示例。


在下文中一共展示了OrderInvoice::getByStatus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processGenerateInvoicesPDF2

 public function processGenerateInvoicesPDF2()
 {
     $order_invoice_collection = array();
     foreach (explode('-', Tools::getValue('id_order_state')) as $id_order_state) {
         if (is_array($order_invoices = OrderInvoice::getByStatus((int) $id_order_state))) {
             $order_invoice_collection = array_merge($order_invoices, $order_invoice_collection);
         }
     }
     if (!count($order_invoice_collection)) {
         die(Tools::displayError('No invoice was found.'));
     }
     $this->generatePDF($order_invoice_collection, PDF::TEMPLATE_INVOICE);
 }
开发者ID:jpodracky,项目名称:dogs,代码行数:13,代码来源:AdminPdfController.php

示例2: postProcess

 public function postProcess()
 {
     if (Tools::getValue('submitAddinvoice_date')) {
         if (!Validate::isDate(Tools::getValue('date_from'))) {
             $this->errors[] = $this->l('Invalid "From" date');
         }
         if (!Validate::isDate(Tools::getValue('date_to'))) {
             $this->errors[] = $this->l('Invalid "To" date');
         }
         if (!count($this->errors)) {
             if (count(OrderInvoice::getByDateInterval(Tools::getValue('date_from'), Tools::getValue('date_to')))) {
                 Tools::redirectAdmin($this->context->link->getAdminLink('AdminPdf') . '&submitAction=generateInvoicesPDF&date_from=' . urlencode(Tools::getValue('date_from')) . '&date_to=' . urlencode(Tools::getValue('date_to')));
             }
             $this->errors[] = $this->l('No invoice has been found for this period.');
         }
     } else {
         if (Tools::isSubmit('submitAddinvoice_status')) {
             if (!is_array($status_array = Tools::getValue('id_order_state')) || !count($status_array)) {
                 $this->errors[] = $this->l('You must select at least one order status.');
             } else {
                 foreach ($status_array as $id_order_state) {
                     if (count(OrderInvoice::getByStatus((int) $id_order_state))) {
                         Tools::redirectAdmin($this->context->link->getAdminLink('AdminPdf') . '&submitAction=generateInvoicesPDF2&id_order_state=' . implode('-', $status_array));
                     }
                 }
                 $this->errors[] = $this->l('No invoice has been found for this status.');
             }
         } else {
             parent::postProcess();
         }
     }
 }
开发者ID:toufikadfab,项目名称:PrestaShop-1.5,代码行数:32,代码来源:AdminInvoicesController.php


注:本文中的OrderInvoice::getByStatus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。