Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Online POS</title>
- <meta charset="utf-8">
- </head>
- <body>
- <h1>Online POS</h1>
- <label for="invoiceRequest">Invoice request json</label>
- <textarea id="invoiceRequest" cols="100" rows="30" style="display:block"></textarea>
- <label for="taxcore_sign_element">Send Invoice Request:</label>
- <button id="taxcore_sign_element"
- data-taxcore-vsdc-url="https://vsdc.sandbox.suf.purs.gov.rs/"
- data-taxcore-input-id="invoiceRequest"
- data-taxcore-output-id="results"
- data-taxcore-invoice-request=""
- data-taxcore-debug="true"
- data-taxcore-signed-invoice-response="">Sign Invoice</button>
- <label for="results">Received Signed Invoice:</label>
- <textarea readonly id="results" cols="100" rows="30"></textarea>
- <!-- TAXCORE.JS -->
- <script src="https://vsdc.sandbox.suf.purs.gov.rs/onlinepos/v1/taxcore.min.js"></script>
- <!-- Custom script at Online POS -->
- <script>
- document.getElementById("invoiceRequest").innerHTML =
- JSON.stringify(CreateExampleInvoiceRequest(), undefined, 4);
- document.getElementById("taxcore_sign_element").dataset.taxcoreInvoiceRequest =
- JSON.stringify(CreateExampleInvoiceRequest());
- // Listen to messages from TaxCore
- window.onmessage = function (e) {
- console.log(e.data);
- }
- function CreateExampleInvoiceRequest() {
- var invoiceRequest = {
- "dateAndTimeOfIssue": "2020-12-08T08:55:23.286Z",
- "cashier": "123456789",
- "buyerId": "RS34564565",
- "buyerCostCenterId": "567546",
- "invoiceType": "Normal",
- "transactionType": "Sale",
- "payment": [
- {
- "amount": 70.00,
- "paymentType": "Cash"
- }
- ],
- "invoiceNumber": "POS2017/998",
- "options": {
- "omitQRCodeGen" : "1" ,
- "omitTextualRepresentation" : "0"
- },
- "items": [
- {
- "name": "Sport-100 Helmet, Blue",
- "quantity": 2,
- "unitPrice": 34.23,
- "labels": [
- "A"
- ],
- "totalAmount": 68.46
- }
- ]
- };
- return invoiceRequest;
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement