Send invoice to specific email address from descriptor option #739
|
@ -10,7 +10,7 @@
|
|||
Show invoice PDF
|
||||
</a>
|
||||
<vn-item
|
||||
ng-click="invoiceConfirmation.show()"
|
||||
ng-click="invoiceConfirmation.show({email: $ctrl.invoiceOut.client.email})"
|
||||
name="sendInvoice"
|
||||
translate>
|
||||
Send invoice PDF
|
||||
|
@ -106,9 +106,18 @@
|
|||
</vn-confirm>
|
||||
|
||||
<!-- Send invoice confirmation popup -->
|
||||
<vn-confirm
|
||||
<vn-dialog class="edit"
|
||||
vn-id="invoiceConfirmation"
|
||||
on-accept="$ctrl.sendInvoice()"
|
||||
question="Are you sure you want to send it?"
|
||||
on-accept="$ctrl.sendInvoice($data)"
|
||||
message="Send invoice PDF">
|
||||
</vn-confirm>
|
||||
<tpl-body>
|
||||
<span translate>Are you sure you want to send it?</span>
|
||||
<vn-textfield vn-one
|
||||
ng-model="invoiceConfirmation.data.email">
|
||||
</vn-textfield>
|
||||
</tpl-body>
|
||||
<tpl-buttons>
|
||||
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
||||
<button response="accept" translate>Confirm</button>
|
||||
</tpl-buttons>
|
||||
</vn-dialog>
|
|
@ -60,10 +60,10 @@ class Controller extends Descriptor {
|
|||
.then(res => this.entity = res.data);
|
||||
}
|
||||
|
||||
sendInvoice() {
|
||||
sendInvoice($data) {
|
||||
return this.vnEmail.send('invoice', {
|
||||
recipientId: this.invoiceOut.client.id,
|
||||
recipient: this.invoiceOut.client.email,
|
||||
recipient: $data.email,
|
||||
invoiceId: this.id
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue