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 params = {
recipient: 'alexm@verdnatura.es', // args.recipient,
recipient: args.recipient,
lang: ctx.req.getLocale()
};
console.log(id);
delete args.ctx;
for (const param in args)
params[param] = args[param];
console.log(params);
const email = new Email('invoiceIn', params);

View File

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

View File

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

View File

@ -202,7 +202,7 @@
<!-- Footer block -->
<report-footer id="pageFooter"
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="$props">
</report-footer>

View File

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