1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 00:11:35 +02:00

app/Filters/InvoiceFilters.php

This commit is contained in:
David Bomba 2019-04-04 12:38:17 +11:00
parent 4620cd7640
commit 1f630eb119
5 changed files with 12 additions and 5 deletions

View File

@ -38,9 +38,9 @@ class InvoiceController extends BaseController
public function index()
{
// $clients = Client::filter($filters);
$invoices = Invoice::filter($filters);
// return $this->listResponse($clients);
return $this->listResponse($invoices);
}

View File

@ -2,13 +2,17 @@
namespace App\Models;
use App\Models\Filterable;
use App\Utils\Traits\MakesHash;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Invoice extends BaseModel
{
use MakesHash;
use SoftDeletes;
use Filterable;
protected $guarded = [
'id',
];

View File

@ -5,7 +5,7 @@ use Faker\Generator as Faker;
$factory->define(App\Models\Invoice::class, function (Faker $faker) {
return [
'invoice_status_id' => App\Models\Invoice::STATUS_PAID,
'invoice_number' => 'abc-123',
'invoice_number' => $faker->text(20),
'discount' => $faker->numberBetween(1,10),
'is_amount_discount' => $faker->boolean(),
'tax_name1' => 'GST',

View File

@ -380,7 +380,7 @@ class CreateUsersTable extends Migration
$t->timestamps();
$t->softDeletes();
$t->unique(['company_id', 'client_id']);
$t->unique(['company_id', 'invoice_number']);
});
Schema::create('invitations', function ($t) {

View File

@ -91,6 +91,9 @@ class RandomDataSeeder extends Seeder
/** Product Factory */
factory(\App\Models\Product::class,50)->create(['user_id' => $user->id, 'company_id' => $company->id]);
/** Invoice Factory */
factory(\App\Models\Invoice::class,50)->create(['user_id' => $user->id, 'company_id' => $company->id, 'client_id' => $client->id]);
}
}