Merge branch 'dbexport' of https://git.vergara.tech/Vergara_Tech/zgo into dbexport

This commit is contained in:
Rene V. Vergara A. 2022-12-24 10:10:20 -05:00
commit 4780c64dcf
2 changed files with 23 additions and 14 deletions

View file

@ -136,7 +136,14 @@
font-weight: 700;
background-color: lightcyan;"
mat-raised-button
(click)="backToShop()" >Return to Shop</button>
(click)="backToShop()" >
<fa-icon style="color: #FB4F14;
margin-bottom: -2px;
margin-right: 5px;
font-size: 20px;
cursor: pointer;"
[icon]="faArrowUpRightFromSquare"> </fa-icon>
Return to Shop</button>
</div>
</div>

View file

@ -4,7 +4,7 @@ import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
import { ReceiptService } from '../receipt.service';
import { Order} from '../order/order.model';
import { Observable } from 'rxjs';
import { faCheck, faHourglass } from '@fortawesome/free-solid-svg-icons';
import { faCheck, faHourglass, faArrowUpRightFromSquare } from '@fortawesome/free-solid-svg-icons';
import { NotifierService } from '../notifier.service';
@ -21,6 +21,7 @@ var Buffer = require('buffer/').Buffer;
export class InvoiceComponent implements OnInit {
faCheck = faCheck;
faHourglass = faHourglass;
faArrowUpRightFromSquare = faArrowUpRightFromSquare;
orderId;
public orderUpdate: Observable<Order>;
public nameUpdate: Observable<string>;
@ -100,18 +101,18 @@ export class InvoiceComponent implements OnInit {
backToShop() {
if ( this.isWCOrder ) {
console.log('External Invoice -> ' + this.order.externalInvoice );
// console.log('External Invoice -> ' + this.order.externalInvoice );
const b64URL:string = this.order.externalInvoice.substring(0,this.order.externalInvoice.indexOf("-"));
console.log('encodedURL -> ' + b64URL );
// console.log('encodedURL -> ' + b64URL );
const shopURL: string = Buffer.from(b64URL, 'base64').toString();
const tmp_orderid = this.order.externalInvoice.substring(this.order.externalInvoice.indexOf('-')+1);
const wc_order_key = tmp_orderid.substring(tmp_orderid.indexOf('-')+1);
const wc_orderid = tmp_orderid.substring(0,tmp_orderid.indexOf('-'));
console.log('wc_order_id -> ' + wc_orderid);
console.log('wc_order_key -> ' + wc_order_key);
console.log('new URL -> ' + shopURL + '/checkout/order-received/' + wc_orderid + '/?key=' + wc_order_key);
// console.log('wc_order_id -> ' + wc_orderid);
// console.log('wc_order_key -> ' + wc_order_key);
// console.log('new URL -> ' + shopURL + '/checkout/order-received/' + wc_orderid + '/?key=' + wc_order_key);
if ( shopURL ) {
console.log('Opening URL....' + shopURL);
// console.log('Opening URL....' + shopURL);
window.open( shopURL + '/checkout/order-received/' + wc_orderid + '/?key=' + wc_order_key,"_blank");
}
}
@ -124,7 +125,7 @@ export class InvoiceComponent implements OnInit {
}
copyAddress() {
copyAddress() {
if (!navigator.clipboard) {
// alert("Copy functionality not supported");
this.notifierService
@ -137,8 +138,9 @@ export class InvoiceComponent implements OnInit {
.showNotification("Error copying address","Close","error");
// console.error("Error", err);
}
}
copyAmount() {
}
copyAmount() {
if (!navigator.clipboard) {
// alert("Copy functionality not supported");
this.notifierService
@ -151,9 +153,9 @@ export class InvoiceComponent implements OnInit {
.showNotification("Error while copying ammount","Close","error");
// console.error("Error", err);
}
}
}
copyMemo() {
copyMemo() {
if (!navigator.clipboard) {
// alert("Copy functionality not supported");
this.notifierService
@ -166,6 +168,6 @@ export class InvoiceComponent implements OnInit {
.showNotification("Error while copying Memo","Close","error");
// console.error("Error", err);
}
}
}
}