mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-09-21 00:41:34 +02:00
Merge pull request #3776 from turbo124/v2
Create a status for Quote -> Completed
This commit is contained in:
commit
f724342571
@ -299,7 +299,7 @@ class CheckData extends Command
|
|||||||
|
|
||||||
$ledger = CompanyLedger::where('client_id', $client->id)->orderBy('id', 'DESC')->first();
|
$ledger = CompanyLedger::where('client_id', $client->id)->orderBy('id', 'DESC')->first();
|
||||||
|
|
||||||
if($ledger && $invoice_balance != $client->balance)
|
if($ledger && number_format($invoice_balance, 4) != number_format($client->balance, 4))
|
||||||
{
|
{
|
||||||
$wrong_balances++;
|
$wrong_balances++;
|
||||||
$this->logMessage($client->present()->name . " - " . $client->id . " - balances do not match {$invoice_balance} - {$client->balance} - {$ledger->balance}");
|
$this->logMessage($client->present()->name . " - " . $client->id . " - balances do not match {$invoice_balance} - {$client->balance} - {$ledger->balance}");
|
||||||
|
@ -25,6 +25,7 @@ use App\Models\PaymentType;
|
|||||||
use App\Models\Product;
|
use App\Models\Product;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Repositories\InvoiceRepository;
|
use App\Repositories\InvoiceRepository;
|
||||||
|
use App\Utils\Traits\GeneratesCounter;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Faker\Factory;
|
use Faker\Factory;
|
||||||
@ -35,7 +36,7 @@ use Illuminate\Support\Str;
|
|||||||
|
|
||||||
class CreateTestData extends Command
|
class CreateTestData extends Command
|
||||||
{
|
{
|
||||||
use MakesHash;
|
use MakesHash, GeneratesCounter;
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
@ -233,7 +234,7 @@ class CreateTestData extends Command
|
|||||||
$this->createClient($company, $user);
|
$this->createClient($company, $user);
|
||||||
}
|
}
|
||||||
|
|
||||||
for($x=0; $x<$this->count; $x++)
|
for($x=0; $x<$this->count*100; $x++)
|
||||||
{
|
{
|
||||||
$client = $company->clients->random();
|
$client = $company->clients->random();
|
||||||
|
|
||||||
@ -324,7 +325,7 @@ class CreateTestData extends Command
|
|||||||
$this->info('Creating '.$this->count. ' clients');
|
$this->info('Creating '.$this->count. ' clients');
|
||||||
|
|
||||||
|
|
||||||
for ($x=0; $x<$this->count; $x++) {
|
for ($x=0; $x<$this->count*1000; $x++) {
|
||||||
$z = $x+1;
|
$z = $x+1;
|
||||||
$this->info("Creating client # ".$z);
|
$this->info("Creating client # ".$z);
|
||||||
|
|
||||||
@ -393,6 +394,10 @@ class CreateTestData extends Command
|
|||||||
'client_id' => $client->id,
|
'client_id' => $client->id,
|
||||||
'company_id' => $company->id
|
'company_id' => $company->id
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$client->id_number = $this->getNextClientNumber($client);
|
||||||
|
$client->save();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function createExpense($client)
|
private function createExpense($client)
|
||||||
|
@ -84,6 +84,7 @@ class Quote extends BaseModel
|
|||||||
const STATUS_DRAFT = 1;
|
const STATUS_DRAFT = 1;
|
||||||
const STATUS_SENT = 2;
|
const STATUS_SENT = 2;
|
||||||
const STATUS_APPROVED = 3;
|
const STATUS_APPROVED = 3;
|
||||||
|
const STATUS_CONVERTED = 4;
|
||||||
const STATUS_EXPIRED = -1;
|
const STATUS_EXPIRED = -1;
|
||||||
|
|
||||||
public function getEntityType()
|
public function getEntityType()
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
namespace App\Services\Quote;
|
namespace App\Services\Quote;
|
||||||
|
|
||||||
use App\Factory\CloneQuoteToInvoiceFactory;
|
use App\Factory\CloneQuoteToInvoiceFactory;
|
||||||
use App\Quote;
|
use App\Models\Quote;
|
||||||
use App\Repositories\InvoiceRepository;
|
use App\Repositories\InvoiceRepository;
|
||||||
|
|
||||||
class ConvertQuote
|
class ConvertQuote
|
||||||
@ -33,6 +33,7 @@ class ConvertQuote
|
|||||||
->save();
|
->save();
|
||||||
|
|
||||||
$quote->invoice_id = $invoice->id;
|
$quote->invoice_id = $invoice->id;
|
||||||
|
$quote->status_id = Quote::STATUS_CONVERTED;
|
||||||
$quote->save();
|
$quote->save();
|
||||||
|
|
||||||
// maybe should return invoice here
|
// maybe should return invoice here
|
||||||
|
Loading…
Reference in New Issue
Block a user