diff --git a/app/Models/Product.php b/app/Models/Product.php index 29174daaf4..60b8c0d821 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -105,6 +105,12 @@ class Product extends BaseModel use SoftDeletes; use Filterable; + public const PRODUCT_TAX_EXEMPT = 0; + public const PRODUCT_TYPE_PHYSICAL = 1; + public const PRODUCT_TYPE_SERVICE = 2; + public const PRODUCT_TYPE_DIGITAL = 3; + public const PRODUCT_TYPE_FREIGHT = 4; + protected $fillable = [ 'custom_value1', 'custom_value2', diff --git a/database/migrations/2023_03_21_053933_tax_calculations_for_invoices.php b/database/migrations/2023_03_21_053933_tax_calculations_for_invoices.php new file mode 100644 index 0000000000..e70b119609 --- /dev/null +++ b/database/migrations/2023_03_21_053933_tax_calculations_for_invoices.php @@ -0,0 +1,40 @@ +mediumText('tax_data')->nullable(); //json object + }); + + Schema::table('companies', function (Blueprint $table) { + $table->boolean('calculate_taxes')->default(false); //setting to turn on/off tax calculations + $table->boolean('tax_all_products')->default(false); //globally tax all products if none defined + }); + + Schema::table('products', function (Blueprint $table){ + $table->unsignedInteger('tax_id')->nullable(); // the product tax constant + }); + + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +}; diff --git a/lang/en/texts.php b/lang/en/texts.php index 054f2c91fe..e017dbfecb 100644 --- a/lang/en/texts.php +++ b/lang/en/texts.php @@ -5027,6 +5027,11 @@ $LANG = array( 'notification_payment_emailed' => 'Payment :payment was emailed to :client', 'notification_payment_emailed_subject' => 'Payment :payment was emailed', 'record_not_found' => 'Record not found', + 'product_tax_exempt' => 'Product Tax Exempt', + 'product_type_physical' => 'Physical Goods', + 'product_type_digital' => 'Digital Goods', + 'product_type_service' => 'Services', + 'product_type_freight' => 'Shipping', );