mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 22:14:33 -04:00
Merge pull request #4649 from turbo124/v5-develop
Fixes for invoice creation from recurring where balance doubles
This commit is contained in:
commit
f618019f52
@ -22,6 +22,7 @@ class ExpenseCategoryFactory
|
|||||||
$expense->company_id = $company_id;
|
$expense->company_id = $company_id;
|
||||||
$expense->name = '';
|
$expense->name = '';
|
||||||
$expense->is_deleted = false;
|
$expense->is_deleted = false;
|
||||||
|
$expense->color = '#fff';
|
||||||
|
|
||||||
return $expense;
|
return $expense;
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ class RecurringInvoiceToInvoiceFactory
|
|||||||
$invoice->custom_value3 = $recurring_invoice->custom_value3;
|
$invoice->custom_value3 = $recurring_invoice->custom_value3;
|
||||||
$invoice->custom_value4 = $recurring_invoice->custom_value4;
|
$invoice->custom_value4 = $recurring_invoice->custom_value4;
|
||||||
$invoice->amount = $recurring_invoice->amount;
|
$invoice->amount = $recurring_invoice->amount;
|
||||||
$invoice->balance = $recurring_invoice->balance;
|
// $invoice->balance = $recurring_invoice->balance;
|
||||||
$invoice->user_id = $recurring_invoice->user_id;
|
$invoice->user_id = $recurring_invoice->user_id;
|
||||||
$invoice->assigned_user_id = $recurring_invoice->assigned_user_id;
|
$invoice->assigned_user_id = $recurring_invoice->assigned_user_id;
|
||||||
$invoice->company_id = $recurring_invoice->company_id;
|
$invoice->company_id = $recurring_invoice->company_id;
|
||||||
|
@ -21,6 +21,7 @@ class TaskStatusFactory
|
|||||||
$task_status->user_id = $user_id;
|
$task_status->user_id = $user_id;
|
||||||
$task_status->company_id = $company_id;
|
$task_status->company_id = $company_id;
|
||||||
$task_status->name = '';
|
$task_status->name = '';
|
||||||
|
$task_status->color = '#fff';
|
||||||
|
|
||||||
return $task_status;
|
return $task_status;
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,9 @@ class InvoiceController extends Controller
|
|||||||
'hashed_ids' => $invoices->pluck('hashed_id'),
|
'hashed_ids' => $invoices->pluck('hashed_id'),
|
||||||
'total' => $total,
|
'total' => $total,
|
||||||
];
|
];
|
||||||
nlog($data);
|
|
||||||
|
// nlog($data);
|
||||||
|
|
||||||
return $this->render('invoices.payment', $data);
|
return $this->render('invoices.payment', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -509,9 +509,6 @@ class InvoiceController extends BaseController
|
|||||||
public function bulk()
|
public function bulk()
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
|
||||||
* WIP!
|
|
||||||
*/
|
|
||||||
$action = request()->input('action');
|
$action = request()->input('action');
|
||||||
|
|
||||||
$ids = request()->input('ids');
|
$ids = request()->input('ids');
|
||||||
|
@ -174,8 +174,11 @@ class TaskStatusController extends BaseController
|
|||||||
*/
|
*/
|
||||||
public function store(StoreTaskStatusRequest $request)
|
public function store(StoreTaskStatusRequest $request)
|
||||||
{
|
{
|
||||||
|
nlog($request->all());
|
||||||
|
|
||||||
$task_status = TaskStatusFactory::create(auth()->user()->company()->id, auth()->user()->id);
|
$task_status = TaskStatusFactory::create(auth()->user()->company()->id, auth()->user()->id);
|
||||||
$task_status->fill($request->all());
|
$task_status->fill($request->all());
|
||||||
|
|
||||||
$task_status->save();
|
$task_status->save();
|
||||||
|
|
||||||
return $this->itemResponse($task_status->fresh());
|
return $this->itemResponse($task_status->fresh());
|
||||||
|
@ -62,6 +62,9 @@ class StoreExpenseRequest extends Request
|
|||||||
$input['currency_id'] = (string)auth()->user()->company()->settings->currency_id;
|
$input['currency_id'] = (string)auth()->user()->company()->settings->currency_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(array_key_exists('color', $input) && is_null($input['color']))
|
||||||
|
$input['color'] = '#fff';
|
||||||
|
|
||||||
$this->replace($input);
|
$this->replace($input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,6 +49,10 @@ class StoreProjectRequest extends Request
|
|||||||
{
|
{
|
||||||
$input = $this->decodePrimaryKeys($this->all());
|
$input = $this->decodePrimaryKeys($this->all());
|
||||||
|
|
||||||
|
|
||||||
|
if(array_key_exists('color', $input) && is_null($input['color']))
|
||||||
|
$input['color'] = '#fff';
|
||||||
|
|
||||||
$this->replace($input);
|
$this->replace($input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,6 +48,9 @@ class UpdateProjectRequest extends Request
|
|||||||
unset($input['client_id']);
|
unset($input['client_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(array_key_exists('color', $input) && is_null($input['color']))
|
||||||
|
$input['color'] = '#fff';
|
||||||
|
|
||||||
$this->replace($input);
|
$this->replace($input);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,6 +50,9 @@ class UpdateTaskRequest extends Request
|
|||||||
$input['status_id'] = $this->decodePrimaryKey($input['status_id']);
|
$input['status_id'] = $this->decodePrimaryKey($input['status_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(array_key_exists('color', $input) && is_null($input['color']))
|
||||||
|
$input['color'] = '#fff';
|
||||||
|
|
||||||
$this->replace($input);
|
$this->replace($input);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,9 @@ class StoreTaskStatusRequest extends Request
|
|||||||
{
|
{
|
||||||
$input = $this->all();
|
$input = $this->all();
|
||||||
|
|
||||||
|
if(array_key_exists('color', $input) && is_null($input['color']))
|
||||||
|
$input['color'] = '#fff';
|
||||||
|
|
||||||
$this->replace($input);
|
$this->replace($input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,4 +38,14 @@ class UpdateTaskStatusRequest extends Request
|
|||||||
|
|
||||||
return $rules;
|
return $rules;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function prepareForValidation()
|
||||||
|
{
|
||||||
|
$input = $this->all();
|
||||||
|
|
||||||
|
if(array_key_exists('color', $input) && is_null($input['color']))
|
||||||
|
$input['color'] = '#fff';
|
||||||
|
|
||||||
|
$this->replace($input);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -168,8 +168,12 @@ class CreateEntityPdf implements ShouldQueue
|
|||||||
return $file_path;
|
return $file_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function failed(\Exception $exception)
|
public function failed($e)
|
||||||
{
|
{
|
||||||
nlog("help!");
|
|
||||||
}
|
}
|
||||||
|
// public function failed(\Exception $exception)
|
||||||
|
// {
|
||||||
|
// nlog("help!");
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
@ -29,5 +29,10 @@ class TaskStatus extends BaseModel
|
|||||||
*/
|
*/
|
||||||
protected $dates = ['deleted_at'];
|
protected $dates = ['deleted_at'];
|
||||||
|
|
||||||
protected $fillable = ['name','color','status_order'];
|
protected $fillable = [
|
||||||
|
'name',
|
||||||
|
'color',
|
||||||
|
'status_order',
|
||||||
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ class InvoiceMigrationRepository extends BaseRepository
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($data['invitations'] as $invitation) {
|
foreach ($data['invitations'] as $invitation) {
|
||||||
nlog($invitation);
|
// nlog($invitation);
|
||||||
|
|
||||||
$new_invitation = $invitation_factory_class::create($model->company_id, $model->user_id);
|
$new_invitation = $invitation_factory_class::create($model->company_id, $model->user_id);
|
||||||
$new_invitation->{$lcfirst_resource_id} = $model->id;
|
$new_invitation->{$lcfirst_resource_id} = $model->id;
|
||||||
|
@ -31,6 +31,7 @@ class TaskStatusFactory extends Factory
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'name' => $this->faker->text(7),
|
'name' => $this->faker->text(7),
|
||||||
|
'color' => '#fff',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -104,8 +104,8 @@ class CompanyGatewayResolutionTest extends TestCase
|
|||||||
{
|
{
|
||||||
$fee = $this->cg->calcGatewayFee(10, GatewayType::CREDIT_CARD, false);
|
$fee = $this->cg->calcGatewayFee(10, GatewayType::CREDIT_CARD, false);
|
||||||
$this->assertEquals(0.2, $fee);
|
$this->assertEquals(0.2, $fee);
|
||||||
$fee = $this->cg->calcGatewayFee(10, GatewayType::CREDIT_CARD, false);
|
// $fee = $this->cg->calcGatewayFee(10, GatewayType::CREDIT_CARD, false);
|
||||||
$this->assertEquals(0.1, $fee);
|
// $this->assertEquals(0.1, $fee);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user