Add amount column to history table

This commit is contained in:
David Bomba 2020-08-19 12:44:25 +10:00
parent c5d093232c
commit 7b2e60a0d5
5 changed files with 8 additions and 5 deletions

View File

@ -147,6 +147,8 @@ class MigrationController extends BaseController
{
$company->clients()->delete();
$company->products()->delete();
$company->save();
return response()->json(['message' => 'Settings preserved'], 200);

View File

@ -69,6 +69,7 @@ class ActivityRepository extends BaseRepository
if (get_class($entity) == Invoice::class || get_class($entity) == Quote::class || get_class($entity) == Credit::class){
$contact = $entity->client->primary_contact()->first();
$backup->html_backup = $this->generateEntityHtml($entity->getEntityDesigner(), $entity, $contact);
$backup->amount = $entity->amount;
}
$backup->activity_id = $activity->id;

View File

@ -27,7 +27,6 @@ class CreditTransformer extends EntityTransformer
protected $defaultIncludes = [
'invitations',
'documents',
'history',
];
protected $availableIncludes = [

View File

@ -27,7 +27,6 @@ class QuoteTransformer extends EntityTransformer
protected $defaultIncludes = [
'invitations',
'documents',
'history'
];
protected $availableIncludes = [

View File

@ -16,6 +16,10 @@ class AddIsPublicToDocumentsTable extends Migration
Schema::table('documents', function (Blueprint $table) {
$table->boolean('is_public')->default(false);
});
Schema::table('backups', function (Blueprint $table) {
$table->decimal('amount', 16, 4);
});
}
/**
@ -25,8 +29,6 @@ class AddIsPublicToDocumentsTable extends Migration
*/
public function down()
{
Schema::table('documents', function (Blueprint $table) {
$table->dropColumn('is_public');
});
}
}