Taxes, tips and bugfixes #10
9 changed files with 54 additions and 23 deletions
|
@ -39,8 +39,8 @@ export class DbExportComponent implements OnInit {
|
||||||
expiration: new Date(Date.now()).toISOString(),
|
expiration: new Date(Date.now()).toISOString(),
|
||||||
payconf: false,
|
payconf: false,
|
||||||
crmToken: '',
|
crmToken: '',
|
||||||
viewkey: '',
|
viewkey: '',
|
||||||
tips: false
|
tips: false
|
||||||
};
|
};
|
||||||
|
|
||||||
_ordersOk = false;
|
_ordersOk = false;
|
||||||
|
@ -140,6 +140,9 @@ export class DbExportComponent implements OnInit {
|
||||||
this.orders[i].total + ',' +
|
this.orders[i].total + ',' +
|
||||||
this.orders[i].price! + ',' +
|
this.orders[i].price! + ',' +
|
||||||
this.orders[i].totalZec + ',' +
|
this.orders[i].totalZec + ',' +
|
||||||
|
this.orders[i].taxAmount + ',' +
|
||||||
|
this.orders[i].vatAmount + ',' +
|
||||||
|
this.orders[i].tipAmount + ',' +
|
||||||
paid + ',"' +
|
paid + ',"' +
|
||||||
this.orders[i].externalInvoice + '"' +
|
this.orders[i].externalInvoice + '"' +
|
||||||
'\n';
|
'\n';
|
||||||
|
|
|
@ -52,19 +52,19 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr *ngIf="order.taxAmount > 0">
|
<tr *ngIf="order.taxAmount > 0">
|
||||||
<td class="newOrdertbdetail" style="text-align: right;">Sales Tax</td>
|
<td class="newOrdertbdetail" style="text-align: right;">{{ vE.invoiceTax }}</td>
|
||||||
<td class="newOrdertbdetail" style="text-align: right;"></td>
|
<td class="newOrdertbdetail" style="text-align: right;"></td>
|
||||||
<td class="newOrdertbdetail" style="text-align: right;">{{ order.taxAmount | currency: order.currency.toUpperCase() }}</td>
|
<td class="newOrdertbdetail" style="text-align: right;">{{ order.taxAmount | currency: order.currency.toUpperCase() }}</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr *ngIf="order.vatAmount > 0">
|
<tr *ngIf="order.vatAmount > 0">
|
||||||
<td class="newOrdertbdetail" style="text-align: right;">Value-Added Tax</td>
|
<td class="newOrdertbdetail" style="text-align: right;">{{ vE.invoiceVAT }}</td>
|
||||||
<td class="newOrdertbdetail" style="text-align: right;"></td>
|
<td class="newOrdertbdetail" style="text-align: right;"></td>
|
||||||
<td class="newOrdertbdetail" style="text-align: right;">{{ order.vatAmount | currency: order.currency.toUpperCase() }}</td>
|
<td class="newOrdertbdetail" style="text-align: right;">{{ order.vatAmount | currency: order.currency.toUpperCase() }}</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr *ngIf="order.tipAmount > 0">
|
<tr *ngIf="order.tipAmount > 0">
|
||||||
<td class="newOrdertbdetail" style="text-align: right;">Tip</td>
|
<td class="newOrdertbdetail" style="text-align: right;">{{ vE.invoiceTip }}</td>
|
||||||
<td class="newOrdertbdetail" style="text-align: right;"></td>
|
<td class="newOrdertbdetail" style="text-align: right;"></td>
|
||||||
<td class="newOrdertbdetail" style="text-align: right;">{{ order.tipAmount | currency: order.currency.toUpperCase() }}</td>
|
<td class="newOrdertbdetail" style="text-align: right;">{{ order.tipAmount | currency: order.currency.toUpperCase() }}</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
|
|
|
@ -90,7 +90,10 @@ export class InvoiceComponent implements OnInit {
|
||||||
invoiceCopyamountError : '',
|
invoiceCopyamountError : '',
|
||||||
invoiceCopymemoError : '',
|
invoiceCopymemoError : '',
|
||||||
invoiceInvalidId : '',
|
invoiceInvalidId : '',
|
||||||
invoiceInfoNotavail : ''
|
invoiceInfoNotavail : '',
|
||||||
|
invoiceTax : '',
|
||||||
|
invoiceVAT : '',
|
||||||
|
invoiceTip : ''
|
||||||
};
|
};
|
||||||
//
|
//
|
||||||
constructor(
|
constructor(
|
||||||
|
@ -278,6 +281,9 @@ export class InvoiceComponent implements OnInit {
|
||||||
this.vE.invoiceCopymemoError = response.data.invoice_copymemo_error;
|
this.vE.invoiceCopymemoError = response.data.invoice_copymemo_error;
|
||||||
this.vE.invoiceInvalidId = response.data.invoice_invalid_id;
|
this.vE.invoiceInvalidId = response.data.invoice_invalid_id;
|
||||||
this.vE.invoiceInfoNotavail = response.data.invoice_info_notavail;
|
this.vE.invoiceInfoNotavail = response.data.invoice_info_notavail;
|
||||||
|
this.vE.invoiceTax = response.data.invoice_tax;
|
||||||
|
this.vE.invoiceVAT = response.data.invoice_vat;
|
||||||
|
this.vE.invoiceTip = response.data.invoice_tip;
|
||||||
|
|
||||||
},
|
},
|
||||||
error => { console.log('Error >> ',error); }
|
error => { console.log('Error >> ',error); }
|
||||||
|
|
|
@ -12,7 +12,7 @@ var Buffer = require('buffer/').Buffer;
|
||||||
export class LanguageService {
|
export class LanguageService {
|
||||||
//
|
//
|
||||||
// URL for test using REST API to local MariaDB database
|
// URL for test using REST API to local MariaDB database
|
||||||
// private baseURL = 'http://localhost:8080/zgointl';
|
// private baseURL = 'http://192.168.1.18:8080/zgointl';
|
||||||
//
|
//
|
||||||
// URL for test using REST API to local MongoDB database
|
// URL for test using REST API to local MongoDB database
|
||||||
// private baseURL = 'http://localhost:5000/zgointl';
|
// private baseURL = 'http://localhost:5000/zgointl';
|
||||||
|
@ -54,6 +54,8 @@ export class LanguageService {
|
||||||
// Get component's text data from language database
|
// Get component's text data from language database
|
||||||
//
|
//
|
||||||
const params = new HttpParams().append('session', this.session!);
|
const params = new HttpParams().append('session', this.session!);
|
||||||
|
// console.log("Params -> ");
|
||||||
|
// console.log(params);
|
||||||
if (viewName === 'login') {
|
if (viewName === 'login') {
|
||||||
return this.http.get<LanguageData>(this.loginURL + '/?lang=' + this.zgoLanguage, {headers: reqHeaders, params: params});
|
return this.http.get<LanguageData>(this.loginURL + '/?lang=' + this.zgoLanguage, {headers: reqHeaders, params: params});
|
||||||
} else if (viewName === 'main') {
|
} else if (viewName === 'main') {
|
||||||
|
@ -71,7 +73,7 @@ export class LanguageService {
|
||||||
,{ headers : reqHeaders
|
,{ headers : reqHeaders
|
||||||
, params: params
|
, params: params
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,19 +155,19 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="tbdetail" *ngIf="order.taxAmount > 0">
|
<tr class="tbdetail" *ngIf="order.taxAmount > 0">
|
||||||
<td class="newOrdertbdetail" style="text-align: right;">Sales Tax</td>
|
<td class="newOrdertbdetail" style="text-align: right;">{{ vE.listordersTax }}</td>
|
||||||
<td class="newOrdertbdetail" style="text-align: right;"></td>
|
<td class="newOrdertbdetail" style="text-align: right;"></td>
|
||||||
<td class="newOrdertbdetail" style="text-align: right;">{{ order.taxAmount | currency: order.currency.toUpperCase() }}</td>
|
<td class="newOrdertbdetail" style="text-align: right;">{{ order.taxAmount | currency: order.currency.toUpperCase() }}</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="tbdetail" *ngIf="order.vatAmount > 0">
|
<tr class="tbdetail" *ngIf="order.vatAmount > 0">
|
||||||
<td class="newOrdertbdetail" style="text-align: right;">Value-Added Tax</td>
|
<td class="newOrdertbdetail" style="text-align: right;">{{ vE.listordersVAT }}</td>
|
||||||
<td class="newOrdertbdetail" style="text-align: right;"></td>
|
<td class="newOrdertbdetail" style="text-align: right;"></td>
|
||||||
<td class="newOrdertbdetail" style="text-align: right;">{{ order.vatAmount | currency: order.currency.toUpperCase() }}</td>
|
<td class="newOrdertbdetail" style="text-align: right;">{{ order.vatAmount | currency: order.currency.toUpperCase() }}</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="tbdetail" *ngIf="order.tipAmount > 0">
|
<tr class="tbdetail" *ngIf="order.tipAmount > 0">
|
||||||
<td class="newOrdertbdetail" style="text-align: right;">Tip</td>
|
<td class="newOrdertbdetail" style="text-align: right;">{{ vE.listordersTip }}</td>
|
||||||
<td class="newOrdertbdetail" style="text-align: right;"></td>
|
<td class="newOrdertbdetail" style="text-align: right;"></td>
|
||||||
<td class="newOrdertbdetail" style="text-align: right;">{{ order.tipAmount | currency: order.currency.toUpperCase() }}</td>
|
<td class="newOrdertbdetail" style="text-align: right;">{{ order.tipAmount | currency: order.currency.toUpperCase() }}</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
|
|
|
@ -87,7 +87,10 @@ export class ListOrdersComponent implements OnInit, OnDestroy{
|
||||||
listordersInvoiceBtn : '',
|
listordersInvoiceBtn : '',
|
||||||
listordersReceiptBtn : '',
|
listordersReceiptBtn : '',
|
||||||
listordersNoOrders : '',
|
listordersNoOrders : '',
|
||||||
listordersEndDate : ''
|
listordersEndDate : '',
|
||||||
|
listordersTax : '',
|
||||||
|
listordersVAT : '',
|
||||||
|
listordersTip : ''
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
|
||||||
|
@ -244,6 +247,9 @@ export class ListOrdersComponent implements OnInit, OnDestroy{
|
||||||
this.vE.listordersReceiptBtn = response.data.listorders_receipt_btn;
|
this.vE.listordersReceiptBtn = response.data.listorders_receipt_btn;
|
||||||
this.vE.listordersNoOrders = response.data.listorders_no_orders;
|
this.vE.listordersNoOrders = response.data.listorders_no_orders;
|
||||||
this.vE.listordersEndDate = response.data.listorders_end_date;
|
this.vE.listordersEndDate = response.data.listorders_end_date;
|
||||||
|
this.vE.listordersTax = response.data.listorders_tax;
|
||||||
|
this.vE.listordersVAT = response.data.listorders_vat;
|
||||||
|
this.vE.listordersTip = response.data.listorders_tip;
|
||||||
|
|
||||||
},
|
},
|
||||||
error: error => { console.log('Error >> ',error); }
|
error: error => { console.log('Error >> ',error); }
|
||||||
|
|
|
@ -52,19 +52,19 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr *ngIf="order.taxAmount > 0">
|
<tr *ngIf="order.taxAmount > 0">
|
||||||
<td class="newOrdertbdetail" style="text-align: right;">Sales Tax</td>
|
<td class="newOrdertbdetail" style="text-align: right;">{{ vE.receiptTax }}</td>
|
||||||
<td class="newOrdertbdetail" style="text-align: right;"></td>
|
<td class="newOrdertbdetail" style="text-align: right;"></td>
|
||||||
<td class="newOrdertbdetail" style="text-align: right;">{{ order.taxAmount | currency: order.currency.toUpperCase() }}</td>
|
<td class="newOrdertbdetail" style="text-align: right;">{{ order.taxAmount | currency: order.currency.toUpperCase() }}</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr *ngIf="order.vatAmount > 0">
|
<tr *ngIf="order.vatAmount > 0">
|
||||||
<td class="newOrdertbdetail" style="text-align: right;">Value-Added Tax</td>
|
<td class="newOrdertbdetail" style="text-align: right;">{{ vE.receiptVAT }}</td>
|
||||||
<td class="newOrdertbdetail" style="text-align: right;"></td>
|
<td class="newOrdertbdetail" style="text-align: right;"></td>
|
||||||
<td class="newOrdertbdetail" style="text-align: right;">{{ order.vatAmount | currency: order.currency.toUpperCase() }}</td>
|
<td class="newOrdertbdetail" style="text-align: right;">{{ order.vatAmount | currency: order.currency.toUpperCase() }}</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr *ngIf="order.tipAmount > 0">
|
<tr *ngIf="order.tipAmount > 0">
|
||||||
<td class="newOrdertbdetail" style="text-align: right;">Tip</td>
|
<td class="newOrdertbdetail" style="text-align: right;">{{ vE.receiptTip }}</td>
|
||||||
<td class="newOrdertbdetail" style="text-align: right;"></td>
|
<td class="newOrdertbdetail" style="text-align: right;"></td>
|
||||||
<td class="newOrdertbdetail" style="text-align: right;">{{ order.tipAmount | currency: order.currency.toUpperCase() }}</td>
|
<td class="newOrdertbdetail" style="text-align: right;">{{ order.tipAmount | currency: order.currency.toUpperCase() }}</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
|
|
|
@ -56,7 +56,10 @@ export class ReceiptComponent implements OnInit {
|
||||||
receiptQtyLbl : '',
|
receiptQtyLbl : '',
|
||||||
receiptOrderPrice : '',
|
receiptOrderPrice : '',
|
||||||
receiptInvalidId : '',
|
receiptInvalidId : '',
|
||||||
receiptInfoNotavail : ''
|
receiptInfoNotavail : '',
|
||||||
|
receiptTax : '',
|
||||||
|
receiptVAT : '',
|
||||||
|
receiptTip : ''
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
@ -102,6 +105,9 @@ export class ReceiptComponent implements OnInit {
|
||||||
this.vE.receiptOrderPrice = response.data.receipt_order_price;
|
this.vE.receiptOrderPrice = response.data.receipt_order_price;
|
||||||
this.vE.receiptInvalidId = response.data.receipt_invalid_id;
|
this.vE.receiptInvalidId = response.data.receipt_invalid_id;
|
||||||
this.vE.receiptInfoNotavail = response.data.receipt_info_notavail;
|
this.vE.receiptInfoNotavail = response.data.receipt_info_notavail;
|
||||||
|
this.vE.receiptTax = response.data.receipt_tax;
|
||||||
|
this.vE.receiptVAT = response.data.receipt_vat;
|
||||||
|
this.vE.receiptTip = response.data.receipt_tip;
|
||||||
},
|
},
|
||||||
error => { console.log('Error >> ',error); }
|
error => { console.log('Error >> ',error); }
|
||||||
);
|
);
|
||||||
|
|
|
@ -3,12 +3,12 @@
|
||||||
|
|
||||||
<div class="container"
|
<div class="container"
|
||||||
style="margin-top: 10px;
|
style="margin-top: 10px;
|
||||||
height: 520px;
|
height: 700px;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
margin-right: 10px;">
|
margin-right: 10px;">
|
||||||
<mat-tab-group mat-tab-align-tabs="start">
|
<mat-tab-group mat-tab-align-tabs="start">
|
||||||
<mat-tab label="{{ vE.settingsTabMainlbl }}"
|
<mat-tab label="{{ vE.settingsTabMainlbl }}"
|
||||||
style="height: 400px;">
|
style="height: 620px;">
|
||||||
<div class="container" style="margin-bottom: 20px;">
|
<div class="container" style="margin-bottom: 20px;">
|
||||||
<mat-dialog-content [formGroup]="settingsForm">
|
<mat-dialog-content [formGroup]="settingsForm">
|
||||||
<mat-form-field class="settings-field" [style.width.%]="100">
|
<mat-form-field class="settings-field" [style.width.%]="100">
|
||||||
|
@ -47,18 +47,22 @@
|
||||||
</textarea>
|
</textarea>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<table cellspacing="0" style="width: 100%">
|
<table cellspacing="0" style="width: 100%">
|
||||||
|
<!--
|
||||||
<colgroup>
|
<colgroup>
|
||||||
<col span="1" style="width: 20%;">
|
<col span="1" style="width: 20%;">
|
||||||
<col span="1" style="width: 40%;">
|
<col span="1" style="width: 40%;">
|
||||||
<col span="1" style="width: 40%;">
|
<col span="1" style="width: 40%;">
|
||||||
</colgroup>
|
</colgroup>
|
||||||
|
-->
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<mat-slide-toggle formControlName="useTips" class="settings-toggle" (change)="onChangeTips($event)">
|
<mat-slide-toggle formControlName="useTips" class="settings-toggle" (change)="onChangeTips($event)">
|
||||||
{{ vE.settingsUseTips }}
|
{{ vE.settingsUseTips }}
|
||||||
</mat-slide-toggle>
|
</mat-slide-toggle>
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td >
|
||||||
<mat-slide-toggle formControlName="useTax" class="settings-toggle" (change)="onChangeTax($event)">
|
<mat-slide-toggle formControlName="useTax" class="settings-toggle" (change)="onChangeTax($event)">
|
||||||
{{ vE.settingsUseTax }}
|
{{ vE.settingsUseTax }}
|
||||||
</mat-slide-toggle>
|
</mat-slide-toggle>
|
||||||
|
@ -71,7 +75,9 @@
|
||||||
formControlName="taxRate">
|
formControlName="taxRate">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</td>
|
</td>
|
||||||
<td align="center">
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
<mat-slide-toggle formControlName="useVat" class="settings-toggle" (change)="onChangeVat($event)">
|
<mat-slide-toggle formControlName="useVat" class="settings-toggle" (change)="onChangeVat($event)">
|
||||||
{{ vE.settingsUseVAT }}
|
{{ vE.settingsUseVAT }}
|
||||||
</mat-slide-toggle>
|
</mat-slide-toggle>
|
||||||
|
@ -88,11 +94,11 @@
|
||||||
</table>
|
</table>
|
||||||
</mat-dialog-content>
|
</mat-dialog-content>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container"
|
<div class="container"
|
||||||
style="display: flex;
|
style="display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;">
|
align-items: center;
|
||||||
|
margin-top: -20px;">
|
||||||
<button mat-raised-button
|
<button mat-raised-button
|
||||||
(click)="close()">
|
(click)="close()">
|
||||||
{{ vE.settingsCloseBtn }}
|
{{ vE.settingsCloseBtn }}
|
||||||
|
@ -103,9 +109,11 @@
|
||||||
{{ vE.settingsSaveBtn }}
|
{{ vE.settingsSaveBtn }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
<!--
|
||||||
<div style="height: 20px;
|
<div style="height: 20px;
|
||||||
margin-top: 10px;">
|
margin-top: 10px;">
|
||||||
</div>
|
</div>
|
||||||
|
-->
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
<mat-tab *ngIf="proVersion"
|
<mat-tab *ngIf="proVersion"
|
||||||
label="{{ vE.settingsTabIntegrations }}"
|
label="{{ vE.settingsTabIntegrations }}"
|
||||||
|
|
Loading…
Reference in a new issue