mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixed issue with production database config not being used
This commit is contained in:
parent
65eb8c540c
commit
dd718387ed
@ -59,19 +59,19 @@ class AppController extends BaseController
|
|||||||
return Redirect::to('/setup')->withInput();
|
return Redirect::to('/setup')->withInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
$content = "<?php return 'production';";
|
$content = "<?php return 'development';";
|
||||||
$fp = fopen(base_path()."/bootstrap/environment.php", 'w');
|
$fp = fopen(base_path()."/bootstrap/environment.php", 'w');
|
||||||
fwrite($fp, $content);
|
fwrite($fp, $content);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|
||||||
$configDir = app_path().'/config/production';
|
$configDir = app_path().'/config/development';
|
||||||
if (!file_exists($configDir)) {
|
if (!file_exists($configDir)) {
|
||||||
mkdir($configDir);
|
mkdir($configDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (['app' => $app, 'database' => $database, 'mail' => $mail] as $key => $config) {
|
foreach (['app' => $app, 'database' => $database, 'mail' => $mail] as $key => $config) {
|
||||||
$content = '<?php return '.var_export($config, true).';';
|
$content = '<?php return '.var_export($config, true).';';
|
||||||
$fp = fopen(app_path()."/config/production/{$key}.php", 'w');
|
$fp = fopen(app_path()."/config/development/{$key}.php", 'w');
|
||||||
fwrite($fp, $content);
|
fwrite($fp, $content);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
}
|
}
|
||||||
|
@ -372,7 +372,10 @@ class InvoiceRepository
|
|||||||
$clone->balance = $invoice->amount;
|
$clone->balance = $invoice->amount;
|
||||||
|
|
||||||
// if the invoice prefix is diff than quote prefix, use the same number for the invoice
|
// if the invoice prefix is diff than quote prefix, use the same number for the invoice
|
||||||
if (($account->invoice_number_prefix || $account->quote_number_prefix) && $account->invoice_number_prefix != $account->quote_number_prefix) {
|
if (($account->invoice_number_prefix || $account->quote_number_prefix)
|
||||||
|
&& $account->invoice_number_prefix != $account->quote_number_prefix
|
||||||
|
&& $account->share_counter) {
|
||||||
|
|
||||||
$invoiceNumber = $invoice->invoice_number;
|
$invoiceNumber = $invoice->invoice_number;
|
||||||
if (strpos($invoiceNumber, $account->quote_number_prefix) === 0) {
|
if (strpos($invoiceNumber, $account->quote_number_prefix) === 0) {
|
||||||
$invoiceNumber = substr($invoiceNumber, strlen($account->quote_number_prefix));
|
$invoiceNumber = substr($invoiceNumber, strlen($account->quote_number_prefix));
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return 'production';
|
return 'development';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user