Settings component updated for use owner.invoices field

This commit is contained in:
Rene V. Vergara A. 2022-08-26 19:16:00 -05:00
parent f7749cb2f7
commit a8ec3f22c6
4 changed files with 45 additions and 4 deletions

41
pay_xero_invoice.txt Normal file
View file

@ -0,0 +1,41 @@
{
"Invoice": { "InvoiceID": "96df0dff-43ec-4899-a7d9-e9d63ef12b19" },
"Account": { "Code": "001" },
"Date": "2022-08-25",
"Amount": 32.06
}
{
"Invoice": { "InvoiceNumber": "INV-0041" },
"Account": { "Code": "001" },
"Date": "2022-08-25",
"Amount": 32.06
}
POST -> https://api.xero.com/api.xro/2.0/Payments
Authorization Bearer ey****
Xero-Tenant-Id 5ae23193-e4b4-4001-99e9-b98634d6040e
Accept application/json
Content-Type application/json
Payload
{
"Payments": [
{
"Invoice": {
"LineItems": [],
"InvoiceID": "00000000-0000-0000-0000-000000000000"
},
"Account": {
"Code": "970"
},
"Date": "2019-03-12",
"Amount": 1
}
]
}

View file

@ -53,7 +53,6 @@ export class OrderService {
viewkey: '' viewkey: ''
}, },
order: { order: {
_id: '',
address: '', address: '',
session: '', session: '',
timestamp: '', timestamp: '',

View file

@ -45,13 +45,14 @@
formControlName="vKey"> formControlName="vKey">
</textarea> </textarea>
</mat-form-field> </mat-form-field>
<!--
<pre></pre> <pre></pre>
<mat-slide-toggle formControlName="proVersion" <mat-slide-toggle formControlName="proVersion"
class="settings-toggle" class="settings-toggle"
(change)="onChangeProVersion($event)"> (change)="onChangeProVersion($event)">
Enable Integrations Enable Integrations
</mat-slide-toggle> </mat-slide-toggle>
-->
</mat-dialog-content> </mat-dialog-content>
</div> </div>

View file

@ -54,14 +54,14 @@ export class SettingsComponent implements OnInit {
currency: [data.currency, Validators.required], currency: [data.currency, Validators.required],
useZats: [data.zats, Validators.required], useZats: [data.zats, Validators.required],
useVKey: [data.payconf, Validators.required], useVKey: [data.payconf, Validators.required],
proVersion: [data.invoices, Validators.required], // proVersion: [data.invoices, Validators.required],
vKey: [data.viewkey] vKey: [data.viewkey]
}); });
if (data.payconf) { if (data.payconf) {
this.settingsForm.get('vKey')!.enable(); this.settingsForm.get('vKey')!.enable();
} }
this.owner = data; this.owner = data;
this.proVersion = this.owner.invoices;
this.clientIdUpdate = xeroService.clientIdUpdate; this.clientIdUpdate = xeroService.clientIdUpdate;
xeroService.getXeroConfig(); xeroService.getXeroConfig();
this.clientIdUpdate.subscribe(clientId => { this.clientIdUpdate.subscribe(clientId => {