diff --git a/app/Transformers/CreditTransformer.php b/app/Transformers/CreditTransformer.php index f9bf7ff61676..b0bc6f720e58 100644 --- a/app/Transformers/CreditTransformer.php +++ b/app/Transformers/CreditTransformer.php @@ -135,6 +135,7 @@ class CreditTransformer extends EntityTransformer 'custom_surcharge_tax4' => (bool) $credit->custom_surcharge_tax4, 'line_items' => $credit->line_items ?: (array)[], 'entity_type' => 'credit', + 'exchange_rate' => (float)$credit->exchange_rate, ]; } } diff --git a/app/Transformers/InvoiceTransformer.php b/app/Transformers/InvoiceTransformer.php index eeb7fe76a70c..c6737e568e6f 100644 --- a/app/Transformers/InvoiceTransformer.php +++ b/app/Transformers/InvoiceTransformer.php @@ -135,6 +135,7 @@ class InvoiceTransformer extends EntityTransformer 'custom_surcharge2' => (float)$invoice->custom_surcharge2, 'custom_surcharge3' => (float)$invoice->custom_surcharge3, 'custom_surcharge4' => (float)$invoice->custom_surcharge4, + 'exchange_rate' => (float)$invoice->exchange_rate, 'custom_surcharge_tax1' => (bool) $invoice->custom_surcharge_tax1, 'custom_surcharge_tax2' => (bool) $invoice->custom_surcharge_tax2, 'custom_surcharge_tax3' => (bool) $invoice->custom_surcharge_tax3, diff --git a/app/Transformers/QuoteTransformer.php b/app/Transformers/QuoteTransformer.php index 7621b80d8d83..14e5ba270ca4 100644 --- a/app/Transformers/QuoteTransformer.php +++ b/app/Transformers/QuoteTransformer.php @@ -134,7 +134,7 @@ class QuoteTransformer extends EntityTransformer 'custom_surcharge_taxes' => (bool) $quote->custom_surcharge_taxes, 'line_items' => $quote->line_items ?: (array)[], 'entity_type' => 'quote', - + 'exchange_rate' => (float)$quote->exchange_rate, ]; } } diff --git a/database/migrations/2020_08_18_140557_add_is_public_to_documents_table.php b/database/migrations/2020_08_18_140557_add_is_public_to_documents_table.php index 61b2b88e07b9..dd77f31a3971 100644 --- a/database/migrations/2020_08_18_140557_add_is_public_to_documents_table.php +++ b/database/migrations/2020_08_18_140557_add_is_public_to_documents_table.php @@ -22,18 +22,6 @@ class AddIsPublicToDocumentsTable extends Migration $table->decimal('amount', 16, 4); }); - Schema::table('invoices', function (Blueprint $table) { - $table->decimal('exchange_rate', 16, 4); - }); - - Schema::table('quotes', function (Blueprint $table) { - $table->decimal('exchange_rate', 16, 4); - }); - - Schema::table('credits', function (Blueprint $table) { - $table->decimal('exchange_rate', 16, 4); - }); - } /**