From 32e956151f0e069e6ecf0349a060e82b5693a71a Mon Sep 17 00:00:00 2001 From: cupcake Date: Tue, 16 Aug 2022 00:03:52 +0800 Subject: [PATCH] chore: fix typo --- Classes/Invoice.php | 10 +++++----- Config/invoices.php | 2 +- Templates/default.blade.php | 2 +- docs/1/readme.md | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Classes/Invoice.php b/Classes/Invoice.php index 1135bc4..8245d09 100644 --- a/Classes/Invoice.php +++ b/Classes/Invoice.php @@ -213,19 +213,19 @@ public function template($template = 'default') * * @param string $name * @param int $price - * @param int $ammount + * @param int $amount * @param string $id * @param string $imageUrl * * @return self */ - public function addItem($name, $price, $ammount = 1, $id = '-', $imageUrl = null) + public function addItem($name, $price, $amount = 1, $id = '-', $imageUrl = null) { $this->items->push(Collection::make([ 'name' => $name, 'price' => $price, - 'ammount' => $ammount, - 'totalPrice' => number_format(bcmul($price, $ammount, $this->decimals), $this->decimals), + 'amount' => $amount, + 'totalPrice' => number_format(bcmul($price, $amount, $this->decimals), $this->decimals), 'id' => $id, 'imageUrl' => $imageUrl, ])); @@ -272,7 +272,7 @@ public function formatCurrency() private function subTotalPrice() { return $this->items->sum(function ($item) { - return bcmul($item['price'], $item['ammount'], $this->decimals); + return bcmul($item['price'], $item['amount'], $this->decimals); }); } diff --git a/Config/invoices.php b/Config/invoices.php index 91aca04..7667357 100644 --- a/Config/invoices.php +++ b/Config/invoices.php @@ -86,7 +86,7 @@ | | The tax type accepted values are: 'percentage' and 'fixed'. | The percentage type calculates the tax depending on the invoice price, and - | the fixed type simply adds a fixed ammount to the total price. + | the fixed type simply adds a fixed amount to the total price. | You can't mix percentage and fixed tax rates. */ 'tax_rates' => [ diff --git a/Templates/default.blade.php b/Templates/default.blade.php index 1b81c46..77e1d31 100644 --- a/Templates/default.blade.php +++ b/Templates/default.blade.php @@ -154,7 +154,7 @@ {{ $item->get('id') }} {{ $item->get('name') }} {{ $item->get('price') }} {{ $invoice->formatCurrency()->symbol }} - {{ $item->get('ammount') }} + {{ $item->get('amount') }} {{ $item->get('totalPrice') }} {{ $invoice->formatCurrency()->symbol }} @endforeach diff --git a/docs/1/readme.md b/docs/1/readme.md index b2048d1..31a7be9 100644 --- a/docs/1/readme.md +++ b/docs/1/readme.md @@ -438,7 +438,7 @@ Select template for invoice. ### addItem - \ConsoleTVs\Invoices\Classes\Invoice ConsoleTVs\Invoices\Classes\Invoice::addItem(string $name, integer $price, integer $ammount, string $id) + \ConsoleTVs\Invoices\Classes\Invoice ConsoleTVs\Invoices\Classes\Invoice::addItem(string $name, integer $price, integer $amount, string $id) Adds an item to the invoice. @@ -450,7 +450,7 @@ Adds an item to the invoice. #### Arguments * $name **string** * $price **integer** -* $ammount **integer** +* $amount **integer** * $id **string**