1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 05:32:39 +01:00

Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Hanne Nijhuis 2016-01-23 22:01:30 +01:00
commit 12d8659eef
7 changed files with 19 additions and 15 deletions

View File

@ -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,

View File

@ -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);

View File

@ -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

View File

@ -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) {

View File

@ -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',

View File

@ -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('<span data-bind="html: currencyCode"></span>') !!}

View File

@ -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) {