feat(invoiceIn): add email
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Alex Moreno 2022-10-25 08:19:56 +02:00
parent 7cb8175b73
commit e8500f926c
5 changed files with 4 additions and 17 deletions

View File

@ -35,19 +35,16 @@ module.exports = Self => {
} }
}); });
Self.invoiceInEmail = async(ctx, id) => { Self.invoiceInEmail = async ctx => {
const args = Object.assign({}, ctx.args); const args = Object.assign({}, ctx.args);
const params = { const params = {
recipient: 'alexm@verdnatura.es', // args.recipient, recipient: args.recipient,
lang: ctx.req.getLocale() lang: ctx.req.getLocale()
}; };
console.log(id);
delete args.ctx; delete args.ctx;
for (const param in args) for (const param in args)
params[param] = args[param]; params[param] = args[param];
console.log(params);
const email = new Email('invoiceIn', params); const email = new Email('invoiceIn', params);

View File

@ -8,7 +8,6 @@ class Controller extends Descriptor {
set invoiceIn(value) { set invoiceIn(value) {
this.entity = value; this.entity = value;
console.log(value);
} }
get entryFilter() { get entryFilter() {

View File

@ -4,14 +4,6 @@ const emailFooter = new Component('email-footer');
module.exports = { module.exports = {
name: 'invoiceIn', name: 'invoiceIn',
async serverPrefetch() {
this.invoice = await this.fetchInvoice(this.id);
},
methods: {
fetchInvoice(reference) {
return this.findOneFromDef('invoice', [reference]);
},
},
components: { components: {
'email-header': emailHeader.build(), 'email-header': emailHeader.build(),
'email-footer': emailFooter.build() 'email-footer': emailFooter.build()

View File

@ -202,7 +202,7 @@
<!-- Footer block --> <!-- Footer block -->
<report-footer id="pageFooter" <report-footer id="pageFooter"
v-bind:company-code="invoice.companyCode" v-bind:company-code="invoice.companyCode"
v-bind:left-text="$t('invoice', [invoice.id])" v-bind:left-text="$t('invoiceId')"
v-bind:center-text="invoice.name" v-bind:center-text="invoice.name"
v-bind="$props"> v-bind="$props">
</report-footer> </report-footer>

View File

@ -6,8 +6,7 @@ SELECT
s.street AS postalAddress, s.street AS postalAddress,
s.nif, s.nif,
s.phone, s.phone,
p.name payMethod, p.name payMethod
c.companyCode
FROM invoiceIn i FROM invoiceIn i
JOIN supplier s ON s.id = i.supplierFk JOIN supplier s ON s.id = i.supplierFk
JOIN company c ON c.id = i.companyFk JOIN company c ON c.id = i.companyFk