Skip to content

Commit

Permalink
Merge pull request #12 from nikhilkuyya/build
Browse files Browse the repository at this point in the history
fix: bugs of showing invoice and entry
  • Loading branch information
nikhilkuyya authored Nov 13, 2023
2 parents 7af3c03 + 4f85a3f commit 7c3e40e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/components/invoices/InvoiceConsigneeSignature.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
<h4>{{heading}} {{client.company_name}}</h4>
<h4>{{heading}} {{client && client.company_name}}</h4>
<p class="signature-space">
</p>
</div>
Expand Down
4 changes: 1 addition & 3 deletions src/components/invoices/InvoiceForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</div>
<div class="row">
<InvoiceConsigneeSignature class="col-4"/>
<InvoiceDisclaimerDetails class="col-4" />
<div class="col-4"></div>
<InvoiceClientSignature class="col-4"/>
</div>
</div>
Expand Down Expand Up @@ -87,7 +87,6 @@ import AppEditable from '@/components/form/AppEditable';
// import TeamLogo from '@/components/team/TeamLogo';
import InvoiceRowsHeader from '@/components/invoices/InvoiceRowsHeader';
import InvoiceAddRowBtn from '@/components/invoices/InvoiceAddRowBtn';
import InvoiceDisclaimerDetails from '@/components/invoices/InvoiceDisclaimerDetails';
import InvoiceClientSignature from '@/components/invoices/InvoiceClientSignature';
import InvoiceConsigneeSignature from '@/components/invoices/InvoiceConsigneeSignature';
Expand All @@ -105,7 +104,6 @@ export default {
InvoiceRowsHeader,
InvoiceClientDetails,
AppEditable,
InvoiceDisclaimerDetails,
InvoiceConsigneeSignature,
InvoiceClientSignature,
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/invoices/InvoiceRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
</td>
<td>
<AppEditable
:value="row.price | dineroCurrency"
:value="row.price | currency"
:errors="errors"
:field="`rows.${index}.price`"
:placeholder="$t('enter_price')"
Expand Down
10 changes: 5 additions & 5 deletions src/components/invoices/InvoiceTotals.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
<td :colspan="colspan">
{{ tax.label }} ({{ tax.rate }}%)
</td>
<td class="currency-readable">{{ tax.total | dineroCurrency }}</td>
<td class="currency-readable">{{ tax.total | dineroCurrency }}</td>
</tr>
<tr class="text-right">
<td :colspan="colspan">
{{ $t('tax_total') }}
</td>
<td class="currency-readable">{{ taxTotal | dineroCurrency }}</td>
<td class="currency-readable">{{ taxTotal | dineroCurrency }}</td>
</tr>
<tr class="text-right">
<th :colspan="colspan">
<tr class="text-right" v-if="invoice.total">
<th :colspan="colspan" >
{{ $t('total') }}
</th>
<th class="text-nowrap currency-readable">{{ invoice.total | dineroCurrency }}</th>
<th class="text-nowrap currency-readable">{{ invoice.total | dineroCurrency}}</th>
</tr>
</tfoot>
</template>
Expand Down
6 changes: 4 additions & 2 deletions src/filters/dineroCurrency.filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import Dinero from "dinero.js";

export function formatCurrencyWithDinero(value, factor = 10 ** 2) {
const newValue = Number(value);

if (Number.isNaN(newValue)) {
return "";
}
console.trace('formatCurrency', { newValue });
const amount = Number.parseFloat(newValue).toFixed(2) * factor;


const amount = Number.parseFloat((Number.parseFloat(newValue).toFixed(2) * factor).toFixed(2));
const dineroObject = Dinero({ amount: amount, currency: "INR" });
const dineroAmount = dineroObject.toRoundedUnit(2);
return Intl.NumberFormat("en-IN", { currency: "INR", style: "currency" }).format(dineroAmount);
Expand Down

0 comments on commit 7c3e40e

Please sign in to comment.