Merge branch 'master' into master
This commit is contained in:
commit
0220045ed6
@ -20,7 +20,7 @@ before_install:
|
||||
|
||||
before_script:
|
||||
- cp .env.testing .env
|
||||
- composer install --no-interaction
|
||||
- composer test --no-interaction
|
||||
|
||||
script:
|
||||
- vendor/bin/phpunit
|
@ -31,17 +31,21 @@ class ModuleInstall extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$alias = $this->argument('alias');
|
||||
$company_id = $this->argument('company_id');
|
||||
|
||||
// Set company id
|
||||
session(['company_id' => $company_id]);
|
||||
|
||||
$request = [
|
||||
'company_id' => $this->argument('company_id'),
|
||||
'alias' => strtolower($this->argument('alias')),
|
||||
'company_id' => $company_id,
|
||||
'alias' => strtolower($alias),
|
||||
'status' => '1',
|
||||
];
|
||||
|
||||
$model = Module::create($request);
|
||||
|
||||
$module = $this->laravel['modules']->findByAlias($model->alias);
|
||||
|
||||
$company_id = $this->argument('company_id');
|
||||
$module = $this->laravel['modules']->findByAlias($alias);
|
||||
|
||||
// Add history
|
||||
$data = [
|
||||
@ -61,7 +65,10 @@ class ModuleInstall extends Command
|
||||
$this->call('migrate', ['--force' => true]);
|
||||
|
||||
// Trigger event
|
||||
event(new ModuleInstalled($model->alias, $company_id));
|
||||
event(new ModuleInstalled($alias, $company_id));
|
||||
|
||||
// Unset company id
|
||||
session()->forget('company_id');
|
||||
|
||||
$this->info('Module installed!');
|
||||
}
|
||||
|
@ -178,8 +178,6 @@ class Accounts extends Controller
|
||||
$message = trans('messages.warning.disabled', ['name' => $account->name, 'text' => implode(', ', $relationships)]);
|
||||
|
||||
flash($message)->warning();
|
||||
|
||||
return redirect()->route('accounts.index');
|
||||
}
|
||||
|
||||
return redirect()->route('accounts.index');
|
||||
|
@ -8,6 +8,7 @@ use App\Http\Requests\Common\Company as Request;
|
||||
use App\Models\Common\Company;
|
||||
use App\Models\Setting\Currency;
|
||||
use App\Traits\Uploads;
|
||||
use App\Utilities\Overrider;
|
||||
|
||||
class Companies extends Controller
|
||||
{
|
||||
@ -60,6 +61,8 @@ class Companies extends Controller
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$company_id = session('company_id');
|
||||
|
||||
setting()->forgetAll();
|
||||
|
||||
// Create company
|
||||
@ -86,6 +89,12 @@ class Companies extends Controller
|
||||
setting()->setExtraColumns(['company_id' => $company->id]);
|
||||
setting()->save();
|
||||
|
||||
setting()->forgetAll();
|
||||
|
||||
session(['company_id' => $company_id]);
|
||||
|
||||
Overrider::load('settings');
|
||||
|
||||
// Redirect
|
||||
$message = trans('messages.success.added', ['type' => trans_choice('general.companies', 1)]);
|
||||
|
||||
@ -129,6 +138,8 @@ class Companies extends Controller
|
||||
*/
|
||||
public function update(Company $company, Request $request)
|
||||
{
|
||||
$company_id = session('company_id');
|
||||
|
||||
// Check if user can update company
|
||||
if (!$this->isUserCompany($company)) {
|
||||
$message = trans('companies.error.not_user_company');
|
||||
@ -166,6 +177,12 @@ class Companies extends Controller
|
||||
|
||||
setting()->save();
|
||||
|
||||
setting()->forgetAll();
|
||||
|
||||
session(['company_id' => $company_id]);
|
||||
|
||||
Overrider::load('settings');
|
||||
|
||||
// Redirect
|
||||
$message = trans('messages.success.updated', ['type' => trans_choice('general.companies', 1)]);
|
||||
|
||||
@ -191,6 +208,7 @@ class Companies extends Controller
|
||||
flash($message)->success();
|
||||
|
||||
return redirect()->route('companies.index');
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -184,7 +184,9 @@ class Invoices extends Controller
|
||||
|
||||
public function link(Invoice $invoice, Request $request)
|
||||
{
|
||||
session(['company_id' => $invoice->company_id]);
|
||||
if (empty($invoice)) {
|
||||
redirect()->route('login');
|
||||
}
|
||||
|
||||
$paid = 0;
|
||||
|
||||
|
@ -245,7 +245,7 @@ class Bills extends Controller
|
||||
*/
|
||||
public function destroy(Bill $bill)
|
||||
{
|
||||
$this->deleteRelationships($bill, ['items', 'histories', 'payments', 'recurring', 'totals']);
|
||||
$this->deleteRelationships($bill, ['items', 'itemTaxes', 'histories', 'payments', 'recurring', 'totals']);
|
||||
$bill->delete();
|
||||
|
||||
$message = trans('messages.success.deleted', ['type' => trans_choice('general.bills', 1)]);
|
||||
|
@ -257,7 +257,7 @@ class Invoices extends Controller
|
||||
*/
|
||||
public function destroy(Invoice $invoice)
|
||||
{
|
||||
$this->deleteRelationships($invoice, ['items', 'histories', 'payments', 'recurring', 'totals']);
|
||||
$this->deleteRelationships($invoice, ['items', 'itemTaxes', 'histories', 'payments', 'recurring', 'totals']);
|
||||
$invoice->delete();
|
||||
|
||||
$message = trans('messages.success.deleted', ['type' => trans_choice('general.invoices', 1)]);
|
||||
|
@ -83,7 +83,7 @@ class Updates extends Controller
|
||||
public function update($alias, $version)
|
||||
{
|
||||
if ($alias == 'core') {
|
||||
$name = 'Akaunting v' . $version;
|
||||
$name = 'Akaunting ' . $version;
|
||||
|
||||
$installed = version('short');
|
||||
} else {
|
||||
@ -98,33 +98,6 @@ class Updates extends Controller
|
||||
return view('install.updates.edit', compact('alias', 'name', 'installed', 'version'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Final actions post update.
|
||||
*
|
||||
* @param $alias
|
||||
* @param $old
|
||||
* @param $new
|
||||
* @return Response
|
||||
*/
|
||||
public function post($alias, $old, $new)
|
||||
{
|
||||
// Check if the file mirror was successful
|
||||
if (($alias == 'core') && (version('short') != $new)) {
|
||||
flash(trans('updates.error'))->error()->important();
|
||||
|
||||
return redirect('install/updates');
|
||||
}
|
||||
|
||||
// Clear cache after update
|
||||
Artisan::call('cache:clear');
|
||||
|
||||
event(new UpdateFinished($alias, $old, $new));
|
||||
|
||||
flash(trans('updates.success'))->success();
|
||||
|
||||
return redirect('install/updates');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for viewing the specified resource.
|
||||
*
|
||||
|
@ -286,8 +286,6 @@ class Item extends Controller
|
||||
* Final actions post update.
|
||||
*
|
||||
* @param $alias
|
||||
* @param $old
|
||||
* @param $new
|
||||
* @return Response
|
||||
*/
|
||||
public function post($alias)
|
||||
|
@ -169,7 +169,7 @@ class ProfitLoss extends Controller
|
||||
private function setAmount(&$totals, &$compares, $items, $type, $date_field)
|
||||
{
|
||||
foreach ($items as $item) {
|
||||
if ($item['table'] == 'bill_payments' || $item['table'] == 'invoice_payments') {
|
||||
if (($item['table'] == 'bill_payments') || ($item['table'] == 'invoice_payments')) {
|
||||
$type_item = $item->$type;
|
||||
|
||||
$item->category_id = $type_item->category_id;
|
||||
@ -183,7 +183,7 @@ class ProfitLoss extends Controller
|
||||
continue;
|
||||
}
|
||||
|
||||
$amount = $item->getConvertedAmount();
|
||||
$amount = $item->getConvertedAmount(false, false);
|
||||
|
||||
// Forecasting
|
||||
if ((($type == 'invoice') || ($type == 'bill')) && ($date_field == 'due_at')) {
|
||||
|
@ -178,8 +178,6 @@ class Categories extends Controller
|
||||
$message = trans('messages.warning.disabled', ['name' => $category->name, 'text' => implode(', ', $relationships)]);
|
||||
|
||||
flash($message)->warning();
|
||||
|
||||
return redirect()->route('categories.index');
|
||||
}
|
||||
|
||||
return redirect()->route('categories.index');
|
||||
|
@ -222,8 +222,6 @@ class Currencies extends Controller
|
||||
$message = trans('messages.warning.disabled', ['name' => $currency->name, 'text' => implode(', ', $relationships)]);
|
||||
|
||||
flash($message)->warning();
|
||||
|
||||
return redirect()->route('currencies.index');
|
||||
}
|
||||
|
||||
return redirect()->route('currencies.index');
|
||||
|
@ -167,8 +167,6 @@ class Taxes extends Controller
|
||||
$message = trans('messages.warning.disabled', ['name' => $tax->name, 'text' => implode(', ', $relationships)]);
|
||||
|
||||
flash($message)->warning();
|
||||
|
||||
return redirect()->route('taxes.index');
|
||||
}
|
||||
|
||||
return redirect()->route('taxes.index');
|
||||
|
@ -73,6 +73,11 @@ class Kernel extends HttpKernel
|
||||
'company.settings',
|
||||
'company.currencies',
|
||||
],
|
||||
|
||||
'signed' => [
|
||||
'signed-url',
|
||||
'signed-url.company',
|
||||
]
|
||||
];
|
||||
|
||||
/**
|
||||
@ -100,5 +105,6 @@ class Kernel extends HttpKernel
|
||||
'company.currencies' => \App\Http\Middleware\LoadCurrencies::class,
|
||||
'dateformat' => \App\Http\Middleware\DateFormat::class,
|
||||
'money' => \App\Http\Middleware\Money::class,
|
||||
'signed-url.company' => \App\Http\Middleware\SignedUrlCompany::class,
|
||||
];
|
||||
}
|
||||
|
@ -36,5 +36,4 @@ class ApiCompany
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
}
|
33
app/Http/Middleware/SignedUrlCompany.php
Normal file
33
app/Http/Middleware/SignedUrlCompany.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
|
||||
class SignedUrlCompany
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
$company_id = $request->get('company_id');
|
||||
|
||||
if (empty($company_id)) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
// Set company id
|
||||
session(['company_id' => $company_id]);
|
||||
|
||||
// Set the company settings
|
||||
setting()->setExtraColumns(['company_id' => $company_id]);
|
||||
setting()->load(true);
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
@ -2,10 +2,25 @@
|
||||
|
||||
namespace App\Http\Requests\Wizard;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use App\Http\Requests\Request;
|
||||
use App\Traits\Modules as RemoteModules;
|
||||
use Illuminate\Validation\Factory as ValidationFactory;
|
||||
|
||||
class Company extends FormRequest
|
||||
class Company extends Request
|
||||
{
|
||||
use RemoteModules;
|
||||
|
||||
public function __construct(ValidationFactory $validation)
|
||||
{
|
||||
$validation->extend(
|
||||
'check',
|
||||
function ($attribute, $value, $parameters) {
|
||||
return $this->checkToken($value);
|
||||
},
|
||||
trans('messages.error.invalid_token')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
@ -23,8 +38,14 @@ class Company extends FormRequest
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
$rules = [
|
||||
'company_logo' => 'mimes:' . setting('general.file_types') . '|between:0,' . setting('general.file_size') * 1024,
|
||||
];
|
||||
|
||||
if (!setting('general.api_token', false)) {
|
||||
$rules['api_token'] = 'required|string|check';
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ class Modules
|
||||
public function compose(View $view)
|
||||
{
|
||||
if (setting('general.api_token')) {
|
||||
$categories = Cache::remember('modules.categories', Date::now()->addHour(6), function () {
|
||||
$categories = Cache::remember('modules.categories.' . language()->getShortCode(), Date::now()->addHour(6), function () {
|
||||
return collect($this->getCategories())->pluck('name', 'slug')
|
||||
->prepend(trans('general.all_type', ['type' => trans_choice('general.categories', 2)]), '');
|
||||
});
|
||||
|
@ -77,7 +77,7 @@ class CreateBillItem
|
||||
$tax = Tax::find($tax_id);
|
||||
|
||||
switch ($tax->type) {
|
||||
case 'included':
|
||||
case 'inclusive':
|
||||
$inclusives[] = $tax;
|
||||
break;
|
||||
case 'compound':
|
||||
|
@ -23,7 +23,7 @@ class Bill extends Model
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $appends = ['attachment', 'discount', 'paid'];
|
||||
protected $appends = ['attachment', 'amount_without_tax', 'discount', 'paid'];
|
||||
|
||||
protected $dates = ['deleted_at', 'billed_at', 'due_at'];
|
||||
|
||||
@ -201,6 +201,22 @@ class Bill extends Model
|
||||
return $percent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the amount without tax.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAmountWithoutTaxAttribute()
|
||||
{
|
||||
$amount = $this->amount;
|
||||
|
||||
$this->totals()->where('code', 'tax')->each(function ($tax) use(&$amount) {
|
||||
$amount -= $tax->amount;
|
||||
});
|
||||
|
||||
return $amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the paid amount.
|
||||
*
|
||||
|
@ -24,7 +24,7 @@ class Invoice extends Model
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $appends = ['attachment', 'discount', 'paid'];
|
||||
protected $appends = ['attachment', 'amount_without_tax', 'discount', 'paid'];
|
||||
|
||||
protected $dates = ['deleted_at', 'invoiced_at', 'due_at'];
|
||||
|
||||
@ -205,6 +205,22 @@ class Invoice extends Model
|
||||
return $percent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the amount without tax.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAmountWithoutTaxAttribute()
|
||||
{
|
||||
$amount = $this->amount;
|
||||
|
||||
$this->totals()->where('code', 'tax')->each(function ($tax) use(&$amount) {
|
||||
$amount -= $tax->amount;
|
||||
});
|
||||
|
||||
return $amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the paid amount.
|
||||
*
|
||||
|
54
app/Overrides/Akaunting/SignedUrl.php
Normal file
54
app/Overrides/Akaunting/SignedUrl.php
Normal file
@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace Akaunting\SignedUrl;
|
||||
|
||||
use Spatie\UrlSigner\MD5UrlSigner;
|
||||
|
||||
class SignedUrl extends MD5UrlSigner
|
||||
{
|
||||
|
||||
/**
|
||||
* The key that is used to generate secure signatures.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signatureKey;
|
||||
|
||||
/**
|
||||
* The URL's query parameter name for the expiration.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $expiresParameter;
|
||||
|
||||
/**
|
||||
* The URL's query parameter name for the signature.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signatureParameter;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->signatureKey = config('signed-url.signatureKey');
|
||||
$this->expiresParameter = config('signed-url.parameters.expires');
|
||||
$this->signatureParameter = config('signed-url.parameters.signature');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a secure URL to a controller action.
|
||||
*
|
||||
* @param string $url
|
||||
* @param \DateTime|int|null $expiration Defaults to the config value
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function sign($url, $expiration = null)
|
||||
{
|
||||
$url .= '?company_id=' . session('company_id');
|
||||
|
||||
$expiration = $expiration ? $expiration : config('signed-url.default_expiration_time_in_days');
|
||||
|
||||
return parent::sign($url, $expiration);
|
||||
}
|
||||
}
|
@ -60,18 +60,24 @@ trait Currencies
|
||||
return $money;
|
||||
}
|
||||
|
||||
public function getConvertedAmount($format = false)
|
||||
public function getConvertedAmount($format = false, $with_tax = true)
|
||||
{
|
||||
return $this->convert($this->amount, $this->currency_code, $this->currency_rate, $format);
|
||||
$amount = $with_tax ? $this->amount : (isset($this->amount_without_tax) ? $this->amount_without_tax : $this->amount);
|
||||
|
||||
return $this->convert($amount, $this->currency_code, $this->currency_rate, $format);
|
||||
}
|
||||
|
||||
public function getReverseConvertedAmount($format = false)
|
||||
public function getReverseConvertedAmount($format = false, $with_tax = true)
|
||||
{
|
||||
return $this->reverseConvert($this->amount, $this->currency_code, $this->currency_rate, $format);
|
||||
$amount = $with_tax ? $this->amount : (isset($this->amount_without_tax) ? $this->amount_without_tax : $this->amount);
|
||||
|
||||
return $this->reverseConvert($amount, $this->currency_code, $this->currency_rate, $format);
|
||||
}
|
||||
|
||||
public function getDynamicConvertedAmount($format = false)
|
||||
public function getDynamicConvertedAmount($format = false, $with_tax = true)
|
||||
{
|
||||
return $this->dynamicConvert($this->default_currency_code, $this->amount, $this->currency_code, $this->currency_rate, $format);
|
||||
$amount = $with_tax ? $this->amount : (isset($this->amount_without_tax) ? $this->amount_without_tax : $this->amount);
|
||||
|
||||
return $this->dynamicConvert($this->default_currency_code, $amount, $this->currency_code, $this->currency_rate, $format);
|
||||
}
|
||||
}
|
@ -3,15 +3,15 @@
|
||||
namespace App\Traits;
|
||||
|
||||
use App\Utilities\Info;
|
||||
use App\Models\Module\Module as Model;
|
||||
use Artisan;
|
||||
use Cache;
|
||||
use Date;
|
||||
use File;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Exception\RequestException;
|
||||
use Module;
|
||||
use App\Models\Module\Module as MModule;
|
||||
use ZipArchive;
|
||||
use Cache;
|
||||
use Date;
|
||||
|
||||
trait Modules
|
||||
{
|
||||
@ -148,7 +148,7 @@ trait Modules
|
||||
|
||||
$installed = [];
|
||||
$modules = Module::all();
|
||||
$installed_modules = MModule::where('company_id', '=', session('company_id'))->pluck('status', 'alias')->toArray();
|
||||
$installed_modules = Model::where('company_id', '=', session('company_id'))->pluck('status', 'alias')->toArray();
|
||||
|
||||
foreach ($modules as $module) {
|
||||
if (!array_key_exists($module->alias, $installed_modules)) {
|
||||
@ -528,6 +528,7 @@ trait Modules
|
||||
'Accept' => 'application/json',
|
||||
'Referer' => env('APP_URL'),
|
||||
'Akaunting' => version('short'),
|
||||
'Language' => language()->getShortCode()
|
||||
];
|
||||
|
||||
$data['http_errors'] = false;
|
||||
|
@ -18,7 +18,8 @@ trait SiteApi
|
||||
'Authorization' => 'Bearer ' . setting('general.api_token'),
|
||||
'Accept' => 'application/json',
|
||||
'Referer' => env('APP_URL'),
|
||||
'Akaunting' => version('short')
|
||||
'Akaunting' => version('short'),
|
||||
'Language' => language()->getShortCode()
|
||||
);
|
||||
|
||||
$data['http_errors'] = false;
|
||||
|
@ -10,6 +10,7 @@ use Date;
|
||||
use File;
|
||||
use Module;
|
||||
use ZipArchive;
|
||||
use Artisan;
|
||||
use GuzzleHttp\Exception\RequestException;
|
||||
|
||||
class Updater
|
||||
@ -18,10 +19,7 @@ class Updater
|
||||
|
||||
public static function clear()
|
||||
{
|
||||
Cache::forget('modules');
|
||||
Cache::forget('updates');
|
||||
Cache::forget('versions');
|
||||
Cache::forget('suggestions');
|
||||
Artisan::call('cache:clear');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -81,6 +81,13 @@
|
||||
"php artisan clear-compiled",
|
||||
"php artisan optimize",
|
||||
"composer dump-autoload"
|
||||
],
|
||||
"test": [
|
||||
"composer install --no-scripts",
|
||||
"Illuminate\\Foundation\\ComposerScripts::postInstall",
|
||||
"php artisan clear-compiled",
|
||||
"php artisan optimize",
|
||||
"composer dump-autoload"
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
|
@ -21,7 +21,17 @@ return [
|
||||
| to url('/')
|
||||
|
|
||||
*/
|
||||
'home' => true,
|
||||
'home' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Add Language Code
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option will add the language code to the redirected url
|
||||
|
|
||||
*/
|
||||
'url' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@ -177,6 +187,6 @@ return [
|
||||
['short' => 'tr', 'long' => 'tr-TR', 'english' => 'Turkish', 'native' => 'Türkçe'],
|
||||
['short' => 'tw', 'long' => 'zh-TW', 'english' => 'Chinese (T)', 'native' => '繁體中文'],
|
||||
['short' => 'uk', 'long' => 'uk-UA', 'english' => 'Ukrainian', 'native' => 'Українська'],
|
||||
['short' => 'vn', 'long' => 'vi-VN', 'english' => 'Vietnamese', 'native' => 'Tiếng Việt'],
|
||||
['short' => 'vi', 'long' => 'vi-VN', 'english' => 'Vietnamese', 'native' => 'Tiếng Việt'],
|
||||
],
|
||||
];
|
||||
|
@ -18,6 +18,5 @@ class CompanySeeder extends Seeder
|
||||
$this->call(Database\Seeds\InvoiceStatuses::class);
|
||||
$this->call(Database\Seeds\Modules::class);
|
||||
$this->call(Database\Seeds\Settings::class);
|
||||
$this->call(Database\Seeds\Taxes::class);
|
||||
}
|
||||
}
|
||||
|
@ -1,54 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeds;
|
||||
|
||||
use App\Models\Model;
|
||||
use App\Models\Setting\Tax;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class Taxes extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
Model::unguard();
|
||||
|
||||
$this->create();
|
||||
|
||||
Model::reguard();
|
||||
}
|
||||
|
||||
private function create()
|
||||
{
|
||||
$company_id = $this->command->argument('company');
|
||||
|
||||
$rows = [
|
||||
[
|
||||
'company_id' => $company_id,
|
||||
'name' => trans('demo.taxes_exempt'),
|
||||
'rate' => '0',
|
||||
'enabled' => '1'
|
||||
],
|
||||
[
|
||||
'company_id' => $company_id,
|
||||
'name' => trans('demo.taxes_normal'),
|
||||
'rate' => '5',
|
||||
'enabled' => '1'
|
||||
],
|
||||
[
|
||||
'company_id' => $company_id,
|
||||
'name' => trans('demo.taxes_sales'),
|
||||
'rate' => '15',
|
||||
'enabled' => '1'
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($rows as $row) {
|
||||
Tax::create($row);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'name' => 'OfflinePayment',
|
||||
|
||||
];
|
@ -4,7 +4,6 @@ namespace Modules\OfflinePayment\Http\Controllers;
|
||||
|
||||
use App\Events\InvoicePaid;
|
||||
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Routing\Controller;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
@ -16,11 +15,12 @@ use SignedUrl;
|
||||
|
||||
class OfflinePayment extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param Invoice
|
||||
* @param PaymentRequest
|
||||
* @return Response
|
||||
* @return JSON
|
||||
*/
|
||||
public function show(Invoice $invoice, PaymentRequest $request)
|
||||
{
|
||||
@ -46,11 +46,12 @@ class OfflinePayment extends Controller
|
||||
'html' => $html,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
* @param $invoice
|
||||
* @param $request
|
||||
* @return Response
|
||||
* @return JSON
|
||||
*/
|
||||
public function link(Invoice $invoice, PaymentRequest $request)
|
||||
{
|
||||
|
@ -12,6 +12,7 @@ use Modules\OfflinePayment\Http\Requests\SettingDelete as DRequest;
|
||||
|
||||
class Settings extends Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
@ -66,7 +67,7 @@ class Settings extends Controller
|
||||
|
||||
Artisan::call('cache:clear');
|
||||
|
||||
return redirect('apps/offlinepayment/settings');
|
||||
return redirect()->route('offlinepayment.edit');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,18 +1,30 @@
|
||||
<?php
|
||||
|
||||
Route::group(['middleware' => ['web', 'auth', 'language', 'adminmenu', 'permission:read-admin-panel'], 'prefix' => 'apps/offlinepayment', 'namespace' => 'Modules\OfflinePayment\Http\Controllers'], function () {
|
||||
Route::get('settings', 'Settings@edit');
|
||||
Route::post('settings', 'Settings@update');
|
||||
Route::post('settings/get', 'Settings@get');
|
||||
Route::post('settings/delete', 'Settings@delete');
|
||||
Route::group([
|
||||
'middleware' => 'admin',
|
||||
'prefix' => 'apps/offlinepayment',
|
||||
'namespace' => 'Modules\OfflinePayment\Http\Controllers'
|
||||
], function () {
|
||||
Route::get('settings', 'Settings@edit')->name('offlinepayment.edit');
|
||||
Route::post('settings', 'Settings@update')->name('offlinepayment.update');
|
||||
Route::post('settings/get', 'Settings@get')->name('offlinepayment.get');
|
||||
Route::post('settings/delete', 'Settings@delete')->name('offlinepayment.delete');
|
||||
});
|
||||
|
||||
Route::group(['middleware' => ['web', 'auth', 'language', 'customermenu', 'permission:read-customer-panel'], 'prefix' => 'customers', 'namespace' => 'Modules\OfflinePayment\Http\Controllers'], function () {
|
||||
Route::group([
|
||||
'middleware' => ['web', 'auth', 'language', 'customermenu', 'permission:read-customer-panel'],
|
||||
'prefix' => 'customers',
|
||||
'namespace' => 'Modules\OfflinePayment\Http\Controllers'
|
||||
], function () {
|
||||
Route::get('invoices/{invoice}/offlinepayment', 'OfflinePayment@show');
|
||||
Route::post('invoices/{invoice}/offlinepayment/confirm', 'OfflinePayment@confirm');
|
||||
});
|
||||
|
||||
Route::group(['middleware' => ['web', 'language'], 'prefix' => 'links', 'namespace' => 'Modules\OfflinePayment\Http\Controllers'], function () {
|
||||
Route::group([
|
||||
'middleware' => ['web', 'language'],
|
||||
'prefix' => 'links',
|
||||
'namespace' => 'Modules\OfflinePayment\Http\Controllers'
|
||||
], function () {
|
||||
Route::group(['middleware' => 'signed-url'], function () {
|
||||
Route::post('invoices/{invoice}/offlinepayment', 'OfflinePayment@link');
|
||||
Route::post('invoices/{invoice}/offlinepayment/confirm', 'OfflinePayment@confirm');
|
||||
|
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\OfflinePayment\Events\Handlers;
|
||||
namespace Modules\OfflinePayment\Listeners;
|
||||
|
||||
use App\Events\AdminMenuCreated;
|
||||
use Auth;
|
||||
|
||||
class OfflinePaymentAdminMenu
|
||||
class AdminMenu
|
||||
{
|
||||
|
||||
/**
|
||||
* Handle the event.
|
||||
*
|
||||
@ -15,14 +15,14 @@ class OfflinePaymentAdminMenu
|
||||
*/
|
||||
public function handle(AdminMenuCreated $event)
|
||||
{
|
||||
$user = Auth::user();
|
||||
$user = auth()->user();
|
||||
|
||||
// Settings
|
||||
if ($user->can(['read-settings-settings', 'read-settings-categories', 'read-settings-currencies', 'read-settings-taxes'])) {
|
||||
// Add child to existing item
|
||||
$item = $event->menu->whereTitle(trans_choice('general.settings', 2));
|
||||
|
||||
$item->url('apps/offlinepayment/settings', trans('offlinepayment::offlinepayment.offlinepayment'), 4, ['icon' => 'fa fa-angle-double-right']);
|
||||
$item->url('apps/offlinepayment/settings', trans('offlinepayment::general.title'), 4, ['icon' => 'fa fa-angle-double-right']);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\OfflinePayment\Events\Handlers;
|
||||
namespace Modules\OfflinePayment\Listeners;
|
||||
|
||||
use App\Events\PaymentGatewayListing;
|
||||
|
||||
class OfflinePaymentGateway
|
||||
class Gateway
|
||||
{
|
||||
/**
|
||||
* Handle the event.
|
@ -2,14 +2,11 @@
|
||||
|
||||
namespace Modules\OfflinePayment\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Database\Eloquent\Factory;
|
||||
|
||||
use App\Events\AdminMenuCreated;
|
||||
use Modules\OfflinePayment\Events\Handlers\OfflinePaymentAdminMenu;
|
||||
|
||||
use App\Events\PaymentGatewayListing;
|
||||
use Modules\OfflinePayment\Events\Handlers\OfflinePaymentGateway;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Modules\OfflinePayment\Listeners\AdminMenu;
|
||||
use Modules\OfflinePayment\Listeners\Gateway;
|
||||
|
||||
class OfflinePaymentServiceProvider extends ServiceProvider
|
||||
{
|
||||
@ -28,14 +25,9 @@ class OfflinePaymentServiceProvider extends ServiceProvider
|
||||
public function boot()
|
||||
{
|
||||
$this->registerTranslations();
|
||||
$this->registerConfig();
|
||||
$this->registerViews();
|
||||
$this->registerFactories();
|
||||
|
||||
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
|
||||
|
||||
$this->app['events']->listen(AdminMenuCreated::class, OfflinePaymentAdminMenu::class);
|
||||
$this->app['events']->listen(PaymentGatewayListing::class, OfflinePaymentGateway::class);
|
||||
$this->registerMigrations();
|
||||
$this->registerEvents();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -48,21 +40,6 @@ class OfflinePaymentServiceProvider extends ServiceProvider
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Register config.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function registerConfig()
|
||||
{
|
||||
$this->publishes([
|
||||
__DIR__.'/../Config/config.php' => config_path('offlinepayment.php'),
|
||||
], 'config');
|
||||
$this->mergeConfigFrom(
|
||||
__DIR__.'/../Config/config.php', 'offlinepayment'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register views.
|
||||
*
|
||||
@ -99,15 +76,15 @@ class OfflinePaymentServiceProvider extends ServiceProvider
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register an additional directory of factories.
|
||||
* @source https://github.com/sebastiaanluca/laravel-resource-flow/blob/develop/src/Modules/ModuleServiceProvider.php#L66
|
||||
*/
|
||||
public function registerFactories()
|
||||
public function registerMigrations()
|
||||
{
|
||||
if (! app()->environment('production')) {
|
||||
app(Factory::class)->load(__DIR__ . '/Database/factories');
|
||||
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
|
||||
}
|
||||
|
||||
public function registerEvents()
|
||||
{
|
||||
$this->app['events']->listen(AdminMenuCreated::class, AdminMenu::class);
|
||||
$this->app['events']->listen(PaymentGatewayListing::class, Gateway::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
21
modules/OfflinePayment/Resources/lang/en-GB/general.php
Normal file
21
modules/OfflinePayment/Resources/lang/en-GB/general.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'title' => 'Offline Payments',
|
||||
|
||||
'add_new' => 'Add New',
|
||||
'edit' => 'Edit: :method',
|
||||
|
||||
'form' => [
|
||||
'code' => 'Code',
|
||||
'customer' => 'Show to Customer',
|
||||
'order' => 'Order'
|
||||
],
|
||||
|
||||
'payment_gateways' => 'Offline Payment Methods',
|
||||
|
||||
'confirm' => 'Confirm',
|
||||
'loading' => 'Loading',
|
||||
|
||||
];
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'offlinepayment' => 'Offline Payments',
|
||||
'add_new' => 'Add New',
|
||||
'edit' => 'Edit: :method',
|
||||
'code' => 'Code',
|
||||
'customer' => 'Show to Customer',
|
||||
'order' => 'Order',
|
||||
'payment_gateways' => 'Offline Payment Methods',
|
||||
|
||||
'confirm' => 'Confirm',
|
||||
'loading' => 'Loading',
|
||||
|
||||
];
|
@ -1,29 +1,29 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans('offlinepayment::offlinepayment.offlinepayment'))
|
||||
@section('title', trans('offlinepayment::general.title'))
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ trans('offlinepayment::offlinepayment.add_new') }}</h3>
|
||||
<h3 class="box-title">{{ trans('offlinepayment::general.add_new') }}</h3>
|
||||
<!-- /.box-tools -->
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
|
||||
{!! Form::open(['url' => 'apps/offlinepayment/settings', 'files' => true, 'role' => 'form']) !!}
|
||||
{!! Form::open(['route' => 'offlinepayment.update', 'files' => true, 'role' => 'form', 'class' => 'form-loading-button']) !!}
|
||||
|
||||
<div class="box-body">
|
||||
<div id="install-loading"></div>
|
||||
|
||||
{{ Form::textGroup('name', trans('general.name'), 'id-card-o', ['required' => 'required'], null, 'col-md-12') }}
|
||||
|
||||
{{ Form::textGroup('code', trans('offlinepayment::offlinepayment.code'), 'key', ['required' => 'required'], null, 'col-md-12') }}
|
||||
{{ Form::textGroup('code', trans('offlinepayment::general.form.code'), 'key', ['required' => 'required'], null, 'col-md-12') }}
|
||||
|
||||
{{ Form::radioGroup('customer', trans('offlinepayment::offlinepayment.customer'), '', ['required' => 'required'], 0, 'col-md-12') }}
|
||||
{{ Form::radioGroup('customer', trans('offlinepayment::general.form.customer'), '', ['required' => 'required'], 0, 'col-md-12') }}
|
||||
|
||||
{{ Form::textGroup('order', trans('offlinepayment::offlinepayment.order'), 'sort', [], null, 'col-md-12') }}
|
||||
{{ Form::textGroup('order', trans('offlinepayment::general.form.order'), 'sort', [], null, 'col-md-12') }}
|
||||
|
||||
{{ Form::textareaGroup('description', trans('general.description')) }}
|
||||
</div>
|
||||
@ -38,22 +38,25 @@
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<!-- Default box -->
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ trans('offlinepayment::offlinepayment.payment_gateways') }}</h3>
|
||||
<h3 class="box-title">{{ trans('offlinepayment::general.payment_gateways') }}</h3>
|
||||
<!-- /.box-tools -->
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<div id="delete-loading"></div>
|
||||
|
||||
<div class="table table-responsive">
|
||||
<table class="table table-striped table-hover" id="tbl-items">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-md-3">{{ trans('general.name') }}</th>
|
||||
<th class="col-md-4">{{ trans('offlinepayment::offlinepayment.code') }}</th>
|
||||
<th class="col-md-2 text-center">{{ trans('offlinepayment::offlinepayment.order') }}</th>
|
||||
<th class="col-md-4">{{ trans('offlinepayment::general.form.code') }}</th>
|
||||
<th class="col-md-2 text-center">{{ trans('offlinepayment::general.form.order') }}</th>
|
||||
<th class="col-md-3">{{ trans('general.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -86,13 +89,14 @@
|
||||
|
||||
@push('stylesheet')
|
||||
<style type="text/css">
|
||||
.install-loading-bar {
|
||||
#install-loading.active, #delete-loading.active {
|
||||
font-size: 35px;
|
||||
position: absolute;
|
||||
z-index: 500;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgb(136, 136, 136);
|
||||
opacity: 0.2;
|
||||
-moz-border-radius-bottomleft: 1px;
|
||||
@ -106,7 +110,11 @@
|
||||
position: absolute;
|
||||
margin: auto;
|
||||
color: #fff;
|
||||
padding: 28% 40%;
|
||||
padding: 45% 40%;
|
||||
}
|
||||
|
||||
#delete-loading .install-loading-spin {
|
||||
padding: 8% 40%;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
@ -115,22 +123,25 @@
|
||||
<script type="text/javascript">
|
||||
var text_yes = '{{ trans('general.yes') }}';
|
||||
var text_no = '{{ trans('general.no') }}';
|
||||
var code = '';
|
||||
var tr = '';
|
||||
|
||||
$(document).ready(function() {
|
||||
$('.method-edit').on('click', function() {
|
||||
var code = $(this).attr('id').replace('edit-', '');
|
||||
code = $(this).attr('id').replace('edit-', '');
|
||||
|
||||
$.ajax({
|
||||
url: '{{ url("apps/offlinepayment/settings/get") }}',
|
||||
url: '{{ route("offlinepayment.get") }}',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {code: code},
|
||||
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
|
||||
beforeSend: function() {
|
||||
$('#install-loading').addClass('active');
|
||||
$('#install-loading').html('<span class="install-loading-bar"><span class="install-loading-spin"><i class="fa fa-spinner fa-spin"></i></span></span>');
|
||||
$('.install-loading-bar').css({"height": $('.col-md-4.no-padding-left').height() - 23});
|
||||
},
|
||||
complete: function() {
|
||||
$('#install-loading').removeClass('active');
|
||||
$('#install-loading .install-loading-bar').remove();
|
||||
},
|
||||
success: function(json) {
|
||||
@ -160,20 +171,30 @@
|
||||
});
|
||||
|
||||
$('.method-delete').on('click', function() {
|
||||
var code = $(this).attr('id').replace('delete-', '');
|
||||
code = $(this).attr('id').replace('delete-', '');
|
||||
tr = $(this).parent().parent();
|
||||
|
||||
$.ajax({
|
||||
url: '{{ url("apps/offlinepayment/settings/delete") }}',
|
||||
url: '{{ route("offlinepayment.delete") }}',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {code: code},
|
||||
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
|
||||
beforeSend: function() {
|
||||
$('#delete-loading').addClass('active');
|
||||
$('#delete-loading').html('<span class="install-loading-bar"><span class="install-loading-spin"><i class="fa fa-spinner fa-spin"></i></span></span>');
|
||||
},
|
||||
complete: function() {
|
||||
//$('#delete-loading').removeClass('active');
|
||||
//$('#delete-loading .install-loading-bar').remove();
|
||||
},
|
||||
success: function(json) {
|
||||
if (json['error']) {
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#method-' + code).remove();
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -5,9 +5,10 @@
|
||||
{{ $gateway['description'] }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="buttons">
|
||||
<div class="pull-right">
|
||||
<input type="button" value="{{ trans('offlinepayment::offlinepayment.confirm') }}" id="button-confirm" class="btn btn-success" data-loading-text="{{ trans('offlinepayment::offlinepayment.loading') }}" />
|
||||
<input type="button" value="{{ trans('offlinepayment::general.confirm') }}" id="button-confirm" class="btn btn-success" data-loading-text="{{ trans('offlinepayment::general.loading') }}" />
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
|
@ -5,9 +5,10 @@
|
||||
{{ $gateway['description'] }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="buttons">
|
||||
<div class="pull-right">
|
||||
<input type="button" value="{{ trans('offlinepayment::offlinepayment.confirm') }}" id="button-confirm" class="btn btn-success" data-loading-text="{{ trans('offlinepayment::offlinepayment.loading') }}" />
|
||||
<input type="button" value="{{ trans('offlinepayment::general.confirm') }}" id="button-confirm" class="btn btn-success" data-loading-text="{{ trans('offlinepayment::general.loading') }}" />
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
|
@ -3,7 +3,7 @@
|
||||
"alias": "offlinepayment",
|
||||
"description": "",
|
||||
"version": "1.0.0",
|
||||
"category": "payment-gateways",
|
||||
"category": "payment-gateway",
|
||||
"keywords": [],
|
||||
"active": 1,
|
||||
"order": 0,
|
||||
|
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'name' => 'PaypalStandard',
|
||||
|
||||
];
|
@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\PaypalStandard\Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PaypalStandardDatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
Model::unguard();
|
||||
|
||||
// $this->call("OthersTableSeeder");
|
||||
}
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\PaypalStandard\Events\Handlers;
|
||||
namespace Modules\PaypalStandard\Listeners;
|
||||
|
||||
use App\Events\PaymentGatewayListing;
|
||||
|
||||
class PaypalStandardGateway
|
||||
class Gateway
|
||||
{
|
||||
/**
|
||||
* Handle the event.
|
@ -2,11 +2,9 @@
|
||||
|
||||
namespace Modules\PaypalStandard\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Database\Eloquent\Factory;
|
||||
|
||||
use App\Events\PaymentGatewayListing;
|
||||
use Modules\PaypalStandard\Events\Handlers\PaypalStandardGateway;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Modules\PaypalStandard\Listeners\Gateway;
|
||||
|
||||
class PaypalStandardServiceProvider extends ServiceProvider
|
||||
{
|
||||
@ -25,13 +23,8 @@ class PaypalStandardServiceProvider extends ServiceProvider
|
||||
public function boot()
|
||||
{
|
||||
$this->registerTranslations();
|
||||
$this->registerConfig();
|
||||
$this->registerViews();
|
||||
$this->registerFactories();
|
||||
|
||||
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
|
||||
|
||||
$this->app['events']->listen(PaymentGatewayListing::class, PaypalStandardGateway::class);
|
||||
$this->registerEvents();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -44,22 +37,6 @@ class PaypalStandardServiceProvider extends ServiceProvider
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Register config.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function registerConfig()
|
||||
{
|
||||
$this->publishes([
|
||||
__DIR__.'/../Config/config.php' => config_path('paypalstandard.php'),
|
||||
], 'config');
|
||||
|
||||
$this->mergeConfigFrom(
|
||||
__DIR__.'/../Config/config.php', 'paypalstandard'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register views.
|
||||
*
|
||||
@ -96,15 +73,9 @@ class PaypalStandardServiceProvider extends ServiceProvider
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register an additional directory of factories.
|
||||
* @source https://github.com/sebastiaanluca/laravel-resource-flow/blob/develop/src/Modules/ModuleServiceProvider.php#L66
|
||||
*/
|
||||
public function registerFactories()
|
||||
public function registerEvents()
|
||||
{
|
||||
if (! app()->environment('production')) {
|
||||
app(Factory::class)->load(__DIR__ . '/Database/factories');
|
||||
}
|
||||
$this->app['events']->listen(PaymentGatewayListing::class, Gateway::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
21
modules/PaypalStandard/Resources/lang/en-GB/general.php
Normal file
21
modules/PaypalStandard/Resources/lang/en-GB/general.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'title' => 'Paypal Standard',
|
||||
'paypalstandard' => 'Paypal Standard',
|
||||
|
||||
'form' => [
|
||||
'email' => 'Email',
|
||||
'mode' => 'Mode',
|
||||
'debug' => 'Debug',
|
||||
'transaction' => 'Transaction',
|
||||
'customer' => 'Show to Customer',
|
||||
'order' => 'Order',
|
||||
],
|
||||
|
||||
'test_mode' => 'Warning: The payment gateway is in \'Sandbox Mode\'. Your account will not be charged.',
|
||||
'description' => 'Pay with PAYPAL',
|
||||
'confirm' => 'Confirm',
|
||||
|
||||
];
|
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'paypalstandard' => 'Paypal Standard',
|
||||
'email' => 'Email',
|
||||
'mode' => 'Mode',
|
||||
'debug' => 'Debug',
|
||||
'transaction' => 'Transaction',
|
||||
'customer' => 'Show to Customer',
|
||||
'order' => 'Order',
|
||||
|
||||
'test_mode' => 'Warning: The payment gateway is in \'Sandbox Mode\'. Your account will not be charged.',
|
||||
'description' => 'Pay with PAYPAL',
|
||||
'confirm' => 'Confirm',
|
||||
|
||||
];
|
@ -1,11 +1,11 @@
|
||||
<h2>{{ $gateway['name'] }}</h2>
|
||||
|
||||
@if($gateway['mode'] == 'sandbox')
|
||||
<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> {{ trans('paypalstandard::paypalstandard.test_mode') }}</div>
|
||||
<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> {{ trans('paypalstandard::general.test_mode') }}</div>
|
||||
@endif
|
||||
|
||||
<div class="well well-sm">
|
||||
{{ trans('paypalstandard::paypalstandard.description') }}
|
||||
{{ trans('paypalstandard::general.description') }}
|
||||
</div>
|
||||
|
||||
<form action="{{ $gateway['action'] }}" method="post">
|
||||
@ -42,7 +42,7 @@
|
||||
<input type="hidden" name="bn" value="Akaunting_1.0_WPS" />
|
||||
<div class="buttons">
|
||||
<div class="pull-right">
|
||||
<input type="submit" value="{{ trans('paypalstandard::paypalstandard.confirm') }}" class="btn btn-success" />
|
||||
<input type="submit" value="{{ trans('paypalstandard::general.confirm') }}" class="btn btn-success" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -3,7 +3,7 @@
|
||||
"alias": "paypalstandard",
|
||||
"description": "",
|
||||
"version": "1.0.0",
|
||||
"category": "payment-gateways",
|
||||
"category": "payment-gateway",
|
||||
"keywords": [],
|
||||
"active": 1,
|
||||
"order": 0,
|
||||
@ -28,7 +28,7 @@
|
||||
{
|
||||
"type": "textGroup",
|
||||
"name": "email",
|
||||
"title": "paypalstandard::paypalstandard.email",
|
||||
"title": "paypalstandard::general.form.email",
|
||||
"icon": "envelope-o",
|
||||
"attributes": {
|
||||
"required": "required"
|
||||
@ -37,7 +37,7 @@
|
||||
{
|
||||
"type": "selectGroup",
|
||||
"name": "mode",
|
||||
"title": "paypalstandard::paypalstandard.mode",
|
||||
"title": "paypalstandard::general.form.mode",
|
||||
"icon": "plane",
|
||||
"values": {
|
||||
"live": "Live",
|
||||
@ -49,7 +49,7 @@
|
||||
{
|
||||
"type": "selectGroup",
|
||||
"name": "transaction",
|
||||
"title": "paypalstandard::paypalstandard.transaction",
|
||||
"title": "paypalstandard::general.form.transaction",
|
||||
"icon": "exchange",
|
||||
"values": {
|
||||
"authorization": "Authorization",
|
||||
@ -61,7 +61,7 @@
|
||||
{
|
||||
"type": "radioGroup",
|
||||
"name": "customer",
|
||||
"title": "paypalstandard::paypalstandard.customer",
|
||||
"title": "paypalstandard::general.form.customer",
|
||||
"enable": "general.yes",
|
||||
"disable": "general.no",
|
||||
"attributes": {}
|
||||
@ -69,7 +69,7 @@
|
||||
{
|
||||
"type": "radioGroup",
|
||||
"name": "debug",
|
||||
"title": "paypalstandard::paypalstandard.debug",
|
||||
"title": "paypalstandard::general.form.debug",
|
||||
"enable": "general.yes",
|
||||
"disable": "general.no",
|
||||
"attributes": {}
|
||||
@ -77,7 +77,7 @@
|
||||
{
|
||||
"type": "textGroup",
|
||||
"name": "order",
|
||||
"title": "paypalstandard::paypalstandard.order",
|
||||
"title": "paypalstandard::general.form.order",
|
||||
"icon": "sort",
|
||||
"attributes": {}
|
||||
}
|
||||
|
18
public/css/app.css
vendored
18
public/css/app.css
vendored
@ -917,3 +917,21 @@ input[type="number"] {
|
||||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
/* App Detail Page Sliders Finish */
|
||||
|
||||
.select2-results__option {
|
||||
color: lightslategray;
|
||||
}
|
||||
|
||||
.select2-results__option:hover {
|
||||
color: white;
|
||||
background: #6da252;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.box-body .app-price-suffix {
|
||||
font-size: 50%;
|
||||
}
|
||||
|
||||
.box-footer .app-price-suffix {
|
||||
font-size: 70%;
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ return [
|
||||
'warning' => [
|
||||
'deleted' => 'Warnung: Sie dürfen <b>:name</b> nicht löschen, da :text dazu in Bezug steht.',
|
||||
'disabled' => 'Warnung: Sie dürfen <b>:name</b> nicht deaktivieren, da :text dazu in Bezug steht.',
|
||||
'disable_code' => 'Warning: You are not allowed to disable or change the currency of <b>:name</b> because it has :text related.',
|
||||
'disable_code' => 'Warnung: Sie dürfen die Währung von <b>:name</b> nicht deaktivieren oder verändern, da :text dazu in Bezug steht.',
|
||||
],
|
||||
|
||||
];
|
||||
|
@ -23,6 +23,9 @@ return [
|
||||
'added' => 'Hinzugefügt',
|
||||
'updated' => 'Aktualisiert',
|
||||
'compatibility' => 'Kompatibilität',
|
||||
'documentation' => 'Dokumentation',
|
||||
'view' => 'Ansicht',
|
||||
'back' => 'Zurück',
|
||||
|
||||
'installed' => ':module installiert',
|
||||
'uninstalled' => ':module deinstalliert',
|
||||
|
@ -10,7 +10,7 @@ return [
|
||||
'start_date' => 'Startdatum',
|
||||
'end_date' => 'Enddatum',
|
||||
'cleared_amount' => 'Ausgeglichener Betrag',
|
||||
'deposit' => 'Deposit',
|
||||
'withdrawal' => 'Withdrawal',
|
||||
'deposit' => 'Einzahlung',
|
||||
'withdrawal' => 'Auszahlung',
|
||||
|
||||
];
|
||||
|
@ -31,6 +31,9 @@ return [
|
||||
'mark_received' => 'Mark Received',
|
||||
'download_pdf' => 'Download PDF',
|
||||
'send_mail' => 'Send Email',
|
||||
'create_bill' => 'Create Bill',
|
||||
'receive_bill' => 'Receive Bill',
|
||||
'make_payment' => 'Make Payment',
|
||||
|
||||
'status' => [
|
||||
'draft' => 'Draft',
|
||||
|
@ -9,8 +9,5 @@ return [
|
||||
'currencies_eur' => 'Euro',
|
||||
'currencies_gbp' => 'British Pound',
|
||||
'currencies_try' => 'Turkish Lira',
|
||||
'taxes_exempt' => 'Tax Exempt',
|
||||
'taxes_normal' => 'Normal Tax',
|
||||
'taxes_sales' => 'Sales Tax',
|
||||
|
||||
];
|
||||
|
@ -40,6 +40,7 @@ return [
|
||||
'others' => 'Other|Others',
|
||||
'contacts' => 'Contact|Contacts',
|
||||
'reconciliations' => 'Reconciliation|Reconciliations',
|
||||
'developers' => 'Developer|Developers',
|
||||
|
||||
'dashboard' => 'Dashboard',
|
||||
'banking' => 'Banking',
|
||||
|
@ -32,6 +32,9 @@ return [
|
||||
'download_pdf' => 'Download PDF',
|
||||
'send_mail' => 'Send Email',
|
||||
'all_invoices' => 'Login to view all invoices',
|
||||
'create_invoice' => 'Create Invoice',
|
||||
'send_invoice' => 'Send Invoice',
|
||||
'get_paid' => 'Get Paid',
|
||||
|
||||
'status' => [
|
||||
'draft' => 'Draft',
|
||||
|
@ -23,7 +23,7 @@ return [
|
||||
|
||||
'error' => [
|
||||
'self_delete' => 'خطا: نمیتوانید خودتان حذف کنید!',
|
||||
'no_company' => 'خطا: هیچ کمپانی به حساب شما متصل نمیباشد. لطفا با مدیر سیستم تماس بگیرید.',
|
||||
'no_company' => 'خطا: هیچ کمپانی به حساب شما متصل نیست. لطفا با مدیر سیستم تماس بگیرید.',
|
||||
],
|
||||
|
||||
'failed' => 'مشخصات وارد شده با اطلاعات ما سازگار نیست.',
|
||||
@ -31,7 +31,7 @@ return [
|
||||
'throttle' => 'دفعات تلاش شما برای ورود بیش از حد مجاز است. لطفا پس از :seconds ثانیه مجددا تلاش فرمایید.',
|
||||
|
||||
'notification' => [
|
||||
'message_1' => 'شما این ایمیل را دریافت نموده اید چون ما درخواست بازیابی رمزعبور حساب شما را دریافت کرده ای.',
|
||||
'message_1' => 'شما این ایمیل را دریافت نموده اید چون ما درخواست بازیابی رمزعبور حساب شما را دریافت کرده ایم.',
|
||||
'message_2' => 'اگر شما درخواست بازیابی رمزعبور حسابتان را ثبت نکرده اید، این پیام را نادیده بگیرید.',
|
||||
'button' => 'بازیابی رمزعبور',
|
||||
],
|
||||
|
@ -40,8 +40,6 @@ return [
|
||||
'others' => 'سایر | سایرین',
|
||||
'contacts' => 'Contact|Contacts',
|
||||
'reconciliations' => 'Reconciliation|Reconciliations',
|
||||
'deposits' => 'Deposit|Deposits',
|
||||
'withdrawals' => 'Withdrawal|Withdrawals',
|
||||
|
||||
'dashboard' => 'پیشخوان',
|
||||
'banking' => 'بانکداری',
|
||||
@ -85,7 +83,7 @@ return [
|
||||
'color' => 'رنگ',
|
||||
'save' => 'ذخیره کردن',
|
||||
'cancel' => 'انصراف',
|
||||
'loading' => 'Loading...',
|
||||
'loading' => 'درحال بارگذاری...',
|
||||
'from' => 'از',
|
||||
'to' => 'به',
|
||||
'print' => 'چاپ کن',
|
||||
@ -106,26 +104,26 @@ return [
|
||||
'partially' => 'جزئی',
|
||||
'partially_paid' => 'پرداخت جزئی',
|
||||
'export' => 'گرفتن خروجی',
|
||||
'finish' => 'Finish',
|
||||
'finish' => 'پایان',
|
||||
'wizard' => 'Wizard',
|
||||
'skip' => 'Skip',
|
||||
'skip' => 'صرفنظر',
|
||||
'enable' => 'فعال',
|
||||
'disable' => 'غیر فعال',
|
||||
'select_all' => 'Select All',
|
||||
'unselect_all' => 'Unselect All',
|
||||
'go_to' => 'Go to :name',
|
||||
'created_date' => 'Created Date',
|
||||
'period' => 'Period',
|
||||
'start' => 'Start',
|
||||
'end' => 'End',
|
||||
'clear' => 'Clear',
|
||||
'difference' => 'Difference',
|
||||
'select_all' => 'انتخاب همه',
|
||||
'unselect_all' => 'عدم انتخاب همه',
|
||||
'go_to' => 'برو به: نام',
|
||||
'created_date' => 'تاریخ ایجاد',
|
||||
'period' => 'دوره',
|
||||
'start' => 'شروع',
|
||||
'end' => 'پایان',
|
||||
'clear' => 'پاک کردن',
|
||||
'difference' => 'تفاوت',
|
||||
|
||||
'title' => [
|
||||
'new' => ':type جدید',
|
||||
'edit' => 'ویرایش :type',
|
||||
'create' => 'Create :type',
|
||||
'send' => 'Send :type',
|
||||
'create' => 'ایجاد: نوع',
|
||||
'send' => 'ارسال: نوع',
|
||||
'get' => 'Get :type',
|
||||
],
|
||||
|
||||
@ -139,10 +137,10 @@ return [
|
||||
],
|
||||
|
||||
'date_range' => [
|
||||
'today' => 'Today',
|
||||
'yesterday' => 'Yesterday',
|
||||
'today' => 'امروز',
|
||||
'yesterday' => 'ديروز',
|
||||
'last_days' => 'Last :day Days',
|
||||
'this_month' => 'This Month',
|
||||
'last_month' => 'Last Month',
|
||||
'this_month' => 'این ماه',
|
||||
'last_month' => 'ماه قبل',
|
||||
],
|
||||
];
|
||||
|
@ -19,8 +19,8 @@ return [
|
||||
'item_name' => 'نام آیتم | نام آیتم ها',
|
||||
|
||||
'show_discount' => ':discount% Discount',
|
||||
'add_discount' => 'Add Discount',
|
||||
'discount_desc' => 'of subtotal',
|
||||
'add_discount' => 'افزودن تخفیف',
|
||||
'discount_desc' => 'از جمع کل',
|
||||
|
||||
'payment_due' => 'سررسید پرداخت',
|
||||
'paid' => 'پرداخت شده',
|
||||
@ -51,11 +51,11 @@ return [
|
||||
'status' => [
|
||||
'created' => 'Created on :date',
|
||||
'send' => [
|
||||
'draft' => 'Not sent',
|
||||
'draft' => 'ارسال نشده',
|
||||
'sent' => 'Sent on :date',
|
||||
],
|
||||
'paid' => [
|
||||
'await' => 'Awaiting payment',
|
||||
'await' => 'در انتظار پرداخت',
|
||||
],
|
||||
],
|
||||
],
|
||||
|
@ -11,6 +11,7 @@ return [
|
||||
'enabled' => ':type enabled!',
|
||||
'disabled' => ':type disabled!',
|
||||
],
|
||||
|
||||
'error' => [
|
||||
'over_payment' => 'Error: Payment not added! The amount you entered passes the total: :amount',
|
||||
'not_user_company' => 'خطا: شما اجازه مدیریت این شرکت را ندارید!',
|
||||
@ -21,9 +22,11 @@ return [
|
||||
'import_column' => 'Error: :message Sheet name: :sheet. Line number: :line.',
|
||||
'import_sheet' => 'Error: Sheet name is not valid. Please, check the sample file.',
|
||||
],
|
||||
|
||||
'warning' => [
|
||||
'deleted' => 'هشدار: شما نمی توانید <b>:name</b> را به دلیل :text حذف کنید.',
|
||||
'disabled' => 'هشدار: شما نمی توانید <b>:name</b> را به دلیل :text غیر فعال کنید.',
|
||||
'disable_code' => 'Warning: You are not allowed to disable or change the currency of <b>:name</b> because it has :text related.',
|
||||
],
|
||||
|
||||
];
|
||||
|
@ -4,25 +4,28 @@ return [
|
||||
|
||||
'title' => 'API Token',
|
||||
'api_token' => 'Token',
|
||||
'my_apps' => 'My Apps',
|
||||
'my_apps' => 'برنامههای من',
|
||||
'top_paid' => 'بهترین غیر رایگان',
|
||||
'new' => 'جدید',
|
||||
'top_free' => 'بهترین رایگان',
|
||||
'free' => 'رایگان',
|
||||
'search' => 'Search',
|
||||
'search' => 'جستجو',
|
||||
'install' => 'نصب',
|
||||
'buy_now' => 'خرید',
|
||||
'token_link' => '<a href="https://akaunting.com/tokens" target="_blank">دریافت Token</a>.',
|
||||
'no_apps' => 'در این بخش هیچ نرم افزاری وجود ندارد.',
|
||||
'developer' => 'آیا شما یک توسعه دهنده هستید؟<a href="https://akaunting.com/blog/akaunting-app-store" target="_blank">با مراجعه به سایت فروشگاهی می توانید نرم افزار های خود را بسیازید و بفروشید.</a>',
|
||||
|
||||
'recommended_apps' => 'Recommended Apps',
|
||||
'recommended_apps' => 'برنامههای توصیه شده',
|
||||
|
||||
'about' => 'درباره ما',
|
||||
|
||||
'added' => 'اضافه شد',
|
||||
'updated' => 'به روز رسانی شده',
|
||||
'compatibility' => 'سازگاری',
|
||||
'documentation' => 'مستندات',
|
||||
'view' => 'مشاهده',
|
||||
'back' => 'برگشت',
|
||||
|
||||
'installed' => ':module نصب شد',
|
||||
'uninstalled' => ':module حذف شد',
|
||||
@ -34,7 +37,7 @@ return [
|
||||
'installation' => 'نصب',
|
||||
'faq' => 'سوالات متداول',
|
||||
'changelog' => 'تغییرات',
|
||||
'reviews' => 'Reviews',
|
||||
'reviews' => 'نظرات',
|
||||
],
|
||||
|
||||
'installation' => [
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user