本文整理汇总了PHP中Invoice::getStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP Invoice::getStatus方法的具体用法?PHP Invoice::getStatus怎么用?PHP Invoice::getStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Invoice
的用法示例。
在下文中一共展示了Invoice::getStatus方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pdf
/**
* Render invoice PDF
*
* @param void
* @return null
*/
function pdf()
{
if ($this->active_invoice->isNew()) {
$this->httpError(HTTP_ERR_NOT_FOUND);
}
// if
if ($this->active_invoice->getStatus() == INVOICE_STATUS_DRAFT) {
$this->httpError(HTTP_ERR_NOT_FOUND);
}
// if
require_once INVOICING_MODULE_PATH . '/models/InvoicePdf.class.php';
InvoicePDF::download($this->active_invoice, lang('#:invoice_id.pdf', array('invoice_id' => $this->active_invoice->getName())));
die;
}
示例2: encodeInvoice
public function encodeInvoice(Invoice $invoice)
{
$data = ['id' => $invoice->getId(), 'number' => $invoice->getNumber(), 'name' => $invoice->getName(), 'created' => $invoice->getCreated(), 'delivered' => $invoice->getDelivered(), 'due' => $invoice->getDue(), 'status' => $invoice->getStatus(), 'variable_symbol' => $invoice->getVariableSymbol(), 'constant_symbol' => $invoice->getConstantSymbol(), 'description' => $invoice->getDescription(), 'items' => $this->encodeItems($invoice->getItems()), 'price' => $invoice->getPrice(), 'price_total' => $invoice->getPriceTotal(), 'currency' => $invoice->getCurrency()];
if ($invoice->getClient()) {
$data['client'] = $this->encodeClient($invoice->getClient());
}
if ($invoice->getShippingAddress()) {
$data['shipping_address'] = $this->encodeAddress($invoice->getShippingAddress());
}
if ($invoice->getDiscount() && $invoice->getDiscount()->getType() != 'none') {
$data['discount'] = ['type' => $invoice->getDiscount()->getType(), 'value' => $invoice->getDiscount()->getValue()];
}
return json_encode(['invoice' => $data]);
}
示例3: executeCommission
public function executeCommission(sfWebRequest $request)
{
$requestparams = $request->getParameter("invoice");
$day = $requestparams["date"]["day"];
$month = $requestparams["date"]["month"];
$year = $requestparams["date"]["year"];
//if no date, date is today. else date is date given
if (!$year or !$month or !$day) {
$date = MyDateTime::today();
} else {
$date = new MyDateTime($year, $month, $day, 0, 0, 0);
}
$invoice = new Invoice();
$invoice->setDate($date->getstartofmonth()->tomysql());
$purchase = new Purchase();
$purchase->setDate($date->getendofmonth()->tomysql());
$this->date = $date;
$this->form = new InvoiceForm($invoice);
$this->toform = new PurchaseForm($purchase);
//set up an array of employees indexed by employee id
$this->rawemployees = Doctrine_Query::create()->from('Employee e')->where('e.commission > 0 ')->execute();
$this->employees = array();
foreach ($this->rawemployees as $employee) {
$this->employees[$employee->getId()] = $employee;
}
$this->empinvoices = array();
foreach ($this->employees as $employee) {
$this->empinvoices[$employee->getId()] = Doctrine_Query::create()->from('Invoice i, i.Employee e, i.Invoicedetail id, id.Product p')->where('i.salesman_id=' . $employee->getId())->andwhere('i.date >= "' . $invoice->getDate() . '"')->andwhere('i.date <= "' . $purchase->getDate() . '"')->orWhere('i.technician_id=' . $employee->getId())->andwhere('i.date >= "' . $invoice->getDate() . '"')->andwhere('i.date <= "' . $purchase->getDate() . '"')->orderBy('i.invno')->execute();
}
$commissiontotals = array();
foreach ($this->empinvoices as $empid => $employeedata) {
$totalcommission = 0;
foreach ($employeedata as $invoice) {
if ($invoice->getStatus() == "Paid") {
$totalcommission += $invoice->getCommissionTotal($this->employees[$empid]);
}
}
$commissiontotals[$empid] = $totalcommission;
}
$this->commissiontotals = $commissiontotals;
$this->grandtotalcommission = 0;
foreach ($commissiontotals as $total) {
$this->grandtotalcommission += $total;
}
}
示例4: setInvoice
/**
* Set invoice
*
* @param Invoice $invoice
* @return void
*/
function setInvoice($invoice)
{
$this->invoice = $invoice;
$this->invoice_label = $this->invoice->getStatus() == INVOICE_STATUS_DRAFT ? lang('PRO FORMA :num', array('num' => $this->invoice->getName(true)), true, $this->invoice->getLanguage()) : lang('INVOICE :num', array('num' => $this->invoice->getName(true)), true, $this->invoice->getLanguage());
}