Add the billing material with drafts, combined invoices and billed marks
Management builds the monthly billing material (laskuaineisto) as a draft: done jobs are added as invoices of their own, combined when the customer, billing unit and reference allow it, and their billable hours are set per work type. Creating the material checks the jobs again, marks the approved hours and billable expenses billed, forms invoice lines with price and VAT snapshots and moves the jobs to "Lasku luotu". Fixed price jobs bill their quoted amount once. Billed hours keep their approval and billed expenses can no longer change. The Fennoa export and monthly fee lines come later. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Modules\Billing\Domain\Enums;
|
||||
|
||||
/**
|
||||
* How a job is billed: its hours per work type at the hourly rates, or its
|
||||
* quoted fixed price as one line. Expenses are billed separately either way.
|
||||
*/
|
||||
enum BillingMode: string
|
||||
{
|
||||
case Hours = 'hours';
|
||||
case FixedPrice = 'fixed_price';
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Modules\Billing\Domain\Enums;
|
||||
|
||||
/**
|
||||
* A billing material is a draft until it is created, which locks it.
|
||||
*/
|
||||
enum ExportStatus: string
|
||||
{
|
||||
case Draft = 'draft';
|
||||
case Created = 'created';
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Modules\Billing\Domain\Enums;
|
||||
|
||||
/**
|
||||
* What an invoice line bills.
|
||||
*/
|
||||
enum LineKind: string
|
||||
{
|
||||
case Hours = 'hours';
|
||||
case FixedPrice = 'fixed_price';
|
||||
case Expense = 'expense';
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Modules\Billing\Domain\Enums;
|
||||
|
||||
/**
|
||||
* Why two jobs cannot be on the same invoice (spec 12).
|
||||
*/
|
||||
enum MergeRefusal: string
|
||||
{
|
||||
case DifferentCustomer = 'different_customer';
|
||||
case DifferentBillingUnit = 'different_billing_unit';
|
||||
case DifferentReference = 'different_reference';
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Modules\Billing\Domain\Enums;
|
||||
|
||||
/**
|
||||
* Why a job cannot go on a billing material (spec 12).
|
||||
*/
|
||||
enum NotBillableReason: string
|
||||
{
|
||||
/** The job is not done. */
|
||||
case WrongStatus = 'wrong_status';
|
||||
|
||||
/** Not billable, billed monthly, or the internal customer. */
|
||||
case NotBillableBasis = 'not_billable_basis';
|
||||
|
||||
/** A consumer customer without a personal identity code. */
|
||||
case MissingIdentityCode = 'missing_identity_code';
|
||||
|
||||
/** A work type with approved hours has no hourly rate. */
|
||||
case MissingHourlyRate = 'missing_hourly_rate';
|
||||
|
||||
/** A fixed price job without a quoted amount. */
|
||||
case MissingQuotedAmount = 'missing_quoted_amount';
|
||||
|
||||
/** No approved hours, expenses or fixed price left to bill. */
|
||||
case NothingToBill = 'nothing_to_bill';
|
||||
}
|
||||
Reference in New Issue
Block a user