本文整理匯總了PHP中Invoice::getInvoice方法的典型用法代碼示例。如果您正苦於以下問題:PHP Invoice::getInvoice方法的具體用法?PHP Invoice::getInvoice怎麽用?PHP Invoice::getInvoice使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Invoice
的用法示例。
在下文中一共展示了Invoice::getInvoice方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: changePaymentMethod
public function changePaymentMethod()
{
$idUser = Generic::mustCheck($_GET['id_user'], Keys::$ERR_NOT_FOUND_ID_USER);
$idOrder = Generic::mustCheck($_GET['id_order'], Keys::$ERR_NOT_FOUND_ID_ORDER);
$paymentMethod = Generic::mustCheck($_GET['payment_method'], Keys::$ERR_NOT_FOUND_PAYMENT_METHOD);
if (!Util::isLeader($idOrder, $idUser)) {
Generic::errorMsg(Keys::$ERR_CHANGE_PAYMENT_NOT_LEADER);
}
if (!in_array($paymentMethod, Helper::getPaymentTypes())) {
Generic::errorMsg(Keys::$ERR_PAYMENT_TYPE_NOT_ALLOWED);
}
$order = new MasterOrderModel();
$order->getByID($idOrder);
$order->payment_method = $paymentMethod;
$invoice = new Invoice($idOrder, true);
//update totalan di row order model
$order->disc_resto = $invoice->valDiscRestaurant;
$order->disc_bank = $invoice->valDiscBank;
$order->disc_mr = $invoice->valDiscMR;
$order->tax_pb1 = $invoice->valTaxCharge;
$order->service_charge = $invoice->valServiceCharge;
$order->other_charge = $invoice->valOtherCharge;
$order->cc_fee = $invoice->valFeeBank;
$order->mr_fee = $invoice->valFeeMR;
$order->total_cost = $invoice->subTotal;
$order->grand_total = $invoice->grandTotal;
$order->save();
$results['invoice'] = $invoice->getInvoice();
Generic::finish($results);
}
示例2: Invoice
<?php
require 'core/init.php';
?>
<?php
//Create Topics Object
$invoice = new Invoice();
$user = new User();
//Get user From URL
$user_id = isset($_GET['username']) ? $_GET['username'] : null;
//Get Template & Assign Vars
$template = new Template('templates/invoices.php');
$name = getUser()['username'];
$id = htmlspecialchars($_GET["id"]);
$template->invoices = $invoice->getInvoice($id);
$unique = $invoice->getInvoice($id);
$_SESSION['invoice_number'] = $unique->invoice_number;
$_SESSION['create_date'] = $unique->create_date;
$_SESSION['due'] = $unique->due;
$_SESSION['payee'] = $unique->payee;
$_SESSION['amount'] = $unique->amount;
$_SESSION['description'] = $unique->description;
//Setting the id of the invoice
$_SESSION['singleId'] = $id;
//Display template
echo $template;
示例3: addOrderInPendingOrder
//.........這裏部分代碼省略.........
if ($od->quantity > 0) {
//minus biasa
$price = $dish->price * ($od->quantity - 1);
$od->quantity--;
$od->price = $price;
$od->datetime_order = $this->setCurrentDate();
$od->status = "1";
$od->load = 1;
$od->save();
$id = $od->id_order_detail;
break;
}
}
} else {
//habis ga bisa dikurangi
Generic::errorMsg("Not Enough Quantity");
}
} else {
Generic::errorMsg("Not Enough Quantity");
}
} else {
//Notify kl jumlah tidak cukup utk dikurangi
Generic::errorMsg("Not Enough Quantity");
}
}
}
if ($arah == "") {
Generic::errorMsg("Please insert arah");
}
// getcurrent qty dr iddish
// $currQuantity = OrderDetail::getQuantityUserByID_dish($id_dish, $id_order, $id_user);
// $id = $this->addOrderDetails($id_order, $id_user, $id_dish, $currQuantity + 1);
if (!$id) {
Generic::errorMsg("Add order failed!");
}
$objOrder = new MasterOrderModel();
$objOrder->getByID($id_order);
$invoice = $this->calcRechnung($objOrder->id_restaurant, $id_order);
$inv = new Invoice($id_order, true);
$this->setInvoiceInOrder($objOrder, $invoice);
$objOrder->datetime_order = $this->setCurrentDate();
// $objOrder->total_cost = $invoice['Total'];
$objOrder->load = 1;
$id_updateOrder = $objOrder->save();
if (!$id_updateOrder) {
Generic::errorMsg("Update Order failed!");
}
$json = array();
$json['status_code'] = 1;
$json['results']['messages'] = "Success";
$orderDetails = Util::getAllOrderDetailsByIDOrder($id_order);
$orderDetailByDishID = array();
// pr($orderDetails);
$total = array();
foreach ($orderDetails as $det) {
if ($det['status_progress'] != 9) {
// echo "dis ID ".$det['id_dish']." | ".$total[$det['id_dish']]['quantity']." add ".$det['quantity']."<br>";
$total[$det['id_dish']]['quantity'] += $det['quantity'];
}
$string_name = rtrim(trim(preg_replace('/\\s\\s+/', ' ', $det['name'])));
$dish = new MasterDishModel();
$dish->getByID($det['id_dish']);
$total[$det['id_dish']]['id_dish'] = $det['id_dish'];
$total[$det['id_dish']]['name'] = $string_name;
$total[$det['id_dish']]['single_price'] = (double) $dish->price;
$orderDetailByDishID[$det['id_dish']][] = $det;
}
$hasilnya = array();
$all_total = 0;
foreach ($total as $key => $val) {
$sem = array();
$val['price_subtotal'] = $val['quantity'] * $val['single_price'];
$all_total += $val['price_subtotal'];
$sem = $val;
$sem["orders"] = array();
//kelompokan menurut status progess
foreach ($orderDetailByDishID[$key] as $orderDetail) {
$userInstance = Util::createUserInstance($orderDetail["id_user"], $orderDetail["note"], $orderDetail["id_order_detail"]);
$orderDetail['user'] = $userInstance;
if ($orderDetail['order_now'] == 0) {
$sem['orders']['Pending'][] = $orderDetail;
} else {
$sem['orders'][Helper::getStatusProgress()[$orderDetail['status_progress']]][] = $orderDetail;
}
}
$hasilnya[] = $sem;
}
$json['results']['hasil'] = $hasilnya;
$json['results']['alltotal'] = $all_total;
$json['results']['invoice'] = $inv->getInvoice();
$ids = $this->getUserIdByIDOrder($id_order, $id_user);
// $json['results']['push'] = $this->notifyAddOrder($ids, $id_order);
$json['results']['push'] = Util::pushNotifyAddOrder($id_order, $id_user, $id_dish);
echo json_encode($json);
// $json['APA'] = "";
// $json2 =$this->notifyAddOrder($ids, $id_order);
// $json3 = array_merge($json, $json2);
// echo json_encode($json3) ;
die;
}
示例4: Invoice
<?php
require 'core/init.php';
$invoice = new Invoice();
$user = new User();
$searcher = getUser()['user_id'];
$search = $_POST['search'];
$searchIDs = $invoice->search($search);
foreach ($searchIDs as $key) {
foreach ($key as $var => $info) {
// echo $info; "<br/>";
$invoices = $invoice->getInvoice($info);
}
}
//Get Template & Assign Vars
$template = new Template('templates/frontpage.php');
$template->invoices = $invoice->search($search);
//Display template
echo $template;
示例5: getPatient
$invoices = Invoice::getInvoices($patient_id);
$patient = getPatient($patient_id);
//set the backLink
$backLink = "index.php?com=patient&view=patient&patient_id=" . $patient_id;
include 'views/list.php';
break;
case 'edit_invoice':
$user_id = get_current_user_id();
// get all the uninvoiced payments for the a patient..
$payments = Payment::getPayments($patient_id, 0);
$appointments = getAppointments($patient_id);
$patient = getPatient($patient_id);
if (getVar('invoice_id') != NULL) {
$invoice_id = getVar('invoice_id');
}
// if letter_id == NULL -> a call was made to create a new invoice. invoice_id is passed from the create_new_invoice task
$invoice = Invoice::getInvoice($invoice_id);
$invoice_date = new DateTime($invoice->date);
//get all invoice items
$invoice_items = Invoice::getInvoiceItems($invoice_id);
//get the invoice heading for the clinic
$invoice_heading = Invoice::getInvoiceHeading($patient->clinic);
//get the practitioner name for the invoice
$user = get_userdata($patient->practitioner);
//get the signature
$signature = "img/signatures/signature_thierry.png";
//set the backLink
$backLink = "index.php?com=invoice&view=list&patient_id=" . $patient->patient_id;
include 'views/edit_invoice.php';
break;
}