mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 08:12:15 +00:00
Delete invoice
This commit is contained in:
@@ -73,10 +73,8 @@ class ClientController extends Controller
|
||||
*/
|
||||
public function destroy(Client $client)
|
||||
{
|
||||
if ($client->user_id === Auth::id()) {
|
||||
$client->delete();
|
||||
$client->delete();
|
||||
|
||||
return response('Done', 204);
|
||||
}
|
||||
return response('Done', 204);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,6 +127,17 @@ class InvoiceController extends Controller
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Invoice $invoice
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function destroy(Invoice $invoice)
|
||||
{
|
||||
$invoice->delete();
|
||||
|
||||
return response('Done', 204);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param StoreInvoiceRequest $request
|
||||
* @return mixed
|
||||
|
||||
@@ -85,7 +85,7 @@ function invoice_total_discount($invoice, $format = false)
|
||||
// Percent discount
|
||||
if ($invoice['discount_type'] === 'percent') {
|
||||
|
||||
$discount = (invoice_total_net($invoice) + invoice_total_tax($invoice)) * ($invoice['discount_rate'] / 100);
|
||||
$discount = (int) (invoice_total_net($invoice) + invoice_total_tax($invoice)) * ($invoice['discount_rate'] / 100);
|
||||
|
||||
if ($format) {
|
||||
return Cashier::formatAmount($discount * 100, $invoice['currency'], 'cs');
|
||||
@@ -153,5 +153,5 @@ function invoice_total_tax($invoice, $format = false)
|
||||
*/
|
||||
function format_to_currency($value, $currency = 'CZK', $locale = 'cs')
|
||||
{
|
||||
return Cashier::formatAmount(($value * 100), $currency, $locale);
|
||||
return Cashier::formatAmount(((int) $value * 100), $currency, $locale);
|
||||
}
|
||||
Reference in New Issue
Block a user