add payments by invoice
This commit is contained in:
@@ -37,10 +37,10 @@ class InvoicePayments
|
||||
|
||||
public static function getPaymentType($id)
|
||||
{
|
||||
return self::PaymentTypes()[$id] ?? false;
|
||||
return self::paymentTypes()[$id] ?? false;
|
||||
}
|
||||
|
||||
public static function PaymentTypes()
|
||||
public static function paymentTypes()
|
||||
{
|
||||
return [
|
||||
'',
|
||||
|
||||
@@ -13,7 +13,7 @@ class Invoices
|
||||
|
||||
public static function getInvoiceHtml($id)
|
||||
{
|
||||
$invoice = self::get($id, ['order.customer', 'order.delivery_address', 'order.detail']);
|
||||
$invoice = self::getFull($id);
|
||||
$order = $invoice->order;
|
||||
$customer = $order->customer;
|
||||
unset($invoice->order, $order->customer);
|
||||
@@ -26,6 +26,19 @@ class Invoices
|
||||
return view('Shop.Invoices.mail', $data)->render();
|
||||
}
|
||||
|
||||
public static function init()
|
||||
{
|
||||
return [
|
||||
'statuses' => Invoices::statuses(),
|
||||
'payment_types' => InvoicePayments::paymentTypes(),
|
||||
];
|
||||
}
|
||||
|
||||
public static function getFull($id)
|
||||
{
|
||||
return self::get($id, ['address', 'order.customer', 'order.delivery_address', 'order.detail']);
|
||||
}
|
||||
|
||||
public static function getByUUID($uuid)
|
||||
{
|
||||
return Invoice::byUUID($uuid)->first();
|
||||
|
||||
Reference in New Issue
Block a user