本文整理汇总了PHP中OrderInvoice::getByDateInterval方法的典型用法代码示例。如果您正苦于以下问题:PHP OrderInvoice::getByDateInterval方法的具体用法?PHP OrderInvoice::getByDateInterval怎么用?PHP OrderInvoice::getByDateInterval使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OrderInvoice
的用法示例。
在下文中一共展示了OrderInvoice::getByDateInterval方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postProcess
public function postProcess()
{
if (Tools::isSubmit('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.');
}
} elseif (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();
}
}
示例2: processGenerateInvoicesPDF
public function processGenerateInvoicesPDF()
{
$order_invoice_collection = OrderInvoice::getByDateInterval(Tools::getValue('date_from'), Tools::getValue('date_to'));
if (!count($order_invoice_collection)) {
die(Tools::displayError('No invoice was found.'));
}
$this->generatePDF($order_invoice_collection, PDF::TEMPLATE_INVOICE);
}
示例3: processGenerateInvoicesPDF
public function processGenerateInvoicesPDF()
{
$order_invoice_collection = OrderInvoice::getByDateInterval(Tools::getValue('date_from'), Tools::getValue('date_to'));
if (!count($order_invoice_collection)) {
die($this->trans('No invoice was found.', array(), 'Admin.OrdersCustomers.Notification'));
}
$this->generatePDF($order_invoice_collection, PDF::TEMPLATE_INVOICE);
}