Merge pull request #198 from mchev/invoice_cancellation

Support for Zero and Negative Item Quantities on Invoices
This commit is contained in:
mchev
2024-11-02 11:24:09 +01:00
committed by Darko Gjorgjijoski
parent e1a0a2d8e4
commit 967c225df9
7 changed files with 148 additions and 23 deletions

View File

@@ -231,13 +231,20 @@ test('estimate mark as rejected', function () {
});
test('create invoice from estimate', function () {
$estimate = Estimate::factory()->create([
'estimate_date' => '1988-07-18',
'expiry_date' => '1988-08-18',
]);
$response = postJson("api/v1/estimates/{$estimate->id}/convert-to-invoice")
->assertStatus(200);
$estimate = Estimate::factory()
->create([
'estimate_date' => now(),
'expiry_date' => now()->addMonth(),
]);
$response = postJson("api/v1/estimates/{$estimate->id}/convert-to-invoice");
if ($response->status() !== 200) {
$this->fail('Response status is not 200. Response body: '.json_encode($response->json()));
}
$response->assertStatus(200);
});
test('delete multiple estimates using a form request', function () {