coding style
This commit is contained in:
@@ -27,7 +27,7 @@ trait DateStats
|
||||
{
|
||||
$periods = DateRange::getPeriodsLastMonth(12);
|
||||
$values = self::sumPeriodly($periods, $field, $fieldDate);
|
||||
|
||||
|
||||
return self::buildLabels($periods, $values, 'MMM YY');
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ trait DateStats
|
||||
$index = Carbon::parse($period->startDate)->isoFormat($format);
|
||||
$data[$index] = $values[$key];
|
||||
}
|
||||
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,13 +4,6 @@ namespace App\Repositories\Shop;
|
||||
|
||||
use App\Models\Shop\Article;
|
||||
use App\Models\Shop\Merchandise;
|
||||
use App\Repositories\Botanic\Species;
|
||||
use App\Repositories\Botanic\Varieties;
|
||||
use App\Repositories\Core\Comments;
|
||||
use App\Repositories\Core\Tag;
|
||||
use App\Traits\Model\Basic;
|
||||
use App\Traits\Repository\Imageable;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ArticleCategories
|
||||
{
|
||||
|
||||
@@ -2,15 +2,10 @@
|
||||
|
||||
namespace App\Repositories\Shop;
|
||||
|
||||
use App\Models\Shop\Article;
|
||||
use App\Models\Shop\Merchandise;
|
||||
use App\Repositories\Botanic\Species;
|
||||
use App\Repositories\Botanic\Varieties;
|
||||
use App\Repositories\Core\Comments;
|
||||
use App\Repositories\Core\Tag;
|
||||
use App\Traits\Model\Basic;
|
||||
use App\Traits\Repository\Imageable;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ArticleImages
|
||||
{
|
||||
|
||||
@@ -3,14 +3,6 @@
|
||||
namespace App\Repositories\Shop;
|
||||
|
||||
use App\Models\Shop\Article;
|
||||
use App\Models\Shop\Merchandise;
|
||||
use App\Repositories\Botanic\Species;
|
||||
use App\Repositories\Botanic\Varieties;
|
||||
use App\Repositories\Core\Comments;
|
||||
use App\Repositories\Core\Tag;
|
||||
use App\Traits\Model\Basic;
|
||||
use App\Traits\Repository\Imageable;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ArticleSiblings
|
||||
{
|
||||
|
||||
@@ -2,15 +2,7 @@
|
||||
|
||||
namespace App\Repositories\Shop;
|
||||
|
||||
use App\Models\Shop\Article;
|
||||
use App\Models\Shop\Merchandise;
|
||||
use App\Repositories\Botanic\Species;
|
||||
use App\Repositories\Botanic\Varieties;
|
||||
use App\Repositories\Core\Comments;
|
||||
use App\Repositories\Core\Tag;
|
||||
use App\Traits\Model\Basic;
|
||||
use App\Traits\Repository\Imageable;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ArticleTags
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ class BasketStores
|
||||
|
||||
public function get($key)
|
||||
{
|
||||
if($this->has($key)) {
|
||||
if ($this->has($key)) {
|
||||
return new CartCollection(Basket::find($key)->cart_data);
|
||||
} else {
|
||||
return [];
|
||||
@@ -26,14 +26,14 @@ class BasketStores
|
||||
|
||||
public function put($key, $value)
|
||||
{
|
||||
if($row = Basket::find($key)) {
|
||||
if ($row = Basket::find($key)) {
|
||||
// update
|
||||
$row->cart_data = $value;
|
||||
$row->save();
|
||||
} else {
|
||||
Basket::create([
|
||||
'id' => $key,
|
||||
'cart_data' => $value
|
||||
'cart_data' => $value,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -41,5 +41,5 @@ class BasketStores
|
||||
public static function getModel()
|
||||
{
|
||||
return Basket::query();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
namespace App\Repositories\Shop;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use LaravelDaily\Invoices\Invoice;
|
||||
use LaravelDaily\Invoices\Classes\Party;
|
||||
use LaravelDaily\Invoices\Classes\InvoiceItem;
|
||||
use LaravelDaily\Invoices\Classes\Party;
|
||||
use LaravelDaily\Invoices\Invoice;
|
||||
|
||||
class InvoicePDF
|
||||
{
|
||||
@@ -18,8 +18,8 @@ class InvoicePDF
|
||||
{
|
||||
$invoice = Invoices::getFull($id);
|
||||
$customer = new Party([
|
||||
'name' => $invoice->customer->name,
|
||||
'address' => self::makeAddress($invoice->address),
|
||||
'name' => $invoice->customer->name,
|
||||
'address' => self::makeAddress($invoice->address),
|
||||
'custom_fields' => [
|
||||
'order number' => $invoice->order->ref,
|
||||
],
|
||||
@@ -27,13 +27,13 @@ class InvoicePDF
|
||||
|
||||
$items = self::makeItems($invoice->order->detail);
|
||||
|
||||
$invoice = Invoice::make(__('invoices::invoice.invoice') . ' ' .$invoice->ref)
|
||||
$invoice = Invoice::make(__('invoices::invoice.invoice').' '.$invoice->ref)
|
||||
->status(Invoices::getStatus($invoice->status))
|
||||
->buyer($customer)
|
||||
->shipping($invoice->shipping)
|
||||
->date(Carbon::parse($invoice->date_invoice))
|
||||
->payUntilDays(14)
|
||||
->filename('invoice-' . $invoice->ref . '-' . $invoice->uuid)
|
||||
->filename('invoice-'.$invoice->ref.'-'.$invoice->uuid)
|
||||
->addItems($items)
|
||||
->notes($invoice->comment ?? '')
|
||||
->logo(public_path('img/logo.png'))
|
||||
@@ -48,7 +48,7 @@ class InvoicePDF
|
||||
|
||||
public static function makeAddress($address)
|
||||
{
|
||||
return $address->address . '<br>' . $address->zipcode . ' ' . $address->city;
|
||||
return $address->address.'<br>'.$address->zipcode.' '.$address->city;
|
||||
}
|
||||
|
||||
public static function makeItems($details)
|
||||
@@ -61,7 +61,7 @@ class InvoicePDF
|
||||
->taxByPercent($detail->vat)
|
||||
->quantity($detail->quantity);
|
||||
}
|
||||
|
||||
|
||||
return $items;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
namespace App\Repositories\Shop;
|
||||
|
||||
use App\Models\Shop\Offer;
|
||||
use App\Traits\Model\Basic;
|
||||
|
||||
class OfferStocks
|
||||
{
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace App\Repositories\Shop;
|
||||
use App\Models\Shop\Order;
|
||||
use App\Repositories\Core\DateStats;
|
||||
use App\Repositories\Core\PDF;
|
||||
use App\Repositories\Shop\Customers;
|
||||
use App\Traits\Model\Basic;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Str;
|
||||
@@ -30,7 +29,7 @@ class Orders
|
||||
|
||||
public static function getPdfByUUID($uuid)
|
||||
{
|
||||
return self::getPdf(self::getIdByUUID($uuid), 'commande-' . $uuid . '.pdf');
|
||||
return self::getPdf(self::getIdByUUID($uuid), 'commande-'.$uuid.'.pdf');
|
||||
}
|
||||
|
||||
public static function getPdf($id, $file = 'order.pdf')
|
||||
|
||||
@@ -12,6 +12,7 @@ class Searches
|
||||
'ids' => Article::search($options['search_name'])->get()->pluck('id'),
|
||||
]))->sortBy('searchOrder')->toArray();
|
||||
}
|
||||
|
||||
public static function getResults($options)
|
||||
{
|
||||
return Articles::getArticlesToSell($options);
|
||||
|
||||
Reference in New Issue
Block a user