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: ''
},
order: {
_id: '',
address: '',
session: '',
timestamp: '',

View File

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

View File

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