-
+ {{#each receipts}}
+
-
+ ++++++{{datestring}}+{{total}}+
+ {{/each}}
+
diff --git a/www/assets/css/app.css b/www/assets/css/app.css index 6632927..a14be37 100644 --- a/www/assets/css/app.css +++ b/www/assets/css/app.css @@ -271,6 +271,14 @@ Framework7 and FontAwesome both have a .fab class height: 30vh; } +#receiptvieweriframe { + width: 100%; + height: calc(100% - var(--f7-navbar-height)); + border: 0; + padding: 0; + margin: 0; +} + @media all and (min-width: 1024px) { #trackMapContainer { height: calc(calc(100vh - calc(var(--f7-list-margin-vertical) * 2)) - var(--f7-navbar-height)); diff --git a/www/assets/js/account.js b/www/assets/js/account.js index 8835c85..7fef679 100644 --- a/www/assets/js/account.js +++ b/www/assets/js/account.js @@ -306,4 +306,26 @@ function openCheckoutWindowToSaveCard(onaccountpage) { setTimeout(initAccountPage, 1000 * 60); setTimeout(initAccountPage, 1000 * 90); setTimeout(initAccountPage, 1000 * 120); +} + +function loadReceiptHTMLIntoPopup(receiptid) { + app.dialog.preloader("Loading..."); + apirequest(SETTINGS.apis.getreceipt, { + accountnumber: getStorage("accountnumber"), + accountkey: getStorage("accountkey"), + receiptid: receiptid + }, function (success) { + app.dialog.close(); + if (success.status == "OK") { + $('#receiptvieweriframe').attr("src", "data:text/html," + encodeURIComponent(success.receipt.html)); + app.popup.open("#receiptViewerPopup"); + } else { + app.dialog.alert(success.msg, "Error"); + sendErrorReport("Receipts", "Loading receipt", success.msg); + } + }, function (xhr, status, error) { + app.dialog.close(); + app.dialog.alert("There's a server or network problem. Check your Internet connection or try again later.", "Error"); + sendErrorReport("Receipts", "Couldn't load receipt", "Server/network problem: " + xhr.status + ": " + xhr.statusText); + }, "POST"); } \ No newline at end of file diff --git a/www/pages/account.html b/www/pages/account.html index b9bdc9c..eafa04c 100644 --- a/www/pages/account.html +++ b/www/pages/account.html @@ -45,8 +45,17 @@