Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump vue #337

Merged
merged 14 commits into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion frappe/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const {
DEFAULT_INTERNAL_PRECISION,
DEFAULT_DISPLAY_PRECISION,
} = require('./utils/consts');
const { markRaw } = require('vue');

module.exports = {
initializeAndRegister(customModels = {}, force = false) {
Expand Down Expand Up @@ -55,7 +56,12 @@ module.exports = {
display = parseInt(display);
}

this.pesa = getMoneyMaker({ currency, precision, display });
this.pesa = getMoneyMaker({
currency,
precision,
display,
wrapper: markRaw,
});
},

init(force) {
Expand Down
116 changes: 90 additions & 26 deletions models/doctype/GSTR3B/GSTR3BPrintView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,28 @@
<div>
<div class="row no-gutters">
<div class="col-8 mx-auto text-right mt-4">
<f-button primary @click="$emit('makePDF', $refs.printComponent.innerHTML)">{{ t('PDF') }}</f-button>
<f-button
primary
@click="$emit('makePDF', $refs.printComponent.innerHTML)"
>{{ t('PDF') }}</f-button
>
</div>
</div>
<div ref="printComponent" class="col-8 bg-white mt-4 mx-auto border shadow">
<div class="print-format" style="padding: 3.5rem; font-size: 8pt !important;">
<div
class="print-format"
style="padding: 3.5rem; font-size: 8pt !important"
>
<div>
<h3 class="text-center">GSTR3B-Form</h3>
<h5>GSTIN: &nbsp; {{ jsonData.gstin }}</h5>
<h5>Period: &nbsp; {{ jsonData.ret_period }}</h5>
</div>

<h5>3.1&nbsp;&nbsp;Details of Outward Supplies and inward supplies liable to reverse charge</h5>
<h5>
3.1&nbsp;&nbsp;Details of Outward Supplies and inward supplies liable
to reverse charge
</h5>
<table class="table table-bordered">
<thead>
<tr>
Expand All @@ -27,7 +37,10 @@
</thead>
<tbody>
<tr>
<td>(a) Outward taxable supplies(other than zero rated, nil rated and exempted</td>
<td>
(a) Outward taxable supplies(other than zero rated, nil rated
and exempted
</td>
<td class="right">{{ jsonData.sup_details.osup_det.txval }}</td>
<td class="right">{{ jsonData.sup_details.osup_det.iamt }}</td>
<td class="right">{{ jsonData.sup_details.osup_det.camt }}</td>
Expand All @@ -44,7 +57,9 @@
</tr>
<tr>
<td>(b) Other outward supplies(Nil rated,Exempted)</td>
<td class="right">{{ jsonData.sup_details.osup_nil_exmp.txval }}</td>
<td class="right">
{{ jsonData.sup_details.osup_nil_exmp.txval }}
</td>
<td class="disabled"></td>
<td class="disabled"></td>
<td class="disabled"></td>
Expand All @@ -60,7 +75,9 @@
</tr>
<tr>
<td>(e) Non-GST outward supplies</td>
<td class="right">{{ jsonData.sup_details.osup_nongst.txval }}</td>
<td class="right">
{{ jsonData.sup_details.osup_nongst.txval }}
</td>
<td class="disabled"></td>
<td class="disabled"></td>
<td class="disabled"></td>
Expand All @@ -69,7 +86,11 @@
</tbody>
</table>

<h5>3.2&nbsp;&nbsp;Of the supplies shown in 3.1 (a) above, details of inter-State supplies made to unregisterd persons, composition taxable persons and UIN holders</h5>
<h5>
3.2&nbsp;&nbsp;Of the supplies shown in 3.1 (a) above, details of
inter-State supplies made to unregisterd persons, composition taxable
persons and UIN holders
</h5>
<table class="table table-bordered">
<thead>
<tr>
Expand All @@ -83,53 +104,80 @@
<tr>
<td>Supplies made to Unregistered Persons</td>
<td class="right">
<div v-for="(row, i) in jsonData.inter_sup.unreg_details" :key="i">
<div
v-for="(row, i) in jsonData.inter_sup.unreg_details"
:key="i"
>
<p>{{ row.pos }}</p>
</div>
</td>
<td class="right">
<div v-for="(row, i) in jsonData.inter_sup.unreg_details" :key="i">
<div
v-for="(row, i) in jsonData.inter_sup.unreg_details"
:key="i"
>
<p>{{ row.txval }}</p>
</div>
</td>
<td class="right">
<div v-for="(row, i) in jsonData.inter_sup.unreg_details" :key="i">
<div
v-for="(row, i) in jsonData.inter_sup.unreg_details"
:key="i"
>
<p>{{ row.iamt }}</p>
</div>
</td>
</tr>
<tr>
<td>Suppliies made to Composition Taxable Persons</td>
<td class="right">
<div v-for="(row, i) in jsonData.inter_sup.comp_details" :key="i">
<div
v-for="(row, i) in jsonData.inter_sup.comp_details"
:key="i"
>
<p>{{ row.pos }}</p>
</div>
</td>
<td class="right">
<div v-for="(row, i) in jsonData.inter_sup.comp_details" :key="i">
<div
v-for="(row, i) in jsonData.inter_sup.comp_details"
:key="i"
>
<p>{{ row.txval }}</p>
</div>
</td>
<td class="right">
<div v-for="(row, i) in jsonData.inter_sup.comp_details" :key="i">
<div
v-for="(row, i) in jsonData.inter_sup.comp_details"
:key="i"
>
<p>{{ row.iamt }}</p>
</div>
</td>
</tr>
<tr>
<td>Supplies made to UIN holders</td>
<td class="right">
<div v-for="(row, i) in jsonData.inter_sup.uin_details" :key="i">
<div
v-for="(row, i) in jsonData.inter_sup.uin_details"
:key="i"
>
<p>{{ row.pos }}</p>
</div>
</td>
<td class="right">
<div v-for="(row, i) in jsonData.inter_sup.uin_details" :key="i">
<div
v-for="(row, i) in jsonData.inter_sup.uin_details"
:key="i"
>
<p>{{ row.txval }}</p>
</div>
</td>
<td class="right">
<div v-for="(row, i) in jsonData.inter_sup.uin_details" :key="i">
<div
v-for="(row, i) in jsonData.inter_sup.uin_details"
:key="i"
>
<p>{{ row.iamt }}</p>
</div>
</td>
Expand Down Expand Up @@ -173,7 +221,10 @@
<td class="right">{{ jsonData.itc_elg.itc_avl[1].csamt }}</td>
</tr>
<tr>
<td>&nbsp; (3) Inward supplies liable to reverse charge (other than 1 & 2 above)</td>
<td>
&nbsp; (3) Inward supplies liable to reverse charge (other than
1 & 2 above)
</td>
<td class="right">{{ jsonData.itc_elg.itc_avl[2].iamt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_avl[2].camt }}</td>
<td class="right">{{ jsonData.itc_elg.itc_avl[2].samt }}</td>
Expand Down Expand Up @@ -251,7 +302,10 @@
</tbody>
</table>

<h5>5. &nbsp;&nbsp; Values of exempt, nil rated and non-GST inward supplies</h5>
<h5>
5. &nbsp;&nbsp; Values of exempt, nil rated and non-GST inward
supplies
</h5>
<table class="table table-bordered">
<thead>
<tr>
Expand All @@ -262,14 +316,24 @@
</thead>
<tbody>
<tr>
<td>From a supplier under composition scheme, Exempt and Nil rated</td>
<td class="right">{{ jsonData.inward_sup.isup_details[0].inter }}</td>
<td class="right">{{ jsonData.inward_sup.isup_details[0].intra }}</td>
<td>
From a supplier under composition scheme, Exempt and Nil rated
</td>
<td class="right">
{{ jsonData.inward_sup.isup_details[0].inter }}
</td>
<td class="right">
{{ jsonData.inward_sup.isup_details[0].intra }}
</td>
</tr>
<tr>
<td>Non GST Inward Supplies</td>
<td class="right">{{ jsonData.inward_sup.isup_details[1].inter }}</td>
<td class="right">{{ jsonData.inward_sup.isup_details[1].intra }}</td>
<td class="right">
{{ jsonData.inward_sup.isup_details[1].inter }}
</td>
<td class="right">
{{ jsonData.inward_sup.isup_details[1].intra }}
</td>
</tr>
</tbody>
</table>
Expand All @@ -282,11 +346,12 @@
export default {
name: 'GSTR3BPrintView',
props: ['doc'],
emits: ['makePDF'],
computed: {
jsonData() {
return JSON.parse(this.doc.jsonData);
}
}
},
},
};
</script>

Expand All @@ -300,4 +365,3 @@ export default {
text-align: right;
}
</style>

8 changes: 4 additions & 4 deletions models/doctype/Party/Customer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import router from '@/router';
import frappe from 'frappe';
import { t } from 'frappe';
import frappe, { t } from 'frappe';
import { h } from 'vue';
import PartyWidget from './PartyWidget.vue';

export default {
Expand Down Expand Up @@ -44,9 +44,9 @@ export default {
},
],
quickEditWidget: (doc) => ({
render(h) {
render() {
return h(PartyWidget, {
props: { doc },
doc,
});
},
}),
Expand Down
8 changes: 4 additions & 4 deletions models/doctype/Party/Supplier.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import router from '@/router';
import frappe from 'frappe';
import { t } from 'frappe';
import frappe, { t } from 'frappe';
import { h } from 'vue';
import PartyWidget from './PartyWidget.vue';

export default {
Expand Down Expand Up @@ -44,9 +44,9 @@ export default {
},
],
quickEditWidget: (doc) => ({
render(h) {
render() {
return h(PartyWidget, {
props: { doc },
doc,
});
},
}),
Expand Down
34 changes: 24 additions & 10 deletions models/doctype/SalesInvoice/SalesInvoicePrint.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,19 @@
<div class="row no-gutters">
<div v-if="showInvoiceCustomizer" class="col-3 mt-4 mx-auto"></div>
<div class="col-8 mx-auto text-right mt-4">
<f-button primary @click="$emit('send', $refs.printComponent.innerHTML)">{{ t('Send') }}</f-button>
<f-button secondary @click="toggleCustomizer">{{ t('Customize') }}</f-button>
<f-button secondary @click="$emit('makePDF', $refs.printComponent.innerHTML)">{{ t('PDF') }}</f-button>
<f-button
primary
@click="$emit('send', $refs.printComponent.innerHTML)"
>{{ t('Send') }}</f-button
>
<f-button secondary @click="toggleCustomizer">{{
t('Customize')
}}</f-button>
<f-button
secondary
@click="$emit('makePDF', $refs.printComponent.innerHTML)"
>{{ t('PDF') }}</f-button
>
</div>
</div>
<div class="row no-gutters">
Expand All @@ -20,7 +30,10 @@
@updateTemplateView="updateTemplateView"
/>
</div>
<div class="col-8 bg-white mt-4 mx-auto border shadow" ref="printComponent">
<div
class="col-8 bg-white mt-4 mx-auto border shadow"
ref="printComponent"
>
<component
:themeColor="themeColor"
:font="font"
Expand All @@ -42,22 +55,23 @@ import InvoiceCustomizer from '@/components/InvoiceCustomizer';
const invoiceTemplates = {
'Basic I': InvoiceTemplate1,
'Basic II': InvoiceTemplate2,
Modern: InvoiceTemplate3
Modern: InvoiceTemplate3,
};

export default {
name: 'InvoicePrint',
props: ['doc'],
emits: ['send', 'makePDF'],
components: {
InvoiceCustomizer
InvoiceCustomizer,
},
data() {
return {
showInvoiceCustomizer: false,
themeColor: undefined,
template: undefined,
font: undefined,
usedForReRender: 0
usedForReRender: 0,
};
},
async created() {
Expand Down Expand Up @@ -96,7 +110,7 @@ export default {
},
updateTemplateView() {
this.usedForReRender += 1;
}
}
},
},
};
</script>
</script>
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"luxon": "^2.0.2",
"pesa": "^1.1.3",
"sqlite3": "npm:@vscode/sqlite3@^5.0.7",
"vue": "^2.6.14",
"vue-router": "^3.5.3"
"vue": "^3.2.30",
"vue-router": "^4.0.12"
},
"devDependencies": {
"@babel/core": "^7.16.0",
Expand Down
Loading