mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 19:51:09 -04:00
fix(items): added unit name after quantity in the pdf templates
This commit is contained in:
@ -22,7 +22,8 @@ class EstimateItem extends Model
|
|||||||
'discount_val',
|
'discount_val',
|
||||||
'tax',
|
'tax',
|
||||||
'total',
|
'total',
|
||||||
'discount'
|
'discount',
|
||||||
|
'unit_name',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
|
|||||||
@ -25,7 +25,8 @@ class InvoiceItem extends Model
|
|||||||
'discount_val',
|
'discount_val',
|
||||||
'total',
|
'total',
|
||||||
'tax',
|
'tax',
|
||||||
'discount'
|
'discount',
|
||||||
|
'unit_name',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
|
|||||||
@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AddUnitNameToPdf extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('invoice_items', function (Blueprint $table) {
|
||||||
|
$table->string('unit_name')->nullable()->after('quantity');
|
||||||
|
});
|
||||||
|
Schema::table('estimate_items', function (Blueprint $table) {
|
||||||
|
$table->string('unit_name')->nullable()->after('quantity');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('invoice_items', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('unit_name');
|
||||||
|
});
|
||||||
|
Schema::table('estimate_items', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('unit_name');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -34,7 +34,7 @@
|
|||||||
class="pr-20 text-right item-cell"
|
class="pr-20 text-right item-cell"
|
||||||
style="vertical-align: top;"
|
style="vertical-align: top;"
|
||||||
>
|
>
|
||||||
{{$item->quantity}}
|
{{$item->quantity}} @if($item->unit_name) {{$item->unit_name}} @endif
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
class="pr-20 text-right item-cell"
|
class="pr-20 text-right item-cell"
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
class="pr-20 text-right item-cell"
|
class="pr-20 text-right item-cell"
|
||||||
style="vertical-align: top;"
|
style="vertical-align: top;"
|
||||||
>
|
>
|
||||||
{{$item->quantity}}
|
{{$item->quantity}} @if($item->unit_name) {{$item->unit_name}} @endif
|
||||||
</td>
|
</td>
|
||||||
<td
|
<td
|
||||||
class="pr-20 text-right item-cell"
|
class="pr-20 text-right item-cell"
|
||||||
|
|||||||
Reference in New Issue
Block a user