diff --git a/app/Models/Account.php b/app/Models/Account.php index 08c10017c0..9af3350dd0 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -26,7 +26,7 @@ class Account extends Eloquent ACCOUNT_USER_DETAILS, ACCOUNT_LOCALIZATION, ACCOUNT_PAYMENTS, - ACCOUNT_BANKS, + //ACCOUNT_BANKS, ACCOUNT_TAX_RATES, ACCOUNT_PRODUCTS, ACCOUNT_NOTIFICATIONS, diff --git a/app/Services/ExpenseService.php b/app/Services/ExpenseService.php index 92a2a048c1..4680bfc0fe 100644 --- a/app/Services/ExpenseService.php +++ b/app/Services/ExpenseService.php @@ -69,6 +69,7 @@ class ExpenseService extends BaseService [ 'amount', function ($model) { + // show both the amount and the converted amount $str = Utils::formatMoney($model->amount, $model->account_currency_id, $model->account_country_id, true); if ($model->exchange_rate != 1) { $str .= ' | ' . Utils::formatMoney(round($model->amount * $model->exchange_rate,2), $model->currency_id, $model->client_country_id, true); diff --git a/database/migrations/2016_01_04_175228_create_vendors_table.php b/database/migrations/2016_01_04_175228_create_vendors_table.php index 2524632662..b1e3f7b4e8 100644 --- a/database/migrations/2016_01_04_175228_create_vendors_table.php +++ b/database/migrations/2016_01_04_175228_create_vendors_table.php @@ -96,12 +96,11 @@ class CreateVendorsTable extends Migration $table->softDeletes(); $table->unsignedInteger('user_id'); $table->unsignedInteger('account_id'); + $table->unsignedInteger('public_id')->index(); //$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade'); //$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); - - $table->unsignedInteger('public_id')->index(); - $table->unique(array('account_id', 'public_id')); + //$table->unique(array('account_id', 'public_id')); }); // Update public id diff --git a/database/seeds/PaymentLibrariesSeeder.php b/database/seeds/PaymentLibrariesSeeder.php index b34d718249..7fd66881ba 100644 --- a/database/seeds/PaymentLibrariesSeeder.php +++ b/database/seeds/PaymentLibrariesSeeder.php @@ -125,6 +125,7 @@ class PaymentLibrariesSeeder extends Seeder ['name' => 'Ghanaian Cedi', 'code' => 'GHS', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['name' => 'Bulgarian Lev', 'code' => 'BGN', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => '.'], ['name' => 'Aruban Florin', 'code' => 'AWG', 'symbol' => 'Afl. ', 'precision' => '2', 'thousand_separator' => ' ', 'decimal_separator' => '.'], + ['name' => 'Turkish Lira', 'code' => 'TRY', 'symbol' => 'TL ', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','], ]; foreach ($currencies as $currency) { diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index b2d035a0c4..be6ce2cc9d 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -1037,7 +1037,7 @@ return array( 'expense_date' => 'Expense Date', 'expense_should_be_invoiced' => 'Should this expense be invoiced?', 'public_notes' => 'Public Notes', - 'converted_amount' => 'Converted Amount', + 'invoice_amount' => 'Invoice Amount', 'exchange_rate' => 'Exchange Rate', 'yes' => 'Yes', 'no' => 'No', diff --git a/resources/views/expenses/edit.blade.php b/resources/views/expenses/edit.blade.php index 8071c0b44e..949e9b73eb 100644 --- a/resources/views/expenses/edit.blade.php +++ b/resources/views/expenses/edit.blade.php @@ -68,7 +68,7 @@ {!! Former::text('exchange_rate') ->data_bind("value: exchange_rate, enable: enableExchangeRate, valueUpdate: 'afterkeydown'") !!} - {!! Former::text('converted_amount') + {!! Former::text('invoice_amount') ->addGroupClass('converted-amount') ->data_bind("value: convertedAmount, enable: enableExchangeRate") ->append('') !!} diff --git a/resources/views/invoices/knockout.blade.php b/resources/views/invoices/knockout.blade.php index 24138c1af3..d9aec7fea5 100644 --- a/resources/views/invoices/knockout.blade.php +++ b/resources/views/invoices/knockout.blade.php @@ -388,12 +388,14 @@ function InvoiceModel(data) { } var taxRate = parseFloat(self.tax_rate()); - if (taxRate > 0) { - var tax = roundToTwo(total * (taxRate/100)); - return self.formatMoney(tax); - } else { - return self.formatMoney(0); - } + //if (taxRate > 0) { + // var tax = roundToTwo(total * (taxRate/100)); + // return self.formatMoney(tax); + //} else { + // return self.formatMoney(0); + //} + var tax = roundToTwo(total * (taxRate/100)); + return self.formatMoney(tax); }); self.totals.itemTaxes = ko.computed(function() { @@ -482,9 +484,10 @@ function InvoiceModel(data) { } var taxRate = parseFloat(self.tax_rate()); - if (taxRate > 0) { - total = NINJA.parseFloat(total) + roundToTwo((total * (taxRate/100))); - } + //if (taxRate > 0) { + // total = NINJA.parseFloat(total) + roundToTwo((total * (taxRate/100))); + //} + total = NINJA.parseFloat(total) + roundToTwo((total * (taxRate/100))); var taxes = self.totals.itemTaxes(); for (var key in taxes) {