mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #4849 from turbo124/master
Minor fixes for migration
This commit is contained in:
commit
aca292b737
@ -73,6 +73,8 @@ trait GenerateMigrationResources
|
|||||||
info("get company");
|
info("get company");
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
'first_day_of_week' => $this->account->start_of_week,
|
||||||
|
'first_month_of_year' => $this->account->financial_year_start,
|
||||||
'version' => NINJA_VERSION,
|
'version' => NINJA_VERSION,
|
||||||
'referral_code' => $this->account->referral_code ?: '',
|
'referral_code' => $this->account->referral_code ?: '',
|
||||||
'account_id' => $this->account->id,
|
'account_id' => $this->account->id,
|
||||||
@ -747,6 +749,34 @@ info("get company");
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function transformQuoteStatusId($quote)
|
||||||
|
{
|
||||||
|
if(!$quote->is_public)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
if($quote->quote_invoice_id)
|
||||||
|
return 4;
|
||||||
|
|
||||||
|
switch ($quote->invoice_status_id) {
|
||||||
|
case 1:
|
||||||
|
return 1;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
return 2;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
return 2;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
return 3;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return 2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
define('INVOICE_STATUS_DRAFT', 1);
|
define('INVOICE_STATUS_DRAFT', 1);
|
||||||
define('INVOICE_STATUS_SENT', 2);
|
define('INVOICE_STATUS_SENT', 2);
|
||||||
@ -916,7 +946,7 @@ info("get company");
|
|||||||
'client_id' => $quote->client_id,
|
'client_id' => $quote->client_id,
|
||||||
'user_id' => $quote->user_id,
|
'user_id' => $quote->user_id,
|
||||||
'company_id' => $quote->account_id,
|
'company_id' => $quote->account_id,
|
||||||
'status_id' => $quote->invoice_status_id,
|
'status_id' => $this->transformQuoteStatusId($quote),
|
||||||
'design_id' => $this->getDesignId($quote->invoice_design_id),
|
'design_id' => $this->getDesignId($quote->invoice_design_id),
|
||||||
'number' => $quote->invoice_number,
|
'number' => $quote->invoice_number,
|
||||||
'discount' => $quote->discount,
|
'discount' => $quote->discount,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user