Fixes for task statuses and tests

This commit is contained in:
David Bomba 2021-01-08 09:25:00 +11:00
parent 2e499adea6
commit b5606c1524
6 changed files with 17 additions and 3 deletions

View File

@ -22,7 +22,8 @@ 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;
} }
} }

View File

@ -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);
} }

View File

@ -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);
} }

View File

@ -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);
} }
} }

View File

@ -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);
} }
} }

View File

@ -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);
} }
/** /**