This commit is contained in:
Carvallegro 2017-12-31 06:12:28 +11:00
commit c07cbd3623
398 changed files with 23534 additions and 1562 deletions

View File

@ -25,7 +25,7 @@ Akaunting uses [Laravel](http://laravel.com), the best existing PHP framework, a
* Install [Composer](https://getcomposer.org/download)
* Download the [repository](https://github.com/akaunting/akaunting/archive/master.zip) and unzip into your server
* Open and point your command line to the directory you unzipped Akaunting
* Run the following commands separately: `composer install` , `composer dump-autoload`
* Run the following command: `composer install`
* Finally, launch the [installer](https://akaunting.com/docs/installation)
## Docker
@ -57,7 +57,7 @@ Please, be very clear on your commit messages and pull requests, empty pull requ
When contributing code to Akaunting, you must follow the PSR coding standards. The golden rule is: Imitate the existing Akaunting code.
Please note that this project is released with a [Contributor Code of Conduct](https://akaunting.com/code-of-conduct). By participating in this project you agree to abide by its terms.
Please note that this project is released with a [Contributor Code of Conduct](https://akaunting.com/conduct). By participating in this project you agree to abide by its terms.
## Translation

View File

@ -52,7 +52,9 @@ class BillReminder extends Command
$days = explode(',', $company->schedule_bill_days);
foreach ($days as $day) {
$this->remind(trim($day), $company);
$day = (int) trim($day);
$this->remind($day, $company);
}
}
}
@ -76,5 +78,4 @@ class BillReminder extends Command
}
}
}
}

View File

@ -52,7 +52,9 @@ class InvoiceReminder extends Command
$days = explode(',', $company->schedule_invoice_days);
foreach ($days as $day) {
$this->remind(trim($day), $company);
$day = (int) trim($day);
$this->remind($day, $company);
}
}
}
@ -67,7 +69,9 @@ class InvoiceReminder extends Command
foreach ($invoices as $invoice) {
// Notify the customer
$invoice->customer->notify(new Notification($invoice));
if ($invoice->customer && !empty($invoice->customer_email)) {
$invoice->customer->notify(new Notification($invoice));
}
// Notify all users assigned to this company
foreach ($company->users as $user) {
@ -79,5 +83,4 @@ class InvoiceReminder extends Command
}
}
}
}

View File

@ -3,7 +3,7 @@
"alias": "$LOWER_NAME$",
"description": "",
"version": "1.0.0",
"category": "payment-gateways",
"category": "payment-gateway",
"keywords": [],
"active": 1,
"order": 0,

View File

@ -0,0 +1,18 @@
<?php
namespace App\Events;
class CompanySwitched
{
public $company;
/**
* Create a new event instance.
*
* @param $company
*/
public function __construct($company)
{
$this->company = $company;
}
}

View File

@ -70,7 +70,7 @@ class Bills extends ApiController
$item_sku = $item_object->sku;
// Increase stock (item bought)
$item_object->quantity++;
$item_object->quantity += $item['quantity'];
$item_object->save();
} elseif (!empty($item['sku'])) {
$item_sku = $item['sku'];
@ -89,7 +89,7 @@ class Bills extends ApiController
}
$bill_item['item_id'] = $item_id;
$bill_item['name'] = $item['name'];
$bill_item['name'] = str_limit($item['name'], 180, '');
$bill_item['sku'] = $item_sku;
$bill_item['quantity'] = $item['quantity'];
$bill_item['price'] = $item['price'];
@ -161,7 +161,7 @@ class Bills extends ApiController
}
$bill_item['item_id'] = $item_id;
$bill_item['name'] = $item['name'];
$bill_item['name'] = str_limit($item['name'], 180, '');
$bill_item['sku'] = $item_sku;
$bill_item['quantity'] = $item['quantity'];
$bill_item['price'] = $item['price'];

View File

@ -79,7 +79,7 @@ class Invoices extends ApiController
$item_sku = $item_object->sku;
// Decrease stock (item sold)
$item_object->quantity--;
$item_object->quantity -= $item['quantity'];
$item_object->save();
// Notify users if out of stock
@ -109,7 +109,7 @@ class Invoices extends ApiController
}
$invoice_item['item_id'] = $item_id;
$invoice_item['name'] = $item['name'];
$invoice_item['name'] = str_limit($item['name'], 180, '');
$invoice_item['sku'] = $item_sku;
$invoice_item['quantity'] = $item['quantity'];
$invoice_item['price'] = $item['price'];
@ -212,7 +212,7 @@ class Invoices extends ApiController
}
$invoice_item['item_id'] = $item_id;
$invoice_item['name'] = $item['name'];
$invoice_item['name'] = str_limit($item['name'], 180, '');
$invoice_item['sku'] = $item_sku;
$invoice_item['quantity'] = $item['quantity'];
$invoice_item['price'] = $item['price'];

View File

@ -243,6 +243,7 @@ class Users extends Controller
public function autocomplete(ARequest $request)
{
$user = false;
$data = false;
$column = $request['column'];
$value = $request['value'];
@ -250,7 +251,7 @@ class Users extends Controller
if (!empty($column) && !empty($value)) {
switch ($column) {
case 'id':
$user = User::find();
$user = User::find((int) $value);
break;
case 'email':
$user = User::where('email', $value)->first();
@ -258,12 +259,16 @@ class Users extends Controller
default:
$user = User::where($column, $value)->first();
}
$data = $user;
} elseif (!empty($column) && empty($value)) {
$data = trans('validation.required', ['attribute' => $column]);
}
return response()->json([
'errors' => ($user) ? false: true,
'success' => ($user) ? true: false,
'data' => $user
'errors' => ($user) ? false : true,
'success' => ($user) ? true : false,
'data' => $data
]);
}
}

View File

@ -5,13 +5,17 @@ namespace App\Http\Controllers\Banking;
use App\Http\Controllers\Controller;
use App\Models\Banking\Account;
use App\Models\Banking\Transaction;
use App\Models\Expense\BillPayment;
use App\Models\Expense\Payment;
use App\Models\Income\InvoicePayment;
use App\Models\Income\Revenue;
use App\Models\Setting\Category;
class Transactions extends Controller
{
public $transactions = [];
/**
* Display a listing of the resource.
*
@ -21,8 +25,6 @@ class Transactions extends Controller
{
$request = request();
$transactions = array();
$accounts = collect(Account::enabled()->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.accounts', 2)]), '');
@ -35,62 +37,64 @@ class Transactions extends Controller
$type = $request->get('type');
if ($type != 'income') {
$payments = Payment::collect('paid_at');
foreach ($payments as $payment) {
$transactions[] = (object)[
'paid_at' => $payment->paid_at,
'account_name' => $payment->account->name,
'type' => trans_choice('general.expenses', 1),
'category_name' => $payment->category->name,
'description' => $payment->description,
'amount' => $payment->amount,
'currency_code' => $payment->currency_code,
];
}
$this->addTransactions(Payment::collect('paid_at'), trans_choice('general.expenses', 1));
$this->addTransactions(BillPayment::collect('paid_at'), trans_choice('general.expenses', 1), trans_choice('general.bills', 1));
}
if ($type != 'expense') {
$revenues = Revenue::collect('paid_at');
foreach ($revenues as $revenue) {
$transactions[] = (object)[
'paid_at' => $revenue->paid_at,
'account_name' => $revenue->account->name,
'type' => trans_choice('general.incomes', 1),
'category_name' => $revenue->category->name,
'description' => $revenue->description,
'amount' => $revenue->amount,
'currency_code' => $revenue->currency_code,
];
}
$this->addTransactions(Revenue::collect('paid_at'), trans_choice('general.incomes', 1));
$this->addTransactions(InvoicePayment::collect('paid_at'), trans_choice('general.incomes', 1), trans_choice('general.invoices', 1));
}
$special_key = array(
'account.name' => 'account_name',
'category.name' => 'category_name',
);
if (isset($request['sort']) && array_key_exists($request['sort'], $special_key)) {
$sort_order = array();
foreach ($transactions as $key => $value) {
$sort = $request['sort'];
if (array_key_exists($request['sort'], $special_key)) {
$sort = $special_key[$request['sort']];
}
$sort_order[$key] = $value->{$sort};
}
$sort_type = (isset($request['order']) && $request['order'] == 'asc') ? SORT_ASC : SORT_DESC;
array_multisort($sort_order, $sort_type, $transactions);
}
$transactions = (object) $transactions;
$transactions = $this->getTransactions($request);
return view('banking.transactions.index', compact('transactions', 'accounts', 'types', 'categories'));
}
/**
* Add items to transactions array.
*
* @param $items
* @param $type
* @param $category
*/
protected function addTransactions($items, $type, $category = null)
{
foreach ($items as $item) {
$data = [
'paid_at' => $item->paid_at,
'account_name' => $item->account->name,
'type' => $type,
'description' => $item->description,
'amount' => $item->amount,
'currency_code' => $item->currency_code,
];
if (!is_null($category)) {
$data['category_name'] = $category;
} else {
$data['category_name'] = $item->category->name;
}
$this->transactions[] = (object) $data;
}
}
protected function getTransactions($request)
{
// Sort items
if (isset($request['sort'])) {
if ($request['order'] == 'asc') {
$f = 'sortBy';
} else {
$f = 'sortByDesc';
}
$transactions = collect($this->transactions)->$f($request['sort']);
} else {
$transactions = collect($this->transactions)->sortByDesc('paid_at');
}
return $transactions;
}
}

View File

@ -102,14 +102,10 @@ class Transfers extends Controller
$request['account_id'] = $request['from_account_id'];
$request['paid_at'] = $request['transferred_at'];
// amount
$request['currency_code'] = $payment_currency_code;
$request['currency_rate'] = $currencies[$payment_currency_code];
$request['vendor_id'] = '0';
// description
$request['category_id'] = Category::enabled()->type('other')->pluck('id')->first(); // Transfer Category ID
// payment_method
// reference
$request['category_id'] = Category::transfer(); // Transfer Category ID
$request['attachment'] = '';
$payment = Payment::create($request->all());
@ -195,14 +191,10 @@ class Transfers extends Controller
$request['account_id'] = $request['from_account_id'];
$request['paid_at'] = $request['transferred_at'];
// amount
$request['currency_code'] = $payment_currency_code;
$request['currency_rate'] = $currencies[$payment_currency_code];
$request['vendor_id'] = '0';
// description
$request['category_id'] = Category::enabled()->type('other')->pluck('id')->first(); // Transfer Category ID
// payment_method
// reference
$request['category_id'] = Category::transfer(); // Transfer Category ID
$request['attachment'] = '';
$payment->update($request->all());

View File

@ -2,14 +2,12 @@
namespace App\Http\Controllers\Companies;
use App\Events\CompanySwitched;
use App\Http\Controllers\Controller;
use App\Http\Requests\Company\Company as Request;
use App\Models\Company\Company;
use App\Models\Setting\Currency;
use App\Traits\Uploads;
use Auth;
use Redirect;
use Setting;
class Companies extends Controller
{
@ -51,26 +49,26 @@ class Companies extends Controller
*/
public function store(Request $request)
{
Setting::forgetAll();
setting()->forgetAll();
// Create company
$company = Company::create($request->input());
// Create settings
Setting::set('general.company_name', $request->get('company_name'));
Setting::set('general.company_email', $request->get('company_email'));
Setting::set('general.company_address', $request->get('company_address'));
setting()->set('general.company_name', $request->get('company_name'));
setting()->set('general.company_email', $request->get('company_email'));
setting()->set('general.company_address', $request->get('company_address'));
$logo_path = $this->getUploadedFilePath($request->file('company_logo'), 'settings', $company->id);
if ($logo_path) {
Setting::set('general.company_logo', $logo_path);
setting()->set('general.company_logo', $logo_path);
}
Setting::set('general.default_currency', $request->get('default_currency'));
Setting::set('general.default_locale', session('locale'));
setting()->set('general.default_currency', $request->get('default_currency'));
setting()->set('general.default_locale', session('locale'));
Setting::setExtraColumns(['company_id' => $company->id]);
Setting::save();
setting()->setExtraColumns(['company_id' => $company->id]);
setting()->save();
// Redirect
$message = trans('messages.success.added', ['type' => trans_choice('general.companies', 1)]);
@ -90,7 +88,13 @@ class Companies extends Controller
public function edit(Company $company)
{
// Check if user can edit company
$this->authorizeUserOrRedirect($company);
if (!$this->isUserCompany($company)) {
$message = trans('companies.error.not_user_company');
flash($message)->error();
return redirect('companies/companies');
}
$company->setSettings();
@ -110,30 +114,36 @@ class Companies extends Controller
public function update(Company $company, Request $request)
{
// Check if user can update company
$this->authorizeUserOrRedirect($company);
if (!$this->isUserCompany($company)) {
$message = trans('companies.error.not_user_company');
flash($message)->error();
return redirect('companies/companies');
}
// Update company
$company->update($request->input());
// Get the company settings
Setting::forgetAll();
Setting::setExtraColumns(['company_id' => $company->id]);
Setting::load(true);
setting()->forgetAll();
setting()->setExtraColumns(['company_id' => $company->id]);
setting()->load(true);
// Update settings
Setting::set('general.company_name', $request->get('company_name'));
Setting::set('general.company_email', $request->get('company_email'));
Setting::set('general.company_address', $request->get('company_address'));
setting()->set('general.company_name', $request->get('company_name'));
setting()->set('general.company_email', $request->get('company_email'));
setting()->set('general.company_address', $request->get('company_address'));
$logo_path = $this->getUploadedFilePath($request->file('company_logo'), 'settings', $company->id);
if ($logo_path) {
Setting::set('general.company_logo', $logo_path);
setting()->set('general.company_logo', $logo_path);
}
Setting::set('general.default_payment_method', 'offlinepayment.cash.1');
Setting::set('general.default_currency', $request->get('default_currency'));
setting()->set('general.default_payment_method', 'offlinepayment.cash.1');
setting()->set('general.default_currency', $request->get('default_currency'));
Setting::save();
setting()->save();
// Redirect
$message = trans('messages.success.updated', ['type' => trans_choice('general.companies', 1)]);
@ -182,9 +192,10 @@ class Companies extends Controller
// Check if user can manage company
if ($this->isUserCompany($company)) {
session(['company_id' => $company->id]);
event(new CompanySwitched($company));
}
//return redirect('/');
return redirect()->back();
}
@ -197,7 +208,7 @@ class Companies extends Controller
*/
public function isUserCompany(Company $company)
{
$companies = Auth::user()->companies()->pluck('id')->toArray();
$companies = auth()->user()->companies()->pluck('id')->toArray();
if (in_array($company->id, $companies)) {
return true;
@ -205,24 +216,4 @@ class Companies extends Controller
return false;
}
/**
* Check user company permission and redirect if not
*
* @param Company $company
*
* @return boolean
*/
public function authorizeUserOrRedirect(Company $company)
{
if ($this->isUserCompany($company)) {
return true;
}
$message = trans('companies.error.not_user_company');
flash($message)->error();
Redirect::away(url('companies/companies'))->send();
}
}

View File

@ -3,12 +3,12 @@
namespace App\Http\Controllers\Customers;
use App\Http\Controllers\Controller;
use Auth;
use App\Models\Income\Invoice;
use Charts;
use Date;
class Dashboard extends Controller
{
/**
* Display a listing of the resource.
*
@ -16,8 +16,110 @@ class Dashboard extends Controller
*/
public function index()
{
$user = Auth::user()->customer;
$customer = auth()->user()->customer;
return view('customers.dashboard.index', compact('user'));
$invoices = Invoice::with('status')->accrued()->where('customer_id', $customer->id)->get();
$start = Date::parse(request('start', Date::today()->startOfYear()->format('Y-m-d')));
$end = Date::parse(request('end', Date::today()->endOfYear()->format('Y-m-d')));
$start_month = $start->month;
$end_month = $end->month;
// Monthly
$labels = [];
$s = clone $start;
for ($j = $end_month; $j >= $start_month; $j--) {
$labels[$end_month - $j] = $s->format('M Y');
$s->addMonth();
}
$unpaid = $paid = $overdue = $partial_paid = [];
foreach ($invoices as $invoice) {
switch ($invoice->invoice_status_code) {
case 'paid':
$paid[] = $invoice;
break;
case 'partial':
$partial_paid[] = $invoice;
break;
case 'sent':
default:
if (Date::today()->format('Y-m-d') > $invoice->due_at->format('Y-m-d')) {
$overdue[] = $invoice;
} else {
$unpaid[] = $invoice;
}
}
}
$total = count($unpaid) + count($paid) + count($partial_paid) + count($overdue);
$progress = [
'unpaid' => count($unpaid),
'paid' => count($paid),
'overdue' => count($overdue),
'partially_paid' => count($partial_paid),
'total' => $total,
];
$unpaid = $this->calculateTotals($unpaid, $start, $end, 'unpaid');
$paid = $this->calculateTotals($paid, $start, $end, 'paid');
$partial_paid = $this->calculateTotals($partial_paid, $start, $end, 'partial');
$overdue = $this->calculateTotals($overdue, $start, $end, 'overdue');
$chart = Charts::multi('line', 'chartjs')
->dimensions(0, 300)
->colors(['#dd4b39', '#6da252', '#f39c12', '#00c0ef'])
->dataset(trans('general.unpaid'), $unpaid)
->dataset(trans('general.paid'), $paid)
->dataset(trans('general.overdue'), $overdue)
->dataset(trans('general.partially_paid'), $partial_paid)
->labels($labels)
->credits(false)
->view('vendor.consoletvs.charts.chartjs.multi.line');
return view('customers.dashboard.index', compact('customer', 'invoices', 'progress', 'chart'));
}
private function calculateTotals($items, $start, $end, $type)
{
$totals = [];
$date_format = 'Y-m';
$n = 1;
$start_date = $start->format($date_format);
$end_date = $end->format($date_format);
$next_date = $start_date;
$s = clone $start;
while ($next_date <= $end_date) {
$totals[$next_date] = 0;
$next_date = $s->addMonths($n)->format($date_format);
}
$this->setTotals($totals, $items, $date_format, $type);
return $totals;
}
private function setTotals(&$totals, $items, $date_format, $type)
{
foreach ($items as $item) {
if ($type == 'partial') {
$item->amount = $item->payments()->paid();
}
$i = Date::parse($item->paid_at)->format($date_format);
$totals[$i] += $item->getConvertedAmount();
}
}
}

View File

@ -12,8 +12,6 @@ use App\Models\Setting\Currency;
use App\Traits\Currencies;
use App\Traits\DateTime;
use App\Traits\Uploads;
use Auth;
use App\Utilities\Modules;
class Invoices extends Controller
@ -27,19 +25,7 @@ class Invoices extends Controller
*/
public function index()
{
$invoices = Invoice::with('status')->where('customer_id', '=', Auth::user()->customer->id)->paginate();
foreach ($invoices as $invoice) {
$paid = 0;
foreach ($invoice->payments as $item) {
$item->default_currency_code = $invoice->currency_code;
$paid += $item->getDynamicConvertedAmount();
}
$invoice->amount = $invoice->amount - $paid;
}
$invoices = Invoice::with('status')->accrued()->where('customer_id', auth()->user()->customer->id)->paginate();
$status = collect(InvoiceStatus::all()->pluck('name', 'code'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.statuses', 2)]), '');
@ -94,7 +80,7 @@ class Invoices extends Controller
/**
* Show the form for viewing the specified resource.
*
* @param int $invoice_id
* @param Invoice $invoice
*
* @return Response
*/
@ -126,7 +112,7 @@ class Invoices extends Controller
/**
* Show the form for viewing the specified resource.
*
* @param int $invoice_id
* @param Invoice $invoice
*
* @return Response
*/

View File

@ -0,0 +1,92 @@
<?php
namespace App\Http\Controllers\Customers;
use App\Http\Controllers\Controller;
use App\Http\Requests\Customer\Profile as Request;
use App\Models\Auth\User;
class Profile extends Controller
{
public function index()
{
return $this->edit();
}
public function show()
{
return $this->edit();
}
/**
* Show the form for editing the specified resource.
*
* @return Response
*/
public function edit()
{
$user = auth()->user();
return view('customers.profile.edit', compact('user'));
}
/**
* Update the specified resource in storage.
*
* @param Request $request
*
* @return Response
*/
public function update(Request $request)
{
$user = auth()->user();
// Upload picture
$picture = $request->file('picture');
if ($picture && $picture->isValid()) {
$request['picture'] = $picture->store('users');
}
// Do not reset password if not entered/changed
if (empty($request['password'])) {
unset($request['password']);
unset($request['password_confirmation']);
}
// Update user
$user->update($request->input());
// Update customer
$user->customer->update($request->input());
$message = trans('messages.success.updated', ['type' => trans('auth.profile')]);
flash($message)->success();
return redirect('customers/profile/edit');
}
/**
* Mark overdue invoices notifications are read and redirect to invoices page.
*
* @return Response
*/
public function readOverdueInvoices()
{
$user = auth()->user();
// Mark invoice notifications as read
foreach ($user->unreadNotifications as $notification) {
// Not an invoice notification
if ($notification->getAttribute('type') != 'App\Notifications\Income\Invoice') {
continue;
}
$notification->markAsRead();
}
// Redirect to invoices
return redirect('customers/invoices');
}
}

View File

@ -12,6 +12,7 @@ use App\Models\Income\InvoicePayment;
use App\Models\Income\Revenue;
use App\Models\Setting\Category;
use App\Traits\Currencies;
use Charts;
use Date;
class Dashboard extends Controller
@ -20,6 +21,10 @@ class Dashboard extends Controller
public $today;
public $income_donut = ['colors' => [], 'labels' => [], 'values' => []];
public $expense_donut = ['colors' => [], 'labels' => [], 'values' => []];
/**
* Display a listing of the resource.
*
@ -28,174 +33,46 @@ class Dashboard extends Controller
public function index()
{
$this->today = Date::today();
$month_days = $this->today->daysInMonth;
/*
* Cash Flow
*/
list($total_incomes, $total_expenses, $total_profit) = $this->getTotals();
// Daily
$day = array();
$cashflow = $this->getCashFlow();
for ($j = $month_days; $j > -1; $j--) {
$day[$month_days - $j] = date("d M", strtotime("-$j day"));
}
list($donut_incomes, $donut_expenses) = $this->getDonuts();
$daily_income = $this->getCashFlow('income', 'daily');
$daily_expense = $this->getCashFlow('expense', 'daily');
$accounts = Account::enabled()->take(6)->get();
$daily_profit = $this->getProfit($daily_income, $daily_expense);
$latest_incomes = $this->getLatestIncomes();
// Monthly
$month = array();
$latest_expenses = $this->getLatestExpenses();
for ($j = 12; $j >= 0; $j--) {
$month[12 - $j] = date("F-Y", strtotime(" -$j month"));
}
return view('dashboard.dashboard.index', compact(
'total_incomes',
'total_expenses',
'total_profit',
'cashflow',
'donut_incomes',
'donut_expenses',
'accounts',
'latest_incomes',
'latest_expenses'
));
}
$monthly_income = $this->getCashFlow('income', 'monthly');
$monthly_expense = $this->getCashFlow('expense', 'monthly');
public function cashFlow()
{
$this->today = Date::today();
$monthly_profit = $this->getProfit($monthly_income, $monthly_expense);
$content = $this->getCashFlow()->render();
$cash_flow = [
'daily' => [
'date' => json_encode($day),
'income' => json_encode(array_values($daily_income)),
'expense' => json_encode(array_values($daily_expense)),
'profit' => json_encode(array_values($daily_profit))
],
'monthly' => [
'date' => json_encode($month),
'income' => json_encode(array_values($monthly_income)),
'expense' => json_encode(array_values($monthly_expense)),
'profit' => json_encode(array_values($monthly_profit))
],
];
//return response()->setContent($content)->send();
/*
* Totals & Pie Charts
*/
echo $content;
}
$incomes = $expenses = array();
$incomes_amount = $expenses_amount = 0;
// Invoices
$invoices = Invoice::with('payments')->accrued()->get();
list($invoice_paid_amount, $open_invoice, $overdue_invoice) = $this->getTotals($invoices, 'invoice');
$incomes_amount += $invoice_paid_amount;
// Bills
$bills = Bill::with('payments')->accrued()->get();
list($bill_paid_amount, $open_bill, $overdue_bill) = $this->getTotals($bills, 'bill');
$expenses_amount += $bill_paid_amount;
// Add to Incomes By Category
$incomes[] = array(
'amount' => money($invoice_paid_amount, setting('general.default_currency'), true)->format(),
'value' => (int) $invoice_paid_amount,
'color' => '#00c0ef',
'highlight' => '#00c0ef',
'label' => trans_choice('general.invoices', 2)
);
// Add to Expenses By Category
$expenses[] = array(
'amount' => money($bill_paid_amount, setting('general.default_currency'), true)->format(),
'value' => (int) $bill_paid_amount,
'color' => '#dd4b39',
'highlight' => '#dd4b39',
'label' => trans_choice('general.bills', 2)
);
// Revenues & Payments
$categories = Category::orWhere('type', 'income')->orWhere('type', 'expense')->enabled()->get();
foreach ($categories as $category) {
switch ($category->type) {
case 'income':
$revenues = $category->revenues;
$amount = 0;
if ($revenues) {
foreach ($revenues as $revenue) {
$amount += $revenue->getConvertedAmount();
}
$incomes[] = array(
'amount' => money($amount, setting('general.default_currency'), true)->format(),
'value' => (int) $amount,
'color' => $category->color,
'highlight' => $category->color,
'label' => $category->name
);
} else {
$incomes[] = array(
'amount' => money(0, setting('general.default_currency'), true)->format(),
'value' => (int) 0,
'color' => $category->color,
'highlight' => $category->color,
'label' => $category->name
);
}
$incomes_amount += $amount;
break;
case 'expense':
$payments = $category->payments;
$amount = 0;
if ($payments) {
foreach ($payments as $payment) {
$amount += $payment->getConvertedAmount();
}
$expenses[] = array(
'amount' => money($amount, setting('general.default_currency'), true)->format(),
'value' => (int) $amount,
'color' => $category->color,
'highlight' => $category->color,
'label' => $category->name
);
} else {
$expenses[] = array(
'amount' => money(0, setting('general.default_currency'), true)->format(),
'value' => (int) 0,
'color' => $category->color,
'highlight' => $category->color,
'label' => $category->name
);
}
$expenses_amount += $amount;
break;
}
}
if (empty($incomes_amount)) {
foreach ($incomes as $key => $income) {
$incomes[$key]['amount'] = money(0, setting('general.default_currency'), true)->format();
$incomes[$key]['value'] = (int) 100 / count($incomes);
}
}
// Incomes Pie Chart
$income_graph = json_encode($incomes);
if (empty($expenses_amount)) {
foreach ($expenses as $key => $expense) {
$expenses[$key]['amount'] = money(0, setting('general.default_currency'), true)->format();
$expenses[$key]['value'] = (int) 100 / count($expenses);
}
}
// Expenses Pie Chart
$expense_graph = json_encode($expenses);
private function getTotals()
{
list($incomes_amount, $open_invoice, $overdue_invoice, $expenses_amount, $open_bill, $overdue_bill) = $this->calculateAmounts();
$incomes_progress = 100;
@ -241,44 +118,175 @@ class Dashboard extends Controller
'progress' => $total_progress
);
/*
* Accounts
*/
$accounts = Account::enabled()->get();
/*
* Latest Incomes
*/
$latest_incomes = collect(Invoice::accrued()->latest()->take(10)->get());
$latest_incomes = $latest_incomes->merge(Revenue::latest()->take(10)->get())->take(5)->sortByDesc('invoiced_at');
/*
* Latest Expenses
*/
$latest_expenses = collect(Bill::accrued()->latest()->take(10)->get());
$latest_expenses = $latest_expenses->merge(Payment::latest()->take(10)->get())->take(5)->sortByDesc('billed_at');
return view('dashboard.dashboard.index', compact(
'total_incomes',
'total_expenses',
'total_profit',
'cash_flow',
'incomes',
'incomes_amount',
'income_graph',
'expenses',
'expenses_amount',
'expense_graph',
'accounts',
'latest_incomes',
'latest_expenses'
));
return array($total_incomes, $total_expenses, $total_profit);
}
private function getCashFlow($type, $period)
private function getCashFlow()
{
$start = Date::parse(request('start', $this->today->startOfYear()->format('Y-m-d')));
$end = Date::parse(request('end', $this->today->endOfYear()->format('Y-m-d')));
$period = request('period', 'month');
$start_month = $start->month;
$end_month = $end->month;
// Monthly
$labels = array();
$s = clone $start;
for ($j = $end_month; $j >= $start_month; $j--) {
$labels[$end_month - $j] = $s->format('M Y');
if ($period == 'month') {
$s->addMonth();
} else {
$s->addMonths(3);
$j -= 2;
}
}
$income = $this->calculateCashFlowTotals('income', $start, $end, $period);
$expense = $this->calculateCashFlowTotals('expense', $start, $end, $period);
$profit = $this->calculateCashFlowProfit($income, $expense);
$chart = Charts::multi('line', 'chartjs')
->dimensions(0, 300)
->colors(['#6da252', '#00c0ef', '#F56954'])
->dataset(trans_choice('general.profits', 1), $profit)
->dataset(trans_choice('general.incomes', 1), $income)
->dataset(trans_choice('general.expenses', 1), $expense)
->labels($labels)
->credits(false)
->view('vendor.consoletvs.charts.chartjs.multi.line');
return $chart;
}
private function getDonuts()
{
// Show donut prorated if there is no income
if (array_sum($this->income_donut['values']) == 0) {
foreach ($this->income_donut['values'] as $key => $value) {
$this->income_donut['values'][$key] = 1;
}
}
// Get 6 categories by amount
$colors = $labels = [];
$values = collect($this->income_donut['values'])->sort()->reverse()->take(6)->all();
foreach ($values as $id => $val) {
$colors[$id] = $this->income_donut['colors'][$id];
$labels[$id] = $this->income_donut['labels'][$id];
}
$donut_incomes = Charts::create('donut', 'chartjs')
->colors($colors)
->labels($labels)
->values($values)
->dimensions(0, 160)
->credits(false)
->view('vendor.consoletvs.charts.chartjs.donut');
// Show donut prorated if there is no expense
if (array_sum($this->expense_donut['values']) == 0) {
foreach ($this->expense_donut['values'] as $key => $value) {
$this->expense_donut['values'][$key] = 1;
}
}
// Get 6 categories by amount
$colors = $labels = [];
$values = collect($this->expense_donut['values'])->sort()->reverse()->take(6)->all();
foreach ($values as $id => $val) {
$colors[$id] = $this->expense_donut['colors'][$id];
$labels[$id] = $this->expense_donut['labels'][$id];
}
$donut_expenses = Charts::create('donut', 'chartjs')
->colors($colors)
->labels($labels)
->values($values)
->dimensions(0, 160)
->credits(false)
->view('vendor.consoletvs.charts.chartjs.donut');
return array($donut_incomes, $donut_expenses);
}
private function getLatestIncomes()
{
$latest = collect(Invoice::accrued()->latest()->take(10)->get());
$latest = $latest->merge(Revenue::latest()->take(10)->get())->take(5)->sortByDesc('invoiced_at');
return $latest;
}
private function getLatestExpenses()
{
$latest = collect(Bill::accrued()->latest()->take(10)->get());
$latest = $latest->merge(Payment::latest()->take(10)->get())->take(5)->sortByDesc('billed_at');
return $latest;
}
private function calculateAmounts()
{
$incomes_amount = $expenses_amount = 0;
// Invoices
$invoices = Invoice::with('payments')->accrued()->get();
list($invoice_paid_amount, $open_invoice, $overdue_invoice) = $this->calculateTotals($invoices, 'invoice');
$incomes_amount += $invoice_paid_amount;
// Add to Incomes By Category
$this->addToIncomeDonut('#00c0ef', $invoice_paid_amount, trans_choice('general.invoices', 2));
// Bills
$bills = Bill::with('payments')->accrued()->get();
list($bill_paid_amount, $open_bill, $overdue_bill) = $this->calculateTotals($bills, 'bill');
$expenses_amount += $bill_paid_amount;
// Add to Expenses By Category
$this->addToExpenseDonut('#dd4b39', $bill_paid_amount, trans_choice('general.bills', 2));
// Revenues & Payments
$categories = Category::orWhere('type', 'income')->orWhere('type', 'expense')->enabled()->get();
foreach ($categories as $category) {
switch ($category->type) {
case 'income':
$amount = 0;
foreach ($category->revenues as $revenue) {
$amount += $revenue->getConvertedAmount();
}
$this->addToIncomeDonut($category->color, $amount, $category->name);
$incomes_amount += $amount;
break;
case 'expense':
$amount = 0;
foreach ($category->payments as $payment) {
$amount += $payment->getConvertedAmount();
}
$this->addToExpenseDonut($category->color, $amount, $category->name);
$expenses_amount += $amount;
break;
}
}
return array($incomes_amount, $open_invoice, $overdue_invoice, $expenses_amount, $open_bill, $overdue_bill);
}
private function calculateCashFlowTotals($type, $start, $end, $period)
{
$totals = array();
@ -290,64 +298,77 @@ class Dashboard extends Controller
$m2 = '\App\Models\Expense\BillPayment';
}
switch ($period) {
case 'yearly':
$f1 = 'subYear';
$f2 = 'addYear';
$date_format = 'Y-m';
$date_format = 'Y';
break;
case 'monthly':
$f1 = 'subYear';
$f2 = 'addMonth';
$date_format = 'Y-m';
break;
default:
case 'daily':
$f1 = 'subMonth';
$f2 = 'addDay';
$date_format = 'Y-m-d';
break;
if ($period == 'month') {
$n = 1;
$start_date = $start->format($date_format);
$end_date = $end->format($date_format);
$next_date = $start_date;
} else {
$n = 3;
$start_date = $start->quarter;
$end_date = $end->quarter;
$next_date = $start_date;
}
$now = Date::now();
$sub = Date::now()->$f1();
$start_date = $sub->format($date_format);
$end_date = $now->format($date_format);
$next_date = $start_date;
$totals[$start_date] = 0;
do {
$next_date = Date::parse($next_date)->$f2()->format($date_format);
$s = clone $start;
//$totals[$start_date] = 0;
while ($next_date <= $end_date) {
$totals[$next_date] = 0;
} while ($next_date < $end_date);
$items_1 = $m1::whereBetween('paid_at', [$sub, $now])->get();
if ($period == 'month') {
$next_date = $s->addMonths($n)->format($date_format);
} else {
if (isset($totals[4])) {
break;
}
$this->setCashFlowTotals($totals, $items_1, $date_format);
$next_date = $s->addMonths($n)->quarter;
}
}
$items_2 = $m2::whereBetween('paid_at', [$sub, $now])->get();
$items_1 = $m1::whereBetween('paid_at', [$start, $end])->get();
$this->setCashFlowTotals($totals, $items_2, $date_format);
$this->setCashFlowTotals($totals, $items_1, $date_format, $period);
$items_2 = $m2::whereBetween('paid_at', [$start, $end])->get();
$this->setCashFlowTotals($totals, $items_2, $date_format, $period);
return $totals;
}
private function setCashFlowTotals(&$totals, $items, $date_format)
private function setCashFlowTotals(&$totals, $items, $date_format, $period)
{
foreach ($items as $item) {
$i = Date::parse($item->paid_at)->format($date_format);
if ($period == 'month') {
$i = Date::parse($item->paid_at)->format($date_format);
} else {
$i = Date::parse($item->paid_at)->quarter;
}
$totals[$i] += $item->getConvertedAmount();
}
}
private function getTotals($items, $type)
private function calculateCashFlowProfit($incomes, $expenses)
{
$profit = [];
foreach ($incomes as $key => $income) {
if ($income > 0 && $income > $expenses[$key]) {
$profit[$key] = $income - $expenses[$key];
} else {
$profit[$key] = 0;
}
}
return $profit;
}
private function calculateTotals($items, $type)
{
$paid = $open = $overdue = 0;
@ -380,18 +401,17 @@ class Dashboard extends Controller
return array($paid, $open, $overdue);
}
private function getProfit($incomes, $expenses)
private function addToIncomeDonut($color, $amount, $text)
{
$profit = [];
$this->income_donut['colors'][] = $color;
$this->income_donut['labels'][] = money($amount, setting('general.default_currency'), true)->format() . ' - ' . $text;
$this->income_donut['values'][] = (int) $amount;
}
foreach ($incomes as $key => $income) {
if ($income > 0 && $income > $expenses[$key]) {
$profit[$key] = $income - $expenses[$key];
} else {
$profit[$key] = 0;
}
}
return $profit;
private function addToExpenseDonut($color, $amount, $text)
{
$this->expense_donut['colors'][] = $color;
$this->expense_donut['labels'][] = money($amount, setting('general.default_currency'), true)->format() . ' - ' . $text;
$this->expense_donut['values'][] = (int) $amount;
}
}

View File

@ -37,7 +37,7 @@ class Bills extends Controller
*/
public function index()
{
$bills = Bill::with(['vendor', 'status', 'items', 'payments', 'histories'])->collect();
$bills = Bill::with(['vendor', 'status', 'items', 'payments', 'histories'])->collect(['billed_at'=> 'desc']);
$vendors = collect(Vendor::enabled()->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.vendors', 2)]), '');
@ -156,7 +156,7 @@ class Bills extends Controller
$item_sku = $item_object->sku;
// Increase stock (item bought)
$item_object->quantity++;
$item_object->quantity += $item['quantity'];
$item_object->save();
}
@ -171,7 +171,7 @@ class Bills extends Controller
}
$bill_item['item_id'] = $item['item_id'];
$bill_item['name'] = $item['name'];
$bill_item['name'] = str_limit($item['name'], 180, '');
$bill_item['sku'] = $item_sku;
$bill_item['quantity'] = $item['quantity'];
$bill_item['price'] = $item['price'];
@ -396,7 +396,7 @@ class Bills extends Controller
}
$bill_item['item_id'] = $item['item_id'];
$bill_item['name'] = $item['name'];
$bill_item['name'] = str_limit($item['name'], 180, '');
$bill_item['sku'] = $item_sku;
$bill_item['quantity'] = $item['quantity'];
$bill_item['price'] = $item['price'];
@ -603,17 +603,11 @@ class Bills extends Controller
$bill = Bill::find($request['bill_id']);
if ($request['currency_code'] == $bill->currency_code) {
if ($request['amount'] > $bill->amount) {
$message = trans('messages.error.added', ['type' => trans_choice('general.payment', 1)]);
$total_amount = $bill->amount;
return response()->json($message);
} elseif ($request['amount'] == $bill->amount) {
$bill->bill_status_code = 'paid';
} else {
$bill->bill_status_code = 'partial';
}
} else {
$amount = (double) $request['amount'];
if ($request['currency_code'] != $bill->currency_code) {
$request_bill = new Bill();
$request_bill->amount = (float) $request['amount'];
@ -621,16 +615,24 @@ class Bills extends Controller
$request_bill->currency_rate = $currency->rate;
$amount = $request_bill->getConvertedAmount();
}
if ($amount > $bill->amount) {
$message = trans('messages.error.added', ['type' => trans_choice('general.payment', 1)]);
if ($bill->payments()->count()) {
$total_amount -= $bill->payments()->paid();
}
return response()->json($message);
} elseif ($amount == $bill->amount) {
$bill->bill_status_code = 'paid';
} else {
$bill->bill_status_code = 'partial';
}
if ($amount > $total_amount) {
$message = trans('messages.error.payment_add');
return response()->json([
'success' => false,
'error' => true,
'message' => $message,
]);
} elseif ($amount == $total_amount) {
$bill->bill_status_code = 'paid';
} else {
$bill->bill_status_code = 'partial';
}
$bill->save();
@ -640,15 +642,19 @@ class Bills extends Controller
$request['status_code'] = $bill->bill_status_code;
$request['notify'] = 0;
$desc_date = Date::parse($request['paid_at'])->format($this->getCompanyDateFormat());
$desc_amount = money((float) $request['amount'], $request['currency_code'], true)->format();
$request['description'] = $desc_date . ' ' . $desc_amount;
$desc_amount = money((float) $request['amount'], (string) $request['currency_code'], true)->format();
$request['description'] = $desc_amount . ' ' . trans_choice('general.payments', 1);
BillHistory::create($request->input());
$message = trans('messages.success.added', ['type' => trans_choice('general.revenues', 1)]);
return response()->json($message);
return response()->json([
'success' => true,
'error' => false,
'message' => $message,
]);
}
/**
@ -660,12 +666,22 @@ class Bills extends Controller
*/
public function paymentDestroy(BillPayment $payment)
{
$bill = Bill::find($payment->bill_id);
if ($bill->payments()->count() > 1) {
$bill->bill_status_code = 'partial';
} else {
$bill->bill_status_code = 'draft';
}
$bill->save();
$payment->delete();
$message = trans('messages.success.deleted', ['type' => trans_choice('general.bills', 1)]);
flash($message)->success();
return redirect('expenses/bills');
return redirect()->back();
}
}

View File

@ -24,7 +24,7 @@ class Payments extends Controller
*/
public function index()
{
$payments = Payment::with(['vendor', 'account', 'category'])->collect();
$payments = Payment::with(['vendor', 'account', 'category'])->collect(['paid_at'=> 'desc']);
$vendors = collect(Vendor::enabled()->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.vendors', 2)]), '');
@ -35,7 +35,9 @@ class Payments extends Controller
$accounts = collect(Account::enabled()->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.accounts', 2)]), '');
return view('expenses.payments.index', compact('payments', 'vendors', 'categories', 'accounts'));
$transfer_cat_id = Category::transfer();
return view('expenses.payments.index', compact('payments', 'vendors', 'categories', 'accounts', 'transfer_cat_id'));
}
/**
@ -197,6 +199,11 @@ class Payments extends Controller
*/
public function destroy(Payment $payment)
{
// Can't delete transfer payment
if ($payment->category->id == Category::transfer()) {
return redirect('expenses/payments');
}
$payment->delete();
$message = trans('messages.success.deleted', ['type' => trans_choice('general.payments', 1)]);

View File

@ -44,6 +44,10 @@ class Vendors extends Controller
*/
public function store(Request $request)
{
if (empty($request['email'])) {
$request['email'] = '';
}
Vendor::create($request->all());
$message = trans('messages.success.added', ['type' => trans_choice('general.vendors', 1)]);
@ -84,6 +88,11 @@ class Vendors extends Controller
foreach ($rows as $row) {
$data = $row->toArray();
if (empty($data['email'])) {
$data['email'] = '';
}
$data['company_id'] = session('company_id');
Vendor::create($data);
@ -120,6 +129,10 @@ class Vendors extends Controller
*/
public function update(Vendor $vendor, Request $request)
{
if (empty($request['email'])) {
$request['email'] = '';
}
$vendor->update($request->all());
$message = trans('messages.success.updated', ['type' => trans_choice('general.vendors', 1)]);
@ -169,6 +182,10 @@ class Vendors extends Controller
public function vendor(Request $request)
{
if (empty($request['email'])) {
$request['email'] = '';
}
$vendor = Vendor::create($request->all());
return response()->json($vendor);

View File

@ -46,6 +46,10 @@ class Customers extends Controller
public function store(Request $request)
{
if (empty($request->input('create_user'))) {
if (empty($request['email'])) {
$request['email'] = '';
}
Customer::create($request->all());
} else {
// Check if user exist
@ -61,10 +65,14 @@ class Customers extends Controller
}
// Create user first
$user = User::create($request->all());
$data = $request->all();
$data['locale'] = setting('general.default_locale', 'en-GB');
$user = User::create($data);
$user->roles()->attach(['3']);
$user->companies()->attach([session('company_id')]);
// Finally create customer
$request['user_id'] = $user->id;
Customer::create($request->all());
@ -108,6 +116,11 @@ class Customers extends Controller
foreach ($rows as $row) {
$data = $row->toArray();
if (empty($data['email'])) {
$data['email'] = '';
}
$data['company_id'] = session('company_id');
Customer::create($data);
@ -145,6 +158,10 @@ class Customers extends Controller
public function update(Customer $customer, Request $request)
{
if (empty($request->input('create_user'))) {
if (empty($request['email'])) {
$request['email'] = '';
}
$customer->update($request->all());
} else {
// Check if user exist
@ -216,6 +233,10 @@ class Customers extends Controller
public function customer(Request $request)
{
if (empty($request['email'])) {
$request['email'] = '';
}
$customer = Customer::create($request->all());
return response()->json($customer);

View File

@ -30,6 +30,8 @@ use App\Utilities\ImportFile;
use App\Utilities\Modules;
use Date;
use File;
use Image;
use Storage;
class Invoices extends Controller
{
@ -42,7 +44,7 @@ class Invoices extends Controller
*/
public function index()
{
$invoices = Invoice::with(['customer', 'status', 'items', 'payments', 'histories'])->collect();
$invoices = Invoice::with(['customer', 'status', 'items', 'payments', 'histories'])->collect(['invoice_number'=> 'desc']);
$customers = collect(Customer::enabled()->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.customers', 2)]), '');
@ -162,7 +164,7 @@ class Invoices extends Controller
$item_sku = $item_object->sku;
// Decrease stock (item sold)
$item_object->quantity--;
$item_object->quantity -= $item['quantity'];
$item_object->save();
// Notify users if out of stock
@ -188,7 +190,7 @@ class Invoices extends Controller
}
$invoice_item['item_id'] = $item['item_id'];
$invoice_item['name'] = $item['name'];
$invoice_item['name'] = str_limit($item['name'], 180, '');
$invoice_item['sku'] = $item_sku;
$invoice_item['quantity'] = $item['quantity'];
$invoice_item['price'] = $item['price'];
@ -386,7 +388,7 @@ class Invoices extends Controller
}
$invoice_item['item_id'] = $item['item_id'];
$invoice_item['name'] = $item['name'];
$invoice_item['name'] = str_limit($item['name'], 180, '');
$invoice_item['sku'] = $item_sku;
$invoice_item['quantity'] = $item['quantity'];
$invoice_item['price'] = $item['price'];
@ -487,9 +489,15 @@ class Invoices extends Controller
*/
public function emailInvoice(Invoice $invoice)
{
if (empty($invoice->customer_email)) {
return redirect()->back();
}
$invoice = $this->prepareInvoice($invoice);
$html = view($invoice->template_path, compact('invoice'))->render();
$logo = $this->getLogo();
$html = view($invoice->template_path, compact('invoice', 'logo'))->render();
$pdf = \App::make('dompdf.wrapper');
$pdf->loadHTML($html);
@ -531,7 +539,9 @@ class Invoices extends Controller
{
$invoice = $this->prepareInvoice($invoice);
return view($invoice->template_path, compact('invoice'));
$logo = $this->getLogo();
return view($invoice->template_path, compact('invoice', 'logo'));
}
/**
@ -545,7 +555,9 @@ class Invoices extends Controller
{
$invoice = $this->prepareInvoice($invoice);
$html = view($invoice->template_path, compact('invoice'))->render();
$logo = $this->getLogo();
$html = view($invoice->template_path, compact('invoice', 'logo'))->render();
$pdf = \App::make('dompdf.wrapper');
$pdf->loadHTML($html);
@ -576,18 +588,23 @@ class Invoices extends Controller
$amount = $invoice->amount - $paid;
$request = new PaymentRequest();
if (!empty($amount)) {
$request = new PaymentRequest();
$request['company_id'] = $invoice->company_id;
$request['invoice_id'] = $invoice->id;
$request['account_id'] = setting('general.default_account');
$request['payment_method'] = setting('general.default_payment_method');
$request['currency_code'] = $invoice->currency_code;
$request['amount'] = $amount;
$request['paid_at'] = Date::now();
$request['_token'] = csrf_token();
$request['company_id'] = $invoice->company_id;
$request['invoice_id'] = $invoice->id;
$request['account_id'] = setting('general.default_account');
$request['payment_method'] = setting('general.default_payment_method', 'offlinepayment.cash.1');
$request['currency_code'] = $invoice->currency_code;
$request['amount'] = $amount;
$request['paid_at'] = Date::now();
$request['_token'] = csrf_token();
$this->payment($request);
$this->payment($request);
} else {
$invoice->invoice_status_code = 'paid';
$invoice->save();
}
return redirect()->back();
}
@ -616,17 +633,11 @@ class Invoices extends Controller
$invoice = Invoice::find($request['invoice_id']);
if ($request['currency_code'] == $invoice->currency_code) {
if ($request['amount'] > $invoice->amount) {
$message = trans('messages.error.added', ['type' => trans_choice('general.payment', 1)]);
$total_amount = $invoice->amount;
return response()->json($message);
} elseif ($request['amount'] == $invoice->amount) {
$invoice->invoice_status_code = 'paid';
} else {
$invoice->invoice_status_code = 'partial';
}
} else {
$amount = (double) $request['amount'];
if ($request['currency_code'] != $invoice->currency_code) {
$request_invoice = new Invoice();
$request_invoice->amount = (float) $request['amount'];
@ -634,16 +645,24 @@ class Invoices extends Controller
$request_invoice->currency_rate = $currency->rate;
$amount = $request_invoice->getConvertedAmount();
}
if ($amount > $invoice->amount) {
$message = trans('messages.error.added', ['type' => trans_choice('general.payment', 1)]);
if ($invoice->payments()->count()) {
$total_amount -= $invoice->payments()->paid();
}
return response()->json($message);
} elseif ($amount == $invoice->amount) {
$invoice->invoice_status_code = 'paid';
} else {
$invoice->invoice_status_code = 'partial';
}
if ($amount > $total_amount) {
$message = trans('messages.error.payment_add');
return response()->json([
'success' => false,
'error' => true,
'message' => $message,
]);
} elseif ($amount == $total_amount) {
$invoice->invoice_status_code = 'paid';
} else {
$invoice->invoice_status_code = 'partial';
}
$invoice->save();
@ -653,15 +672,19 @@ class Invoices extends Controller
$request['status_code'] = $invoice->invoice_status_code;
$request['notify'] = 0;
$desc_date = Date::parse($request['paid_at'])->format($this->getCompanyDateFormat());
$desc_amount = money((float) $request['amount'], $request['currency_code'], true)->format();
$request['description'] = $desc_date . ' ' . $desc_amount;
$desc_amount = money((float) $request['amount'], (string) $request['currency_code'], true)->format();
$request['description'] = $desc_amount . ' ' . trans_choice('general.payments', 1);
InvoiceHistory::create($request->input());
$message = trans('messages.success.added', ['type' => trans_choice('general.revenues', 1)]);
return response()->json($message);
return response()->json([
'success' => true,
'error' => false,
'message' => $message,
]);
}
/**
@ -673,13 +696,25 @@ class Invoices extends Controller
*/
public function paymentDestroy(InvoicePayment $payment)
{
$invoice = Invoice::find($payment->invoice_id);
if ($invoice->payments()->paid() == $invoice->amount) {
$invoice->invoice_status_code = 'paid';
} elseif ($invoice->payments()->count() > 1) {
$invoice->invoice_status_code = 'partial';
} else {
$invoice->invoice_status_code = 'draft';
}
$invoice->save();
$payment->delete();
$message = trans('messages.success.deleted', ['type' => trans_choice('general.invoices', 1)]);
flash($message)->success();
return redirect('incomes/invoices');
return redirect()->back();
}
protected function prepareInvoice(Invoice $invoice)
@ -743,4 +778,31 @@ class Invoices extends Controller
'sort_order' => $sort_order,
]);
}
protected function getLogo()
{
$logo = '';
if (setting('general.invoice_logo')) {
$file = session('company_id') . '/' . setting('general.invoice_logo');
} else {
$file = session('company_id') . '/' . setting('general.company_logo');
}
$path = Storage::path($file);
if (!is_file($path)) {
return $logo;
}
$image = Image::make($path)->encode()->getEncoded();
if (empty($image)) {
return $logo;
}
$extension = File::extension($path);
$logo = 'data:image/' . $extension . ';base64,' . base64_encode($image);
return $logo;
}
}

View File

@ -26,7 +26,7 @@ class Revenues extends Controller
*/
public function index()
{
$revenues = Revenue::with(['account', 'category', 'customer'])->collect();
$revenues = Revenue::with(['account', 'category', 'customer'])->collect(['paid_at'=> 'desc']);
$customers = collect(Customer::enabled()->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.customers', 2)]), '');
@ -37,7 +37,9 @@ class Revenues extends Controller
$accounts = collect(Account::enabled()->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.accounts', 2)]), '');
return view('incomes.revenues.index', compact('revenues', 'customers', 'categories', 'accounts'));
$transfer_cat_id = Category::transfer();
return view('incomes.revenues.index', compact('revenues', 'customers', 'categories', 'accounts', 'transfer_cat_id'));
}
/**
@ -199,6 +201,11 @@ class Revenues extends Controller
*/
public function destroy(Revenue $revenue)
{
// Can't delete transfer revenue
if ($revenue->category->id == Category::transfer()) {
return redirect('incomes/revenues');
}
$revenue->delete();
$message = trans('messages.success.deleted', ['type' => trans_choice('general.revenues', 1)]);

View File

@ -247,13 +247,16 @@ class Items extends Controller
if ($input_items) {
foreach ($input_items as $key => $item) {
$price = (double) $item['price'];
$quantity = (int) $item['quantity'];
$item_tax_total= 0;
$item_sub_total = ($item['price'] * $item['quantity']);
$item_sub_total = ($price * $quantity);
if (!empty($item['tax_id'])) {
$tax = Tax::find($item['tax_id']);
$item_tax_total = (($item['price'] * $item['quantity']) / 100) * $tax->rate;
$item_tax_total = (($price * $quantity) / 100) * $tax->rate;
}
$sub_total += $item_sub_total;

View File

@ -19,9 +19,15 @@ class Home extends Controller
{
$this->checkApiToken();
$paid = $this->getPaidModules();
$new = $this->getNewModules();
$free = $this->getFreeModules();
$data = [
'query' => [
'limit' => 4
]
];
$paid = $this->getPaidModules($data);
$new = $this->getNewModules($data);
$free = $this->getFreeModules($data);
return view('modules.home.index', compact('paid', 'new', 'free'));
}

View File

@ -2,19 +2,33 @@
namespace App\Http\Controllers\Modules;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Models\Module\Module;
use App\Models\Module\ModuleHistory;
use App\Traits\Modules;
use Artisan;
use Illuminate\Http\Request;
use Illuminate\Routing\Route;
class Item extends Controller
{
use Modules;
/**
* Instantiate a new controller instance.
*
* @param Route $route
*/
public function __construct(Route $route)
{
parent::__construct($route);
// Add CRUD permission check
$this->middleware('permission:create-modules-item')->only(['install']);
$this->middleware('permission:update-modules-item')->only(['update', 'enable', 'disable']);
$this->middleware('permission:delete-modules-item')->only(['uninstall']);
}
/**
* Show the form for viewing the specified resource.
*
@ -31,7 +45,7 @@ class Item extends Controller
$module = $this->getModule($alias);
$check = Module::where('alias', $alias)->first();
$check = Module::alias($alias)->first();
if ($check) {
$installed = true;
@ -154,7 +168,7 @@ class Item extends Controller
$json = $this->uninstallModule($alias);
$module = Module::where('alias', $alias)->first();
$module = Module::alias($alias)->first();
$data = array(
'company_id' => session('company_id'),
@ -181,7 +195,7 @@ class Item extends Controller
$json = $this->updateModule($alias);
$module = Module::where('alias', $alias)->first();
$module = Module::alias($alias)->first();
$data = array(
'company_id' => session('company_id'),
@ -206,7 +220,7 @@ class Item extends Controller
$json = $this->enableModule($alias);
$module = Module::where('alias', $alias)->first();
$module = Module::alias($alias)->first();
$data = array(
'company_id' => session('company_id'),
@ -235,7 +249,7 @@ class Item extends Controller
$json = $this->disableModule($alias);
$module = Module::where('alias', $alias)->first();
$module = Module::alias($alias)->first();
$data = array(
'company_id' => session('company_id'),

View File

@ -7,6 +7,7 @@ use App\Models\Expense\Bill;
use App\Models\Expense\BillPayment;
use App\Models\Expense\Payment;
use App\Models\Setting\Category;
use Charts;
use Date;
class ExpenseSummary extends Controller
@ -90,10 +91,19 @@ class ExpenseSummary extends Controller
$this->setAmount($expenses_graph, $totals, $expenses, $payments, 'payment', 'paid_at');
}
// Expenses chart
$chart = Charts::multi('line', 'chartjs')
->dimensions(0, 300)
->colors(['#F56954'])
->dataset(trans_choice('general.expenses', 1), $expenses_graph)
->labels($dates)
->credits(false)
->view('vendor.consoletvs.charts.chartjs.multi.line');
// Expenses Graph
$expenses_graph = json_encode($expenses_graph);
return view('reports.expense_summary.index', compact('dates', 'categories', 'expenses', 'expenses_graph', 'totals'));
return view('reports.expense_summary.index', compact('chart', 'dates', 'categories', 'expenses', 'totals'));
}
private function setAmount(&$graph, &$totals, &$expenses, $items, $type, $date_field)

View File

@ -10,6 +10,7 @@ use App\Models\Expense\Bill;
use App\Models\Expense\BillPayment;
use App\Models\Expense\Payment;
use App\Models\Setting\Category;
use Charts;
use Date;
class IncomeExpenseSummary extends Controller
@ -21,7 +22,7 @@ class IncomeExpenseSummary extends Controller
*/
public function index()
{
$dates = $totals = $compares = $compares_graph = $categories = [];
$dates = $totals = $compares = $profit_graph = $categories = [];
$status = request('status');
@ -49,7 +50,7 @@ class IncomeExpenseSummary extends Controller
for ($j = 1; $j <= 12; $j++) {
$dates[$j] = Date::parse($year . '-' . $j)->format('F');
$compares_graph[Date::parse($year . '-' . $j)->format('F-Y')] = 0;
$profit_graph[Date::parse($year . '-' . $j)->format('F-Y')] = 0;
// Totals
$totals[$dates[$j]] = array(
@ -100,50 +101,56 @@ class IncomeExpenseSummary extends Controller
switch ($status) {
case 'paid':
$invoices = InvoicePayment::monthsOfYear('paid_at')->get();
$this->setAmount($compares_graph, $totals, $compares, $invoices, 'invoice', 'paid_at');
$this->setAmount($profit_graph, $totals, $compares, $invoices, 'invoice', 'paid_at');
break;
case 'upcoming':
$invoices = Invoice::accrued()->monthsOfYear('due_at')->get();
$this->setAmount($compares_graph, $totals, $compares, $invoices, 'invoice', 'due_at');
$this->setAmount($profit_graph, $totals, $compares, $invoices, 'invoice', 'due_at');
break;
default:
$invoices = Invoice::accrued()->monthsOfYear('invoiced_at')->get();
$this->setAmount($compares_graph, $totals, $compares, $invoices, 'invoice', 'invoiced_at');
$this->setAmount($profit_graph, $totals, $compares, $invoices, 'invoice', 'invoiced_at');
break;
}
// Revenues
if ($status != 'upcoming') {
$revenues = Revenue::monthsOfYear('paid_at')->get();
$this->setAmount($compares_graph, $totals, $compares, $revenues, 'revenue', 'paid_at');
$this->setAmount($profit_graph, $totals, $compares, $revenues, 'revenue', 'paid_at');
}
// Bills
switch ($status) {
case 'paid':
$bills = BillPayment::monthsOfYear('paid_at')->get();
$this->setAmount($compares_graph, $totals, $compares, $bills, 'bill', 'paid_at');
$this->setAmount($profit_graph, $totals, $compares, $bills, 'bill', 'paid_at');
break;
case 'upcoming':
$bills = Bill::accrued()->monthsOfYear('due_at')->get();
$this->setAmount($compares_graph, $totals, $compares, $bills, 'bill', 'due_at');
$this->setAmount($profit_graph, $totals, $compares, $bills, 'bill', 'due_at');
break;
default:
$bills = Bill::accrued()->monthsOfYear('billed_at')->get();
$this->setAmount($compares_graph, $totals, $compares, $bills, 'bill', 'billed_at');
$this->setAmount($profit_graph, $totals, $compares, $bills, 'bill', 'billed_at');
break;
}
// Payments
if ($status != 'upcoming') {
$payments = Payment::monthsOfYear('paid_at')->get();
$this->setAmount($compares_graph, $totals, $compares, $payments, 'payment', 'paid_at');
$this->setAmount($profit_graph, $totals, $compares, $payments, 'payment', 'paid_at');
}
// Incomes Graph
$compares_graph = json_encode($compares_graph);
// Profit chart
$chart = Charts::multi('line', 'chartjs')
->dimensions(0, 300)
->colors(['#6da252'])
->dataset(trans_choice('general.profits', 1), $profit_graph)
->labels($dates)
->credits(false)
->view('vendor.consoletvs.charts.chartjs.multi.line');
return view('reports.income_expense_summary.index', compact('dates', 'income_categories', 'expense_categories', 'compares', 'compares_graph', 'totals'));
return view('reports.income_expense_summary.index', compact('chart', 'dates', 'income_categories', 'expense_categories', 'compares', 'totals'));
}
private function setAmount(&$graph, &$totals, &$compares, $items, $type, $date_field)

View File

@ -7,6 +7,7 @@ use App\Models\Income\Invoice;
use App\Models\Income\InvoicePayment;
use App\Models\Income\Revenue;
use App\Models\Setting\Category;
use Charts;
use Date;
class IncomeSummary extends Controller
@ -90,10 +91,16 @@ class IncomeSummary extends Controller
$this->setAmount($incomes_graph, $totals, $incomes, $revenues, 'revenue', 'paid_at');
}
// Incomes Graph
$incomes_graph = json_encode($incomes_graph);
// Incomes chart
$chart = Charts::multi('line', 'chartjs')
->dimensions(0, 300)
->colors(['#00c0ef'])
->dataset(trans_choice('general.incomes', 1), $incomes_graph)
->labels($dates)
->credits(false)
->view('vendor.consoletvs.charts.chartjs.multi.line');
return view('reports.income_summary.index', compact('dates', 'categories', 'incomes', 'incomes_graph', 'totals'));
return view('reports.income_summary.index', compact('chart', 'dates', 'categories', 'incomes', 'totals'));
}
private function setAmount(&$graph, &$totals, &$incomes, $items, $type, $date_field)

View File

@ -18,10 +18,12 @@ class Categories extends Controller
{
$categories = Category::collect();
$transfer_id = Category::transfer();
$types = collect(['expense' => 'Expense', 'income' => 'Income', 'item' => 'Item', 'other' => 'Other'])
->prepend(trans('general.all_type', ['type' => trans_choice('general.types', 2)]), '');
return view('settings.categories.index', compact('categories', 'types'));
return view('settings.categories.index', compact('categories', 'types', 'transfer_id'));
}
/**
@ -112,6 +114,11 @@ class Categories extends Controller
'payments' => 'payments',
]);
// Can't delete transfer category
if ($category->id == Category::transfer()) {
return redirect('settings/categories');
}
if (empty($relationships)) {
$category->delete();

View File

@ -19,7 +19,7 @@ class Currencies extends Controller
{
$currencies = Currency::collect();
return view('settings.currencies.index', compact('currencies', 'codes', 'rates'));
return view('settings.currencies.index', compact('currencies'));
}
/**
@ -116,20 +116,23 @@ class Currencies extends Controller
*/
public function update(Currency $currency, Request $request)
{
$relationships = $this->countRelationships($currency, [
'accounts' => 'accounts',
'customers' => 'customers',
'invoices' => 'invoices',
'revenues' => 'revenues',
'bills' => 'bills',
'payments' => 'payments',
]);
// Check if we can disable it
if (!$request['enabled']) {
$relationships = $this->countRelationships($currency, [
'accounts' => 'accounts',
'customers' => 'customers',
'invoices' => 'invoices',
'revenues' => 'revenues',
'bills' => 'bills',
'payments' => 'payments',
]);
if ($currency->code == setting('general.default_currency')) {
$relationships[] = strtolower(trans_choice('general.companies', 1));
if ($currency->code == setting('general.default_currency')) {
$relationships[] = strtolower(trans_choice('general.companies', 1));
}
}
if (empty($relationships) || $request['enabled']) {
if (empty($relationships)) {
// Force the rate to be 1 for default currency
if ($request['default_currency']) {
$request['rate'] = '1';
@ -209,4 +212,20 @@ class Currencies extends Controller
return response()->json($json);
}
public function config()
{
$json = new \stdClass();
$code = request('code');
if ($code) {
$currency = config('money.' . $code);
$currency['symbol_first'] = $currency['symbol_first'] ? 1 : 0;
$json = (object) $currency;
}
return response()->json($json);
}
}

View File

@ -5,13 +5,14 @@ namespace App\Http\Controllers\Settings;
use App\Http\Controllers\Controller;
use App\Http\Requests\Setting\Setting as Request;
use App\Models\Banking\Account;
use App\Models\Company\Company;
use App\Models\Setting\Currency;
use App\Models\Setting\Tax;
use App\Models\Setting\Setting;
use App\Models\Setting\Tax;
use App\Traits\DateTime;
use App\Traits\Uploads;
use App\Utilities\Modules;
use DotenvEditor;
class Settings extends Controller
{
@ -91,6 +92,8 @@ class Settings extends Controller
$skip_keys = ['company_id', '_method', '_token'];
$file_keys = ['company_logo', 'invoice_logo'];
$companies = Company::all()->count();
foreach ($fields as $key => $value) {
// Don't process unwanted keys
if (in_array($key, $skip_keys)) {
@ -107,6 +110,17 @@ class Settings extends Controller
}
}
// Change default locale if only 1 company
if (($key == 'default_locale') && ($companies == 1)) {
// Update .env file
DotenvEditor::setKeys([
[
'key' => 'APP_LOCALE',
'value' => $value,
],
])->save();
}
setting()->set('general.' . $key, $value);
}

View File

@ -36,6 +36,7 @@ class Kernel extends HttpKernel
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\App\Http\Middleware\RedirectIfNotInstalled::class,
\App\Http\Middleware\LoadSettings::class,
\App\Http\Middleware\LoadCurrencies::class,
\App\Http\Middleware\AddXHeader::class,
],

View File

@ -0,0 +1,46 @@
<?php
namespace App\Http\Middleware;
use Akaunting\Money\Currency;
use App\Models\Setting\Currency as Model;
use Closure;
class LoadCurrencies
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$company_id = session('company_id');
if (empty($company_id)) {
return $next($request);
}
$currencies = Model::all();
foreach ($currencies as $currency) {
if (!isset($currency->precision)) {
continue;
}
config(['money.' . $currency->code . '.precision' => $currency->precision]);
config(['money.' . $currency->code . '.symbol' => $currency->symbol]);
config(['money.' . $currency->code . '.symbol_first' => $currency->symbol_first]);
config(['money.' . $currency->code . '.decimal_mark' => $currency->decimal_mark]);
config(['money.' . $currency->code . '.thousands_separator' => $currency->thousands_separator]);
}
// Set currencies with new settings
Currency::setCurrencies(config('money'));
return $next($request);
}
}

View File

@ -0,0 +1,35 @@
<?php
namespace App\Http\Requests\Customer;
use Illuminate\Foundation\Http\FormRequest;
class Profile extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
$id = auth()->user()->getAttribute('id');
return [
'name' => 'required|string',
'email' => 'required|email|unique:users,email,' . $id . ',id,deleted_at,NULL',
'password' => 'confirmed',
'picture' => 'mimes:' . setting('general.file_types') . '|between:0,' . setting('general.file_size') * 1024,
];
}
}

View File

@ -23,6 +23,11 @@ class Vendor extends Request
*/
public function rules()
{
$email = '';
// Get company id
$company_id = $this->request->get('company_id');
// Check if store or update
if ($this->getMethod() == 'PATCH') {
$id = $this->vendor->getAttribute('id');
@ -30,12 +35,13 @@ class Vendor extends Request
$id = null;
}
// Get company id
$company_id = $this->request->get('company_id');
if (!empty($this->request->get('email'))) {
$email = 'email|unique:vendors,NULL,' . $id . ',id,company_id,' . $company_id . ',deleted_at,NULL';
}
return [
'name' => 'required|string',
'email' => 'required|email|unique:vendors,NULL,' . $id . ',id,company_id,' . $company_id . ',deleted_at,NULL',
'email' => $email,
'currency_code' => 'required|string',
];
}

View File

@ -23,8 +23,12 @@ class Customer extends Request
*/
public function rules()
{
$email = '';
$required = '';
// Get company id
$company_id = $this->request->get('company_id');
// Check if store or update
if ($this->getMethod() == 'PATCH') {
$id = $this->customer->getAttribute('id');
@ -36,12 +40,13 @@ class Customer extends Request
$required = 'required|';
}
// Get company id
$company_id = $this->request->get('company_id');
if (!empty($this->request->get('email'))) {
$email = 'email|unique:customers,NULL,' . $id . ',id,company_id,' . $company_id . ',deleted_at,NULL';
}
return [
'name' => 'required|string',
'email' => 'required|email|unique:customers,NULL,' . $id . ',id,company_id,' . $company_id . ',deleted_at,NULL',
'email' => $email,
'currency_code' => 'required|string',
'password' => $required . 'confirmed',
];

View File

@ -2,6 +2,7 @@
namespace App\Http\ViewComposers;
use Date;
use Illuminate\View\View;
class Index
@ -16,8 +17,17 @@ class Index
{
$limits = ['10' => '10', '25' => '25', '50' => '50', '100' => '100'];
$years = ['2017' => '2017', '2016' => '2016', '2015' => '2015', '2014' => '2014'];
$now = Date::now();
$view->with(['limits' => $limits, 'years' => $years]);
$this_year = $now->year;
$years = [];
$y = $now->addYears(5);
for ($i = 0; $i < 10; $i++) {
$years[$y->year] = $y->year;
$y->subYear();
}
$view->with(['limits' => $limits, 'this_year' => $this_year, 'years' => $years]);
}
}

View File

@ -0,0 +1,43 @@
<?php
namespace App\Listeners\Updates;
use App\Events\UpdateFinished;
use App\Models\Company\Company;
use DotenvEditor;
class Version112 extends Listener
{
const ALIAS = 'core';
const VERSION = '1.1.2';
/**
* Handle the event.
*
* @param $event
* @return void
*/
public function handle(UpdateFinished $event)
{
// Check if should listen
if (!$this->check($event)) {
return;
}
$locale = 'en-GB';
// Get default locale if only 1 company
if (Company::all()->count() == 1) {
$locale = setting('general.default_locale', 'en-GB');
}
// Set default locale
DotenvEditor::setKeys([
[
'key' => 'APP_LOCALE',
'value' => $locale,
],
])->save();
}
}

View File

@ -0,0 +1,41 @@
<?php
namespace App\Listeners\Updates;
use App\Events\UpdateFinished;
use App\Models\Setting\Currency;
class Version113 extends Listener
{
const ALIAS = 'core';
const VERSION = '1.1.3';
/**
* Handle the event.
*
* @param $event
* @return void
*/
public function handle(UpdateFinished $event)
{
// Check if should listen
if (!$this->check($event)) {
return;
}
// Update currencies
$currencies = Currency::all();
foreach ($currencies as $currency) {
$currency->precision = config('money.' . $currency->code . '.precision');
$currency->symbol = config('money.' . $currency->code . '.symbol');
$currency->symbol_first = config('money.' . $currency->code . '.symbol_first') ? 1 : 0;
$currency->decimal_mark = config('money.' . $currency->code . '.decimal_mark');
$currency->thousands_separator = config('money.' . $currency->code . '.thousands_separator');
$currency->save();
}
}
}

View File

@ -59,16 +59,6 @@ class User extends Authenticatable
return $this->hasOne('App\Models\Income\Customer', 'user_id', 'id');
}
public function invoices()
{
return $this->hasMany('App\Models\Income\Invoice', 'customer_id', 'id');
}
public function revenues()
{
return $this->hasMany('App\Models\Income\Revenue', 'customer_id', 'id');
}
/**
* Always capitalize the name when we retrieve it
*/

View File

@ -67,4 +67,15 @@ class BillPayment extends Model
{
$this->attributes['currency_rate'] = (double) $value;
}
/**
* Scope paid invoice.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopePaid($query)
{
return $query->sum('amount');
}
}

View File

@ -9,10 +9,40 @@ class BillStatus extends Model
protected $table = 'bill_statuses';
/**
* The accessors to append to the model's array form.
*
* @var array
*/
protected $appends = ['label'];
/**
* Attributes that should be mass-assignable.
*
* @var array
*/
protected $fillable = ['company_id', 'name', 'code'];
/**
* Get the status label.
*
* @return string
*/
public function getLabelAttribute()
{
switch ($this->code) {
case 'paid':
$label = 'label-success';
break;
case 'partial':
case 'received':
$label = 'label-warning';
break;
default:
$label = 'bg-aqua';
break;
}
return $label;
}
}

View File

@ -57,7 +57,7 @@ class Customer extends Model
public function user()
{
return $this->belongsTo('App\Models\Auth\User', 'customer_id', 'id');
return $this->belongsTo('App\Models\Auth\User', 'user_id', 'id');
}
public function onCloning($src, $child = null)

View File

@ -53,11 +53,6 @@ class Invoice extends Model
*/
protected $cloneable_relations = ['items', 'totals'];
public function user()
{
return $this->belongsTo('App\Models\Auth\User', 'customer_id', 'id');
}
public function customer()
{
return $this->belongsTo('App\Models\Income\Customer');

View File

@ -67,4 +67,15 @@ class InvoicePayment extends Model
{
$this->attributes['currency_rate'] = (double) $value;
}
/**
* Scope paid invoice.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopePaid($query)
{
return $query->sum('amount');
}
}

View File

@ -9,10 +9,40 @@ class InvoiceStatus extends Model
protected $table = 'invoice_statuses';
/**
* The accessors to append to the model's array form.
*
* @var array
*/
protected $appends = ['label'];
/**
* Attributes that should be mass-assignable.
*
* @var array
*/
protected $fillable = ['company_id', 'name', 'code'];
/**
* Get the status label.
*
* @return string
*/
public function getLabelAttribute()
{
switch ($this->code) {
case 'paid':
$label = 'label-success';
break;
case 'partial':
case 'sent':
$label = 'label-warning';
break;
default:
$label = 'bg-aqua';
break;
}
return $label;
}
}

View File

@ -17,4 +17,16 @@ class Module extends Model
* @var array
*/
protected $fillable = ['company_id', 'alias', 'status'];
/**
* Scope alias.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param string $alias
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeAlias($query, $alias)
{
return $query->where('alias', $alias);
}
}

View File

@ -48,4 +48,15 @@ class Category extends Model
{
return $query->where('type', $type);
}
/**
* Scope transfer category.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeTransfer($query)
{
return $query->where('type', 'other')->pluck('id')->first();
}
}

View File

@ -14,7 +14,7 @@ class Currency extends Model
*
* @var array
*/
protected $fillable = ['company_id', 'name', 'code', 'rate', 'enabled'];
protected $fillable = ['company_id', 'name', 'code', 'rate', 'enabled', 'precision', 'symbol', 'symbol_first', 'decimal_mark', 'thousands_separator'];
/**
* Sortable columns.

View File

@ -47,7 +47,7 @@ class Bill extends Notification
public function toMail($notifiable)
{
return (new MailMessage)
->line('You are receiving this email because you have an upcoming ' . money($this->bill->amount, $this->bill->currency_code, true) . ' bill to ' . $this->bill->vendor->name . ' vendor.')
->line('You are receiving this email because you have an upcoming ' . money($this->bill->amount, $this->bill->currency_code, true) . ' bill to ' . $this->bill->vendor_name . ' vendor.')
->action('Add Payment', url('expenses/bills', $this->bill->id, true));
}

View File

@ -47,7 +47,7 @@ class Invoice extends Notification
public function toMail($notifiable)
{
$message = (new MailMessage)
->line(trans('invoices.notification.message', ['amount' => money($this->invoice->amount, $this->invoice->currency_code, true), 'customer' => $this->invoice->customer->name]))
->line(trans('invoices.notification.message', ['amount' => money($this->invoice->amount, $this->invoice->currency_code, true), 'customer' => $this->invoice->customer_name]))
->action(trans('invoices.notification.button'), url('customers/invoices', $this->invoice->id, true));
// Attach the PDF file if available

View File

@ -19,6 +19,8 @@ class EventServiceProvider extends ServiceProvider
'App\Listeners\Updates\Version108',
'App\Listeners\Updates\Version109',
'App\Listeners\Updates\Version110',
'App\Listeners\Updates\Version112',
'App\Listeners\Updates\Version113',
],
'Illuminate\Auth\Events\Login' => [
'App\Listeners\Auth\Login',

View File

@ -13,9 +13,9 @@ trait Currencies
$default = new Currency(setting('general.default_currency', 'USD'));
if ($format) {
$money = Money::$code($amount, true)->convert($default, $rate)->format();
$money = Money::$code($amount, true)->convert($default, (double) $rate)->format();
} else {
$money = Money::$code($amount)->convert($default, $rate)->getAmount();
$money = Money::$code($amount)->convert($default, (double) $rate)->getAmount();
}
return $money;
@ -28,9 +28,9 @@ trait Currencies
$code = new Currency($code);
if ($format) {
$money = Money::$default($amount, true)->convert($code, $rate)->format();
$money = Money::$default($amount, true)->convert($code, (double) $rate)->format();
} else {
$money = Money::$default($amount)->convert($code, $rate)->getAmount();
$money = Money::$default($amount)->convert($code, (double) $rate)->getAmount();
}
return $money;
@ -41,9 +41,9 @@ trait Currencies
$code = new Currency($code);
if ($format) {
$money = Money::$default($amount, true)->convert($code, $rate)->format();
$money = Money::$default($amount, true)->convert($code, (double) $rate)->format();
} else {
$money = Money::$default($amount)->convert($code, $rate)->getAmount();
$money = Money::$default($amount)->convert($code, (double) $rate)->getAmount();
}
return $money;

View File

@ -56,9 +56,9 @@ trait Modules
return [];
}
public function getPaidModules()
public function getPaidModules($data = [])
{
$response = $this->getRemote('apps/paid');
$response = $this->getRemote('apps/paid', 'GET', $data);
if ($response->getStatusCode() == 200) {
return json_decode($response->getBody())->data;
@ -67,9 +67,9 @@ trait Modules
return [];
}
public function getNewModules()
public function getNewModules($data = [])
{
$response = $this->getRemote('apps/new');
$response = $this->getRemote('apps/new', 'GET', $data);
if ($response->getStatusCode() == 200) {
return json_decode($response->getBody())->data;
@ -78,9 +78,9 @@ trait Modules
return [];
}
public function getFreeModules()
public function getFreeModules($data = [])
{
$response = $this->getRemote('apps/free');
$response = $this->getRemote('apps/free', 'GET', $data);
if ($response->getStatusCode() == 200) {
return json_decode($response->getBody())->data;

View File

@ -20,6 +20,11 @@ class Currency extends TransformerAbstract
'code' => $model->code,
'rate' => $model->rate,
'enabled' => $model->enabled,
'precision' => $model->precision,
'symbol' => $model->symbol,
'symbol_first' => $model->symbol_first,
'decimal_mark' => $model->decimal_mark,
'thousands_separator' => $model->thousands_separator,
'created_at' => $model->created_at->toIso8601String(),
'updated_at' => $model->updated_at->toIso8601String(),
];

View File

@ -21,7 +21,7 @@ class ImportFile extends ExcelFile
$folder = session('company_id') . '/imports';
// Upload file
$path = Storage::path($request->import->store($folder));
$path = Storage::path($request->file('import')->store($folder));
return $path;
}

View File

@ -16,6 +16,7 @@
"barryvdh/laravel-dompdf": "0.*",
"barryvdh/laravel-ide-helper": "2.3.*",
"bkwld/cloner": "3.2.*",
"consoletvs/charts": "4.6.*",
"dingo/api": "1.0.0-beta8",
"guzzlehttp/guzzle": "6.3.*",
"intervention/image": "2.3.*",
@ -53,27 +54,28 @@
},
"scripts": {
"post-install-cmd": [
"composer dump-autoload",
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan ide-helper:generate",
"php artisan ide-helper:meta",
"php artisan clear-compiled",
"php artisan optimize"
"php artisan optimize",
"composer dump-autoload"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan ide-helper:generate",
"php artisan ide-helper:meta",
"php artisan clear-compiled",
"php artisan optimize"
"php artisan optimize",
"composer dump-autoload"
],
"post-create-project-cmd": [
"composer dump-autoload",
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan ide-helper:generate",
"php artisan ide-helper:meta",
"php artisan clear-compiled",
"php artisan optimize"
"php artisan optimize",
"composer dump-autoload"
]
},
"config": {

263
composer.lock generated
View File

@ -4,20 +4,20 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "77eee9c4a4422febbdddd6dd2036225d",
"content-hash": "65f7ba7bd79152e73e9b08b62b09b2f4",
"packages": [
{
"name": "akaunting/language",
"version": "1.0.0",
"version": "1.0.3",
"source": {
"type": "git",
"url": "https://github.com/akaunting/language.git",
"reference": "1c6fcb4f73614dd730d301e798055fcbcac70679"
"reference": "89d1b5246a05d4a3d40a23ca266df40c35a6ce9e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/akaunting/language/zipball/1c6fcb4f73614dd730d301e798055fcbcac70679",
"reference": "1c6fcb4f73614dd730d301e798055fcbcac70679",
"url": "https://api.github.com/repos/akaunting/language/zipball/89d1b5246a05d4a3d40a23ca266df40c35a6ce9e",
"reference": "89d1b5246a05d4a3d40a23ca266df40c35a6ce9e",
"shasum": ""
},
"require": {
@ -62,25 +62,25 @@
"laravel",
"switcher"
],
"time": "2017-09-03T19:53:28+00:00"
"time": "2017-12-18T14:59:05+00:00"
},
{
"name": "akaunting/money",
"version": "1.0.0",
"version": "1.0.3",
"source": {
"type": "git",
"url": "https://github.com/akaunting/money.git",
"reference": "1c01d2120941d99f758cf23be20fe5931bdd4a36"
"reference": "dc6b42d23aab805e7a54fd4c087a6a28b39ecd9d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/akaunting/money/zipball/1c01d2120941d99f758cf23be20fe5931bdd4a36",
"reference": "1c01d2120941d99f758cf23be20fe5931bdd4a36",
"url": "https://api.github.com/repos/akaunting/money/zipball/dc6b42d23aab805e7a54fd4c087a6a28b39ecd9d",
"reference": "dc6b42d23aab805e7a54fd4c087a6a28b39ecd9d",
"shasum": ""
},
"require": {
"illuminate/support": ">=5.1",
"illuminate/view": ">=5.1",
"illuminate/support": "5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5.*",
"illuminate/view": "5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5.*",
"php": ">=5.5.9"
},
"require-dev": {
@ -123,24 +123,24 @@
"laravel",
"money"
],
"time": "2017-11-26T22:24:28+00:00"
"time": "2017-12-20T19:42:43+00:00"
},
{
"name": "akaunting/setting",
"version": "1.0.1",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/akaunting/setting.git",
"reference": "f5a20ee26384c0eb1dcde512c570d3094a4bf2c4"
"reference": "4462ce24d567e3bc7c1a880fdd3bbe5841e4be7d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/akaunting/setting/zipball/f5a20ee26384c0eb1dcde512c570d3094a4bf2c4",
"reference": "f5a20ee26384c0eb1dcde512c570d3094a4bf2c4",
"url": "https://api.github.com/repos/akaunting/setting/zipball/4462ce24d567e3bc7c1a880fdd3bbe5841e4be7d",
"reference": "4462ce24d567e3bc7c1a880fdd3bbe5841e4be7d",
"shasum": ""
},
"require": {
"laravel/framework": ">=5.2.0",
"laravel/framework": "5.2.* || 5.3.* || 5.4.* || 5.5.*",
"php": ">=5.5.9"
},
"type": "library",
@ -181,7 +181,7 @@
"laravel",
"persistent"
],
"time": "2017-10-16T07:22:22+00:00"
"time": "2017-12-04T18:39:43+00:00"
},
{
"name": "akaunting/version",
@ -552,6 +552,55 @@
"description": "A trait for Laravel Eloquent models that lets you clone of a model and it's relationships, including files.",
"time": "2017-03-27T22:38:12+00:00"
},
{
"name": "consoletvs/charts",
"version": "4.6.0",
"source": {
"type": "git",
"url": "https://github.com/ConsoleTVs/Charts.git",
"reference": "5f31e72cf292c0042ff3eec68ad7a7fa36bdffc2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ConsoleTVs/Charts/zipball/5f31e72cf292c0042ff3eec68ad7a7fa36bdffc2",
"reference": "5f31e72cf292c0042ff3eec68ad7a7fa36bdffc2",
"shasum": ""
},
"require": {
"illuminate/support": "5.*",
"jenssegers/date": "v3.*",
"jlawrence/eos": "3.*",
"php": ">=5.6.4"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"ConsoleTVs\\Charts\\ChartsServiceProvider"
],
"aliases": {
"Charts": "ConsoleTVs\\Charts\\Facades\\Charts"
}
}
},
"autoload": {
"psr-4": {
"ConsoleTVs\\Charts\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Erik Campobadal",
"email": "soc@erik.cat"
}
],
"description": "Create charts for laravel using diferent charts libraries",
"time": "2017-06-07T20:23:50+00:00"
},
{
"name": "consoletvs/identify",
"version": "1.3.0",
@ -1570,6 +1619,49 @@
],
"time": "2016-12-07T09:37:55+00:00"
},
{
"name": "jlawrence/eos",
"version": "v3.2.2",
"source": {
"type": "git",
"url": "https://github.com/jlawrence11/eos.git",
"reference": "25e3d0f2316cb4636000f452a8e7dcc83725a32a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/jlawrence11/eos/zipball/25e3d0f2316cb4636000f452a8e7dcc83725a32a",
"reference": "25e3d0f2316cb4636000f452a8e7dcc83725a32a",
"shasum": ""
},
"require-dev": {
"codeclimate/php-test-reporter": "dev-master",
"phpunit/phpunit": "4.*"
},
"type": "library",
"autoload": {
"psr-4": {
"jlawrence\\eos\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"LGPL-2.1+"
],
"authors": [
{
"name": "Jon Lawrence",
"email": "jon@jon-lawrence.com"
}
],
"description": "Parse and solve math equations without using 'eval()'.",
"keywords": [
"eos",
"equations",
"math",
"solve"
],
"time": "2016-03-02T22:35:41+00:00"
},
{
"name": "kkszymanowski/traitor",
"version": "0.2.4",
@ -1851,16 +1943,16 @@
},
{
"name": "laravel/tinker",
"version": "v1.0.2",
"version": "v1.0.3",
"source": {
"type": "git",
"url": "https://github.com/laravel/tinker.git",
"reference": "203978fd67f118902acff95925847e70b72e3daf"
"reference": "852c2abe0b0991555a403f1c0583e64de6acb4a6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/tinker/zipball/203978fd67f118902acff95925847e70b72e3daf",
"reference": "203978fd67f118902acff95925847e70b72e3daf",
"url": "https://api.github.com/repos/laravel/tinker/zipball/852c2abe0b0991555a403f1c0583e64de6acb4a6",
"reference": "852c2abe0b0991555a403f1c0583e64de6acb4a6",
"shasum": ""
},
"require": {
@ -1869,7 +1961,7 @@
"illuminate/support": "~5.1",
"php": ">=5.5.9",
"psy/psysh": "0.7.*|0.8.*",
"symfony/var-dumper": "~3.0"
"symfony/var-dumper": "~3.0|~4.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0|~5.0"
@ -1910,7 +2002,7 @@
"laravel",
"psysh"
],
"time": "2017-07-13T13:11:05+00:00"
"time": "2017-12-18T16:25:11+00:00"
},
{
"name": "laravelcollective/html",
@ -3039,16 +3131,16 @@
},
{
"name": "psy/psysh",
"version": "v0.8.15",
"version": "v0.8.16",
"source": {
"type": "git",
"url": "https://github.com/bobthecow/psysh.git",
"reference": "b1d289c2cb03a2f8249912c53e96ced38f879926"
"reference": "d4c8eab0683dc056f2ca54ca67f5388527c068b1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/b1d289c2cb03a2f8249912c53e96ced38f879926",
"reference": "b1d289c2cb03a2f8249912c53e96ced38f879926",
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/d4c8eab0683dc056f2ca54ca67f5388527c068b1",
"reference": "d4c8eab0683dc056f2ca54ca67f5388527c068b1",
"shasum": ""
},
"require": {
@ -3056,14 +3148,13 @@
"jakub-onderka/php-console-highlighter": "0.3.*",
"nikic/php-parser": "~1.3|~2.0|~3.0",
"php": ">=5.3.9",
"symfony/console": "~2.3.10|^2.4.2|~3.0",
"symfony/var-dumper": "~2.7|~3.0"
"symfony/console": "~2.3.10|^2.4.2|~3.0|~4.0",
"symfony/var-dumper": "~2.7|~3.0|~4.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "~1.11",
"hoa/console": "~3.16|~1.14",
"phpunit/phpunit": "^4.8.35|^5.4.3",
"symfony/finder": "~2.1|~3.0"
"symfony/finder": "~2.1|~3.0|~4.0"
},
"suggest": {
"ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)",
@ -3108,7 +3199,7 @@
"interactive",
"shell"
],
"time": "2017-11-16T14:29:51+00:00"
"time": "2017-12-10T21:49:27+00:00"
},
{
"name": "ramsey/uuid",
@ -3518,7 +3609,7 @@
},
{
"name": "symfony/class-loader",
"version": "v3.4.0",
"version": "v3.4.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/class-loader.git",
@ -3574,16 +3665,16 @@
},
{
"name": "symfony/console",
"version": "v3.4.0",
"version": "v3.4.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "9468ad3fba3a5e1f0dc12a96e50e84cddb923cf0"
"reference": "9f21adfb92a9315b73ae2ed43138988ee4913d4e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/9468ad3fba3a5e1f0dc12a96e50e84cddb923cf0",
"reference": "9468ad3fba3a5e1f0dc12a96e50e84cddb923cf0",
"url": "https://api.github.com/repos/symfony/console/zipball/9f21adfb92a9315b73ae2ed43138988ee4913d4e",
"reference": "9f21adfb92a9315b73ae2ed43138988ee4913d4e",
"shasum": ""
},
"require": {
@ -3639,20 +3730,20 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2017-11-29T13:28:14+00:00"
"time": "2017-12-14T19:40:10+00:00"
},
{
"name": "symfony/css-selector",
"version": "v3.4.0",
"version": "v3.4.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
"reference": "7134b93e90ea7e7881fcb2da006d21b4c5f31908"
"reference": "eac760b414cf1f64362c3dd047b989e4db121332"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/7134b93e90ea7e7881fcb2da006d21b4c5f31908",
"reference": "7134b93e90ea7e7881fcb2da006d21b4c5f31908",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/eac760b414cf1f64362c3dd047b989e4db121332",
"reference": "eac760b414cf1f64362c3dd047b989e4db121332",
"shasum": ""
},
"require": {
@ -3692,20 +3783,20 @@
],
"description": "Symfony CssSelector Component",
"homepage": "https://symfony.com",
"time": "2017-11-05T16:10:10+00:00"
"time": "2017-12-14T19:40:10+00:00"
},
{
"name": "symfony/debug",
"version": "v3.4.0",
"version": "v3.4.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
"reference": "fb2001e5d85f95d8b6ab94ae3be5d2672df128fd"
"reference": "543deab3ffff94402440b326fc94153bae2dfa7a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/debug/zipball/fb2001e5d85f95d8b6ab94ae3be5d2672df128fd",
"reference": "fb2001e5d85f95d8b6ab94ae3be5d2672df128fd",
"url": "https://api.github.com/repos/symfony/debug/zipball/543deab3ffff94402440b326fc94153bae2dfa7a",
"reference": "543deab3ffff94402440b326fc94153bae2dfa7a",
"shasum": ""
},
"require": {
@ -3748,20 +3839,20 @@
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
"time": "2017-11-21T09:01:46+00:00"
"time": "2017-12-12T08:27:14+00:00"
},
{
"name": "symfony/event-dispatcher",
"version": "v3.4.0",
"version": "v3.4.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "ca20b8f9ef149f40ff656d52965f240d85f7a8e4"
"reference": "b869cbf8a15ca6261689de2c28a7d7f2d0706835"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ca20b8f9ef149f40ff656d52965f240d85f7a8e4",
"reference": "ca20b8f9ef149f40ff656d52965f240d85f7a8e4",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b869cbf8a15ca6261689de2c28a7d7f2d0706835",
"reference": "b869cbf8a15ca6261689de2c28a7d7f2d0706835",
"shasum": ""
},
"require": {
@ -3811,11 +3902,11 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"time": "2017-11-09T14:14:31+00:00"
"time": "2017-12-14T19:40:10+00:00"
},
{
"name": "symfony/finder",
"version": "v3.4.0",
"version": "v3.4.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
@ -3864,16 +3955,16 @@
},
{
"name": "symfony/http-foundation",
"version": "v3.4.0",
"version": "v3.4.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
"reference": "d9625c8abb907e0ca2d7506afd7a719a572c766f"
"reference": "59bf131b5460227a2f583a7dbe6b179f98f9e0a5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/d9625c8abb907e0ca2d7506afd7a719a572c766f",
"reference": "d9625c8abb907e0ca2d7506afd7a719a572c766f",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/59bf131b5460227a2f583a7dbe6b179f98f9e0a5",
"reference": "59bf131b5460227a2f583a7dbe6b179f98f9e0a5",
"shasum": ""
},
"require": {
@ -3914,20 +4005,20 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com",
"time": "2017-11-30T14:56:21+00:00"
"time": "2017-12-14T19:40:10+00:00"
},
{
"name": "symfony/http-kernel",
"version": "v3.4.0",
"version": "v3.4.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
"reference": "2df856c9dd8a1e1f11439b12e58c474afc1aac0d"
"reference": "48325096bbda77b983e642d21a4dd9bdde3ab73e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/2df856c9dd8a1e1f11439b12e58c474afc1aac0d",
"reference": "2df856c9dd8a1e1f11439b12e58c474afc1aac0d",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/48325096bbda77b983e642d21a4dd9bdde3ab73e",
"reference": "48325096bbda77b983e642d21a4dd9bdde3ab73e",
"shasum": ""
},
"require": {
@ -4002,7 +4093,7 @@
],
"description": "Symfony HttpKernel Component",
"homepage": "https://symfony.com",
"time": "2017-11-30T16:56:05+00:00"
"time": "2017-12-15T02:05:18+00:00"
},
{
"name": "symfony/polyfill-mbstring",
@ -4232,16 +4323,16 @@
},
{
"name": "symfony/process",
"version": "v3.4.0",
"version": "v3.4.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "db25e810fd5e124085e3777257d0cf4ae533d0ea"
"reference": "bb3ef65d493a6d57297cad6c560ee04e2a8f5098"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/db25e810fd5e124085e3777257d0cf4ae533d0ea",
"reference": "db25e810fd5e124085e3777257d0cf4ae533d0ea",
"url": "https://api.github.com/repos/symfony/process/zipball/bb3ef65d493a6d57297cad6c560ee04e2a8f5098",
"reference": "bb3ef65d493a6d57297cad6c560ee04e2a8f5098",
"shasum": ""
},
"require": {
@ -4277,20 +4368,20 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
"time": "2017-11-22T12:18:49+00:00"
"time": "2017-12-14T19:40:10+00:00"
},
{
"name": "symfony/routing",
"version": "v3.4.0",
"version": "v3.4.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/routing.git",
"reference": "d768aa5b25d98188bae3fe4ce3eb2924c97aafac"
"reference": "5f248dfac5e4660c74982eb3dadc71cf58595570"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/routing/zipball/d768aa5b25d98188bae3fe4ce3eb2924c97aafac",
"reference": "d768aa5b25d98188bae3fe4ce3eb2924c97aafac",
"url": "https://api.github.com/repos/symfony/routing/zipball/5f248dfac5e4660c74982eb3dadc71cf58595570",
"reference": "5f248dfac5e4660c74982eb3dadc71cf58595570",
"shasum": ""
},
"require": {
@ -4355,20 +4446,20 @@
"uri",
"url"
],
"time": "2017-11-24T14:13:49+00:00"
"time": "2017-12-14T22:37:31+00:00"
},
{
"name": "symfony/translation",
"version": "v3.4.0",
"version": "v3.4.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
"reference": "e05b0a5996ad7a35ba3a19ffad8b72c9daa64dfa"
"reference": "4c5d5582baf2829751a5207659329c1f52eedeb6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/e05b0a5996ad7a35ba3a19ffad8b72c9daa64dfa",
"reference": "e05b0a5996ad7a35ba3a19ffad8b72c9daa64dfa",
"url": "https://api.github.com/repos/symfony/translation/zipball/4c5d5582baf2829751a5207659329c1f52eedeb6",
"reference": "4c5d5582baf2829751a5207659329c1f52eedeb6",
"shasum": ""
},
"require": {
@ -4423,20 +4514,20 @@
],
"description": "Symfony Translation Component",
"homepage": "https://symfony.com",
"time": "2017-11-27T14:23:00+00:00"
"time": "2017-12-12T08:27:14+00:00"
},
{
"name": "symfony/var-dumper",
"version": "v3.4.0",
"version": "v3.4.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "ec650a975a8e04e0c114d35eab732981243db3a2"
"reference": "757074cf71b952ce9e75b557538948811c2bf006"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/ec650a975a8e04e0c114d35eab732981243db3a2",
"reference": "ec650a975a8e04e0c114d35eab732981243db3a2",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/757074cf71b952ce9e75b557538948811c2bf006",
"reference": "757074cf71b952ce9e75b557538948811c2bf006",
"shasum": ""
},
"require": {
@ -4492,7 +4583,7 @@
"debug",
"dump"
],
"time": "2017-11-30T14:59:23+00:00"
"time": "2017-12-11T22:06:16+00:00"
},
{
"name": "tijsverkoyen/css-to-inline-styles",

View File

@ -77,7 +77,7 @@ return [
|
*/
'locale' => 'en-GB',
'locale' => env('APP_LOCALE', 'en-GB'),
/*
|--------------------------------------------------------------------------
@ -190,6 +190,7 @@ return [
Barryvdh\DomPDF\ServiceProvider::class,
Bkwld\Cloner\ServiceProvider::class,
Collective\Html\HtmlServiceProvider::class,
ConsoleTVs\Charts\ChartsServiceProvider::class,
Dingo\Api\Provider\LaravelServiceProvider::class,
EloquentFilter\ServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,
@ -256,6 +257,7 @@ return [
* Vendor Aliases...
*/
//'Api' => Dingo\Api\Facade\API,
'Charts' => ConsoleTVs\Charts\Facades\Charts::class,
'Debugbar' => Barryvdh\Debugbar\Facade::class,
'Date' => Jenssegers\Date\Date::class,
'DotenvEditor' => Jackiedo\DotenvEditor\Facades\DotenvEditor::class,

173
config/charts.php Normal file
View File

@ -0,0 +1,173 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default settings for charts.
|--------------------------------------------------------------------------
*/
'default' => [
'type' => 'line', // The default chart type.
'library' => 'material', // The default chart library.
'element_label' => '', // The default chart element label.
'empty_dataset_label' => 'No Data Set',
'empty_dataset_value' => 0,
'title' => '', // Default chart title.
'height' => 400, // 0 Means it will take 100% of the division height.
'width' => 0, // 0 Means it will take 100% of the division width.
'responsive' => false, // Not recommended since all libraries have diferent sizes.
'background_color' => 'inherit', // The chart division background color.
'colors' => [], // Default chart colors if using no template is set.
'one_color' => false, // Only use the first color in all values.
'template' => 'material', // The default chart color template.
'legend' => true, // Whether to enable the chart legend (where applicable).
'x_axis_title' => false, // The title of the x-axis
'y_axis_title' => null, // The title of the y-axis (When set to null will use element_label value).
'loader' => [
'active' => false, // Determines the if loader is active by default.
'duration' => 500, // In milliseconds.
'color' => '#6da252', // Determines the default loader color.
],
],
/*
|--------------------------------------------------------------------------
| All the color templates available for the charts.
|--------------------------------------------------------------------------
*/
'templates' => [
'material' => [
'#2196F3', '#F44336', '#FFC107',
],
'red-material' => [
'#B71C1C', '#F44336', '#E57373',
],
'indigo-material' => [
'#1A237E', '#3F51B5', '#7986CB',
],
'blue-material' => [
'#0D47A1', '#2196F3', '#64B5F6',
],
'teal-material' => [
'#004D40', '#009688', '#4DB6AC',
],
'green-material' => [
'#1B5E20', '#4CAF50', '#81C784',
],
'yellow-material' => [
'#F57F17', '#FFEB3B', '#FFF176',
],
'orange-material' => [
'#E65100', '#FF9800', '#FFB74D',
],
],
/*
|--------------------------------------------------------------------------
| Assets required by the libraries.
|--------------------------------------------------------------------------
*/
'assets' => [
'global' => [
'scripts' => [
//'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js',
],
],
'canvas-gauges' => [
'scripts' => [
//'https://cdn.rawgit.com/Mikhus/canvas-gauges/gh-pages/download/2.1.2/all/gauge.min.js',
],
],
'chartist' => [
'scripts' => [
//'https://cdnjs.cloudflare.com/ajax/libs/chartist/0.10.1/chartist.min.js',
],
'styles' => [
//'https://cdnjs.cloudflare.com/ajax/libs/chartist/0.10.1/chartist.min.css',
],
],
'chartjs' => [
'scripts' => [
env('APP_URL') . '/public/js/chartjs/Chart.min.js',
],
],
'fusioncharts' => [
'scripts' => [
//'https://static.fusioncharts.com/code/latest/fusioncharts.js',
//'https://static.fusioncharts.com/code/latest/themes/fusioncharts.theme.fint.js',
],
],
'google' => [
'scripts' => [
//'https://www.google.com/jsapi',
//'https://www.gstatic.com/charts/loader.js',
//"google.charts.load('current', {'packages':['corechart', 'gauge', 'geochart', 'bar', 'line']})",
],
],
'highcharts' => [
'styles' => [
// The following CSS is not added due to color compatibility errors.
// 'https://cdnjs.cloudflare.com/ajax/libs/highcharts/5.0.7/css/highcharts.css',
],
'scripts' => [
//'https://cdnjs.cloudflare.com/ajax/libs/highcharts/5.0.7/highcharts.js',
//'https://cdnjs.cloudflare.com/ajax/libs/highcharts/5.0.7/js/modules/offline-exporting.js',
//'https://cdnjs.cloudflare.com/ajax/libs/highmaps/5.0.7/js/modules/map.js',
//'https://cdnjs.cloudflare.com/ajax/libs/highmaps/5.0.7/js/modules/data.js',
//'https://code.highcharts.com/mapdata/custom/world.js',
],
],
'justgage' => [
'scripts' => [
//'https://cdnjs.cloudflare.com/ajax/libs/raphael/2.2.6/raphael.min.js',
//'https://cdnjs.cloudflare.com/ajax/libs/justgage/1.2.2/justgage.min.js',
],
],
'morris' => [
'styles' => [
//'https://cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css',
],
'scripts' => [
//'https://cdnjs.cloudflare.com/ajax/libs/raphael/2.2.6/raphael.min.js',
//'https://cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js',
],
],
'plottablejs' => [
'scripts' => [
//'https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js',
//'https://cdnjs.cloudflare.com/ajax/libs/plottable.js/2.8.0/plottable.min.js',
],
'styles' => [
//'https://cdnjs.cloudflare.com/ajax/libs/plottable.js/2.2.0/plottable.css',
],
],
'progressbarjs' => [
'scripts' => [
//'https://cdnjs.cloudflare.com/ajax/libs/progressbar.js/1.0.1/progressbar.min.js',
],
],
'c3' => [
'scripts' => [
//'https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js',
//'https://cdnjs.cloudflare.com/ajax/libs/c3/0.4.11/c3.min.js',
],
'styles' => [
//'https://cdnjs.cloudflare.com/ajax/libs/c3/0.4.11/c3.min.css',
],
],
],
];

View File

@ -15,7 +15,7 @@ return [
'class' => 'fa fa-sort-amount'
],
'numeric' => [
'rows' => ['created_at', 'updated_at', 'paid_at', 'invoiced_at', 'due_at', 'id', 'quantity', 'rate', 'number', 'invoice_number', 'bill_number'],
'rows' => ['created_at', 'updated_at', 'paid_at', 'invoiced_at', 'billed_at', 'due_at', 'id', 'quantity', 'rate', 'number', 'invoice_number', 'bill_number'],
'class' => 'fa fa-sort-numeric'
],
],

View File

@ -115,7 +115,7 @@ return [
|
*/
'allowed' => ['en-GB', 'de-DE', 'es-ES', 'fa-IR', 'fr-FR', 'nl-NL', 'pt-BR', 'ru-RU', 'sq-AL', 'tr-TR', 'vi-VN', 'zh-TW'],
'allowed' => ['en-GB', 'ar-SA', 'cs-CZ', 'de-DE', 'es-ES', 'fa-IR', 'fr-FR', 'hr-HR', 'it-IT', 'nl-NL', 'pt-BR', 'ru-RU', 'sq-AL', 'tr-TR', 'vi-VN', 'zh-TW'],
/*
|--------------------------------------------------------------------------

View File

@ -93,9 +93,9 @@ return [
'config' => 'Config',
'command' => 'Console',
'event' => 'Events',
'listener' => 'Events/Handlers',
'listener' => 'Listeners',
'migration' => 'Database/Migrations',
'model' => 'Entities',
'model' => 'Models',
'repository' => 'Repositories',
'seeder' => 'Database/Seeders',
'controller' => 'Http/Controllers',

View File

@ -87,7 +87,7 @@ return [
'symbol' => '$',
'symbol_first' => true,
'decimal_mark' => '.',
'thousands_separator' => ',',
'thousands_separator' => ' ',
],
'AWG' => [

View File

@ -10,15 +10,15 @@ return [
'minor' => '1',
'patch' => '1',
'patch' => '6',
'build' => '',
'status' => 'Stable',
'date' => '2-December-2017',
'date' => '22-December-2017',
'time' => '17:30',
'time' => '16:00',
'zone' => 'GMT +3',

View File

@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
class AddCurrencyColumns extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('currencies', function ($table) {
$table->string('precision')->nullable();
$table->string('symbol')->nullable();
$table->integer('symbol_first')->default(1);
$table->string('decimal_mark')->nullable();
$table->string('thousands_separator')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('currencies', function ($table) {
$table->dropColumn('precision');
$table->dropColumn('symbol');
$table->dropColumn('symbol_first');
$table->dropColumn('decimal_mark');
$table->dropColumn('thousands_separator');
});
}
}

View File

@ -34,24 +34,44 @@ class Currencies extends Seeder
'code' => 'USD',
'rate' => '1.00',
'enabled' => '1',
'precision' => config('money.USD.precision'),
'symbol' => config('money.USD.symbol'),
'symbol_first' => config('money.USD.symbol_first'),
'decimal_mark' => config('money.USD.decimal_mark'),
'thousands_separator' => config('money.USD.thousands_separator'),
],
[
'company_id' => $company_id,
'name' => trans('demo.currencies_eur'),
'code' => 'EUR',
'rate' => '1.25',
'precision' => config('money.EUR.precision'),
'symbol' => config('money.EUR.symbol'),
'symbol_first' => config('money.EUR.symbol_first'),
'decimal_mark' => config('money.EUR.decimal_mark'),
'thousands_separator' => config('money.EUR.thousands_separator'),
],
[
'company_id' => $company_id,
'name' => trans('demo.currencies_gbp'),
'code' => 'GBP',
'rate' => '1.60',
'precision' => config('money.GBP.precision'),
'symbol' => config('money.GBP.symbol'),
'symbol_first' => config('money.GBP.symbol_first'),
'decimal_mark' => config('money.GBP.decimal_mark'),
'thousands_separator' => config('money.GBP.thousands_separator'),
],
[
'company_id' => $company_id,
'name' => trans('demo.currencies_try'),
'code' => 'TRY',
'rate' => '0.80',
'precision' => config('money.TRY.precision'),
'symbol' => config('money.TRY.symbol'),
'symbol_first' => config('money.TRY.symbol_first'),
'decimal_mark' => config('money.TRY.decimal_mark'),
'thousands_separator' => config('money.TRY.thousands_separator'),
],
];

View File

@ -6,7 +6,6 @@ use Artisan;
use Illuminate\Http\Response;
use Illuminate\Routing\Controller;
use Modules\OfflinePayment\Http\Requests\Setting as Request;
use Modules\OfflinePayment\Http\Requests\SettingGet as GRequest;
use Modules\OfflinePayment\Http\Requests\SettingDelete as DRequest;
@ -15,6 +14,7 @@ class Settings extends Controller
{
/**
* Show the form for editing the specified resource.
*
* @return Response
*/
public function edit()
@ -26,28 +26,32 @@ class Settings extends Controller
/**
* Update the specified resource in storage.
*
* @param Request $request
*
* @return Response
*/
public function update(Request $request)
{
$offlinepayment = json_decode(setting('offlinepayment.methods'), true);
$methods = json_decode(setting('offlinepayment.methods'), true);
if (isset($request['method'])) {
foreach ($offlinepayment as $key => $method) {
if ($method['code'] == $request['method']) {
$method = explode('.', $request['method']);
$offlinepayment[$key]['code'] = 'offlinepayment.' . $request['code'] . '.' . $method[2];
$offlinepayment[$key]['name'] = $request['name'];
$offlinepayment[$key]['customer'] = $request['customer'];
$offlinepayment[$key]['order'] = $request['order'];
$offlinepayment[$key]['description'] = $request['description'];
foreach ($methods as $key => $method) {
if ($method['code'] != $request['method']) {
continue;
}
$method = explode('.', $request['method']);
$methods[$key]['code'] = 'offlinepayment.' . $request['code'] . '.' . $method[2];
$methods[$key]['name'] = $request['name'];
$methods[$key]['customer'] = $request['customer'];
$methods[$key]['order'] = $request['order'];
$methods[$key]['description'] = $request['description'];
}
} else {
$offlinepayment[] = array(
'code' => 'offlinepayment.' . $request['code'] . '.' . (count($offlinepayment) + 1),
$methods[] = array(
'code' => 'offlinepayment.' . $request['code'] . '.' . (count($methods) + 1),
'name' => $request['name'],
'customer' => $request['customer'],
'order' => $request['order'],
@ -56,7 +60,7 @@ class Settings extends Controller
}
// Set Api Token
setting()->set('offlinepayment.methods', json_encode($offlinepayment));
setting()->set('offlinepayment.methods', json_encode($methods));
setting()->save();
@ -67,27 +71,34 @@ class Settings extends Controller
/**
* Remove the specified resource from storage.
*
* @param GRequest $request
*
* @return Response
*/
public function get(GRequest $request)
{
$data = [];
$code = $request['code'];
$offlinepayment = json_decode(setting('offlinepayment.methods'), true);
$methods = json_decode(setting('offlinepayment.methods'), true);
foreach ($offlinepayment as $key => $method) {
if ($method['code'] == $code) {
$method['title'] = trans('offlinepayment::offlinepayment.edit', ['method' => $method['name']]);
$method['method'] = $code;
$code = explode('.', $method['code']);
$method['code'] = $code[1];
$data = $method;
break;
foreach ($methods as $key => $method) {
if ($method['code'] != $code) {
continue;
}
$method['title'] = trans('offlinepayment::offlinepayment.edit', ['method' => $method['name']]);
$method['method'] = $code;
$code = explode('.', $method['code']);
$method['code'] = $code[1];
$data = $method;
break;
}
return response()->json([
@ -99,22 +110,27 @@ class Settings extends Controller
/**
* Remove the specified resource from storage.
*
* @param DRequest $request
*
* @return Response
*/
public function delete(DRequest $request)
{
$code = $request['code'];
$offlinepayment = json_decode(setting('offlinepayment.methods'), true);
$methods = json_decode(setting('offlinepayment.methods'), true);
foreach ($offlinepayment as $key => $method) {
if ($method['code'] == $code) {
unset($offlinepayment[$key]);
foreach ($methods as $key => $method) {
if ($method['code'] != $code) {
continue;
}
unset($methods[$key]);
}
// Set Api Token
setting()->set('offlinepayment.methods', json_encode($offlinepayment));
setting()->set('offlinepayment.methods', json_encode($methods));
setting()->save();

View File

@ -149,7 +149,7 @@
}
$('input[name="order"]').val(json['data']['order']);
$('input[name="description"]').val(json['data']['description']);
$('textarea[name="description"]').val(json['data']['description']);
$('input[name="method"]').remove();

30
public/css/app.css vendored
View File

@ -498,7 +498,20 @@ ul.add-new.nav.navbar-nav.pull-left {
background-color: #ffffff;
}
}
.text-disabled {
opacity: 0.4;
}
/*
.tooltip > .tooltip-inner {
background-color: #6da252;
}
.tooltip.right .tooltip-arrow {
border-right-color: #6da252 !important;
}
.content-wrapper {
overflow: inherit;
}
@ -509,4 +522,19 @@ ul.add-new.nav.navbar-nav.pull-left {
position: fixed;
right: 0;
z-index: 999;
}*/
}
*/
.progress-bar-green, .progress-bar-success {
background-color: #6da252;
}
#chart .row {
margin-top: 10px;
}
#chart .row .col-md-3 .customer-content .progress {
clear: both;
margin-top: 25px;
margin-bottom: 10px;
}

269
public/css/daterangepicker.css vendored Normal file
View File

@ -0,0 +1,269 @@
.daterangepicker {
position: absolute;
color: inherit;
background-color: #fff;
border-radius: 4px;
width: 278px;
padding: 4px;
margin-top: 1px;
top: 100px;
left: 20px;
/* Calendars */ }
.daterangepicker:before, .daterangepicker:after {
position: absolute;
display: inline-block;
border-bottom-color: rgba(0, 0, 0, 0.2);
content: ''; }
.daterangepicker:before {
top: -7px;
border-right: 7px solid transparent;
border-left: 7px solid transparent;
border-bottom: 7px solid #ccc; }
.daterangepicker:after {
top: -6px;
border-right: 6px solid transparent;
border-bottom: 6px solid #fff;
border-left: 6px solid transparent; }
.daterangepicker.opensleft:before {
right: 9px; }
.daterangepicker.opensleft:after {
right: 10px; }
.daterangepicker.openscenter:before {
left: 0;
right: 0;
width: 0;
margin-left: auto;
margin-right: auto; }
.daterangepicker.openscenter:after {
left: 0;
right: 0;
width: 0;
margin-left: auto;
margin-right: auto; }
.daterangepicker.opensright:before {
left: 9px; }
.daterangepicker.opensright:after {
left: 10px; }
.daterangepicker.dropup {
margin-top: -5px; }
.daterangepicker.dropup:before {
top: initial;
bottom: -7px;
border-bottom: initial;
border-top: 7px solid #ccc; }
.daterangepicker.dropup:after {
top: initial;
bottom: -6px;
border-bottom: initial;
border-top: 6px solid #fff; }
.daterangepicker.dropdown-menu {
max-width: none;
z-index: 3001; }
.daterangepicker.single .ranges, .daterangepicker.single .calendar {
float: none; }
.daterangepicker.show-calendar .calendar {
display: block; }
.daterangepicker .calendar {
display: none;
max-width: 270px;
margin: 4px; }
.daterangepicker .calendar.single .calendar-table {
border: none; }
.daterangepicker .calendar th, .daterangepicker .calendar td {
white-space: nowrap;
text-align: center;
min-width: 32px; }
.daterangepicker .calendar-table {
border: 1px solid #fff;
padding: 4px;
border-radius: 4px;
background-color: #fff; }
.daterangepicker table {
width: 100%;
margin: 0; }
.daterangepicker td, .daterangepicker th {
text-align: center;
width: 20px;
height: 20px;
border-radius: 4px;
border: 1px solid transparent;
white-space: nowrap;
cursor: pointer; }
.daterangepicker td.available:hover, .daterangepicker th.available:hover {
background-color: #eee;
border-color: transparent;
color: inherit; }
.daterangepicker td.week, .daterangepicker th.week {
font-size: 80%;
color: #ccc; }
.daterangepicker td.off, .daterangepicker td.off.in-range, .daterangepicker td.off.start-date, .daterangepicker td.off.end-date {
background-color: #fff;
border-color: transparent;
color: #999; }
.daterangepicker td.in-range {
background-color: #ebf4f8;
border-color: transparent;
color: #000;
border-radius: 0; }
.daterangepicker td.start-date {
border-radius: 4px 0 0 4px; }
.daterangepicker td.end-date {
border-radius: 0 4px 4px 0; }
.daterangepicker td.start-date.end-date {
border-radius: 4px; }
.daterangepicker td.active, .daterangepicker td.active:hover {
background-color: #357ebd;
border-color: transparent;
color: #fff; }
.daterangepicker th.month {
width: auto; }
.daterangepicker td.disabled, .daterangepicker option.disabled {
color: #999;
cursor: not-allowed;
text-decoration: line-through; }
.daterangepicker select.monthselect, .daterangepicker select.yearselect {
font-size: 12px;
padding: 1px;
height: auto;
margin: 0;
cursor: default; }
.daterangepicker select.monthselect {
margin-right: 2%;
width: 56%; }
.daterangepicker select.yearselect {
width: 40%; }
.daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.secondselect, .daterangepicker select.ampmselect {
width: 50px;
margin-bottom: 0; }
.daterangepicker .input-mini {
border: 1px solid #ccc;
border-radius: 4px;
color: #555;
height: 30px;
line-height: 30px;
display: block;
vertical-align: middle;
margin: 0 0 5px 0;
padding: 0 6px 0 28px;
width: 100%; }
.daterangepicker .input-mini.active {
border: 1px solid #08c;
border-radius: 4px; }
.daterangepicker .daterangepicker_input {
position: relative; }
.daterangepicker .daterangepicker_input i {
position: absolute;
left: 8px;
top: 8px; }
.daterangepicker.rtl .input-mini {
padding-right: 28px;
padding-left: 6px; }
.daterangepicker.rtl .daterangepicker_input i {
left: auto;
right: 8px; }
.daterangepicker .calendar-time {
text-align: center;
margin: 5px auto;
line-height: 30px;
position: relative;
padding-left: 28px; }
.daterangepicker .calendar-time select.disabled {
color: #ccc;
cursor: not-allowed; }
.ranges {
font-size: 11px;
float: none;
margin: 4px;
text-align: left; }
.ranges ul {
list-style: none;
margin: 0 auto;
padding: 0;
width: 100%; }
.ranges li {
font-size: 13px;
background-color: #f5f5f5;
border: 1px solid #f5f5f5;
border-radius: 4px;
color: #08c;
padding: 3px 12px;
margin-bottom: 8px;
cursor: pointer; }
.ranges li:hover {
background-color: #08c;
border: 1px solid #08c;
color: #fff; }
.ranges li.active {
background-color: #08c;
border: 1px solid #08c;
color: #fff; }
/* Larger Screen Styling */
@media (min-width: 564px) {
.daterangepicker {
width: auto; }
.daterangepicker .ranges ul {
width: 160px; }
.daterangepicker.single .ranges ul {
width: 100%; }
.daterangepicker.single .calendar.left {
clear: none; }
.daterangepicker.single.ltr .ranges, .daterangepicker.single.ltr .calendar {
float: left; }
.daterangepicker.single.rtl .ranges, .daterangepicker.single.rtl .calendar {
float: right; }
.daterangepicker.ltr {
direction: ltr;
text-align: left; }
.daterangepicker.ltr .calendar.left {
clear: left;
margin-right: 0; }
.daterangepicker.ltr .calendar.left .calendar-table {
border-right: none;
border-top-right-radius: 0;
border-bottom-right-radius: 0; }
.daterangepicker.ltr .calendar.right {
margin-left: 0; }
.daterangepicker.ltr .calendar.right .calendar-table {
border-left: none;
border-top-left-radius: 0;
border-bottom-left-radius: 0; }
.daterangepicker.ltr .left .daterangepicker_input {
padding-right: 12px; }
.daterangepicker.ltr .calendar.left .calendar-table {
padding-right: 12px; }
.daterangepicker.ltr .ranges, .daterangepicker.ltr .calendar {
float: left; }
.daterangepicker.rtl {
direction: rtl;
text-align: right; }
.daterangepicker.rtl .calendar.left {
clear: right;
margin-left: 0; }
.daterangepicker.rtl .calendar.left .calendar-table {
border-left: none;
border-top-left-radius: 0;
border-bottom-left-radius: 0; }
.daterangepicker.rtl .calendar.right {
margin-right: 0; }
.daterangepicker.rtl .calendar.right .calendar-table {
border-right: none;
border-top-right-radius: 0;
border-bottom-right-radius: 0; }
.daterangepicker.rtl .left .daterangepicker_input {
padding-left: 12px; }
.daterangepicker.rtl .calendar.left .calendar-table {
padding-left: 12px; }
.daterangepicker.rtl .ranges, .daterangepicker.rtl .calendar {
text-align: right;
float: right; } }
@media (min-width: 730px) {
.daterangepicker .ranges {
width: auto; }
.daterangepicker.ltr .ranges {
float: left; }
.daterangepicker.rtl .ranges {
float: right; }
.daterangepicker .calendar.left {
clear: none !important; } }

10
public/js/chartjs/Chart.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

73
public/js/moment/locale/af.js vendored Normal file
View File

@ -0,0 +1,73 @@
//! moment.js locale configuration
//! locale : Afrikaans [af]
//! author : Werner Mollentze : https://github.com/wernerm
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var af = moment.defineLocale('af', {
months : 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split('_'),
monthsShort : 'Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),
weekdays : 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split('_'),
weekdaysShort : 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),
weekdaysMin : 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),
meridiemParse: /vm|nm/i,
isPM : function (input) {
return /^nm$/i.test(input);
},
meridiem : function (hours, minutes, isLower) {
if (hours < 12) {
return isLower ? 'vm' : 'VM';
} else {
return isLower ? 'nm' : 'NM';
}
},
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd, D MMMM YYYY HH:mm'
},
calendar : {
sameDay : '[Vandag om] LT',
nextDay : '[Môre om] LT',
nextWeek : 'dddd [om] LT',
lastDay : '[Gister om] LT',
lastWeek : '[Laas] dddd [om] LT',
sameElse : 'L'
},
relativeTime : {
future : 'oor %s',
past : '%s gelede',
s : '\'n paar sekondes',
m : '\'n minuut',
mm : '%d minute',
h : '\'n uur',
hh : '%d ure',
d : '\'n dag',
dd : '%d dae',
M : '\'n maand',
MM : '%d maande',
y : '\'n jaar',
yy : '%d jaar'
},
dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
ordinal : function (number) {
return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); // Thanks to Joris Röling : https://github.com/jjupiter
},
week : {
dow : 1, // Maandag is die eerste dag van die week.
doy : 4 // Die week wat die 4de Januarie bevat is die eerste week van die jaar.
}
});
return af;
})));

59
public/js/moment/locale/ar-dz.js vendored Normal file
View File

@ -0,0 +1,59 @@
//! moment.js locale configuration
//! locale : Arabic (Algeria) [ar-dz]
//! author : Noureddine LOUAHEDJ : https://github.com/noureddineme
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var arDz = moment.defineLocale('ar-dz', {
months : انفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
monthsShort : انفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
weekdaysShort : 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
weekdaysMin : 'أح_إث_ثلا_أر_خم_جم_سب'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
calendar : {
sameDay: '[اليوم على الساعة] LT',
nextDay: '[غدا على الساعة] LT',
nextWeek: 'dddd [على الساعة] LT',
lastDay: '[أمس على الساعة] LT',
lastWeek: 'dddd [على الساعة] LT',
sameElse: 'L'
},
relativeTime : {
future : 'في %s',
past : 'منذ %s',
s : 'ثوان',
m : 'دقيقة',
mm : '%d دقائق',
h : 'ساعة',
hh : '%d ساعات',
d : 'يوم',
dd : '%d أيام',
M : 'شهر',
MM : '%d أشهر',
y : 'سنة',
yy : '%d سنوات'
},
week : {
dow : 0, // Sunday is the first day of the week.
doy : 4 // The week that contains Jan 1st is the first week of the year.
}
});
return arDz;
})));

59
public/js/moment/locale/ar-kw.js vendored Normal file
View File

@ -0,0 +1,59 @@
//! moment.js locale configuration
//! locale : Arabic (Kuwait) [ar-kw]
//! author : Nusret Parlak: https://github.com/nusretparlak
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var arKw = moment.defineLocale('ar-kw', {
months : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
monthsShort : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
weekdays : 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
weekdaysShort : 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
calendar : {
sameDay: '[اليوم على الساعة] LT',
nextDay: '[غدا على الساعة] LT',
nextWeek: 'dddd [على الساعة] LT',
lastDay: '[أمس على الساعة] LT',
lastWeek: 'dddd [على الساعة] LT',
sameElse: 'L'
},
relativeTime : {
future : 'في %s',
past : 'منذ %s',
s : 'ثوان',
m : 'دقيقة',
mm : '%d دقائق',
h : 'ساعة',
hh : '%d ساعات',
d : 'يوم',
dd : '%d أيام',
M : 'شهر',
MM : '%d أشهر',
y : 'سنة',
yy : '%d سنوات'
},
week : {
dow : 0, // Sunday is the first day of the week.
doy : 12 // The week that contains Jan 1st is the first week of the year.
}
});
return arKw;
})));

126
public/js/moment/locale/ar-ly.js vendored Normal file
View File

@ -0,0 +1,126 @@
//! moment.js locale configuration
//! locale : Arabic (Lybia) [ar-ly]
//! author : Ali Hmer: https://github.com/kikoanis
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var symbolMap = {
'1': '1',
'2': '2',
'3': '3',
'4': '4',
'5': '5',
'6': '6',
'7': '7',
'8': '8',
'9': '9',
'0': '0'
};
var pluralForm = function (n) {
return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;
};
var plurals = {
s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],
m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],
h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],
d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],
M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],
y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']
};
var pluralize = function (u) {
return function (number, withoutSuffix, string, isFuture) {
var f = pluralForm(number),
str = plurals[u][pluralForm(number)];
if (f === 2) {
str = str[withoutSuffix ? 0 : 1];
}
return str.replace(/%d/i, number);
};
};
var months = [
'يناير',
'فبراير',
'مارس',
'أبريل',
'مايو',
'يونيو',
'يوليو',
'أغسطس',
'سبتمبر',
'أكتوبر',
'نوفمبر',
'ديسمبر'
];
var arLy = moment.defineLocale('ar-ly', {
months : months,
monthsShort : months,
weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'D/\u200FM/\u200FYYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
meridiemParse: /ص|م/,
isPM : function (input) {
return 'م' === input;
},
meridiem : function (hour, minute, isLower) {
if (hour < 12) {
return 'ص';
} else {
return 'م';
}
},
calendar : {
sameDay: '[اليوم عند الساعة] LT',
nextDay: '[غدًا عند الساعة] LT',
nextWeek: 'dddd [عند الساعة] LT',
lastDay: '[أمس عند الساعة] LT',
lastWeek: 'dddd [عند الساعة] LT',
sameElse: 'L'
},
relativeTime : {
future : 'بعد %s',
past : 'منذ %s',
s : pluralize('s'),
m : pluralize('m'),
mm : pluralize('m'),
h : pluralize('h'),
hh : pluralize('h'),
d : pluralize('d'),
dd : pluralize('d'),
M : pluralize('M'),
MM : pluralize('M'),
y : pluralize('y'),
yy : pluralize('y')
},
preparse: function (string) {
return string.replace(/،/g, ',');
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
}).replace(/,/g, '،');
},
week : {
dow : 6, // Saturday is the first day of the week.
doy : 12 // The week that contains Jan 1st is the first week of the year.
}
});
return arLy;
})));

60
public/js/moment/locale/ar-ma.js vendored Normal file
View File

@ -0,0 +1,60 @@
//! moment.js locale configuration
//! locale : Arabic (Morocco) [ar-ma]
//! author : ElFadili Yassine : https://github.com/ElFadiliY
//! author : Abdel Said : https://github.com/abdelsaid
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var arMa = moment.defineLocale('ar-ma', {
months : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
monthsShort : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'),
weekdays : 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
weekdaysShort : 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
calendar : {
sameDay: '[اليوم على الساعة] LT',
nextDay: '[غدا على الساعة] LT',
nextWeek: 'dddd [على الساعة] LT',
lastDay: '[أمس على الساعة] LT',
lastWeek: 'dddd [على الساعة] LT',
sameElse: 'L'
},
relativeTime : {
future : 'في %s',
past : 'منذ %s',
s : 'ثوان',
m : 'دقيقة',
mm : '%d دقائق',
h : 'ساعة',
hh : '%d ساعات',
d : 'يوم',
dd : '%d أيام',
M : 'شهر',
MM : '%d أشهر',
y : 'سنة',
yy : '%d سنوات'
},
week : {
dow : 6, // Saturday is the first day of the week.
doy : 12 // The week that contains Jan 1st is the first week of the year.
}
});
return arMa;
})));

105
public/js/moment/locale/ar-sa.js vendored Normal file
View File

@ -0,0 +1,105 @@
//! moment.js locale configuration
//! locale : Arabic (Saudi Arabia) [ar-sa]
//! author : Suhail Alkowaileet : https://github.com/xsoh
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var symbolMap = {
'1': '١',
'2': '٢',
'3': '٣',
'4': '٤',
'5': '٥',
'6': '٦',
'7': '٧',
'8': '٨',
'9': '٩',
'0': '٠'
};
var numberMap = {
'١': '1',
'٢': '2',
'٣': '3',
'٤': '4',
'٥': '5',
'٦': '6',
'٧': '7',
'٨': '8',
'٩': '9',
'٠': '0'
};
var arSa = moment.defineLocale('ar-sa', {
months : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
monthsShort : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
meridiemParse: /ص|م/,
isPM : function (input) {
return 'م' === input;
},
meridiem : function (hour, minute, isLower) {
if (hour < 12) {
return 'ص';
} else {
return 'م';
}
},
calendar : {
sameDay: '[اليوم على الساعة] LT',
nextDay: '[غدا على الساعة] LT',
nextWeek: 'dddd [على الساعة] LT',
lastDay: '[أمس على الساعة] LT',
lastWeek: 'dddd [على الساعة] LT',
sameElse: 'L'
},
relativeTime : {
future : 'في %s',
past : 'منذ %s',
s : 'ثوان',
m : 'دقيقة',
mm : '%d دقائق',
h : 'ساعة',
hh : '%d ساعات',
d : 'يوم',
dd : '%d أيام',
M : 'شهر',
MM : '%d أشهر',
y : 'سنة',
yy : '%d سنوات'
},
preparse: function (string) {
return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
return numberMap[match];
}).replace(/،/g, ',');
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
}).replace(/,/g, '،');
},
week : {
dow : 0, // Sunday is the first day of the week.
doy : 6 // The week that contains Jan 1st is the first week of the year.
}
});
return arSa;
})));

59
public/js/moment/locale/ar-tn.js vendored Normal file
View File

@ -0,0 +1,59 @@
//! moment.js locale configuration
//! locale : Arabic (Tunisia) [ar-tn]
//! author : Nader Toukabri : https://github.com/naderio
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var arTn = moment.defineLocale('ar-tn', {
months: انفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
monthsShort: انفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'),
weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
weekdaysParseExact : true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[اليوم على الساعة] LT',
nextDay: '[غدا على الساعة] LT',
nextWeek: 'dddd [على الساعة] LT',
lastDay: '[أمس على الساعة] LT',
lastWeek: 'dddd [على الساعة] LT',
sameElse: 'L'
},
relativeTime: {
future: 'في %s',
past: 'منذ %s',
s: 'ثوان',
m: 'دقيقة',
mm: '%d دقائق',
h: 'ساعة',
hh: '%d ساعات',
d: 'يوم',
dd: '%d أيام',
M: 'شهر',
MM: '%d أشهر',
y: 'سنة',
yy: '%d سنوات'
},
week: {
dow: 1, // Monday is the first day of the week.
doy: 4 // The week that contains Jan 4th is the first week of the year.
}
});
return arTn;
})));

142
public/js/moment/locale/ar.js vendored Normal file
View File

@ -0,0 +1,142 @@
//! moment.js locale configuration
//! locale : Arabic [ar]
//! author : Abdel Said: https://github.com/abdelsaid
//! author : Ahmed Elkhatib
//! author : forabi https://github.com/forabi
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var symbolMap = {
'1': '١',
'2': '٢',
'3': '٣',
'4': '٤',
'5': '٥',
'6': '٦',
'7': '٧',
'8': '٨',
'9': '٩',
'0': '٠'
};
var numberMap = {
'١': '1',
'٢': '2',
'٣': '3',
'٤': '4',
'٥': '5',
'٦': '6',
'٧': '7',
'٨': '8',
'٩': '9',
'٠': '0'
};
var pluralForm = function (n) {
return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5;
};
var plurals = {
s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],
m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],
h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],
d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],
M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],
y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']
};
var pluralize = function (u) {
return function (number, withoutSuffix, string, isFuture) {
var f = pluralForm(number),
str = plurals[u][pluralForm(number)];
if (f === 2) {
str = str[withoutSuffix ? 0 : 1];
}
return str.replace(/%d/i, number);
};
};
var months = [
'كانون الثاني يناير',
'شباط فبراير',
'آذار مارس',
'نيسان أبريل',
'أيار مايو',
'حزيران يونيو',
'تموز يوليو',
'آب أغسطس',
'أيلول سبتمبر',
'تشرين الأول أكتوبر',
'تشرين الثاني نوفمبر',
'كانون الأول ديسمبر'
];
var ar = moment.defineLocale('ar', {
months : months,
monthsShort : months,
weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'D/\u200FM/\u200FYYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
meridiemParse: /ص|م/,
isPM : function (input) {
return 'م' === input;
},
meridiem : function (hour, minute, isLower) {
if (hour < 12) {
return 'ص';
} else {
return 'م';
}
},
calendar : {
sameDay: '[اليوم عند الساعة] LT',
nextDay: '[غدًا عند الساعة] LT',
nextWeek: 'dddd [عند الساعة] LT',
lastDay: '[أمس عند الساعة] LT',
lastWeek: 'dddd [عند الساعة] LT',
sameElse: 'L'
},
relativeTime : {
future : 'بعد %s',
past : 'منذ %s',
s : pluralize('s'),
m : pluralize('m'),
mm : pluralize('m'),
h : pluralize('h'),
hh : pluralize('h'),
d : pluralize('d'),
dd : pluralize('d'),
M : pluralize('M'),
MM : pluralize('M'),
y : pluralize('y'),
yy : pluralize('y')
},
preparse: function (string) {
return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
return numberMap[match];
}).replace(/،/g, ',');
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
}).replace(/,/g, '،');
},
week : {
dow : 6, // Saturday is the first day of the week.
doy : 12 // The week that contains Jan 1st is the first week of the year.
}
});
return ar;
})));

105
public/js/moment/locale/az.js vendored Normal file
View File

@ -0,0 +1,105 @@
//! moment.js locale configuration
//! locale : Azerbaijani [az]
//! author : topchiyev : https://github.com/topchiyev
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var suffixes = {
1: '-inci',
5: '-inci',
8: '-inci',
70: '-inci',
80: '-inci',
2: '-nci',
7: '-nci',
20: '-nci',
50: '-nci',
3: '-üncü',
4: '-üncü',
100: '-üncü',
6: '-ncı',
9: '-uncu',
10: '-uncu',
30: '-uncu',
60: '-ıncı',
90: '-ıncı'
};
var az = moment.defineLocale('az', {
months : 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split('_'),
monthsShort : 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'),
weekdays : 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split('_'),
weekdaysShort : 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'),
weekdaysMin : 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd, D MMMM YYYY HH:mm'
},
calendar : {
sameDay : '[bugün saat] LT',
nextDay : '[sabah saat] LT',
nextWeek : '[gələn həftə] dddd [saat] LT',
lastDay : '[dünən] LT',
lastWeek : '[keçən həftə] dddd [saat] LT',
sameElse : 'L'
},
relativeTime : {
future : '%s sonra',
past : '%s əvvəl',
s : 'birneçə saniyyə',
m : 'bir dəqiqə',
mm : '%d dəqiqə',
h : 'bir saat',
hh : '%d saat',
d : 'bir gün',
dd : '%d gün',
M : 'bir ay',
MM : '%d ay',
y : 'bir il',
yy : '%d il'
},
meridiemParse: /gecə|səhər|gündüz|axşam/,
isPM : function (input) {
return /^(gündüz|axşam)$/.test(input);
},
meridiem : function (hour, minute, isLower) {
if (hour < 4) {
return 'gecə';
} else if (hour < 12) {
return 'səhər';
} else if (hour < 17) {
return 'gündüz';
} else {
return 'axşam';
}
},
dayOfMonthOrdinalParse: /\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,
ordinal : function (number) {
if (number === 0) { // special case for zero
return number + '-ıncı';
}
var a = number % 10,
b = number % 100 - a,
c = number >= 100 ? 100 : null;
return number + (suffixes[a] || suffixes[b] || suffixes[c]);
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return az;
})));

134
public/js/moment/locale/be.js vendored Normal file
View File

@ -0,0 +1,134 @@
//! moment.js locale configuration
//! locale : Belarusian [be]
//! author : Dmitry Demidov : https://github.com/demidov91
//! author: Praleska: http://praleska.pro/
//! Author : Menelion Elensúle : https://github.com/Oire
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
function plural(word, num) {
var forms = word.split('_');
return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
}
function relativeTimeWithPlural(number, withoutSuffix, key) {
var format = {
'mm': withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін',
'hh': withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін',
'dd': 'дзень_дні_дзён',
'MM': есяц_месяцы_месяцаў',
'yy': 'год_гады_гадоў'
};
if (key === 'm') {
return withoutSuffix ? 'хвіліна' : 'хвіліну';
}
else if (key === 'h') {
return withoutSuffix ? 'гадзіна' : 'гадзіну';
}
else {
return number + ' ' + plural(format[key], +number);
}
}
var be = moment.defineLocale('be', {
months : {
format: 'студзеня_лютага_сакавікарасавікараўня_чэрвеня_ліпеня_жніўня_верасня_кастрычнікаістапада_снежня'.split('_'),
standalone: 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_')
},
monthsShort : 'студ_лют_сак_красрав_чэрв_ліп_жнів_вераст_ліст_снеж'.split('_'),
weekdays : {
format: 'нядзелю_панядзелак_аўторак_серадуацвер_пятніцу_суботу'.split('_'),
standalone: 'нядзеля_панядзелак_аўторак_серадаацвер_пятніца_субота'.split('_'),
isFormat: /\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/
},
weekdaysShort : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
weekdaysMin : 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D MMMM YYYY г.',
LLL : 'D MMMM YYYY г., HH:mm',
LLLL : 'dddd, D MMMM YYYY г., HH:mm'
},
calendar : {
sameDay: '[Сёння ў] LT',
nextDay: '[Заўтра ў] LT',
lastDay: '[Учора ў] LT',
nextWeek: function () {
return '[У] dddd [ў] LT';
},
lastWeek: function () {
switch (this.day()) {
case 0:
case 3:
case 5:
case 6:
return '[У мінулую] dddd [ў] LT';
case 1:
case 2:
case 4:
return '[У мінулы] dddd [ў] LT';
}
},
sameElse: 'L'
},
relativeTime : {
future : 'праз %s',
past : '%s таму',
s : 'некалькі секунд',
m : relativeTimeWithPlural,
mm : relativeTimeWithPlural,
h : relativeTimeWithPlural,
hh : relativeTimeWithPlural,
d : 'дзень',
dd : relativeTimeWithPlural,
M : 'месяц',
MM : relativeTimeWithPlural,
y : 'год',
yy : relativeTimeWithPlural
},
meridiemParse: /ночы|раніцы|дня|вечара/,
isPM : function (input) {
return /^(дня|вечара)$/.test(input);
},
meridiem : function (hour, minute, isLower) {
if (hour < 4) {
return 'ночы';
} else if (hour < 12) {
return 'раніцы';
} else if (hour < 17) {
return 'дня';
} else {
return 'вечара';
}
},
dayOfMonthOrdinalParse: /\d{1,2}-(і|ы|га)/,
ordinal: function (number, period) {
switch (period) {
case 'M':
case 'd':
case 'DDD':
case 'w':
case 'W':
return (number % 10 === 2 || number % 10 === 3) && (number % 100 !== 12 && number % 100 !== 13) ? number + '-і' : number + '-ы';
case 'D':
return number + '-га';
default:
return number;
}
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return be;
})));

90
public/js/moment/locale/bg.js vendored Normal file
View File

@ -0,0 +1,90 @@
//! moment.js locale configuration
//! locale : Bulgarian [bg]
//! author : Krasen Borisov : https://github.com/kraz
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var bg = moment.defineLocale('bg', {
months : 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'),
monthsShort : 'янрев_мар_апрай_юни_юли_авг_сеп_окт_ноеек'.split('_'),
weekdays : еделя_понеделник_вторник_срядаетвъртък_петък_събота'.split('_'),
weekdaysShort : ед_пон_вто_сря_чет_пет_съб'.split('_'),
weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
longDateFormat : {
LT : 'H:mm',
LTS : 'H:mm:ss',
L : 'D.MM.YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY H:mm',
LLLL : 'dddd, D MMMM YYYY H:mm'
},
calendar : {
sameDay : '[Днес в] LT',
nextDay : '[Утре в] LT',
nextWeek : 'dddd [в] LT',
lastDay : '[Вчера в] LT',
lastWeek : function () {
switch (this.day()) {
case 0:
case 3:
case 6:
return '[В изминалата] dddd [в] LT';
case 1:
case 2:
case 4:
case 5:
return '[В изминалия] dddd [в] LT';
}
},
sameElse : 'L'
},
relativeTime : {
future : 'след %s',
past : 'преди %s',
s : 'няколко секунди',
m : 'минута',
mm : '%d минути',
h : 'час',
hh : '%d часа',
d : 'ден',
dd : '%d дни',
M : 'месец',
MM : '%d месеца',
y : 'година',
yy : '%d години'
},
dayOfMonthOrdinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
ordinal : function (number) {
var lastDigit = number % 10,
last2Digits = number % 100;
if (number === 0) {
return number + '-ев';
} else if (last2Digits === 0) {
return number + '-ен';
} else if (last2Digits > 10 && last2Digits < 20) {
return number + '-ти';
} else if (lastDigit === 1) {
return number + '-ви';
} else if (lastDigit === 2) {
return number + '-ри';
} else if (lastDigit === 7 || lastDigit === 8) {
return number + '-ми';
} else {
return number + '-ти';
}
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return bg;
})));

59
public/js/moment/locale/bm.js vendored Normal file
View File

@ -0,0 +1,59 @@
//! moment.js locale configuration
//! locale : Bambara [bm]
//! author : Estelle Comment : https://github.com/estellecomment
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
// Language contact person : Abdoufata Kane : https://github.com/abdoufata
var bm = moment.defineLocale('bm', {
months : 'Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo'.split('_'),
monthsShort : 'Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des'.split('_'),
weekdays : 'Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri'.split('_'),
weekdaysShort : 'Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib'.split('_'),
weekdaysMin : 'Ka_Nt_Ta_Ar_Al_Ju_Si'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD/MM/YYYY',
LL : 'MMMM [tile] D [san] YYYY',
LLL : 'MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm',
LLLL : 'dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm'
},
calendar : {
sameDay : '[Bi lɛrɛ] LT',
nextDay : '[Sini lɛrɛ] LT',
nextWeek : 'dddd [don lɛrɛ] LT',
lastDay : '[Kunu lɛrɛ] LT',
lastWeek : 'dddd [tɛmɛnen lɛrɛ] LT',
sameElse : 'L'
},
relativeTime : {
future : '%s kɔnɔ',
past : 'a bɛ %s bɔ',
s : 'sanga dama dama',
m : 'miniti kelen',
mm : 'miniti %d',
h : 'lɛrɛ kelen',
hh : 'lɛrɛ %d',
d : 'tile kelen',
dd : 'tile %d',
M : 'kalo kelen',
MM : 'kalo %d',
y : 'san kelen',
yy : 'san %d'
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return bm;
})));

119
public/js/moment/locale/bn.js vendored Normal file
View File

@ -0,0 +1,119 @@
//! moment.js locale configuration
//! locale : Bengali [bn]
//! author : Kaushik Gandhi : https://github.com/kaushikgandhi
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var symbolMap = {
'1': '১',
'2': '২',
'3': '৩',
'4': '',
'5': '৫',
'6': '৬',
'7': '',
'8': '৮',
'9': '৯',
'0': ''
};
var numberMap = {
'১': '1',
'২': '2',
'৩': '3',
'': '4',
'৫': '5',
'৬': '6',
'': '7',
'৮': '8',
'৯': '9',
'': '0'
};
var bn = moment.defineLocale('bn', {
months : 'জানুয়ারী_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split('_'),
monthsShort : 'জানু_ফেব_মার্চ_এপ্র_মে_জুন_জুল_আগ_সেপ্ট_অক্টো_নভে_ডিসে'.split('_'),
weekdays : 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split('_'),
weekdaysShort : 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'),
weekdaysMin : 'রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি'.split('_'),
longDateFormat : {
LT : 'A h:mm সময়',
LTS : 'A h:mm:ss সময়',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY, A h:mm সময়',
LLLL : 'dddd, D MMMM YYYY, A h:mm সময়'
},
calendar : {
sameDay : '[আজ] LT',
nextDay : '[আগামীকাল] LT',
nextWeek : 'dddd, LT',
lastDay : '[গতকাল] LT',
lastWeek : '[গত] dddd, LT',
sameElse : 'L'
},
relativeTime : {
future : '%s পরে',
past : '%s আগে',
s : 'কয়েক সেকেন্ড',
m : 'এক মিনিট',
mm : '%d মিনিট',
h : 'এক ঘন্টা',
hh : '%d ঘন্টা',
d : 'এক দিন',
dd : '%d দিন',
M : 'এক মাস',
MM : '%d মাস',
y : 'এক বছর',
yy : '%d বছর'
},
preparse: function (string) {
return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/,
meridiemHour : function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if ((meridiem === 'রাত' && hour >= 4) ||
(meridiem === 'দুপুর' && hour < 5) ||
meridiem === 'বিকাল') {
return hour + 12;
} else {
return hour;
}
},
meridiem : function (hour, minute, isLower) {
if (hour < 4) {
return 'রাত';
} else if (hour < 10) {
return 'সকাল';
} else if (hour < 17) {
return 'দুপুর';
} else if (hour < 20) {
return 'বিকাল';
} else {
return 'রাত';
}
},
week : {
dow : 0, // Sunday is the first day of the week.
doy : 6 // The week that contains Jan 1st is the first week of the year.
}
});
return bn;
})));

119
public/js/moment/locale/bo.js vendored Normal file
View File

@ -0,0 +1,119 @@
//! moment.js locale configuration
//! locale : Tibetan [bo]
//! author : Thupten N. Chakrishar : https://github.com/vajradog
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var symbolMap = {
'1': '༡',
'2': '༢',
'3': '༣',
'4': '༤',
'5': '༥',
'6': '༦',
'7': '༧',
'8': '༨',
'9': '༩',
'0': '༠'
};
var numberMap = {
'༡': '1',
'༢': '2',
'༣': '3',
'༤': '4',
'༥': '5',
'༦': '6',
'༧': '7',
'༨': '8',
'༩': '9',
'༠': '0'
};
var bo = moment.defineLocale('bo', {
months : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),
monthsShort : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'),
weekdays : 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split('_'),
weekdaysShort : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),
weekdaysMin : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'),
longDateFormat : {
LT : 'A h:mm',
LTS : 'A h:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY, A h:mm',
LLLL : 'dddd, D MMMM YYYY, A h:mm'
},
calendar : {
sameDay : '[དི་རིང] LT',
nextDay : '[སང་ཉིན] LT',
nextWeek : '[བདུན་ཕྲག་རྗེས་མ], LT',
lastDay : '[ཁ་སང] LT',
lastWeek : '[བདུན་ཕྲག་མཐའ་མ] dddd, LT',
sameElse : 'L'
},
relativeTime : {
future : '%s ལ་',
past : '%s སྔན་ལ',
s : 'ལམ་སང',
m : 'སྐར་མ་གཅིག',
mm : '%d སྐར་མ',
h : 'ཆུ་ཚོད་གཅིག',
hh : '%d ཆུ་ཚོད',
d : 'ཉིན་གཅིག',
dd : '%d ཉིན་',
M : 'ཟླ་བ་གཅིག',
MM : '%d ཟླ་བ',
y : 'ལོ་གཅིག',
yy : '%d ལོ'
},
preparse: function (string) {
return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) {
return numberMap[match];
});
},
postformat: function (string) {
return string.replace(/\d/g, function (match) {
return symbolMap[match];
});
},
meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,
meridiemHour : function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if ((meridiem === 'མཚན་མོ' && hour >= 4) ||
(meridiem === 'ཉིན་གུང' && hour < 5) ||
meridiem === 'དགོང་དག') {
return hour + 12;
} else {
return hour;
}
},
meridiem : function (hour, minute, isLower) {
if (hour < 4) {
return 'མཚན་མོ';
} else if (hour < 10) {
return 'ཞོགས་ཀས';
} else if (hour < 17) {
return 'ཉིན་གུང';
} else if (hour < 20) {
return 'དགོང་དག';
} else {
return 'མཚན་མོ';
}
},
week : {
dow : 0, // Sunday is the first day of the week.
doy : 6 // The week that contains Jan 1st is the first week of the year.
}
});
return bo;
})));

108
public/js/moment/locale/br.js vendored Normal file
View File

@ -0,0 +1,108 @@
//! moment.js locale configuration
//! locale : Breton [br]
//! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
function relativeTimeWithMutation(number, withoutSuffix, key) {
var format = {
'mm': 'munutenn',
'MM': 'miz',
'dd': 'devezh'
};
return number + ' ' + mutation(format[key], number);
}
function specialMutationForYears(number) {
switch (lastNumber(number)) {
case 1:
case 3:
case 4:
case 5:
case 9:
return number + ' bloaz';
default:
return number + ' vloaz';
}
}
function lastNumber(number) {
if (number > 9) {
return lastNumber(number % 10);
}
return number;
}
function mutation(text, number) {
if (number === 2) {
return softMutation(text);
}
return text;
}
function softMutation(text) {
var mutationTable = {
'm': 'v',
'b': 'v',
'd': 'z'
};
if (mutationTable[text.charAt(0)] === undefined) {
return text;
}
return mutationTable[text.charAt(0)] + text.substring(1);
}
var br = moment.defineLocale('br', {
months : 'Genver_C\'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split('_'),
monthsShort : 'Gen_C\'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'),
weekdays : 'Sul_Lun_Meurzh_Merc\'her_Yaou_Gwener_Sadorn'.split('_'),
weekdaysShort : 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),
weekdaysMin : 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'h[e]mm A',
LTS : 'h[e]mm:ss A',
L : 'DD/MM/YYYY',
LL : 'D [a viz] MMMM YYYY',
LLL : 'D [a viz] MMMM YYYY h[e]mm A',
LLLL : 'dddd, D [a viz] MMMM YYYY h[e]mm A'
},
calendar : {
sameDay : '[Hiziv da] LT',
nextDay : '[Warc\'hoazh da] LT',
nextWeek : 'dddd [da] LT',
lastDay : '[Dec\'h da] LT',
lastWeek : 'dddd [paset da] LT',
sameElse : 'L'
},
relativeTime : {
future : 'a-benn %s',
past : '%s \'zo',
s : 'un nebeud segondennoù',
m : 'ur vunutenn',
mm : relativeTimeWithMutation,
h : 'un eur',
hh : '%d eur',
d : 'un devezh',
dd : relativeTimeWithMutation,
M : 'ur miz',
MM : relativeTimeWithMutation,
y : 'ur bloaz',
yy : specialMutationForYears
},
dayOfMonthOrdinalParse: /\d{1,2}(añ|vet)/,
ordinal : function (number) {
var output = (number === 1) ? 'añ' : 'vet';
return number + output;
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return br;
})));

143
public/js/moment/locale/bs.js vendored Normal file
View File

@ -0,0 +1,143 @@
//! moment.js locale configuration
//! locale : Bosnian [bs]
//! author : Nedim Cholich : https://github.com/frontyard
//! based on (hr) translation by Bojan Marković
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
function translate(number, withoutSuffix, key) {
var result = number + ' ';
switch (key) {
case 'm':
return withoutSuffix ? 'jedna minuta' : 'jedne minute';
case 'mm':
if (number === 1) {
result += 'minuta';
} else if (number === 2 || number === 3 || number === 4) {
result += 'minute';
} else {
result += 'minuta';
}
return result;
case 'h':
return withoutSuffix ? 'jedan sat' : 'jednog sata';
case 'hh':
if (number === 1) {
result += 'sat';
} else if (number === 2 || number === 3 || number === 4) {
result += 'sata';
} else {
result += 'sati';
}
return result;
case 'dd':
if (number === 1) {
result += 'dan';
} else {
result += 'dana';
}
return result;
case 'MM':
if (number === 1) {
result += 'mjesec';
} else if (number === 2 || number === 3 || number === 4) {
result += 'mjeseca';
} else {
result += 'mjeseci';
}
return result;
case 'yy':
if (number === 1) {
result += 'godina';
} else if (number === 2 || number === 3 || number === 4) {
result += 'godine';
} else {
result += 'godina';
}
return result;
}
}
var bs = moment.defineLocale('bs', {
months : 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split('_'),
monthsShort : 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split('_'),
monthsParseExact: true,
weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'),
weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'H:mm',
LTS : 'H:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D. MMMM YYYY',
LLL : 'D. MMMM YYYY H:mm',
LLLL : 'dddd, D. MMMM YYYY H:mm'
},
calendar : {
sameDay : '[danas u] LT',
nextDay : '[sutra u] LT',
nextWeek : function () {
switch (this.day()) {
case 0:
return '[u] [nedjelju] [u] LT';
case 3:
return '[u] [srijedu] [u] LT';
case 6:
return '[u] [subotu] [u] LT';
case 1:
case 2:
case 4:
case 5:
return '[u] dddd [u] LT';
}
},
lastDay : '[jučer u] LT',
lastWeek : function () {
switch (this.day()) {
case 0:
case 3:
return '[prošlu] dddd [u] LT';
case 6:
return '[prošle] [subote] [u] LT';
case 1:
case 2:
case 4:
case 5:
return '[prošli] dddd [u] LT';
}
},
sameElse : 'L'
},
relativeTime : {
future : 'za %s',
past : 'prije %s',
s : 'par sekundi',
m : translate,
mm : translate,
h : translate,
hh : translate,
d : 'dan',
dd : translate,
M : 'mjesec',
MM : translate,
y : 'godinu',
yy : translate
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return bs;
})));

88
public/js/moment/locale/ca.js vendored Normal file
View File

@ -0,0 +1,88 @@
//! moment.js locale configuration
//! locale : Catalan [ca]
//! author : Juan G. Hurtado : https://github.com/juanghurtado
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var ca = moment.defineLocale('ca', {
months : {
standalone: 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split('_'),
format: 'de gener_de febrer_de març_d\'abril_de maig_de juny_de juliol_d\'agost_de setembre_d\'octubre_de novembre_de desembre'.split('_'),
isFormat: /D[oD]?(\s)+MMMM/
},
monthsShort : 'gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.'.split('_'),
monthsParseExact : true,
weekdays : 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split('_'),
weekdaysShort : 'dg._dl._dt._dc._dj._dv._ds.'.split('_'),
weekdaysMin : 'dg_dl_dt_dc_dj_dv_ds'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT : 'H:mm',
LTS : 'H:mm:ss',
L : 'DD/MM/YYYY',
LL : 'D MMMM [de] YYYY',
ll : 'D MMM YYYY',
LLL : 'D MMMM [de] YYYY [a les] H:mm',
lll : 'D MMM YYYY, H:mm',
LLLL : 'dddd D MMMM [de] YYYY [a les] H:mm',
llll : 'ddd D MMM YYYY, H:mm'
},
calendar : {
sameDay : function () {
return '[avui a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
},
nextDay : function () {
return '[demà a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
},
nextWeek : function () {
return 'dddd [a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
},
lastDay : function () {
return '[ahir a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
},
lastWeek : function () {
return '[el] dddd [passat a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT';
},
sameElse : 'L'
},
relativeTime : {
future : 'd\'aquí %s',
past : 'fa %s',
s : 'uns segons',
m : 'un minut',
mm : '%d minuts',
h : 'una hora',
hh : '%d hores',
d : 'un dia',
dd : '%d dies',
M : 'un mes',
MM : '%d mesos',
y : 'un any',
yy : '%d anys'
},
dayOfMonthOrdinalParse: /\d{1,2}(r|n|t|è|a)/,
ordinal : function (number, period) {
var output = (number === 1) ? 'r' :
(number === 2) ? 'n' :
(number === 3) ? 'r' :
(number === 4) ? 't' : 'è';
if (period === 'w' || period === 'W') {
output = 'a';
}
return number + output;
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return ca;
})));

172
public/js/moment/locale/cs.js vendored Normal file
View File

@ -0,0 +1,172 @@
//! moment.js locale configuration
//! locale : Czech [cs]
//! author : petrbela : https://github.com/petrbela
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_');
var monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_');
function plural(n) {
return (n > 1) && (n < 5) && (~~(n / 10) !== 1);
}
function translate(number, withoutSuffix, key, isFuture) {
var result = number + ' ';
switch (key) {
case 's': // a few seconds / in a few seconds / a few seconds ago
return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami';
case 'm': // a minute / in a minute / a minute ago
return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou');
case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'minuty' : 'minut');
} else {
return result + 'minutami';
}
break;
case 'h': // an hour / in an hour / an hour ago
return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');
case 'hh': // 9 hours / in 9 hours / 9 hours ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'hodiny' : 'hodin');
} else {
return result + 'hodinami';
}
break;
case 'd': // a day / in a day / a day ago
return (withoutSuffix || isFuture) ? 'den' : 'dnem';
case 'dd': // 9 days / in 9 days / 9 days ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'dny' : 'dní');
} else {
return result + 'dny';
}
break;
case 'M': // a month / in a month / a month ago
return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem';
case 'MM': // 9 months / in 9 months / 9 months ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'měsíce' : 'měsíců');
} else {
return result + 'měsíci';
}
break;
case 'y': // a year / in a year / a year ago
return (withoutSuffix || isFuture) ? 'rok' : 'rokem';
case 'yy': // 9 years / in 9 years / 9 years ago
if (withoutSuffix || isFuture) {
return result + (plural(number) ? 'roky' : 'let');
} else {
return result + 'lety';
}
break;
}
}
var cs = moment.defineLocale('cs', {
months : months,
monthsShort : monthsShort,
monthsParse : (function (months, monthsShort) {
var i, _monthsParse = [];
for (i = 0; i < 12; i++) {
// use custom parser to solve problem with July (červenec)
_monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');
}
return _monthsParse;
}(months, monthsShort)),
shortMonthsParse : (function (monthsShort) {
var i, _shortMonthsParse = [];
for (i = 0; i < 12; i++) {
_shortMonthsParse[i] = new RegExp('^' + monthsShort[i] + '$', 'i');
}
return _shortMonthsParse;
}(monthsShort)),
longMonthsParse : (function (months) {
var i, _longMonthsParse = [];
for (i = 0; i < 12; i++) {
_longMonthsParse[i] = new RegExp('^' + months[i] + '$', 'i');
}
return _longMonthsParse;
}(months)),
weekdays : 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),
weekdaysShort : 'ne_po_út_st_čt_pá_so'.split('_'),
weekdaysMin : 'ne_po_út_st_čt_pá_so'.split('_'),
longDateFormat : {
LT: 'H:mm',
LTS : 'H:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D. MMMM YYYY',
LLL : 'D. MMMM YYYY H:mm',
LLLL : 'dddd D. MMMM YYYY H:mm',
l : 'D. M. YYYY'
},
calendar : {
sameDay: '[dnes v] LT',
nextDay: '[zítra v] LT',
nextWeek: function () {
switch (this.day()) {
case 0:
return '[v neděli v] LT';
case 1:
case 2:
return '[v] dddd [v] LT';
case 3:
return '[ve středu v] LT';
case 4:
return '[ve čtvrtek v] LT';
case 5:
return '[v pátek v] LT';
case 6:
return '[v sobotu v] LT';
}
},
lastDay: '[včera v] LT',
lastWeek: function () {
switch (this.day()) {
case 0:
return '[minulou neděli v] LT';
case 1:
case 2:
return '[minulé] dddd [v] LT';
case 3:
return '[minulou středu v] LT';
case 4:
case 5:
return '[minulý] dddd [v] LT';
case 6:
return '[minulou sobotu v] LT';
}
},
sameElse: 'L'
},
relativeTime : {
future : 'za %s',
past : 'před %s',
s : translate,
m : translate,
mm : translate,
h : translate,
hh : translate,
d : translate,
dd : translate,
M : translate,
MM : translate,
y : translate,
yy : translate
},
dayOfMonthOrdinalParse : /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return cs;
})));

63
public/js/moment/locale/cv.js vendored Normal file
View File

@ -0,0 +1,63 @@
//! moment.js locale configuration
//! locale : Chuvash [cv]
//! author : Anatoly Mironov : https://github.com/mirontoli
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var cv = moment.defineLocale('cv', {
months : 'кӑрлач_нарӑс_пуш_акаай_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав'.split('_'),
monthsShort : 'кӑрар_пуш_акаай_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'),
weekdays : 'вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун'.split('_'),
weekdaysShort : 'вырун_ытл_юн_кӗҫ_эрн_шӑм'.split('_'),
weekdaysMin : р_тн_ыт_юн_кҫ_эр_шм'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD-MM-YYYY',
LL : 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]',
LLL : 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',
LLLL : 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm'
},
calendar : {
sameDay: '[Паян] LT [сехетре]',
nextDay: '[Ыран] LT [сехетре]',
lastDay: '[Ӗнер] LT [сехетре]',
nextWeek: '[Ҫитес] dddd LT [сехетре]',
lastWeek: '[Иртнӗ] dddd LT [сехетре]',
sameElse: 'L'
},
relativeTime : {
future : function (output) {
var affix = /сехет$/i.exec(output) ? 'рен' : /ҫул$/i.exec(output) ? 'тан' : 'ран';
return output + affix;
},
past : '%s каялла',
s : 'пӗр-ик ҫеккунт',
m : 'пӗр минут',
mm : '%d минут',
h : 'пӗр сехет',
hh : '%d сехет',
d : 'пӗр кун',
dd : '%d кун',
M : 'пӗр уйӑх',
MM : '%d уйӑх',
y : 'пӗр ҫул',
yy : '%d ҫул'
},
dayOfMonthOrdinalParse: /\d{1,2}-мӗш/,
ordinal : '%d-мӗш',
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 1st is the first week of the year.
}
});
return cv;
})));

81
public/js/moment/locale/cy.js vendored Normal file
View File

@ -0,0 +1,81 @@
//! moment.js locale configuration
//! locale : Welsh [cy]
//! author : Robert Allen : https://github.com/robgallen
//! author : https://github.com/ryangreaves
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var cy = moment.defineLocale('cy', {
months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split('_'),
monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split('_'),
weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split('_'),
weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'),
weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'),
weekdaysParseExact : true,
// time formats are the same as en-gb
longDateFormat: {
LT: 'HH:mm',
LTS : 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm'
},
calendar: {
sameDay: '[Heddiw am] LT',
nextDay: '[Yfory am] LT',
nextWeek: 'dddd [am] LT',
lastDay: '[Ddoe am] LT',
lastWeek: 'dddd [diwethaf am] LT',
sameElse: 'L'
},
relativeTime: {
future: 'mewn %s',
past: '%s yn ôl',
s: 'ychydig eiliadau',
m: 'munud',
mm: '%d munud',
h: 'awr',
hh: '%d awr',
d: 'diwrnod',
dd: '%d diwrnod',
M: 'mis',
MM: '%d mis',
y: 'blwyddyn',
yy: '%d flynedd'
},
dayOfMonthOrdinalParse: /\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,
// traditional ordinal numbers above 31 are not commonly used in colloquial Welsh
ordinal: function (number) {
var b = number,
output = '',
lookup = [
'', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed
'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed' // 11eg to 20fed
];
if (b > 20) {
if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) {
output = 'fed'; // not 30ain, 70ain or 90ain
} else {
output = 'ain';
}
} else if (b > 0) {
output = lookup[b];
}
return number + output;
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return cy;
})));

60
public/js/moment/locale/da.js vendored Normal file
View File

@ -0,0 +1,60 @@
//! moment.js locale configuration
//! locale : Danish [da]
//! author : Ulrik Nielsen : https://github.com/mrbase
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var da = moment.defineLocale('da', {
months : 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split('_'),
monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
weekdaysShort : 'søn_man_tir_ons_tor_fre_lør'.split('_'),
weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D. MMMM YYYY',
LLL : 'D. MMMM YYYY HH:mm',
LLLL : 'dddd [d.] D. MMMM YYYY [kl.] HH:mm'
},
calendar : {
sameDay : '[i dag kl.] LT',
nextDay : '[i morgen kl.] LT',
nextWeek : 'på dddd [kl.] LT',
lastDay : '[i går kl.] LT',
lastWeek : '[i] dddd[s kl.] LT',
sameElse : 'L'
},
relativeTime : {
future : 'om %s',
past : '%s siden',
s : 'få sekunder',
m : 'et minut',
mm : '%d minutter',
h : 'en time',
hh : '%d timer',
d : 'en dag',
dd : '%d dage',
M : 'en måned',
MM : '%d måneder',
y : 'et år',
yy : '%d år'
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return da;
})));

79
public/js/moment/locale/de-at.js vendored Normal file
View File

@ -0,0 +1,79 @@
//! moment.js locale configuration
//! locale : German (Austria) [de-at]
//! author : lluchs : https://github.com/lluchs
//! author: Menelion Elensúle: https://github.com/Oire
//! author : Martin Groller : https://github.com/MadMG
//! author : Mikolaj Dadela : https://github.com/mik01aj
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var format = {
'm': ['eine Minute', 'einer Minute'],
'h': ['eine Stunde', 'einer Stunde'],
'd': ['ein Tag', 'einem Tag'],
'dd': [number + ' Tage', number + ' Tagen'],
'M': ['ein Monat', 'einem Monat'],
'MM': [number + ' Monate', number + ' Monaten'],
'y': ['ein Jahr', 'einem Jahr'],
'yy': [number + ' Jahre', number + ' Jahren']
};
return withoutSuffix ? format[key][0] : format[key][1];
}
var deAt = moment.defineLocale('de-at', {
months : 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
monthsShort : 'Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),
monthsParseExact : true,
weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D. MMMM YYYY',
LLL : 'D. MMMM YYYY HH:mm',
LLLL : 'dddd, D. MMMM YYYY HH:mm'
},
calendar : {
sameDay: '[heute um] LT [Uhr]',
sameElse: 'L',
nextDay: '[morgen um] LT [Uhr]',
nextWeek: 'dddd [um] LT [Uhr]',
lastDay: '[gestern um] LT [Uhr]',
lastWeek: '[letzten] dddd [um] LT [Uhr]'
},
relativeTime : {
future : 'in %s',
past : 'vor %s',
s : 'ein paar Sekunden',
m : processRelativeTime,
mm : '%d Minuten',
h : processRelativeTime,
hh : '%d Stunden',
d : processRelativeTime,
dd : processRelativeTime,
M : processRelativeTime,
MM : processRelativeTime,
y : processRelativeTime,
yy : processRelativeTime
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return deAt;
})));

78
public/js/moment/locale/de-ch.js vendored Normal file
View File

@ -0,0 +1,78 @@
//! moment.js locale configuration
//! locale : German (Switzerland) [de-ch]
//! author : sschueller : https://github.com/sschueller
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
// based on: https://www.bk.admin.ch/dokumentation/sprachen/04915/05016/index.html?lang=de#
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var format = {
'm': ['eine Minute', 'einer Minute'],
'h': ['eine Stunde', 'einer Stunde'],
'd': ['ein Tag', 'einem Tag'],
'dd': [number + ' Tage', number + ' Tagen'],
'M': ['ein Monat', 'einem Monat'],
'MM': [number + ' Monate', number + ' Monaten'],
'y': ['ein Jahr', 'einem Jahr'],
'yy': [number + ' Jahre', number + ' Jahren']
};
return withoutSuffix ? format[key][0] : format[key][1];
}
var deCh = moment.defineLocale('de-ch', {
months : 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
monthsShort : 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),
monthsParseExact : true,
weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
weekdaysShort : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT: 'HH.mm',
LTS: 'HH.mm.ss',
L : 'DD.MM.YYYY',
LL : 'D. MMMM YYYY',
LLL : 'D. MMMM YYYY HH.mm',
LLLL : 'dddd, D. MMMM YYYY HH.mm'
},
calendar : {
sameDay: '[heute um] LT [Uhr]',
sameElse: 'L',
nextDay: '[morgen um] LT [Uhr]',
nextWeek: 'dddd [um] LT [Uhr]',
lastDay: '[gestern um] LT [Uhr]',
lastWeek: '[letzten] dddd [um] LT [Uhr]'
},
relativeTime : {
future : 'in %s',
past : 'vor %s',
s : 'ein paar Sekunden',
m : processRelativeTime,
mm : '%d Minuten',
h : processRelativeTime,
hh : '%d Stunden',
d : processRelativeTime,
dd : processRelativeTime,
M : processRelativeTime,
MM : processRelativeTime,
y : processRelativeTime,
yy : processRelativeTime
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return deCh;
})));

78
public/js/moment/locale/de.js vendored Normal file
View File

@ -0,0 +1,78 @@
//! moment.js locale configuration
//! locale : German [de]
//! author : lluchs : https://github.com/lluchs
//! author: Menelion Elensúle: https://github.com/Oire
//! author : Mikolaj Dadela : https://github.com/mik01aj
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
function processRelativeTime(number, withoutSuffix, key, isFuture) {
var format = {
'm': ['eine Minute', 'einer Minute'],
'h': ['eine Stunde', 'einer Stunde'],
'd': ['ein Tag', 'einem Tag'],
'dd': [number + ' Tage', number + ' Tagen'],
'M': ['ein Monat', 'einem Monat'],
'MM': [number + ' Monate', number + ' Monaten'],
'y': ['ein Jahr', 'einem Jahr'],
'yy': [number + ' Jahre', number + ' Jahren']
};
return withoutSuffix ? format[key][0] : format[key][1];
}
var de = moment.defineLocale('de', {
months : 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
monthsShort : 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),
monthsParseExact : true,
weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
weekdaysParseExact : true,
longDateFormat : {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L : 'DD.MM.YYYY',
LL : 'D. MMMM YYYY',
LLL : 'D. MMMM YYYY HH:mm',
LLLL : 'dddd, D. MMMM YYYY HH:mm'
},
calendar : {
sameDay: '[heute um] LT [Uhr]',
sameElse: 'L',
nextDay: '[morgen um] LT [Uhr]',
nextWeek: 'dddd [um] LT [Uhr]',
lastDay: '[gestern um] LT [Uhr]',
lastWeek: '[letzten] dddd [um] LT [Uhr]'
},
relativeTime : {
future : 'in %s',
past : 'vor %s',
s : 'ein paar Sekunden',
m : processRelativeTime,
mm : '%d Minuten',
h : processRelativeTime,
hh : '%d Stunden',
d : processRelativeTime,
dd : processRelativeTime,
M : processRelativeTime,
MM : processRelativeTime,
y : processRelativeTime,
yy : processRelativeTime
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal : '%d.',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return de;
})));

100
public/js/moment/locale/dv.js vendored Normal file
View File

@ -0,0 +1,100 @@
//! moment.js locale configuration
//! locale : Maldivian [dv]
//! author : Jawish Hameed : https://github.com/jawish
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var months = [
'ޖެނުއަރީ',
'ފެބްރުއަރީ',
'މާރިޗު',
'އޭޕްރީލު',
'މޭ',
'ޖޫން',
'ޖުލައި',
'އޯގަސްޓު',
'ސެޕްޓެމްބަރު',
'އޮކްޓޯބަރު',
'ނޮވެމްބަރު',
'ޑިސެމްބަރު'
];
var weekdays = [
'އާދިއްތަ',
'ހޯމަ',
'އަންގާރަ',
'ބުދަ',
'ބުރާސްފަތި',
'ހުކުރު',
'ހޮނިހިރު'
];
var dv = moment.defineLocale('dv', {
months : months,
monthsShort : months,
weekdays : weekdays,
weekdaysShort : weekdays,
weekdaysMin : 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'),
longDateFormat : {
LT : 'HH:mm',
LTS : 'HH:mm:ss',
L : 'D/M/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY HH:mm',
LLLL : 'dddd D MMMM YYYY HH:mm'
},
meridiemParse: /މކ|މފ/,
isPM : function (input) {
return 'މފ' === input;
},
meridiem : function (hour, minute, isLower) {
if (hour < 12) {
return 'މކ';
} else {
return 'މފ';
}
},
calendar : {
sameDay : '[މިއަދު] LT',
nextDay : '[މާދަމާ] LT',
nextWeek : 'dddd LT',
lastDay : '[އިއްޔެ] LT',
lastWeek : '[ފާއިތުވި] dddd LT',
sameElse : 'L'
},
relativeTime : {
future : 'ތެރޭގައި %s',
past : 'ކުރިން %s',
s : 'ސިކުންތުކޮޅެއް',
m : 'މިނިޓެއް',
mm : 'މިނިޓު %d',
h : 'ގަޑިއިރެއް',
hh : 'ގަޑިއިރު %d',
d : 'ދުވަހެއް',
dd : 'ދުވަސް %d',
M : 'މަހެއް',
MM : 'މަސް %d',
y : 'އަހަރެއް',
yy : 'އަހަރު %d'
},
preparse: function (string) {
return string.replace(/،/g, ',');
},
postformat: function (string) {
return string.replace(/,/g, '،');
},
week : {
dow : 7, // Sunday is the first day of the week.
doy : 12 // The week that contains Jan 1st is the first week of the year.
}
});
return dv;
})));

100
public/js/moment/locale/el.js vendored Normal file
View File

@ -0,0 +1,100 @@
//! moment.js locale configuration
//! locale : Greek [el]
//! author : Aggelos Karalias : https://github.com/mehiel
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
function isFunction(input) {
return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
}
var el = moment.defineLocale('el', {
monthsNominativeEl : 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split('_'),
monthsGenitiveEl : 'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split('_'),
months : function (momentToFormat, format) {
if (!momentToFormat) {
return this._monthsNominativeEl;
} else if (typeof format === 'string' && /D/.test(format.substring(0, format.indexOf('MMMM')))) { // if there is a day number before 'MMMM'
return this._monthsGenitiveEl[momentToFormat.month()];
} else {
return this._monthsNominativeEl[momentToFormat.month()];
}
},
monthsShort : 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'),
weekdays : 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split('_'),
weekdaysShort : 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παραβ'.split('_'),
weekdaysMin : 'Κυ_Δε_Τρ_Τε_Πε_Παα'.split('_'),
meridiem : function (hours, minutes, isLower) {
if (hours > 11) {
return isLower ? 'μμ' : 'ΜΜ';
} else {
return isLower ? 'πμ' : 'ΠΜ';
}
},
isPM : function (input) {
return ((input + '').toLowerCase()[0] === 'μ');
},
meridiemParse : /[ΠΜ]\.?Μ?\.?/i,
longDateFormat : {
LT : 'h:mm A',
LTS : 'h:mm:ss A',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY h:mm A',
LLLL : 'dddd, D MMMM YYYY h:mm A'
},
calendarEl : {
sameDay : '[Σήμερα {}] LT',
nextDay : '[Αύριο {}] LT',
nextWeek : 'dddd [{}] LT',
lastDay : '[Χθες {}] LT',
lastWeek : function () {
switch (this.day()) {
case 6:
return '[το προηγούμενο] dddd [{}] LT';
default:
return '[την προηγούμενη] dddd [{}] LT';
}
},
sameElse : 'L'
},
calendar : function (key, mom) {
var output = this._calendarEl[key],
hours = mom && mom.hours();
if (isFunction(output)) {
output = output.apply(mom);
}
return output.replace('{}', (hours % 12 === 1 ? 'στη' : 'στις'));
},
relativeTime : {
future : 'σε %s',
past : '%s πριν',
s : 'λίγα δευτερόλεπτα',
m : 'ένα λεπτό',
mm : '%d λεπτά',
h : 'μία ώρα',
hh : '%d ώρες',
d : 'μία μέρα',
dd : '%d μέρες',
M : 'ένας μήνας',
MM : '%d μήνες',
y : 'ένας χρόνος',
yy : '%d χρόνια'
},
dayOfMonthOrdinalParse: /\d{1,2}η/,
ordinal: '%dη',
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4st is the first week of the year.
}
});
return el;
})));

67
public/js/moment/locale/en-au.js vendored Normal file
View File

@ -0,0 +1,67 @@
//! moment.js locale configuration
//! locale : English (Australia) [en-au]
//! author : Jared Morse : https://github.com/jarcoal
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var enAu = moment.defineLocale('en-au', {
months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
longDateFormat : {
LT : 'h:mm A',
LTS : 'h:mm:ss A',
L : 'DD/MM/YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY h:mm A',
LLLL : 'dddd, D MMMM YYYY h:mm A'
},
calendar : {
sameDay : '[Today at] LT',
nextDay : '[Tomorrow at] LT',
nextWeek : 'dddd [at] LT',
lastDay : '[Yesterday at] LT',
lastWeek : '[Last] dddd [at] LT',
sameElse : 'L'
},
relativeTime : {
future : 'in %s',
past : '%s ago',
s : 'a few seconds',
m : 'a minute',
mm : '%d minutes',
h : 'an hour',
hh : '%d hours',
d : 'a day',
dd : '%d days',
M : 'a month',
MM : '%d months',
y : 'a year',
yy : '%d years'
},
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
ordinal : function (number) {
var b = number % 10,
output = (~~(number % 100 / 10) === 1) ? 'th' :
(b === 1) ? 'st' :
(b === 2) ? 'nd' :
(b === 3) ? 'rd' : 'th';
return number + output;
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
return enAu;
})));

63
public/js/moment/locale/en-ca.js vendored Normal file
View File

@ -0,0 +1,63 @@
//! moment.js locale configuration
//! locale : English (Canada) [en-ca]
//! author : Jonathan Abourbih : https://github.com/jonbca
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
var enCa = moment.defineLocale('en-ca', {
months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
longDateFormat : {
LT : 'h:mm A',
LTS : 'h:mm:ss A',
L : 'YYYY-MM-DD',
LL : 'MMMM D, YYYY',
LLL : 'MMMM D, YYYY h:mm A',
LLLL : 'dddd, MMMM D, YYYY h:mm A'
},
calendar : {
sameDay : '[Today at] LT',
nextDay : '[Tomorrow at] LT',
nextWeek : 'dddd [at] LT',
lastDay : '[Yesterday at] LT',
lastWeek : '[Last] dddd [at] LT',
sameElse : 'L'
},
relativeTime : {
future : 'in %s',
past : '%s ago',
s : 'a few seconds',
m : 'a minute',
mm : '%d minutes',
h : 'an hour',
hh : '%d hours',
d : 'a day',
dd : '%d days',
M : 'a month',
MM : '%d months',
y : 'a year',
yy : '%d years'
},
dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
ordinal : function (number) {
var b = number % 10,
output = (~~(number % 100 / 10) === 1) ? 'th' :
(b === 1) ? 'st' :
(b === 2) ? 'nd' :
(b === 3) ? 'rd' : 'th';
return number + output;
}
});
return enCa;
})));

Some files were not shown because too many files have changed in this diff Show More