Expense categories

This commit is contained in:
David Bomba 2020-10-13 15:14:13 +11:00
parent 05caec8aef
commit 28f140ee37
7 changed files with 11 additions and 8 deletions

View File

@ -31,7 +31,7 @@ class ExpenseFactory
$expense->tax_rate2 = 0;
$expense->tax_name3 = '';
$expense->tax_rate3 = 0;
$expense->expense_date = null;
$expense->date = null;
$expense->payment_date = null;
return $expense;

View File

@ -32,7 +32,7 @@
* @OA\Property(property="amount", type="number", format="float", example="10.00", description="_________"),
* @OA\Property(property="foreign_amount", type="number", format="float", example="10.00", description="_________"),
* @OA\Property(property="exchange_rate", type="number", format="float", example="0.80", description="_________"),
* @OA\Property(property="expense_date", type="string", example="", description="________"),
* @OA\Property(property="date", type="string", example="", description="________"),
* @OA\Property(property="payment_date", type="string", example="", description="________"),
* @OA\Property(property="should_be_invoiced", type="boolean", example=true, description="_________"),
* @OA\Property(property="is_deleted", type="boolean", example=true, description="_________"),

View File

@ -25,7 +25,7 @@ class Expense extends BaseModel
'client_id',
'vendor_id',
'expense_currency_id',
'expense_date',
'date',
'invoice_currency_id',
'amount',
'foreign_amount',

View File

@ -77,7 +77,7 @@ class ExpenseTransformer extends EntityTransformer
'public_notes' => (string) $expense->public_notes ?: '',
'transaction_reference' => (string) $expense->transaction_reference ?: '',
'transaction_id' => (string) $expense->transaction_id ?: '',
'expense_date' => $expense->expense_date ?: '',
'date' => $expense->date ?: '',
'payment_date' => $expense->payment_date ?: '',
'custom_value1' => $expense->custom_value1 ?: '',
'custom_value2' => $expense->custom_value2 ?: '',

View File

@ -37,7 +37,7 @@ class ExpenseFactory extends Factory
'custom_value3' => $this->faker->text(10),
'custom_value4' => $this->faker->text(10),
'exchange_rate' => $this->faker->randomFloat(2, 0, 1),
'expense_date' => $this->faker->date(),
'date' => $this->faker->date(),
'is_deleted' => false,
'public_notes' => $this->faker->text(50),
'private_notes' => $this->faker->text(50),

View File

@ -20,6 +20,10 @@ class ProjectNumberColumn extends Migration
Schema::table('expenses', function ($t){
$t->renameColumn('expense_date', 'date');
});
Schema::table('expense_categories', function ($t){
$t->boolean('is_deleted')->default(false);
});
}
/**

View File

@ -54,7 +54,7 @@ class ExpenseCategoryApiTest extends TestCase
public function testExpenseCategoryPost()
{
$data = [
'public_notes' => $this->faker->firstName,
'name' => $this->faker->firstName,
];
$response = $this->withHeaders([
@ -68,8 +68,7 @@ class ExpenseCategoryApiTest extends TestCase
public function testExpenseCategoryPut()
{
$data = [
'public_notes' => $this->faker->firstName,
'id_number' => 'Coolio',
'name' => $this->faker->firstName,
];
$response = $this->withHeaders([