Fix db:seed config, add quickbooks sdk

This commit is contained in:
Deon George 2018-06-18 21:51:20 +10:00
parent 047693f6cd
commit 7e503eb1bc
No known key found for this signature in database
GPG Key ID: 7670E8DC27415254
5 changed files with 420 additions and 315 deletions

View File

@ -22,6 +22,7 @@
"laravel/socialite": "^3.0", "laravel/socialite": "^3.0",
"laravel/tinker": "^1.0", "laravel/tinker": "^1.0",
"leenooks/laravel": "0.*", "leenooks/laravel": "0.*",
"quickbooks/v3-php-sdk": "^5.0",
"spatie/laravel-demo-mode": "^2.2", "spatie/laravel-demo-mode": "^2.2",
"spatie/laravel-failed-job-monitor": "^3.0", "spatie/laravel-failed-job-monitor": "^3.0",
"spatie/laravel-sitemap": "^5.2", "spatie/laravel-sitemap": "^5.2",

649
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CurrencyChangeThreecode extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('ab_currency', function (Blueprint $table) {
$table->renameColumn('three_digit','iso_code');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('ab_currency', function (Blueprint $table) {
$table->renameColumn('iso_code','three_digit');
});
}
}

View File

@ -1,6 +1,7 @@
<?php <?php
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
use App\Models\{Country,Currency}; use App\Models\{Country,Currency};
class CountryTableSeeder extends Seeder class CountryTableSeeder extends Seeder
@ -10,17 +11,17 @@ class CountryTableSeeder extends Seeder
* *
* @return void * @return void
*/ */
public function run() public function run()
{ {
$o = new Country; $o = new Country;
$o->name = 'Australia'; $o->name = 'Australia';
$o->twocode = 'AU'; $o->two_code = 'AU';
$o->threecode = 'AUS'; $o->three_code = 'AUS';
$o->currency_id = '61'; $o->currency_id = '61';
$o->active = TRUE; $o->active = TRUE;
$oo = Currency::where('threecode','AUD')->firstOrFail(); $oo = Currency::where('iso_code','AUD')->firstOrFail();
$oo->countries()->save($o); $oo->countries()->save($o);
} }
} }

View File

@ -1,22 +1,24 @@
<?php <?php
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
use App\Models\Currency; use App\Models\Currency;
class CurrencyTableSeeder extends Seeder class CurrencyTableSeeder extends Seeder
{ {
/** /**
* Run the database seeds. * Run the database seeds.
* *
* @return void * @return void
*/ */
public function run() public function run()
{ {
$o = new Currency; $o = new Currency;
$o->name = 'Australian Dollars'; $o->name = 'Australian Dollars';
$o->symbol = '$'; $o->symbol = '$';
$o->threecode = 'AUD'; $o->iso_code = 'AUD';
$o->active = TRUE; $o->rounding = 2;
$o->save(); $o->active = TRUE;
$o->save();
} }
} }