mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01: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,7 +22,8 @@ class ExpenseCategoryFactory
|
||||
$expense->company_id = $company_id;
|
||||
$expense->name = '';
|
||||
$expense->is_deleted = false;
|
||||
|
||||
$expense->color = '#fff';
|
||||
|
||||
return $expense;
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ class RecurringInvoiceToInvoiceFactory
|
||||
$invoice->custom_value3 = $recurring_invoice->custom_value3;
|
||||
$invoice->custom_value4 = $recurring_invoice->custom_value4;
|
||||
$invoice->amount = $recurring_invoice->amount;
|
||||
$invoice->balance = $recurring_invoice->balance;
|
||||
// $invoice->balance = $recurring_invoice->balance;
|
||||
$invoice->user_id = $recurring_invoice->user_id;
|
||||
$invoice->assigned_user_id = $recurring_invoice->assigned_user_id;
|
||||
$invoice->company_id = $recurring_invoice->company_id;
|
||||
|
@ -21,6 +21,7 @@ class TaskStatusFactory
|
||||
$task_status->user_id = $user_id;
|
||||
$task_status->company_id = $company_id;
|
||||
$task_status->name = '';
|
||||
$task_status->color = '#fff';
|
||||
|
||||
return $task_status;
|
||||
}
|
||||
|
@ -119,7 +119,9 @@ class InvoiceController extends Controller
|
||||
'hashed_ids' => $invoices->pluck('hashed_id'),
|
||||
'total' => $total,
|
||||
];
|
||||
nlog($data);
|
||||
|
||||
// nlog($data);
|
||||
|
||||
return $this->render('invoices.payment', $data);
|
||||
}
|
||||
|
||||
|
@ -508,10 +508,7 @@ class InvoiceController extends BaseController
|
||||
*/
|
||||
public function bulk()
|
||||
{
|
||||
|
||||
/*
|
||||
* WIP!
|
||||
*/
|
||||
|
||||
$action = request()->input('action');
|
||||
|
||||
$ids = request()->input('ids');
|
||||
|
@ -174,8 +174,11 @@ class TaskStatusController extends BaseController
|
||||
*/
|
||||
public function store(StoreTaskStatusRequest $request)
|
||||
{
|
||||
nlog($request->all());
|
||||
|
||||
$task_status = TaskStatusFactory::create(auth()->user()->company()->id, auth()->user()->id);
|
||||
$task_status->fill($request->all());
|
||||
|
||||
$task_status->save();
|
||||
|
||||
return $this->itemResponse($task_status->fresh());
|
||||
|
@ -62,6 +62,9 @@ class StoreExpenseRequest extends Request
|
||||
$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);
|
||||
}
|
||||
|
||||
|
@ -49,6 +49,10 @@ class StoreProjectRequest extends Request
|
||||
{
|
||||
$input = $this->decodePrimaryKeys($this->all());
|
||||
|
||||
|
||||
if(array_key_exists('color', $input) && is_null($input['color']))
|
||||
$input['color'] = '#fff';
|
||||
|
||||
$this->replace($input);
|
||||
}
|
||||
|
||||
|
@ -48,6 +48,9 @@ class UpdateProjectRequest extends Request
|
||||
unset($input['client_id']);
|
||||
}
|
||||
|
||||
if(array_key_exists('color', $input) && is_null($input['color']))
|
||||
$input['color'] = '#fff';
|
||||
|
||||
$this->replace($input);
|
||||
}
|
||||
}
|
||||
|
@ -50,6 +50,9 @@ class UpdateTaskRequest extends Request
|
||||
$input['status_id'] = $this->decodePrimaryKey($input['status_id']);
|
||||
}
|
||||
|
||||
if(array_key_exists('color', $input) && is_null($input['color']))
|
||||
$input['color'] = '#fff';
|
||||
|
||||
$this->replace($input);
|
||||
}
|
||||
}
|
||||
|
@ -32,6 +32,9 @@ class StoreTaskStatusRequest extends Request
|
||||
{
|
||||
$input = $this->all();
|
||||
|
||||
if(array_key_exists('color', $input) && is_null($input['color']))
|
||||
$input['color'] = '#fff';
|
||||
|
||||
$this->replace($input);
|
||||
}
|
||||
|
||||
|
@ -38,4 +38,14 @@ class UpdateTaskStatusRequest extends Request
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public function failed(\Exception $exception)
|
||||
public function failed($e)
|
||||
{
|
||||
nlog("help!");
|
||||
|
||||
}
|
||||
// public function failed(\Exception $exception)
|
||||
// {
|
||||
// nlog("help!");
|
||||
// }
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ class SendRecurring implements ShouldQueue
|
||||
$invoice = RecurringInvoiceToInvoiceFactory::create($this->recurring_invoice, $this->recurring_invoice->client);
|
||||
|
||||
$invoice->date = now()->format('Y-m-d');
|
||||
|
||||
|
||||
$invoice = $invoice->service()
|
||||
->markSent()
|
||||
->applyNumber()
|
||||
|
@ -29,5 +29,10 @@ class TaskStatus extends BaseModel
|
||||
*/
|
||||
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) {
|
||||
nlog($invitation);
|
||||
// nlog($invitation);
|
||||
|
||||
$new_invitation = $invitation_factory_class::create($model->company_id, $model->user_id);
|
||||
$new_invitation->{$lcfirst_resource_id} = $model->id;
|
||||
|
@ -31,6 +31,7 @@ class TaskStatusFactory extends Factory
|
||||
{
|
||||
return [
|
||||
'name' => $this->faker->text(7),
|
||||
'color' => '#fff',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -104,8 +104,8 @@ class CompanyGatewayResolutionTest extends TestCase
|
||||
{
|
||||
$fee = $this->cg->calcGatewayFee(10, GatewayType::CREDIT_CARD, false);
|
||||
$this->assertEquals(0.2, $fee);
|
||||
$fee = $this->cg->calcGatewayFee(10, GatewayType::CREDIT_CARD, false);
|
||||
$this->assertEquals(0.1, $fee);
|
||||
// $fee = $this->cg->calcGatewayFee(10, GatewayType::CREDIT_CARD, false);
|
||||
// $this->assertEquals(0.1, $fee);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user