mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
Merge branch 'build-201' into 'master'
Build 201 See merge request mohit.panjvani/crater-web!120
This commit is contained in:
@ -24,6 +24,7 @@ class EstimateItem extends Model
|
|||||||
'price' => 'integer',
|
'price' => 'integer',
|
||||||
'total' => 'integer',
|
'total' => 'integer',
|
||||||
'discount' => 'float',
|
'discount' => 'float',
|
||||||
|
'quantity' => 'float',
|
||||||
'discount_val' => 'integer',
|
'discount_val' => 'integer',
|
||||||
'tax' => 'integer'
|
'tax' => 'integer'
|
||||||
];
|
];
|
||||||
|
|||||||
@ -82,7 +82,7 @@ class Invoice extends Model
|
|||||||
// So the substr returns this 000001
|
// So the substr returns this 000001
|
||||||
|
|
||||||
// Add the string in front and higher up the number.
|
// Add the string in front and higher up the number.
|
||||||
// the %05d part makes sure that there are always 6 numbers in the string.
|
// the %06d part makes sure that there are always 6 numbers in the string.
|
||||||
// so it adds the missing zero's when needed.
|
// so it adds the missing zero's when needed.
|
||||||
|
|
||||||
return sprintf('%06d', intval($number) + 1);
|
return sprintf('%06d', intval($number) + 1);
|
||||||
|
|||||||
@ -30,6 +30,7 @@ class InvoiceItem extends Model
|
|||||||
'price' => 'integer',
|
'price' => 'integer',
|
||||||
'total' => 'integer',
|
'total' => 'integer',
|
||||||
'discount' => 'float',
|
'discount' => 'float',
|
||||||
|
'quantity' => 'float',
|
||||||
'discount_val' => 'integer',
|
'discount_val' => 'integer',
|
||||||
'tax' => 'integer'
|
'tax' => 'integer'
|
||||||
];
|
];
|
||||||
|
|||||||
@ -4,6 +4,7 @@ namespace Crater\Listeners\Updates\v2;
|
|||||||
|
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
use Illuminate\Queue\InteractsWithQueue;
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Crater\Events\UpdateFinished;
|
use Crater\Events\UpdateFinished;
|
||||||
use Crater\Listeners\Updates\Listener;
|
use Crater\Listeners\Updates\Listener;
|
||||||
use Crater\Setting;
|
use Crater\Setting;
|
||||||
@ -37,6 +38,9 @@ class Version201 extends Listener
|
|||||||
// Remove the language files
|
// Remove the language files
|
||||||
$this->removeLanguageFiles();
|
$this->removeLanguageFiles();
|
||||||
|
|
||||||
|
// Change estimate & invoice migrations
|
||||||
|
$this->changeMigrations();
|
||||||
|
|
||||||
// Update Crater app version
|
// Update Crater app version
|
||||||
Setting::setSetting('version', static::VERSION);
|
Setting::setSetting('version', static::VERSION);
|
||||||
}
|
}
|
||||||
@ -58,4 +62,26 @@ class Version201 extends Listener
|
|||||||
unlink($fr);
|
unlink($fr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function changeMigrations()
|
||||||
|
{
|
||||||
|
\Schema::table('invoices', function (Blueprint $table) {
|
||||||
|
$table->decimal('discount', 15, 2)->nullable()->change();
|
||||||
|
});
|
||||||
|
|
||||||
|
\Schema::table('estimates', function (Blueprint $table) {
|
||||||
|
$table->decimal('discount', 15, 2)->nullable()->change();
|
||||||
|
});
|
||||||
|
|
||||||
|
\Schema::table('invoice_items', function (Blueprint $table) {
|
||||||
|
$table->decimal('quantity', 15, 2)->change();
|
||||||
|
$table->decimal('discount', 15, 2)->nullable()->change();
|
||||||
|
});
|
||||||
|
|
||||||
|
\Schema::table('estimate_items', function (Blueprint $table) {
|
||||||
|
$table->decimal('quantity', 15, 2)->change();
|
||||||
|
$table->decimal('discount', 15, 2)->nullable()->change();
|
||||||
|
$table->unsignedBigInteger('discount_val')->nullable()->change();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,7 @@ class CreateInvoicesTable extends Migration
|
|||||||
$table->string('discount_per_item');
|
$table->string('discount_per_item');
|
||||||
$table->text('notes')->nullable();
|
$table->text('notes')->nullable();
|
||||||
$table->string('discount_type')->nullable();
|
$table->string('discount_type')->nullable();
|
||||||
$table->unsignedBigInteger('discount')->nullable();
|
$table->decimal('discount', 15, 2)->nullable();
|
||||||
$table->unsignedBigInteger('discount_val')->nullable();
|
$table->unsignedBigInteger('discount_val')->nullable();
|
||||||
$table->unsignedBigInteger('sub_total');
|
$table->unsignedBigInteger('sub_total');
|
||||||
$table->unsignedBigInteger('total');
|
$table->unsignedBigInteger('total');
|
||||||
|
|||||||
@ -18,10 +18,10 @@ class CreateInvoiceItemsTable extends Migration
|
|||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->string('description')->nullable();
|
$table->string('description')->nullable();
|
||||||
$table->string('discount_type');
|
$table->string('discount_type');
|
||||||
$table->unsignedBigInteger('quantity');
|
|
||||||
$table->unsignedBigInteger('price');
|
$table->unsignedBigInteger('price');
|
||||||
|
$table->decimal('quantity', 15, 2);
|
||||||
|
$table->decimal('discount', 15, 2)->nullable();
|
||||||
$table->unsignedBigInteger('discount_val');
|
$table->unsignedBigInteger('discount_val');
|
||||||
$table->unsignedBigInteger('discount');
|
|
||||||
$table->unsignedBigInteger('tax');
|
$table->unsignedBigInteger('tax');
|
||||||
$table->unsignedBigInteger('total');
|
$table->unsignedBigInteger('total');
|
||||||
$table->integer('invoice_id')->unsigned();
|
$table->integer('invoice_id')->unsigned();
|
||||||
|
|||||||
@ -23,8 +23,8 @@ class CreateEstimatesTable extends Migration
|
|||||||
$table->string('tax_per_item');
|
$table->string('tax_per_item');
|
||||||
$table->string('discount_per_item');
|
$table->string('discount_per_item');
|
||||||
$table->string('notes')->nullable();
|
$table->string('notes')->nullable();
|
||||||
|
$table->decimal('discount', 15, 2)->nullable();
|
||||||
$table->string('discount_type')->nullable();
|
$table->string('discount_type')->nullable();
|
||||||
$table->unsignedBigInteger('discount')->nullable();
|
|
||||||
$table->unsignedBigInteger('discount_val')->nullable();
|
$table->unsignedBigInteger('discount_val')->nullable();
|
||||||
$table->unsignedBigInteger('sub_total');
|
$table->unsignedBigInteger('sub_total');
|
||||||
$table->unsignedBigInteger('total');
|
$table->unsignedBigInteger('total');
|
||||||
|
|||||||
@ -18,9 +18,9 @@ class CreateEstimateItemsTable extends Migration
|
|||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->string('description')->nullable();
|
$table->string('description')->nullable();
|
||||||
$table->string('discount_type');
|
$table->string('discount_type');
|
||||||
$table->unsignedBigInteger('quantity');
|
$table->decimal('quantity', 15, 2);
|
||||||
$table->unsignedBigInteger('discount');
|
$table->decimal('discount', 15, 2)->nullable();
|
||||||
$table->unsignedBigInteger('discount_val');
|
$table->unsignedBigInteger('discount_val')->nullable();
|
||||||
$table->unsignedBigInteger('price');
|
$table->unsignedBigInteger('price');
|
||||||
$table->unsignedBigInteger('tax');
|
$table->unsignedBigInteger('tax');
|
||||||
$table->unsignedBigInteger('total');
|
$table->unsignedBigInteger('total');
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"/assets/js/app.js": "/assets/js/app.js?id=334224502420e0ff495c",
|
"/assets/js/app.js": "/assets/js/app.js?id=2a5cfd8271e10bd501dc",
|
||||||
"/assets/css/crater.css": "/assets/css/crater.css?id=108e3a8d009e7d38018c"
|
"/assets/css/crater.css": "/assets/css/crater.css?id=108e3a8d009e7d38018c"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -286,7 +286,7 @@ export default {
|
|||||||
let request = await this.deleteInvoice(this.id)
|
let request = await this.deleteInvoice(this.id)
|
||||||
if (request.data.success) {
|
if (request.data.success) {
|
||||||
window.toastr['success'](this.$tc('invoices.deleted_message', 1))
|
window.toastr['success'](this.$tc('invoices.deleted_message', 1))
|
||||||
this.$router.push('/admin/invoices/')
|
this.$router.push('/admin/invoices')
|
||||||
} else if (request.data.error) {
|
} else if (request.data.error) {
|
||||||
window.toastr['error'](request.data.message)
|
window.toastr['error'](request.data.message)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user