mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-13 14:42:42 +01:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
12d8659eef
@ -26,7 +26,7 @@ class Account extends Eloquent
|
|||||||
ACCOUNT_USER_DETAILS,
|
ACCOUNT_USER_DETAILS,
|
||||||
ACCOUNT_LOCALIZATION,
|
ACCOUNT_LOCALIZATION,
|
||||||
ACCOUNT_PAYMENTS,
|
ACCOUNT_PAYMENTS,
|
||||||
ACCOUNT_BANKS,
|
//ACCOUNT_BANKS,
|
||||||
ACCOUNT_TAX_RATES,
|
ACCOUNT_TAX_RATES,
|
||||||
ACCOUNT_PRODUCTS,
|
ACCOUNT_PRODUCTS,
|
||||||
ACCOUNT_NOTIFICATIONS,
|
ACCOUNT_NOTIFICATIONS,
|
||||||
|
@ -69,6 +69,7 @@ class ExpenseService extends BaseService
|
|||||||
[
|
[
|
||||||
'amount',
|
'amount',
|
||||||
function ($model) {
|
function ($model) {
|
||||||
|
// show both the amount and the converted amount
|
||||||
$str = Utils::formatMoney($model->amount, $model->account_currency_id, $model->account_country_id, true);
|
$str = Utils::formatMoney($model->amount, $model->account_currency_id, $model->account_country_id, true);
|
||||||
if ($model->exchange_rate != 1) {
|
if ($model->exchange_rate != 1) {
|
||||||
$str .= ' | ' . Utils::formatMoney(round($model->amount * $model->exchange_rate,2), $model->currency_id, $model->client_country_id, true);
|
$str .= ' | ' . Utils::formatMoney(round($model->amount * $model->exchange_rate,2), $model->currency_id, $model->client_country_id, true);
|
||||||
|
@ -96,12 +96,11 @@ class CreateVendorsTable extends Migration
|
|||||||
$table->softDeletes();
|
$table->softDeletes();
|
||||||
$table->unsignedInteger('user_id');
|
$table->unsignedInteger('user_id');
|
||||||
$table->unsignedInteger('account_id');
|
$table->unsignedInteger('account_id');
|
||||||
|
$table->unsignedInteger('public_id')->index();
|
||||||
|
|
||||||
//$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
//$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
||||||
//$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
//$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||||
|
//$table->unique(array('account_id', 'public_id'));
|
||||||
$table->unsignedInteger('public_id')->index();
|
|
||||||
$table->unique(array('account_id', 'public_id'));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Update public id
|
// Update public id
|
||||||
|
@ -125,6 +125,7 @@ class PaymentLibrariesSeeder extends Seeder
|
|||||||
['name' => 'Ghanaian Cedi', 'code' => 'GHS', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
['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' => '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' => '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) {
|
foreach ($currencies as $currency) {
|
||||||
|
@ -1037,7 +1037,7 @@ return array(
|
|||||||
'expense_date' => 'Expense Date',
|
'expense_date' => 'Expense Date',
|
||||||
'expense_should_be_invoiced' => 'Should this expense be invoiced?',
|
'expense_should_be_invoiced' => 'Should this expense be invoiced?',
|
||||||
'public_notes' => 'Public Notes',
|
'public_notes' => 'Public Notes',
|
||||||
'converted_amount' => 'Converted Amount',
|
'invoice_amount' => 'Invoice Amount',
|
||||||
'exchange_rate' => 'Exchange Rate',
|
'exchange_rate' => 'Exchange Rate',
|
||||||
'yes' => 'Yes',
|
'yes' => 'Yes',
|
||||||
'no' => 'No',
|
'no' => 'No',
|
||||||
|
@ -68,7 +68,7 @@
|
|||||||
{!! Former::text('exchange_rate')
|
{!! Former::text('exchange_rate')
|
||||||
->data_bind("value: exchange_rate, enable: enableExchangeRate, valueUpdate: 'afterkeydown'") !!}
|
->data_bind("value: exchange_rate, enable: enableExchangeRate, valueUpdate: 'afterkeydown'") !!}
|
||||||
|
|
||||||
{!! Former::text('converted_amount')
|
{!! Former::text('invoice_amount')
|
||||||
->addGroupClass('converted-amount')
|
->addGroupClass('converted-amount')
|
||||||
->data_bind("value: convertedAmount, enable: enableExchangeRate")
|
->data_bind("value: convertedAmount, enable: enableExchangeRate")
|
||||||
->append('<span data-bind="html: currencyCode"></span>') !!}
|
->append('<span data-bind="html: currencyCode"></span>') !!}
|
||||||
|
@ -388,12 +388,14 @@ function InvoiceModel(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var taxRate = parseFloat(self.tax_rate());
|
var taxRate = parseFloat(self.tax_rate());
|
||||||
if (taxRate > 0) {
|
//if (taxRate > 0) {
|
||||||
var tax = roundToTwo(total * (taxRate/100));
|
// var tax = roundToTwo(total * (taxRate/100));
|
||||||
return self.formatMoney(tax);
|
// return self.formatMoney(tax);
|
||||||
} else {
|
//} else {
|
||||||
return self.formatMoney(0);
|
// return self.formatMoney(0);
|
||||||
}
|
//}
|
||||||
|
var tax = roundToTwo(total * (taxRate/100));
|
||||||
|
return self.formatMoney(tax);
|
||||||
});
|
});
|
||||||
|
|
||||||
self.totals.itemTaxes = ko.computed(function() {
|
self.totals.itemTaxes = ko.computed(function() {
|
||||||
@ -482,9 +484,10 @@ function InvoiceModel(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var taxRate = parseFloat(self.tax_rate());
|
var taxRate = parseFloat(self.tax_rate());
|
||||||
if (taxRate > 0) {
|
//if (taxRate > 0) {
|
||||||
total = NINJA.parseFloat(total) + roundToTwo((total * (taxRate/100)));
|
// total = NINJA.parseFloat(total) + roundToTwo((total * (taxRate/100)));
|
||||||
}
|
//}
|
||||||
|
total = NINJA.parseFloat(total) + roundToTwo((total * (taxRate/100)));
|
||||||
|
|
||||||
var taxes = self.totals.itemTaxes();
|
var taxes = self.totals.itemTaxes();
|
||||||
for (var key in taxes) {
|
for (var key in taxes) {
|
||||||
|
Loading…
Reference in New Issue
Block a user