@@ -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); |
@@ -4,19 +4,19 @@ |
||
| 4 | 4 | |
| 5 | 5 | class BaseRepository |
| 6 | 6 | { |
| 7 | - public function selectAll() |
|
| 8 | - { |
|
| 9 | - return $this->model->where('shop_id', '=', auth('hideyobackend')->user()->selected_shop_id)->get(); |
|
| 10 | - } |
|
| 7 | + public function selectAll() |
|
| 8 | + { |
|
| 9 | + return $this->model->where('shop_id', '=', auth('hideyobackend')->user()->selected_shop_id)->get(); |
|
| 10 | + } |
|
| 11 | 11 | |
| 12 | 12 | function selectAllByShopId($shopId) |
| 13 | 13 | { |
| 14 | - return $this->model->where('shop_id', '=', $shopId)->get(); |
|
| 14 | + return $this->model->where('shop_id', '=', $shopId)->get(); |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | public function selectAllActiveByShopId($shopId) |
| 18 | 18 | { |
| 19 | - return $this->model->where('shop_id', '=', $shopId)->where('active', '=', 1)->get(); |
|
| 19 | + return $this->model->where('shop_id', '=', $shopId)->where('active', '=', 1)->get(); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | public function getModel() { |
@@ -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); |
@@ -33,13 +33,13 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | public function handle(OrderChangeStatus $event) |
| 35 | 35 | { |
| 36 | - if($event->order->shop->wholesale) { |
|
| 36 | + if ($event->order->shop->wholesale) { |
|
| 37 | 37 | |
| 38 | 38 | if ($event->status->send_email_to_customer) { |
| 39 | 39 | |
| 40 | 40 | if ($event->status->orderStatusEmailTemplate) { |
| 41 | 41 | |
| 42 | - $destinationPath = storage_path() . "/app"; |
|
| 42 | + $destinationPath = storage_path()."/app"; |
|
| 43 | 43 | $orderStatusEmailFromResult = GeneralSettingService::selectOneByShopIdAndName($event->order->shop_id, 'order-status-email-from'); |
| 44 | 44 | |
| 45 | 45 | $orderStatusEmailFrom = '[email protected]'; |
@@ -57,12 +57,12 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | $orderStatusEmailBcc = '[email protected]'; |
| 59 | 59 | $language = 'en'; |
| 60 | - if(strtoupper($event->order->orderBillAddress->country) == 'NL') { |
|
| 60 | + if (strtoupper($event->order->orderBillAddress->country) == 'NL') { |
|
| 61 | 61 | $language = 'nl'; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | |
| 65 | - Mail::send('frontend.email.order-status', ['content' => $this->cart->replaceTags($event->status->orderStatusEmailTemplate->translate($language)->content, $event->order)], function ($message) use ($event, $destinationPath, $orderStatusEmailFrom, $orderStatusEmailName, $orderStatusEmailBcc, $language) { |
|
| 65 | + Mail::send('frontend.email.order-status', ['content' => $this->cart->replaceTags($event->status->orderStatusEmailTemplate->translate($language)->content, $event->order)], function($message) use ($event, $destinationPath, $orderStatusEmailFrom, $orderStatusEmailName, $orderStatusEmailBcc, $language) { |
|
| 66 | 66 | $message->from($orderStatusEmailFrom, $orderStatusEmailName); |
| 67 | 67 | $message->to($event->order->client->email, $event->order->orderBillAddress->firstname)->subject($this->cart->replaceTags($event->status->orderStatusEmailTemplate->translate($language)->subject, $event->order)); |
| 68 | 68 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | if ($event->order and $event->status->attach_order_to_email) { |
| 74 | 74 | $pdfText = ""; |
| 75 | 75 | $sign = '€'; |
| 76 | - if($event->order->client->usd) { |
|
| 76 | + if ($event->order->client->usd) { |
|
| 77 | 77 | $sign = '$'; |
| 78 | 78 | } |
| 79 | 79 | |
@@ -96,9 +96,9 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - if($event->order->type == 'pre_order') { |
|
| 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 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | } else { |
| 108 | 108 | if ($event->status->send_email_to_customer) { |
| 109 | 109 | if ($event->status->orderStatusEmailTemplate) { |
| 110 | - $destinationPath = storage_path() . "/app"; |
|
| 110 | + $destinationPath = storage_path()."/app"; |
|
| 111 | 111 | $orderStatusEmailFromResult = GeneralSettingService::selectOneByShopIdAndName($event->order->shop_id, 'order-status-email-from'); |
| 112 | 112 | |
| 113 | 113 | $orderStatusEmailFrom = '[email protected]'; |
@@ -130,11 +130,11 @@ discard block |
||
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | $language = 'en'; |
| 133 | - if(strtoupper($event->order->orderBillAddress->country) == 'NL') { |
|
| 133 | + if (strtoupper($event->order->orderBillAddress->country) == 'NL') { |
|
| 134 | 134 | $language = 'nl'; |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - Mail::send('frontend.email.order-status', ['content' => $this->cart->replaceTags($event->status->orderStatusEmailTemplate->translate($language)->content, $event->order)], function ($message) use ($event, $destinationPath, $orderStatusEmailFrom, $orderStatusEmailName, $orderStatusEmailBcc, $language) { |
|
| 137 | + Mail::send('frontend.email.order-status', ['content' => $this->cart->replaceTags($event->status->orderStatusEmailTemplate->translate($language)->content, $event->order)], function($message) use ($event, $destinationPath, $orderStatusEmailFrom, $orderStatusEmailName, $orderStatusEmailBcc, $language) { |
|
| 138 | 138 | $message->from($orderStatusEmailFrom, $orderStatusEmailName); |
| 139 | 139 | $message->to($event->order->client->email, $event->order->orderBillAddress->firstname)->subject($this->cart->replaceTags($event->status->orderStatusEmailTemplate->translate($language)->subject, $event->order)); |
| 140 | 140 | |
@@ -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 | |
@@ -9,14 +9,14 @@ |
||
| 9 | 9 | |
| 10 | 10 | class OrderService extends BaseService |
| 11 | 11 | { |
| 12 | - public function __construct(OrderRepository $order) |
|
| 13 | - { |
|
| 14 | - $this->repo = $order; |
|
| 15 | - } |
|
| 12 | + public function __construct(OrderRepository $order) |
|
| 13 | + { |
|
| 14 | + $this->repo = $order; |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | - public function createByUserAndShopId(array $attributes, $shopId, $noAccountUser) |
|
| 17 | + public function createByUserAndShopId(array $attributes, $shopId, $noAccountUser) |
|
| 18 | 18 | { |
| 19 | - return $this->repo->createByUserAndShopId($attributes, $shopId, $noAccountUser); |
|
| 19 | + return $this->repo->createByUserAndShopId($attributes, $shopId, $noAccountUser); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | public function updateStatus($id, $orderStatusId) |
@@ -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; |