@@ -8,10 +8,10 @@ |
||
| 8 | 8 | |
| 9 | 9 | class TaxRateService extends BaseService |
| 10 | 10 | { |
| 11 | - public function __construct(TaxRateRepository $taxRate) |
|
| 12 | - { |
|
| 13 | - $this->repo = $taxRate; |
|
| 14 | - } |
|
| 11 | + public function __construct(TaxRateRepository $taxRate) |
|
| 12 | + { |
|
| 13 | + $this->repo = $taxRate; |
|
| 14 | + } |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * The validation rules for the model. |
@@ -26,8 +26,8 @@ |
||
| 26 | 26 | 'rate' => 'numeric|required' |
| 27 | 27 | ); |
| 28 | 28 | |
| 29 | - if($taxRateId) { |
|
| 30 | - $rules['title'] = $rules['title'].','.$taxRateId.' = id'; |
|
| 29 | + if ($taxRateId) { |
|
| 30 | + $rules['title'] = $rules['title'].','.$taxRateId.' = id'; |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | return $rules; |
@@ -9,10 +9,10 @@ discard block |
||
| 9 | 9 | |
| 10 | 10 | class RedirectService extends BaseService |
| 11 | 11 | { |
| 12 | - public function __construct(RedirectRepository $taxRate) |
|
| 13 | - { |
|
| 14 | - $this->repo = $taxRate; |
|
| 15 | - } |
|
| 12 | + public function __construct(RedirectRepository $taxRate) |
|
| 13 | + { |
|
| 14 | + $this->repo = $taxRate; |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * The validation rules for the model. |
@@ -85,10 +85,10 @@ discard block |
||
| 85 | 85 | $attributes['active'] = 1; |
| 86 | 86 | } |
| 87 | 87 | $model = $this->find($result->id); |
| 88 | - $model->fill($attributes); |
|
| 89 | - $model->save(); |
|
| 88 | + $model->fill($attributes); |
|
| 89 | + $model->save(); |
|
| 90 | 90 | |
| 91 | - return $model; |
|
| 91 | + return $model; |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | } else { |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | $result = $this->repo->getModel()->where('url', '=', $attributes['url'])->get()->first(); |
| 82 | 82 | if ($result) { |
| 83 | 83 | $attributes['active'] = 0; |
| 84 | - if($attributes['redirect_url']) { |
|
| 84 | + if ($attributes['redirect_url']) { |
|
| 85 | 85 | $attributes['active'] = 1; |
| 86 | 86 | } |
| 87 | 87 | $model = $this->find($result->id); |
@@ -9,8 +9,8 @@ |
||
| 9 | 9 | |
| 10 | 10 | class InvoiceService extends BaseService |
| 11 | 11 | { |
| 12 | - public function __construct(InvoiceRepository $invoice) |
|
| 13 | - { |
|
| 14 | - $this->repo = $invoice; |
|
| 15 | - } |
|
| 12 | + public function __construct(InvoiceRepository $invoice) |
|
| 13 | + { |
|
| 14 | + $this->repo = $invoice; |
|
| 15 | + } |
|
| 16 | 16 | } |
| 17 | 17 | \ No newline at end of file |
@@ -33,6 +33,6 @@ |
||
| 33 | 33 | |
| 34 | 34 | function selectAllByInvoiceId($orderId) |
| 35 | 35 | { |
| 36 | - return $this->model->where('order_id', '=', $orderId)->get(); |
|
| 36 | + return $this->model->where('order_id', '=', $orderId)->get(); |
|
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | \ No newline at end of file |
@@ -15,11 +15,11 @@ |
||
| 15 | 15 | protected $table = 'invoice'; |
| 16 | 16 | |
| 17 | 17 | // Add the 'avatar' attachment to the fillable array so that it's mass-assignable on this model. |
| 18 | - protected $fillable = ['order_id', 'type', 'client_id', 'shop_id', 'price_with_tax', 'price_without_tax', 'bill_invoice_address_id', 'delivery_invoice_address_id',]; |
|
| 18 | + protected $fillable = ['order_id', 'type', 'client_id', 'shop_id', 'price_with_tax', 'price_without_tax', 'bill_invoice_address_id', 'delivery_invoice_address_id', ]; |
|
| 19 | 19 | |
| 20 | 20 | public static function boot() |
| 21 | 21 | { |
| 22 | - static::creating(function ($model) { |
|
| 22 | + static::creating(function($model) { |
|
| 23 | 23 | |
| 24 | 24 | $order = Invoice::whereNotNull('client_id')->where('shop_id', '=', $model->shop_id)->where('created_at', '>=', Carbon::now()->year)->orderBy('created_at', 'desc')->first(); |
| 25 | 25 | $shop = Shop::find($model->shop_id); |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | |
| 99 | 99 | if($event->order->type == 'pre_order') { |
| 100 | 100 | |
| 101 | - }elseif($event->order->type == 'from_stock') { |
|
| 101 | + } elseif($event->order->type == 'from_stock') { |
|
| 102 | 102 | |
| 103 | 103 | } |
| 104 | 104 | |
@@ -20,13 +20,13 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | public function handle(OrderChangeStatus $event) |
| 22 | 22 | { |
| 23 | - if($event->order->shop->wholesale) { |
|
| 23 | + if ($event->order->shop->wholesale) { |
|
| 24 | 24 | |
| 25 | 25 | if ($event->status->send_email_to_customer) { |
| 26 | 26 | |
| 27 | 27 | if ($event->status->orderStatusEmailTemplate) { |
| 28 | 28 | |
| 29 | - $destinationPath = storage_path() . "/app"; |
|
| 29 | + $destinationPath = storage_path()."/app"; |
|
| 30 | 30 | $orderStatusEmailFromResult = GeneralSettingService::selectOneByShopIdAndName($event->order->shop_id, 'order-status-email-from'); |
| 31 | 31 | |
| 32 | 32 | $orderStatusEmailFrom = '[email protected]'; |
@@ -44,12 +44,12 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | $orderStatusEmailBcc = '[email protected]'; |
| 46 | 46 | $language = 'en'; |
| 47 | - if(strtoupper($event->order->orderBillAddress->country) == 'NL') { |
|
| 47 | + if (strtoupper($event->order->orderBillAddress->country) == 'NL') { |
|
| 48 | 48 | $language = 'nl'; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| 52 | - Mail::send('frontend.email.order-status', ['content' => Cart::replaceTags($event->status->orderStatusEmailTemplate->translate($language)->content, $event->order)], function ($message) use ($event, $destinationPath, $orderStatusEmailFrom, $orderStatusEmailName, $orderStatusEmailBcc, $language) { |
|
| 52 | + Mail::send('frontend.email.order-status', ['content' => Cart::replaceTags($event->status->orderStatusEmailTemplate->translate($language)->content, $event->order)], function($message) use ($event, $destinationPath, $orderStatusEmailFrom, $orderStatusEmailName, $orderStatusEmailBcc, $language) { |
|
| 53 | 53 | $message->from($orderStatusEmailFrom, $orderStatusEmailName); |
| 54 | 54 | $message->to($event->order->client->email, $event->order->orderBillAddress->firstname)->subject(Cart::replaceTags($event->status->orderStatusEmailTemplate->translate($language)->subject, $event->order)); |
| 55 | 55 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | if ($event->order and $event->status->attach_order_to_email) { |
| 61 | 61 | $pdfText = ""; |
| 62 | 62 | $sign = '€'; |
| 63 | - if($event->order->client->usd) { |
|
| 63 | + if ($event->order->client->usd) { |
|
| 64 | 64 | $sign = '$'; |
| 65 | 65 | } |
| 66 | 66 | |
@@ -83,9 +83,9 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - if($event->order->type == 'pre_order') { |
|
| 86 | + if ($event->order->type == 'pre_order') { |
|
| 87 | 87 | |
| 88 | - }elseif($event->order->type == 'from_stock') { |
|
| 88 | + }elseif ($event->order->type == 'from_stock') { |
|
| 89 | 89 | |
| 90 | 90 | } |
| 91 | 91 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | } else { |
| 95 | 95 | if ($event->status->send_email_to_customer) { |
| 96 | 96 | if ($event->status->orderStatusEmailTemplate) { |
| 97 | - $destinationPath = storage_path() . "/app"; |
|
| 97 | + $destinationPath = storage_path()."/app"; |
|
| 98 | 98 | $orderStatusEmailFromResult = GeneralSettingService::selectOneByShopIdAndName($event->order->shop_id, 'order-status-email-from'); |
| 99 | 99 | |
| 100 | 100 | $orderStatusEmailFrom = '[email protected]'; |
@@ -117,11 +117,11 @@ discard block |
||
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | $language = 'en'; |
| 120 | - if(strtoupper($event->order->orderBillAddress->country) == 'NL') { |
|
| 120 | + if (strtoupper($event->order->orderBillAddress->country) == 'NL') { |
|
| 121 | 121 | $language = 'nl'; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - Mail::send('frontend.email.order-status', ['content' => Cart::replaceTags($event->status->orderStatusEmailTemplate->translate($language)->content, $event->order)], function ($message) use ($event, $destinationPath, $orderStatusEmailFrom, $orderStatusEmailName, $orderStatusEmailBcc, $language) { |
|
| 124 | + Mail::send('frontend.email.order-status', ['content' => Cart::replaceTags($event->status->orderStatusEmailTemplate->translate($language)->content, $event->order)], function($message) use ($event, $destinationPath, $orderStatusEmailFrom, $orderStatusEmailName, $orderStatusEmailBcc, $language) { |
|
| 125 | 125 | $message->from($orderStatusEmailFrom, $orderStatusEmailName); |
| 126 | 126 | $message->to($event->order->client->email, $event->order->orderBillAddress->firstname)->subject(Cart::replaceTags($event->status->orderStatusEmailTemplate->translate($language)->subject, $event->order)); |
| 127 | 127 | |
@@ -10,10 +10,10 @@ |
||
| 10 | 10 | |
| 11 | 11 | class OrderStatusEmailTemplateService extends BaseService |
| 12 | 12 | { |
| 13 | - public function __construct(OrderStatusEmailTemplateRepository $orderStatusEmailTemplate) |
|
| 14 | - { |
|
| 15 | - $this->repo = $orderStatusEmailTemplate; |
|
| 16 | - } |
|
| 13 | + public function __construct(OrderStatusEmailTemplateRepository $orderStatusEmailTemplate) |
|
| 14 | + { |
|
| 15 | + $this->repo = $orderStatusEmailTemplate; |
|
| 16 | + } |
|
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | ); |
| 34 | 34 | |
| 35 | 35 | if ($id) { |
| 36 | - $rules['title'] = 'required|unique_with:order_status_email_template, shop_id,'.$id; |
|
| 36 | + $rules['title'] = 'required|unique_with:order_status_email_template, shop_id,'.$id; |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | return $rules; |
@@ -10,10 +10,10 @@ |
||
| 10 | 10 | |
| 11 | 11 | class OrderStatusService extends BaseService |
| 12 | 12 | { |
| 13 | - public function __construct(OrderStatusRepository $orderStatus) |
|
| 14 | - { |
|
| 15 | - $this->repo = $orderStatus; |
|
| 16 | - } |
|
| 13 | + public function __construct(OrderStatusRepository $orderStatus) |
|
| 14 | + { |
|
| 15 | + $this->repo = $orderStatus; |
|
| 16 | + } |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * The validation rules for the model. |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | ); |
| 30 | 30 | |
| 31 | 31 | if ($id) { |
| 32 | - $rules['title'] = 'required|between:4,65|unique_with:order_status, shop_id, '.$id.' = id'; |
|
| 32 | + $rules['title'] = 'required|between:4,65|unique_with:order_status, shop_id, '.$id.' = id'; |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | return $rules; |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | } |
| 54 | 54 | }); |
| 55 | 55 | |
| 56 | - parent::boot(); |
|
| 56 | + parent::boot(); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | public function products() |
@@ -18,11 +18,11 @@ |
||
| 18 | 18 | protected $table = 'order'; |
| 19 | 19 | |
| 20 | 20 | // Add the 'avatar' attachment to the fillable array so that it's mass-assignable on this model. |
| 21 | - protected $fillable = ['id', 'validated', 'client_id', 'shop_id', 'price_with_tax', 'price_without_tax', 'total_discount', 'coupon_id', 'coupon_title', 'coupon_discount_way', 'coupon_type', 'coupon_value', 'coupon_code', 'coupon_group_title', 'bill_order_address_id', 'delivery_order_address_id', 'order_status_id', 'mollie_payment_id', 'comments', 'present_gender', 'present_occassion', 'present_message', 'browser_detect']; |
|
| 21 | + protected $fillable = ['id', 'validated', 'client_id', 'shop_id', 'price_with_tax', 'price_without_tax', 'total_discount', 'coupon_id', 'coupon_title', 'coupon_discount_way', 'coupon_type', 'coupon_value', 'coupon_code', 'coupon_group_title', 'bill_order_address_id', 'delivery_order_address_id', 'order_status_id', 'mollie_payment_id', 'comments', 'present_gender', 'present_occassion', 'present_message', 'browser_detect']; |
|
| 22 | 22 | |
| 23 | 23 | public static function boot() |
| 24 | 24 | { |
| 25 | - static::creating(function ($model) { |
|
| 25 | + static::creating(function($model) { |
|
| 26 | 26 | |
| 27 | 27 | if ($model->created_at) { |
| 28 | 28 | $order = Order::where('shop_id', '=', $model->shop_id)->where('created_at', '>=', Carbon::createFromFormat('Y-m-d H:i:s', $model->created_at)->year)->orderBy('id', 'desc')->first(); |