Add the quoted amount and completion time to customer jobs
- Jobs get a budget / quoted amount (cents, VAT 0). Only users who may see quotes see and edit it on the job form and page, and only they see its changes in the history. Others' saves keep the stored amount: the server decides whether the amount is set, not the browser. - Jobs record when they were done: set when a job first reaches a status that locks its hours, kept through the billing statuses, cleared when management opens the lock. The billing export will use it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* The budget or quoted amount of a job (cents, VAT 0), seen only with the
|
||||
* quotes permission, and when the job was done, for billing.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('customer_jobs', function (Blueprint $table) {
|
||||
$table->unsignedInteger('quoted_amount_cents')->nullable()->after('estimated_hours');
|
||||
$table->timestamp('completed_at')->nullable()->after('created_by');
|
||||
|
||||
$table->index('completed_at');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('customer_jobs', function (Blueprint $table) {
|
||||
$table->dropIndex(['completed_at']);
|
||||
$table->dropColumn(['quoted_amount_cents', 'completed_at']);
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user