本文整理汇总了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);
}
示例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();
}
}
}