@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | { |
| 16 | 16 | $tableNames = config('soap.invoices.table_names'); |
| 17 | 17 | |
| 18 | - Schema::create($tableNames['invoices'], function (Blueprint $table) { |
|
| 18 | + Schema::create($tableNames['invoices'], function(Blueprint $table) { |
|
| 19 | 19 | $table->uuid('id')->primary(); |
| 20 | 20 | $table->uuid('related_id'); |
| 21 | 21 | $table->string('related_type'); |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $table->index(['invoicable_id', 'invoicable_type']); |
| 38 | 38 | }); |
| 39 | 39 | |
| 40 | - Schema::create($tableNames['invoice_lines'], function (Blueprint $table) { |
|
| 40 | + Schema::create($tableNames['invoice_lines'], function(Blueprint $table) { |
|
| 41 | 41 | $table->uuid('id')->primary(); |
| 42 | 42 | $table->bigInteger('amount')->default(0)->description('in cents, including tax'); |
| 43 | 43 | $table->bigInteger('tax')->default(0)->description('in cents'); |
@@ -64,11 +64,11 @@ |
||
| 64 | 64 | return (string) $this->currency; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - /** |
|
| 68 | - * Sets the current currency |
|
| 69 | - * @param $currency The currency (i.e. 'EUR') |
|
| 70 | - * @return Void |
|
| 71 | - */ |
|
| 67 | + /** |
|
| 68 | + * Sets the current currency |
|
| 69 | + * @param $currency The currency (i.e. 'EUR') |
|
| 70 | + * @return Void |
|
| 71 | + */ |
|
| 72 | 72 | public function setCurrency(string $currency) |
| 73 | 73 | { |
| 74 | 74 | $this->currency = $currency; |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | * @var array |
| 17 | 17 | */ |
| 18 | 18 | protected $fillable = [ |
| 19 | - 'related_id', 'related_type', 'tax', 'total', 'discount', 'currency', |
|
| 19 | + 'related_id', 'related_type', 'tax', 'total', 'discount', 'currency', |
|
| 20 | 20 | 'reference', 'status', 'receiver_info', 'sender_info', 'payment_info', 'note', 'is_bill' |
| 21 | 21 | ]; |
| 22 | 22 | |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | { |
| 29 | 29 | parent::boot(); |
| 30 | 30 | static::addGlobalScope(new BillScope()); |
| 31 | - static::creating(function ($model) { |
|
| 31 | + static::creating(function($model) { |
|
| 32 | 32 | /** |
| 33 | 33 | * @var \Illuminate\Database\Eloquent\Model $model |
| 34 | 34 | */ |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | { |
| 30 | 30 | parent::boot(); |
| 31 | 31 | static::addGlobalScope(new InvoiceScope()); |
| 32 | - static::creating(function ($model) { |
|
| 32 | + static::creating(function($model) { |
|
| 33 | 33 | /** |
| 34 | 34 | * @var \Illuminate\Database\Eloquent\Model $model |
| 35 | 35 | */ |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | protected static function boot() |
| 35 | 35 | { |
| 36 | 36 | parent::boot(); |
| 37 | - static::creating(function ($model) { |
|
| 37 | + static::creating(function($model) { |
|
| 38 | 38 | /** |
| 39 | 39 | * @var \Illuminate\Database\Eloquent\Model $model |
| 40 | 40 | */ |
@@ -177,9 +177,9 @@ |
||
| 177 | 177 | $free = $lines->where('is_free', true)->toBase(); |
| 178 | 178 | $complimentary = $lines->where('is_complimentary', true)->toBase(); |
| 179 | 179 | $other = $lines |
| 180 | - ->where('is_free', false) |
|
| 181 | - ->where('is_complimentary', false) |
|
| 182 | - ->toBase(); |
|
| 180 | + ->where('is_free', false) |
|
| 181 | + ->where('is_complimentary', false) |
|
| 182 | + ->toBase(); |
|
| 183 | 183 | |
| 184 | 184 | $this->bill->total = $other->sum('amount'); |
| 185 | 185 | $this->bill->tax = $other->sum('tax'); |
@@ -213,11 +213,11 @@ discard block |
||
| 213 | 213 | */ |
| 214 | 214 | public function pdf(array $data = []): string |
| 215 | 215 | { |
| 216 | - if (! defined('DOMPDF_ENABLE_AUTOLOAD')) { |
|
| 216 | + if (!defined('DOMPDF_ENABLE_AUTOLOAD')) { |
|
| 217 | 217 | define('DOMPDF_ENABLE_AUTOLOAD', false); |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | - if (file_exists($configPath = base_path().'/vendor/dompdf/dompdf/dompdf_config.inc.php')) { |
|
| 220 | + if (file_exists($configPath = base_path() . '/vendor/dompdf/dompdf/dompdf_config.inc.php')) { |
|
| 221 | 221 | require_once $configPath; |
| 222 | 222 | } |
| 223 | 223 | |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | |
| 237 | 237 | return new Response($this->pdf($data), 200, [ |
| 238 | 238 | 'Content-Description' => 'File Transfer', |
| 239 | - 'Content-Disposition' => 'attachment; filename="'.$filename.'"', |
|
| 239 | + 'Content-Disposition' => 'attachment; filename="' . $filename . '"', |
|
| 240 | 240 | 'Content-Transfer-Encoding' => 'binary', |
| 241 | 241 | 'Content-Type' => 'application/pdf', |
| 242 | 242 | ]); |
@@ -105,11 +105,11 @@ |
||
| 105 | 105 | |
| 106 | 106 | protected function registerServices() |
| 107 | 107 | { |
| 108 | - $this->app->bind(InvoiceServiceInterface::class, function ($app) { |
|
| 108 | + $this->app->bind(InvoiceServiceInterface::class, function($app) { |
|
| 109 | 109 | return new InvoiceService(); |
| 110 | 110 | }); |
| 111 | 111 | |
| 112 | - $this->app->bind(BillServiceInterface::class, function ($app) { |
|
| 112 | + $this->app->bind(BillServiceInterface::class, function($app) { |
|
| 113 | 113 | return new BillService(); |
| 114 | 114 | }); |
| 115 | 115 | } |
@@ -11,10 +11,10 @@ |
||
| 11 | 11 | class Invoice extends Facade |
| 12 | 12 | { |
| 13 | 13 | /** |
| 14 | - * Get the registered name of the component. |
|
| 15 | - * |
|
| 16 | - * @return string |
|
| 17 | - */ |
|
| 14 | + * Get the registered name of the component. |
|
| 15 | + * |
|
| 16 | + * @return string |
|
| 17 | + */ |
|
| 18 | 18 | protected static function getFacadeAccessor() |
| 19 | 19 | { |
| 20 | 20 | return 'invoice'; |