@bookipi/htmlgenerator 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,6 @@
1
- import React, { useState, useEffect } from 'react';
1
+ import React from 'react';
2
2
  import Moment from 'moment';
3
+ import moment from 'moment-timezone';
3
4
 
4
5
  var currencies = {
5
6
  "AED": {
@@ -1581,6 +1582,7 @@ var currencyFormat = function currencyFormat(value, currency, lang, cFormat, rtl
1581
1582
  formattedValue = formattedValue.replace("$$", symbol);
1582
1583
  return formattedValue;
1583
1584
  };
1585
+
1584
1586
  var FormatCurrency = function FormatCurrency(value, currency, language, cFormat) {
1585
1587
  return currencyFormat(value, currency, language, cFormat);
1586
1588
  };
@@ -1596,43 +1598,15 @@ var nl2br = function nl2br(str, is_xhtml) {
1596
1598
 
1597
1599
  var PreviewDocument = function PreviewDocument(_ref) {
1598
1600
  var previewDocument = _ref.invoice,
1599
- documentDefinitions = _ref.documentDefinitions;
1600
- var lang = {};
1601
-
1602
- var _useState = useState(null),
1603
- company = _useState[0],
1604
- setCompany = _useState[1];
1605
-
1606
- var _useState2 = useState(null),
1607
- document = _useState2[0],
1608
- setDocument = _useState2[1];
1609
-
1610
- var _useState3 = useState(null),
1611
- logoBase64 = _useState3[0],
1612
- setLogoBase64 = _useState3[1];
1613
-
1614
- var _useState4 = useState(null),
1615
- attachments = _useState4[0],
1616
- setAttachments = _useState4[1];
1617
-
1618
- var _useState5 = useState(null),
1619
- customerSignBase64 = _useState5[0],
1620
- setCustomerSignBase64 = _useState5[1];
1621
-
1622
- var _useState6 = useState(null),
1623
- signatureBase64 = _useState6[0],
1624
- setSignatureBase64 = _useState6[1];
1625
-
1626
- useEffect(function () {
1627
- if (previewDocument != null) {
1628
- setCompany(previewDocument.company);
1629
- setDocument(previewDocument.document);
1630
- setLogoBase64(previewDocument.logoBase64);
1631
- setAttachments(previewDocument.attachments);
1632
- setCustomerSignBase64(previewDocument.customerSignBase64);
1633
- setSignatureBase64(previewDocument.signatureBase64);
1634
- }
1635
- }, [previewDocument]);
1601
+ documentDefinitions = _ref.documentDefinitions,
1602
+ _ref$lang = _ref.lang,
1603
+ lang = _ref$lang === void 0 ? {} : _ref$lang;
1604
+ var company = previewDocument.company;
1605
+ var document = previewDocument.document;
1606
+ var logoBase64 = previewDocument.logoBase64;
1607
+ var attachments = previewDocument.attachments;
1608
+ var customerSignBase64 = previewDocument.customerSignBase64;
1609
+ var signatureBase64 = previewDocument.signatureBase64;
1636
1610
 
1637
1611
  if (!company || !document || !document.customer || !document.items) {
1638
1612
  return false;
@@ -1776,6 +1750,9 @@ var PreviewDocument = function PreviewDocument(_ref) {
1776
1750
  href: "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css",
1777
1751
  integrity: "sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh",
1778
1752
  crossOrigin: "anonymous"
1753
+ }), /*#__PURE__*/React.createElement("link", {
1754
+ href: "https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css",
1755
+ rel: "stylesheet"
1779
1756
  }), /*#__PURE__*/React.createElement("div", {
1780
1757
  className: "print invoice-preview"
1781
1758
  }, /*#__PURE__*/React.createElement("div", {
@@ -2019,5 +1996,755 @@ var PreviewDocument = function PreviewDocument(_ref) {
2019
1996
  }))), lang.empowered_by));
2020
1997
  };
2021
1998
 
2022
- export { PreviewDocument as Invoice };
1999
+ function _extends() {
2000
+ _extends = Object.assign || function (target) {
2001
+ for (var i = 1; i < arguments.length; i++) {
2002
+ var source = arguments[i];
2003
+
2004
+ for (var key in source) {
2005
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
2006
+ target[key] = source[key];
2007
+ }
2008
+ }
2009
+ }
2010
+
2011
+ return target;
2012
+ };
2013
+
2014
+ return _extends.apply(this, arguments);
2015
+ }
2016
+
2017
+ function _unsupportedIterableToArray(o, minLen) {
2018
+ if (!o) return;
2019
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
2020
+ var n = Object.prototype.toString.call(o).slice(8, -1);
2021
+ if (n === "Object" && o.constructor) n = o.constructor.name;
2022
+ if (n === "Map" || n === "Set") return Array.from(o);
2023
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
2024
+ }
2025
+
2026
+ function _arrayLikeToArray(arr, len) {
2027
+ if (len == null || len > arr.length) len = arr.length;
2028
+
2029
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
2030
+
2031
+ return arr2;
2032
+ }
2033
+
2034
+ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
2035
+ var it;
2036
+
2037
+ if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
2038
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
2039
+ if (it) o = it;
2040
+ var i = 0;
2041
+ return function () {
2042
+ if (i >= o.length) return {
2043
+ done: true
2044
+ };
2045
+ return {
2046
+ done: false,
2047
+ value: o[i++]
2048
+ };
2049
+ };
2050
+ }
2051
+
2052
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2053
+ }
2054
+
2055
+ it = o[Symbol.iterator]();
2056
+ return it.next.bind(it);
2057
+ }
2058
+
2059
+ var invoiceHtml = (function (_ref) {
2060
+ var invoice = _ref.invoice,
2061
+ lang = _ref.lang,
2062
+ referral = _ref.referral,
2063
+ _ref$companyLogoBase = _ref.companyLogoBase,
2064
+ companyLogoBase = _ref$companyLogoBase === void 0 ? 'https://s3.amazonaws.com/bookipi/' : _ref$companyLogoBase;
2065
+ var company = invoice.company;
2066
+ var document = invoice.document;
2067
+ var logoBase64 = invoice.logoBase64;
2068
+ var attachments = invoice.attachments || [];
2069
+ var customerSignBase64 = invoice.customerSignBase64;
2070
+ var signatureBase64 = invoice.signatureBase64;
2071
+ var logoPath = invoice.logoPath || company.logoExists && "" + companyLogoBase + company._id + "/logo.jpg?" + new Date().getTime();
2072
+ var documentName = null;
2073
+
2074
+ if (company.doc && company.doc[document.ty] && company.doc[document.ty].n) {
2075
+ documentName = company.doc[document.ty].n;
2076
+ } else {
2077
+ if (document.ty === 1) {
2078
+ documentName = company.r_inv ? company.r_inv : lang['document'];
2079
+ } else if (document.ty === 2) {
2080
+ documentName = company.r_crd ? company.r_crd : lang['creditnote'];
2081
+ } else {
2082
+ documentName = company.r_est ? company.r_est : lang['Estimate'];
2083
+ }
2084
+ }
2085
+
2086
+ var logoContainer = null;
2087
+
2088
+ if (logoPath) {
2089
+ logoContainer = "<img src=\"" + logoPath + "\" id=\"invoice-logo\" class=\"img-fluid\" style=\"padding-top: 10px;width: " + (company.ls ? company.ls * 1.8 + 'px' : '250px') + ";height:auto;\">";
2090
+ } else if (logoBase64) {
2091
+ logoContainer = "<img\n src=\"" + logoBase64 + "\"\n id='invoice-logo'\n className='img-fluid'\n style=\"width:" + (company.ls * 2 || 200) + "px, height: 'auto'\"\n />";
2092
+ } else {
2093
+ logoContainer = " <h1>" + company.c + " </h1>";
2094
+ }
2095
+
2096
+ console.log(company);
2097
+ console.log(document);
2098
+ var timeZone = company.tz;
2099
+
2100
+ var formatDate = function formatDate(date) {
2101
+ var d = moment(date);
2102
+
2103
+ if (timeZone) {
2104
+ d = d.tz(timeZone);
2105
+ }
2106
+
2107
+ return d.format(company.df === 0 ? 'D MMM YYYY' : company.df === 1 ? 'DD/MM/YYYY' : company.df === 3 ? 'MM/D/YYYY' : company.df === 4 ? 'YYYY/MM/DD' : 'MMM D, YYYY');
2108
+ };
2109
+
2110
+ var companyAddress = {
2111
+ address1: company && (company.address && company.address.address1 || company.address1) || null,
2112
+ address2: company && (company.address && company.address.address2 || company.address2) || null,
2113
+ address3: company && (company.address && company.address.address3 || company.address3) || null,
2114
+ city: company && company.address && company.address.city || null,
2115
+ state: company && company.address && company.address.state || null,
2116
+ zip: company && company.address && company.address.zip || null,
2117
+ country: company && company.address && company.address.country || null
2118
+ };
2119
+ var customer = document.cu;
2120
+ console.log("customer");
2121
+ console.log(customer);
2122
+ console.log("company");
2123
+ console.log(company);
2124
+ var customerAddress = customer.address || {};
2125
+ var customerShippingAddress = customer.shippingAddress || {};
2126
+ var shippingAddressExists = customerShippingAddress.address1 || customerShippingAddress.address2 || customerShippingAddress.address3 || customerShippingAddress.city || customerShippingAddress.state || customerShippingAddress.zip || document.asi;
2127
+ var taxPercent1 = document.tp ? parseFloat(document.tp) : 0;
2128
+ var taxPercent2 = document.tp2 ? parseFloat(document.tp2) : 0;
2129
+ var discountOnItem = false;
2130
+
2131
+ for (var _iterator = _createForOfIteratorHelperLoose(document.it), _step; !(_step = _iterator()).done;) {
2132
+ var item = _step.value;
2133
+
2134
+ if (item.dc && item.dc > 0) {
2135
+ discountOnItem = true;
2136
+ }
2137
+
2138
+ if (taxPercent1 > 0 && item.tx) {
2139
+ if (document.ti && !document.t1d) {
2140
+ var totalTaxRate = void 0;
2141
+
2142
+ if (document.ttx && !document.t2d) {
2143
+ totalTaxRate = taxPercent1 + taxPercent2;
2144
+ } else {
2145
+ totalTaxRate = taxPercent1;
2146
+ }
2147
+
2148
+ item.taxAmount1 = item.t * (1 - 1 / (1 + totalTaxRate / 100)) * (taxPercent1 / totalTaxRate);
2149
+ } else {
2150
+ item.taxAmount1 = item.t * taxPercent1 / 100;
2151
+ }
2152
+ }
2153
+
2154
+ if (document.ttx && taxPercent2 > 0 && item.tx2) {
2155
+ if (document.ti && !document.t2d) {
2156
+ var _totalTaxRate = taxPercent1 + taxPercent2;
2157
+
2158
+ item.taxAmount2 = item.t * (1 - 1 / (1 + _totalTaxRate / 100)) * (taxPercent2 / _totalTaxRate);
2159
+ } else {
2160
+ item.taxAmount2 = item.t * taxPercent2 / 100;
2161
+ }
2162
+ }
2163
+ }
2164
+
2165
+ var itemsContainer = '';
2166
+
2167
+ for (var _iterator2 = _createForOfIteratorHelperLoose(document.it), _step2; !(_step2 = _iterator2()).done;) {
2168
+ var _item = _step2.value;
2169
+ itemsContainer = itemsContainer + ("<tr>\n <td>\n <span class=\"text-inverse\"><strong>" + (_item.n || "") + "</strong></span>\n <div><small>" + (nl2br(_item.dsc) || "") + "</small></div>\n <div class=\"d-block d-sm-none mt-1\">\n " + ((_item.p || _item.p == 0) && (_item.q || _item.q == 0) ? FormatCurrency(_item.p, company.cr, company.la, company.cf) + " \u2715 " + _item.q : '') + "\n " + (discountOnItem && (_item.p || _item.p == 0) && _item.dc ? (_item.dc > 0 ? " - " : " + ") + FormatCurrency(Math.abs(_item.dc), company.cr, company.la, company.cf) : "") + "\n </div>\n</td>\n<td class=\"text-center d-none d-sm-table-cell\">" + ((_item.p || _item.p == 0) && (_item.q || _item.q == 0) ? _item.q : "") + "</td>\n<td class=\"text-right d-none d-sm-table-cell\">\n" + (_item.p || _item.p == 0 ? FormatCurrency(_item.p, company.cr, company.la, company.cf) : "") + "\n</td>\n" + (discountOnItem ? "<td class=\"text-right\">" + ((_item.p || _item.p == 0) && _item.dc ? FormatCurrency(_item.dc, company.cr, company.la, company.cf) : "") + "</td>" : '') + "\n<td class=\"text-right\">" + (_item.p || _item.p == 0 ? FormatCurrency(_item.t, company.cr, company.la, company.cf) : "") + "</td>\n</tr>");
2170
+ }
2171
+
2172
+ var taxName1;
2173
+ var taxIncluded1;
2174
+ var taxName2;
2175
+ var taxIncluded2;
2176
+
2177
+ if (document.tx != 0) {
2178
+ taxName1 = document.tn ? document.tn : 'Tax';
2179
+ taxIncluded1 = document.ti ? ' ' + (company.r_ic ? company.r_ic : lang["included"]) : ' ';
2180
+ }
2181
+
2182
+ if (document.ttx && document.tx2 != 0) {
2183
+ taxName2 = document.tn2 ? document.tn2 : 'Tax 2';
2184
+ taxIncluded2 = document.ti ? ' ' + (company.r_ic ? company.r_ic : lang["included"]) : ' ';
2185
+ }
2186
+
2187
+ function payment_on(date, brand, endNumber) {
2188
+ if (brand && endNumber) {
2189
+ return 'Paid on ' + date + ' using ' + brand + ' ending in ' + endNumber;
2190
+ } else if (brand && !endNumber) {
2191
+ return 'Paid on ' + date + ' using ' + brand;
2192
+ } else {
2193
+ return 'Paid on ' + date;
2194
+ }
2195
+ }
2196
+
2197
+ var paymentContainer = '';
2198
+
2199
+ for (var _iterator3 = _createForOfIteratorHelperLoose(document.pm), _step3; !(_step3 = _iterator3()).done;) {
2200
+ var payment = _step3.value;
2201
+ paymentContainer = paymentContainer + ("<tr>\n <td class=\"d-none d-sm-table-cell\"></td>\n <td class=\"text-md-right\" width=\"25%\">" + (lang.payment_on ? lang.payment_on(formatDate(payment.d), payment.b) : payment_on(formatDate(payment.d), payment.b)) + "</td>\n <td class=\"text-right\" width=\"25%\">" + FormatCurrency(payment.a, company.cr, company.la, company.cf) + "</td>\n </tr>");
2202
+ }
2203
+
2204
+ var paymentOn = company.pi && document.ty === 1 && (company.p1 || company.p2 || company.p3);
2205
+ var attachmentContainer = '';
2206
+
2207
+ for (var i = 0; i < attachments.length; i++) {
2208
+ attachmentContainer = attachmentContainer + ("<div class=\"mt-5\">\n <img src=\"" + attachments[i].imageUrl + "\" style=\"max-width:100%\"/>\n <div><strong>" + attachments[i].t + "</strong></div>\n <div>" + attachments[i].d + "</div>\n </div>");
2209
+ }
2210
+
2211
+ var signatureContainer = document.signDate && "\n <div className=\"col-6\" style={textAlign:'center'}>\n <strong>{document.customerSignature || customerSignBase64 ? company.name : ''}</strong>\n <div style={{height:'130px',borderBottom:'2px solid #dee2e6', marginRight:'40px', marginLeft:'40px'}}>\n { signatureBase64 && <img src=" + signatureBase64 + " style={{width:'220px',marginTop:'20px'}} />}\n </div>\n <div>{document.signDate && formatDate(document.signDate) }</div>\n </div>" || '';
2212
+ var clientSignature = (document.customer || customerSignBase64) && "\n <div className=\"col-6\" style={{textAlign: 'center'}}>\n <strong>{customer.companyName}</strong>\n <div style={{height:'130px',borderBottom:'2px solid #dee2e6', marginRight:'40px', marginLeft:'40px'}}>\n { customerSignBase64 && <img src=" + customerSignBase64 + " style={{width:'220px',marginTop:'20px'}} />}\n </div>\n <div>{customerSignBase64 ? formatDate(new Date()) : '( &nbsp;&nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp/ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp)'}</div>\n </div>" || '';
2213
+ return "\n<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"utf-8\">\n <title>Invoice</title>\n <link rel=\"stylesheet\" href=\"https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css\" integrity=\"sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh\" crossorigin=\"anonymous\">\n <link href=\"https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css\" rel=\"stylesheet\">\n </head>\n <style>\n body {\n font-size: 18px;\n }\n .invoice-body {\n background: #fff;\n padding: 50px\n }\n\n .invoice-company {\n font-size: 20px\n }\n\n .invoice-header {\n /* margin: 0 -50px; */\n background: #f0f3f4;\n padding: 30px 50px;\n }\n .invoice-content {\n padding: 38px;\n }\n .invoice-date,\n .invoice-from,\n .invoice-to {\n /* display: table-cell; */\n /* width: 1% */\n }\n\n .invoice-from,\n .invoice-to {\n padding-right: 20px\n }\n\n .invoice-date .date,\n .invoice-from strong,\n .invoice-to strong {\n font-size: 18px;\n font-weight: 600\n }\n\n .invoice-date {\n /* text-align: right; */\n padding-left: 20px\n }\n\n .invoice-price {\n /* background: #f0f3f4; */\n display: table;\n width: 100%\n }\n\n .invoice-price .invoice-price-left,\n .invoice-price .invoice-price-right {\n display: table-cell;\n padding: 28px 12px 16px;\n font-size: 20px;\n font-weight: 600;\n width: 70%;\n position: relative;\n vertical-align: middle\n }\n\n .invoice-price .invoice-price-left .sub-price {\n display: table-cell;\n vertical-align: middle;\n padding: 0 20px\n }\n\n .invoice-price small {\n font-size: 18px;\n font-weight: 400;\n display: block\n }\n\n .invoice-price .invoice-price-row {\n display: table;\n float: left\n }\n\n .invoice-price .invoice-price-right {\n width: 30%;\n background: #2d353c;\n color: #fff;\n font-size: 28px;\n text-align: right;\n vertical-align: bottom;\n font-weight: 300;\n right: 38px;\n }\n\n .invoice-price .invoice-price-right small {\n display: block;\n opacity: .7;\n position: absolute;\n top: 10px;\n left: 12px;\n font-size: 18px\n }\n\n .invoice-footer {\n border-top: 1px solid #ddd;\n padding-top: 10px;\n font-size: 18px\n }\n\n .invoice-note {\n color: #999;\n margin-top: 80px;\n font-size: 85%\n }\n\n .invoice-body > div:not(.invoice-footer) {\n margin-bottom: 20px\n }\n\n .btn.btn-white, .btn.btn-white.disabled, .btn.btn-white.disabled:focus, .btn.btn-white.disabled:hover, .btn.btn-white[disabled], .btn.btn-white[disabled]:focus, .btn.btn-white[disabled]:hover {\n color: #2d353c;\n background: #fff;\n border-color: #d9dfe3;\n }\n .table-inline-block{\n display: inline-block;\n }\n\n @media print {\n body, page {\n /* width: 21cm; */\n /* margin: 0; */\n box-shadow: 0;\n background-color: #fff\n }\n /* .invoice-body {\n padding:10;\n } */\n #invoice {\n width:100%\n }\n\n .invoice-price .invoice-price-right {\n background: #f0f3f4;\n color: black;\n border: 2px solid #f0f3f4;\n }\n }\n\n @media only screen {\n #invoice {\n margin-top:10px;\n max-width:28cm;\n zoom: 0.8;\n box-shadow: 0 0 0.5cm rgba(0,0,0,0.2);\n margin-right:auto;margin-left:auto;\n background: white;\n }\n }\n\n @media (min-width: 767.99px) {\n .invoice-detail-right {\n max-width: 200px;\n }\n }\n @media (max-width: 767.98px) {\n .invoice-body {\n padding: 30px\n }\n .invoice-header {\n padding: 20px 30px;\n }\n .invoice-content {\n padding: 18px;\n }\n .invoice-price .invoice-price-right {\n right: 18px;\n }\n #invoice-logo {\n padding-top:0;\n max-width: 250px;\n text-align: center;\n margin-right:auto;\n margin-left:auto;\n display: block;\n }\n .invoice-date {\n margin-top:10px;\n border-top: 1px solid #dee2e6;\n }\n }\n\n .table-small td{\n padding: 8px 12px\n }\n .table-invoice-header{\n background: #f0f3f4\n }\n h1,h2,h3,h4 {margin-top:15px}\n h1 {font-size:27px}\n h2 {font-size:22px}\n </style>\n <body>\n <div id=\"invoice\" class=\"print\">\n <div class=\"invoice-body\">\n <!-- begin invoice-company -->\n <div class=\"row\">\n <div class=\"col-sm-12 col-md-6 mb-3 mb-md-0\">\n " + logoContainer + "\n </div>\n <div class=\"col-sm-12 col-md-6 text-md-right\">\n <h1>" + documentName + "</h1>\n <div class=\"text-inverse mb-1\" style=\"font-size: 20px;\">\n <strong>" + company.c + "</strong>\n </div>\n <address class=\"m-t-5 m-b-5\">\n <div class=\"mb-2\">\n " + (companyAddress.address1 ? "<div>" + companyAddress.address1 + "</div>" : "") + "\n " + (companyAddress.address2 ? "<div>" + companyAddress.address2 + "</div>" : "") + "\n " + (companyAddress.address3 ? "<div>" + companyAddress.address3 + "</div>" : "") + "\n " + (companyAddress.city || companyAddress.state || companyAddress.zip ? "<div>" + ((companyAddress.city ? companyAddress.city + " " : "") + (companyAddress.state ? companyAddress.state + " " : "") + (companyAddress.zip ? companyAddress.zip + " " : "")) + "</div>" : "") + "\n " + (companyAddress.country ? "<div>" + companyAddress.country + "</div>" : "") + "\n </div>\n " + (company.ai ? "<div>" + company.ai + "</div>" : "") + "\n " + (company.ph ? "<div>" + company.ph + "</div>" : "") + "\n " + (company.de ? "<div>" + company.de + "</div>" : "") + "\n " + (company.tfn ? "<div>" + ((company.bn ? company.bn : "Tax no.") + " : " + company.tfn) + "</div>" : "") + "\n </address>\n </div>\n </div>\n </div>\n <!-- end invoice-company -->\n <!-- begin invoice-header -->\n <div class=\"invoice-header\">\n <div class=\"row\">\n <div class=\"invoice-to col-sm-12 col-md-6\">\n <strong>" + (company.r_bt ? company.r_bt : lang["bill_to"]) + "</strong>\n <div class=\"text-inverse mb-1\">\n <small style=\"font-size: 18px;\">" + document.cu.c + "</small>\n </div>\n <address class=\"m-t-5 m-b-5\">\n " + (customerAddress.address1 ? "<div>" + customerAddress.address1 + "</div>" : "") + "\n " + (customerAddress.address2 ? "<div>" + customerAddress.address2 + "</div>" : "") + "\n " + (customerAddress.address3 ? "<div>" + customerAddress.address3 + "</div>" : "") + "\n " + (customerAddress.city || customerAddress.state || customerAddress.zip ? "<div>" + ((customerAddress.city ? customerAddress.city + " " : "") + (customerAddress.state ? customerAddress.state + " " : "") + (customerAddress.zip ? customerAddress.zip + " " : "")) + "</div>" : "") + "\n " + (customerAddress.country ? "<div>" + customerAddress.country + "</div>" : "") + "\n " + (document.cu.tfn ? "<div>" + (document.cu.tfn ? (company.bn || "Tax no.") + " : " + document.cu.tfn : "") + "</div>" : "") + "\n " + (document.cu.ph ? "<div>" + document.cu.ph + "</div>" : "") + "\n </address>\n\n " + (shippingAddressExists ? "<strong stryle=\"margin-top:10px\">" + (company.r_st ? company.r_st : lang.ship_to) + "</strong>" : "") + "\n " + (shippingAddressExists ? "\n <address class=\"m-t-5 m-b-5\">\n " + (customerShippingAddress.address1 ? "<div>" + customerShippingAddress.address1 + "</div>" : "") + "\n " + (customerShippingAddress.address2 ? "<div>" + customerShippingAddress.address2 + "</div>" : "") + "\n " + (customerShippingAddress.address3 ? "<div>" + customerShippingAddress.address3 + "</div>" : "") + "\n " + (customerShippingAddress.city || customerShippingAddress.state || customerShippingAddress.zip ? "<div>" + ((customerShippingAddress.city ? customerShippingAddress.city + " " : "") + (customerShippingAddress.state ? customerShippingAddress.state + " " : "") + (customerShippingAddress.zip ? customerShippingAddress.zip + " " : "")) + "</div>" : "") + "\n " + (customerShippingAddress.country ? "<div>" + customerShippingAddress.country + "</div>" : "") + "\n " + (document.asi ? "<div>" + document.asi + "</div>" : "") + "\n </address>\n " : "") + "\n </div>\n\n <div class=\"invoice-date col-sm-12 col-md-6\">\n <small>&nbsp;</small>\n <div class=\"row text-md-right\">\n <div class=\"col\">\n <strong>" + documentName + " #</strong>\n </div>\n <div class=\"col invoice-detail-right\">" + (document.no ? document.no : "") + "</div>\n </div>\n <div class=\"row text-md-right\">\n <div class=\"col\">\n <strong>" + (company.r_d ? company.r_d : lang["date"]) + "</strong>\n </div>\n <div class=\"col invoice-detail-right\">" + formatDate(document.d) + "</div>\n </div>\n " + (document.ty == 1 && !document.rd ? "<div class=\"row text-md-right\">\n <div class=\"col\">\n <strong>" + (company.r_dd ? company.r_dd : lang["due_date"]) + "</strong>\n </div>\n <div class=\"col invoice-detail-right\">\n " + (document.dd ? formatDate(document.dd) : formatDate(new Date(document.d).setDate(new Date(document.d).getDate() + parseInt(document.di)))) + "\n </div>\n </div>" : '') + "\n " + (document.pon ? "<div class=\"row text-md-right\">\n <div class=\"col\">\n <strong>" + (company.r_po ? company.r_po : lang['po_number']) + "</strong>\n </div>\n <div class=\"col invoice-detail-right\">" + document.pon + "</div>\n </div>\n " : '') + "\n </div>\n </div>\n </div>\n <!-- end invoice-header -->\n <!-- begin invoice-content -->\n <div class=\"invoice-content\">\n <div class=\"table-responsive\">\n <table class=\"table table-invoice\">\n <thead>\n <tr class=\"table table-invoice\">\n <th class=\"text-left\">" + (company.r_it ? company.r_it : lang['item']) + "</th>\n <th class=\"text-center d-none d-sm-table-cell\" width=\"15%\">" + (document.um ? document.um : company.r_q ? company.r_q : lang['quantity']) + "</th>\n <th class=\"text-right d-none d-sm-table-cell\" width=\"15%\">" + (company.r_p ? company.r_p : lang['price']) + "</th>\n " + (discountOnItem ? "<th class=\"text-right\" width=\"15%\">" + (company.r_dc ? company.r_dc : lang['discount']) + "</th>" : '') + "\n <th class=\"text-right\" width=\"15%\">" + (company.r_a ? company.r_a : lang['amount']) + "</th>\n </tr>\n </thead>\n <tbody>\n " + itemsContainer + "\n </tbody>\n </table>\n </div>\n \n <hr>\n <div class=\"row\">\n <div class=\"col-12\">\n <table class=\"table table-borderless table-small\">\n <tbody>\n <tr>\n <td class=\"d-none d-sm-table-cell\"></td>\n <td class=\"text-md-right\" width=\"25%\">" + (company.r_sb ? company.r_sb : lang["subtotal"]) + "</td>\n <td class=\"text-right\" width=\"25%\">" + FormatCurrency(document.st, company.cr, company.la, company.cf) + "</td>\n </tr>\n " + (document.dc ? " <tr>\n <td class=\"d-none d-sm-table-cell\"></td>\n <td class=\"text-md-right\" width=\"25%\">" + ((company.r_dc ? company.r_dc : lang["discount"]) + (document.dcpo && document.dcp ? " (" + document.dcp + "%)" : "")) + "</td>\n <td class=\"text-right\" width=\"25%\">" + ("(" + FormatCurrency(document.dc, company.cr, company.la, company.cf) + ")") + "</td>\n </tr>" : '') + "\n " + (document.sp && !document.sntx ? "<tr>\n <td class=\"d-none d-sm-table-cell\"></td>\n <td class=\"text-md-right\" width=\"25%\">" + (company.r_sp ? company.r_sp : lang["shipping"]) + "</td>\n <td class=\"text-right\" width=\"25%\">" + FormatCurrency(document.sp, company.cr, company.la, company.cf) + "</td>\n </tr>" : '') + "\n " + (document.tx != 0 ? "<tr>\n <td class=\"d-none d-sm-table-cell\"></td>\n <td class=\"text-md-right\" width=\"25%\">" + (taxName1 + taxIncluded1 + "(" + document.tp + "%)") + "</td>\n <td class=\"text-right\" width=\"25%\">" + ((document.t1d ? "(" : "") + FormatCurrency(document.tx, company.cr, company.la, company.cf) + (document.t1d ? ")" : "")) + "</td>\n </tr>" : '') + "\n " + (document.ttx && document.tx2 != 0 ? "<tr>\n <td class=\"d-none d-sm-table-cell\"></td>\n <td class=\"text-md-right\" width=\"25%\">" + (taxName2 + taxIncluded2 + "(" + document.tp2 + "%)") + "</td>\n <td class=\"text-right\" width=\"25%\">" + ((document.t2d ? "(" : "") + FormatCurrency(document.tx2, company.cr, company.la, company.cf) + (document.t2d ? ")" : "")) + "</td>\n </tr>" : '') + "\n " + (document.sp && document.sntx ? " <tr>\n <td class=\"d-none d-sm-table-cell\"></td>\n <td class=\"text-md-right\" width=\"25%\">" + (company.r_sp ? company.r_sp : lang["shipping"]) + "</td>\n <td class=\"text-right\" width=\"25%\">" + FormatCurrency(document.sp, company.cr, company.la, company.cf) + "</td>\n </tr>" : '') + "\n " + (document.ti ? " <tr>\n <td class=\"d-none d-sm-table-cell\"></td>\n <td class=\"text-md-right\" width=\"25%\" style=\"border-top: 1px solid #ddd\">" + (company.r_n ? company.r_n : lang["net"]) + "</td>\n <td class=\"text-right\" width=\"25%\" style=\"border-top: 1px solid #ddd\">" + FormatCurrency(document.tt - (document.tx || 0) - (document.tx2 || 0), company.cr, company.la, company.cd) + "</td>\n </tr>" : '') + "\n " + (document.ty == 1 || document.ty !== 1 && (document.t1d || document.ttx && document.tx2 > 0 && document.t2d) ? "<tr>\n <td class=\"d-none d-sm-table-cell\"></td>\n <td class=\"text-md-right\" width=\"25%\" style=\"border-bottom: 1px solid #ddd\">" + (company.r_tt ? company.r_tt : lang["total"]) + "</td>\n <td class=\"text-right\" width=\"25%\" style=\"border-bottom: 1px solid #ddd\">" + FormatCurrency(document.tt ? document.tt : 0, company.cr, company.la, company.cf) + "</td>\n </tr>" : '') + "\n " + (document.sca ? "<tr>\n <td class=\"d-none d-sm-table-cell\"></td>\n <td class=\"text-md-right\" width=\"25%\">" + lang["credit_card_surcharge"] + "</td>\n <td class=\"text-right\" width=\"25%\">" + FormatCurrency(document.sca, company.cr, company.la, company.cf) + "</td>\n </tr>" : '') + "\n " + (document.ty == 1 && document.pma && document.pm ? paymentContainer : '') + "\n </tbody>\n </table>\n </div>\n </div>\n </div>\n <!-- end invoice-content -->\n\n <!-- begin invoice price -->\n <div class=\"invoice-price\">\n <div class=\"invoice-price-left\">\n <div class=\"invoice-price-row\"></div>\n </div>\n <div class=\"invoice-price-right\">\n <small>" + (document.ty == 1 ? company.r_ad ? company.r_ad : lang["amount_due"] : company.r_gt ? company.r_gt : lang["grand_total"]) + "</small>\n <span class=\"f-w-600\">" + FormatCurrency(document.ad, company.cr, company.la, company.cf) + "</span>\n </div>\n </div>\n <!-- end invoice price -->\n\n <div class=\"invoice-body\">\n <!-- begin payment-instruction -->\n " + (paymentOn ? "<h2>" + (company.r_pi ? company.r_pi : lang['payment_instruction']) + "</h2>" : "") + "\n " + (paymentOn && company.p1 ? company.p1 + "<br>" : "") + "\n " + (paymentOn && company.p2 ? company.p2 + "<br>" : "") + "\n " + (paymentOn && company.p3 ? company.p3 + "<br>" : "") + "\n <!-- end payment-instruction -->\n\n <!-- begin invoice-note -->\n " + (document.noteHtml ? "<div class=\"mt-4\">\n " + document.noteHtml + "\n </div>" : document.nt ? "<div class=\"mt-4\">\n <h2>" + (company.r_nt ? company.r_nt : lang["note"]) + "</h2>\n " + nl2br(document.nt) + "\n </div>" : document.tc ? "<div class=\"mt-4\">\n <h2>" + (company.r_tc ? company.r_tc : lang["terms"]) + "</h2>\n " + nl2br(document.tc) + "\n </div>" : '') + "\n <!-- end invoice-note -->\n " + signatureContainer + "\n " + clientSignature + "\n \n <!--- begin company signature -->\n <!-- begin invoice-signature -->\n " + (document.sd || document.cs || customerSignBase64 ? "<hr class=\"mt-5\">\n <div>" + (company.r_bs || lang['by_signing'] || "") + "</div>\n <div class=\"row mt-4\">\n " + (signatureContainer || clientSignature || "") + "\n " + (signatureContainer && clientSignature || "") + "\n </div>" : '') + "\n <!-- end invoice-signature-->\n\n <!-- begin invoice attachments -->\n\n " + (attachments && attachments.length > 0 ? "<div style=\"text-align: center\">\n " + attachmentContainer + "\n </div>" : '') + "\n <!-- end invoice attachment -->\n </div>\n </body>\n\n " + (referral ? "<div style=\"text-align:center;color:rgb(108, 108, 108);font-size:16px;padding:10px\">\n <div style=\"font-size:14px;padding:10px\">{lang[\"try_bookipi\"]}</div>\n <div style=\"text-align:center;font-size:12px\">\n <a href=\"" + referral + "\"><img src=\"https://s3.amazonaws.com/bookipi.com/img/appstore-btn-130.png\"/></a>\n <a href=\"" + referral + "\"><img src=\"https://s3.amazonaws.com/bookipi.com/img/googleplay-btn-130.png\"/></a>\n </div>\n </div>" : '') + "\n</html>\n";
2214
+ });
2215
+
2216
+ var docTypeMapping = new Map([[0, 'estimate'], [1, 'invoice'], [2, 'credit_note'], [3, 'delivery_note'], [4, 'purchase_order'], ['estimate', 0], ['invoice', 1], ['credit_note', 2], ['delivery_note', 3], ['purchase_order', 4]]);
2217
+
2218
+ var ItemCompat = function ItemCompat(item) {
2219
+ var mapping = new Map([['name', 'n'], ['description', 'dsc'], ['price', 'p'], ['quantity', 'q'], ['tax', 'tx'], ['tax2', 'tx2'], ['discount', 'dc'], ['total', 't']]);
2220
+ return Object.fromEntries(Object.entries(item).map(function (_ref) {
2221
+ var k = _ref[0],
2222
+ v = _ref[1];
2223
+ return [mapping.get(k) || k, v];
2224
+ }));
2225
+ };
2226
+
2227
+ var PaymentCompat = function PaymentCompat(payment) {
2228
+ var mapping = new Map([['amount', 'a'], ['date', 'd'], ['chargeId', 'cid'], ['surchargeRate', 'sr'], ['last4', 'l'], ['brand', 'b']]);
2229
+ return Object.fromEntries(Object.entries(payment).map(function (_ref2) {
2230
+ var k = _ref2[0],
2231
+ v = _ref2[1];
2232
+ return [mapping.get(k) || k, v];
2233
+ }));
2234
+ };
2235
+
2236
+ var CustomerCompat = function CustomerCompat(customer) {
2237
+ var mapping = new Map([['companyName', 'c'], ['firstName', 'f'], ['lastName', 'l'], ['email', 'e'], ['additionalInfo', 'ai'], ['address1', 'a1'], ['address2', 'a2'], ['address3', 'a3'], ['shippingAddress1', 'sa1'], ['shippingAddress2', 'sa2'], ['shippingAddress3', 'sa3'], ['mobile', 'mb'], ['phone', 'ph'], ['TFN', 'tfn'], ['trashed', 'tr'], ['trashedDate', 'trd'], ['company', 'ui'], ['fax', 'fax']]);
2238
+ return Object.fromEntries(Object.entries(customer).map(function (_ref3) {
2239
+ var k = _ref3[0],
2240
+ v = _ref3[1];
2241
+ return [mapping.get(k) || k, v];
2242
+ }));
2243
+ };
2244
+
2245
+ var InvoiceCompat = function InvoiceCompat(doc) {
2246
+ var mapping = new Map([['address1', 'a1'], ['address2', 'a2'], ['address3', 'a3'], ['customer', ['cu', CustomerCompat]], ['items', ['it', ItemCompat]], ['taxInclusive', 'ti'], ['taxPercentage', 'tp'], ['taxDeductible', 't1d'], ['taxInclusive', 'ti'], ['taxName', 'tn'], ['twoTaxes', 'ttx'], ['taxName2', 'tn2'], ['taxPercentage2', 'tp2'], ['taxDeductible2', 't2d'], ['taxAmount', 'tx'], ['tax2', 'tx2'], ['taxDeductibleInc2', 't2di'], ['shippingCost', 'sp'], ['shippingNonTax', 'sntx'], ['total', 'tt'], ['subTotal', 'st'], ['amountDue', 'ad'], ['discount', 'dc'], ['discountOption', 'dco'], ['discountPercentage', 'dcp'], ['discountPercentageOption', 'dcpo'], ['payments', ['pm', PaymentCompat]], ['timeZone', 'tz'], ['type', 'ty'], ['date', 'd'], ['dueDate', 'dd'], ['dueIn', 'di'], ['removeDueDate', 'rd'], ['purchaseOrderNumber', 'pon'], ['note', 'nt']]);
2247
+ return Object.fromEntries(Object.entries(doc).map(function (_ref4) {
2248
+ var k = _ref4[0],
2249
+ v = _ref4[1];
2250
+ var mapV = mapping.get(k);
2251
+
2252
+ if (!mapV) {
2253
+ return [k, v];
2254
+ } else if (!Array.isArray(mapV)) {
2255
+ return [mapV || k, v];
2256
+ } else {
2257
+ if (Array.isArray(v)) {
2258
+ return [mapV[0] || k, v.map(function (val) {
2259
+ return mapV[1](val);
2260
+ })];
2261
+ } else {
2262
+ return [mapV[0] || k, mapV[1](v)];
2263
+ }
2264
+ }
2265
+ }));
2266
+ };
2267
+
2268
+ var TemplateCompat = function TemplateCompat(template) {
2269
+ console.log('template');
2270
+ console.log(template);
2271
+ var mapping = new Map([['billTo', 'r_bt'], ['shipTo', 'r_st'], ['item', 'r_it'], ['quantity', 'r_q'], ['price', 'r_p'], ['amount', 'r_a'], ['date', 'r_d'], ['dueDate', 'r_dd'], ['postCode', 'r_po'], ['shipping', 'r_sp'], ['included', 'r_ic'], ['subtotal', 'r_sb'], ['net', 'r_n'], ['total', 'r_tt'], ['amountDue', 'r_ad'], ['grandTotal', 'r_gt'], ['payInt', 'r_pi'], ['note', 'r_nt'], ['Tos', 'r_tc'], ['bySigning', 'r_bs']]);
2272
+ return Object.fromEntries(Object.entries(template).map(function (_ref5) {
2273
+ var k = _ref5[0],
2274
+ v = _ref5[1];
2275
+ return [mapping.get(k) || k, v];
2276
+ }));
2277
+ };
2278
+
2279
+ var CompanyCompat = function CompanyCompat(doc) {
2280
+ console.log('company');
2281
+ console.log(doc);
2282
+ var mapping = new Map([['dateFormat', 'df'], ['timeZone', 'tz'], ['language', 'la'], ['TFN', 'tfn'], ['paymentInstruction1', 'p1'], ['paymentInstruction2', 'p2'], ['paymentInstruction3', 'p3'], ['invoiceColor', 'ct'], ['taxPercentage', 'tp'], ['taxDeductible', 't1d'], ['taxInclusive', 'ti'], ['taxName', 'tn'], ['twoTaxes', 'ttx'], ['taxName2', 'tn2'], ['taxPercentage2', 'tp2'], ['taxDeductible2', 't2d'], ['name', 'c'], ['hasPaymentInstruction', 'pi'], ['additionalInfo', 'ai'], ['phoneNumber', 'ph'], ['displayEmail', 'de'], ['email', 'e']]);
2283
+ var rootMapping = new Map([['template', TemplateCompat]]);
2284
+ var newCompany = Object.fromEntries(Object.entries(doc).map(function (_ref6) {
2285
+ var k = _ref6[0],
2286
+ v = _ref6[1];
2287
+ return [mapping.get(k) || k, v];
2288
+ }));
2289
+ var subDoc = {};
2290
+ Object.entries(newCompany).forEach(function (_ref7) {
2291
+ var k = _ref7[0],
2292
+ v = _ref7[1];
2293
+
2294
+ if (rootMapping.get(k)) {
2295
+ var mapped = rootMapping.get(k)(v);
2296
+ delete mapped.__typename;
2297
+ subDoc = _extends({}, subDoc, mapped);
2298
+ }
2299
+ });
2300
+ newCompany = _extends({}, newCompany, subDoc);
2301
+
2302
+ var documentDefinitionCompat = function documentDefinitionCompat(doc) {
2303
+ if (!doc.documentDefinitions) {
2304
+ return {
2305
+ value: []
2306
+ };
2307
+ }
2308
+
2309
+ doc.ms = [];
2310
+ doc.pf = [];
2311
+ doc.tc = [];
2312
+ var ret = doc.documentDefinitions.map(function (def, idx) {
2313
+ var enabled = false;
2314
+
2315
+ if (typeof def.enabled === 'undefined') {
2316
+ if (def.name) {
2317
+ enabled = true;
2318
+ }
2319
+ } else {
2320
+ enabled = def.enabled;
2321
+ }
2322
+
2323
+ var obj = {
2324
+ n: def.name,
2325
+ enabled: enabled,
2326
+ ty: docTypeMapping.get(def.type),
2327
+ note: def.note,
2328
+ docType: def.docType
2329
+ };
2330
+ doc.ms.push(obj.defaultMessage);
2331
+ doc.pf.push(obj.prefix);
2332
+ doc.tc.push(obj.terms);
2333
+ return obj;
2334
+ });
2335
+ return ret;
2336
+ };
2337
+
2338
+ newCompany.documentDefinitions = documentDefinitionCompat(newCompany);
2339
+ return newCompany;
2340
+ };
2341
+
2342
+ var defaultLang = {
2343
+ terms: "Terms and conditions",
2344
+ privacy: "Privacy Policy",
2345
+ firstname: "First Name",
2346
+ lastname: "Last Name",
2347
+ optional: "Optional",
2348
+ whats_name: "What's your name?",
2349
+ username: "USERNAME",
2350
+ already_have_id: "Already have a user ID?",
2351
+ submit: "Submit",
2352
+ password: "Password",
2353
+ company_name_required: "Company name is required.",
2354
+ email_required: "Email address is required.",
2355
+ email_not_valid: "Email address is invalid.",
2356
+ password_required: "Password is required.",
2357
+ password_length_check: "Password must be at least 8 characters.",
2358
+ get_started_with_google: "Get Started with Google",
2359
+ forgot_password: "Forgot Password",
2360
+ signup: "Sign Up",
2361
+ login: "Log In",
2362
+ login_with_google: "Log in with Google",
2363
+ reset_password: "Reset your password",
2364
+ enter_email_to_reset: "Please enter your email address and we'll send you an email to reset your password.",
2365
+ send_email: "Send Email",
2366
+ next: "Next",
2367
+ done: "Done",
2368
+ upload_logo: "Upload your logo",
2369
+ "export": "Export",
2370
+ export_to_csv: "Export data to CSV",
2371
+ time_period: "Time Period",
2372
+ start_date: "Start Date",
2373
+ end_date: "End Date",
2374
+ select_action: "Select Action",
2375
+ more: "More",
2376
+ "new": "New",
2377
+ cancel: "Cancel",
2378
+ save: "Save",
2379
+ menu: "Menu",
2380
+ options: "Options",
2381
+ invoice: "Invoice",
2382
+ estimate: "Estimate",
2383
+ customer: "Customer",
2384
+ settings: "Settings",
2385
+ support: "Support",
2386
+ desktop_app: "MAC/PC App",
2387
+ logout: "Logout",
2388
+ overdue: "Overdue",
2389
+ paid: "Paid",
2390
+ partial: "Partial",
2391
+ unpaid: "Unpaid",
2392
+ sent: "Sent",
2393
+ saved: "Saved",
2394
+ read: "Read",
2395
+ undelivered: "Undelivered",
2396
+ search: "Search",
2397
+ details: "Details",
2398
+ number: "Number",
2399
+ prefix: "Prefix",
2400
+ date: "Date",
2401
+ due_in: "Due in (days)",
2402
+ sameday: "Same day",
2403
+ due_date: "Due date",
2404
+ remove_due_date: "Remove due date",
2405
+ due_on: "Due on",
2406
+ po_number: "PO #",
2407
+ enter_date: "Enter date",
2408
+ add_customer: "Add Customer",
2409
+ item: "Item",
2410
+ add_item: "Add Item",
2411
+ total: "Total",
2412
+ subtotal: "Subtotal",
2413
+ discount: "Discount",
2414
+ amount_due: "Amount Due",
2415
+ grand_total: "Grand Total",
2416
+ sign: "Sign",
2417
+ mysign: "My Signature",
2418
+ clientsign: "Client's Signature",
2419
+ note: "Note",
2420
+ signed_on: "Signed on",
2421
+ leave_with_out_saving: "Are you sure you want to leave without saving?",
2422
+ included: "included",
2423
+ company_name: "Company Name",
2424
+ email: "Email",
2425
+ phone_number: "Phone Number",
2426
+ address: "Address",
2427
+ import_contact: "Import Contact",
2428
+ from_mobile_contacts: "From mobile contacts",
2429
+ from_saved_customers: "From saved customers",
2430
+ "import": "Import",
2431
+ item_name: "Name",
2432
+ price: "Price",
2433
+ quantity: "Quantity",
2434
+ taxable: "Taxable",
2435
+ non_taxable: "Non-taxable",
2436
+ description: "Description",
2437
+ amount: "Amount",
2438
+ save_for_future_invoices: "Save for future invoices",
2439
+ tax_discount: "Tax & Discount",
2440
+ tax: "Tax",
2441
+ tax_label: "Tax label",
2442
+ tax_rate: "Tax %",
2443
+ second: "Second",
2444
+ inclusive: "Inclusive",
2445
+ deductible: "Deductible",
2446
+ none: "None",
2447
+ preview: "Preview",
2448
+ send: "Send",
2449
+ payment: "Payment",
2450
+ copy: "Copy",
2451
+ print: "Print",
2452
+ share: "Share",
2453
+ record: "Record",
2454
+ recipient: "Recipient",
2455
+ message: "Message",
2456
+ record_payment: "Record Payment",
2457
+ get_paid_with_credit_card: "Get paid with credit card",
2458
+ fully_paid: "Fully paid",
2459
+ amount_paid: "Amount paid",
2460
+ date_paid: "Date paid",
2461
+ signature: "Signature",
2462
+ add_photo: "Add Photo",
2463
+ logo: "Logo",
2464
+ company: "Company",
2465
+ company_info: "Company Information",
2466
+ payment_instruction: "Payment Instruction",
2467
+ accept_debit_or_credit_card: "Accept Credit Card",
2468
+ currency: "Currency",
2469
+ default_note: "Default Note",
2470
+ default_email_message: "Default Email Message",
2471
+ Send_me_a_copy: "Send me a copy",
2472
+ rename_fields: "Rename Fields",
2473
+ general: "General",
2474
+ passcode: "Passcode",
2475
+ set_passcode: "Set your passcode",
2476
+ language: "Language",
2477
+ purchase_subscription: "Purchase Subscription",
2478
+ credit_card_surcharge: "Credit Card Surcharge",
2479
+ click_to_pay: "Please click the following link if you would like to pay with a credit card.",
2480
+ imposing_surcharge_available: "Imposing surcharge to your customers available",
2481
+ surcharge_rate: "Surcharge Rate",
2482
+ surcharge: "Surcharge",
2483
+ see_transaction_fees: "See available countries and fees",
2484
+ prepare_followings: "Prepare the followings",
2485
+ your_bank_and_website: "1.Your bank account details \n2.Website address (any web link related to your business. eg. Blog, Facebook page, LinkedIn, or etc)",
2486
+ "delete": "Delete",
2487
+ surcharge_shoulbe_be_0_5: "Surcharge rate should be between 0% and 5%.",
2488
+ email_address_on_the_invoice: "Email address on the invoice",
2489
+ display_payment_instruction: "Display payment instruction",
2490
+ symbol_at_start: "Symbol at start",
2491
+ tax_info: "Tax Information",
2492
+ bn_abbreviation: "Abbreviation",
2493
+ business_number: "Business Number",
2494
+ name: "Name",
2495
+ color_theme: "Color Theme",
2496
+ set_color_theme: "Set color theme",
2497
+ date_format: "Date Format",
2498
+ error: "Error!",
2499
+ are_you_sure: "Are you sure?",
2500
+ customer_required: "Customer Required",
2501
+ item_required: "Item Required",
2502
+ subscribe_now: "Subscribe Now",
2503
+ subscribe: "Subscribe",
2504
+ later: "Later",
2505
+ problem_processing: "Sorry, there was a problem processing your request. Please try again.",
2506
+ yes: "Yes!",
2507
+ no: "No",
2508
+ sub_status: "Subscription Status",
2509
+ sub_info: "Subscription Information",
2510
+ subscribed_on: "You have already subscribed to Bookipi on ",
2511
+ enjoying_bookipi: "Enjoying Bookipi?",
2512
+ not_really: "Not really",
2513
+ giving_me_some_feedback: "Would you mind giving us some feedback?",
2514
+ rate_us: "Rate us",
2515
+ no_thanks: "No, thanks",
2516
+ ok_sure: "Ok, sure!",
2517
+ dont_ask_me_again: "Don't ask me again",
2518
+ want_send_email: "Would you like to send a receipt?",
2519
+ provide_email_for_receipt: "Provide email address to send a receipt.",
2520
+ receipt_sent_successfully: "Receipt has been sent successfully.",
2521
+ sent_successfully: "Sent successfully.",
2522
+ thank_you_for_subscribing: "Thank you for subscribing to Bookipi. Enjoy your business journey with us!",
2523
+ by_signing: "By signing this document, the customer agrees to the services and conditions described in this document.",
2524
+ bill_to: "BILL TO",
2525
+ ship_to: "SHIP TO",
2526
+ shipping: "Shipping",
2527
+ shipping_address: "Shipping Address",
2528
+ add_info: "Additional information",
2529
+ add_info_ci: "Additional information",
2530
+ add_recipients_email: "Please add recipient's email address.",
2531
+ Recipient_email_not_your_email: "Recipient's email address shouldn't be your email address.",
2532
+ thank_you_for_your_business: "Thank you for your business.",
2533
+ alert: "Alert",
2534
+ payment_greater_than_zero: "Payment amount must be greater than zero",
2535
+ overdue_reminder: "Overdue Reminder",
2536
+ overdue_msg: "This is a reminder that your payment is now overdue. If you have already sent your payment, please disregard this email.",
2537
+ tips: "Helpful tips",
2538
+ pull_down_refresh: "Pull down to refresh data",
2539
+ send_reminder: "Send a reminder for overdue invoices",
2540
+ "40_inv_yr": "FREE 40 invoices & estimates per year",
2541
+ "5_in_30": "Max. 5 within 30 days",
2542
+ you_user: function you_user(xx) {
2543
+ return "You are a " + xx + " user";
2544
+ },
2545
+ how_about_rating: function how_about_rating(appStore) {
2546
+ return "Would you like to rate us on " + appStore + "?";
2547
+ },
2548
+ give_5: "Give us a 5 star rating",
2549
+ payment_on: function payment_on(date, brand, endNumber) {
2550
+ if (brand && endNumber) {
2551
+ return "Paid on " + date + " using " + brand + " ending in " + endNumber;
2552
+ } else if (brand && !endNumber) {
2553
+ return "Paid on " + date + " using " + brand;
2554
+ } else {
2555
+ return "Paid on " + date;
2556
+ }
2557
+ },
2558
+ sign_doc_appear: "“Sign the document“ button will appear on sent email.",
2559
+ max_10_sign_free: "Maximum of 10 client's signatures for free",
2560
+ reached_max_limit: "You have reached the maximum limit.\n\nTo use this function, please subscribe at bookipi.com.",
2561
+ click_to_sign: "Click below to sign.",
2562
+ not_found: function not_found(q) {
2563
+ return "We couldn't find anything for “" + q + "“";
2564
+ },
2565
+ get_signature: "Get Signature",
2566
+ sign_directly: "Your client can also sign directly on the app.",
2567
+ how_to_sign: '(Tap on "More" > "Get Signature")',
2568
+ enter_paypal: "Enter a PayPal email address",
2569
+ receive_pay_online: "Receive Payment Online",
2570
+ accept_paypal: "Accept PayPal",
2571
+ payment_option: "Payment Option",
2572
+ customer_payment_option: "Customer Payment Option",
2573
+ already_signed: "This document has already been signed",
2574
+ add_note_question: "Would you like to add the default note to the note field?",
2575
+ freq_used: "Frequently used",
2576
+ empty: "It's empty",
2577
+ notification: "Notification",
2578
+ notified_once_read: "Would you like to get notified once your customer read your invoice?",
2579
+ tap_to_add: "Tap on + button to add a document",
2580
+ by_date: "By Date",
2581
+ by_no: "By Number",
2582
+ call: "Call",
2583
+ add_new_type: "Add a new category",
2584
+ name_doc: "Document name",
2585
+ type_doc_name: "Type the name of the document you want to create.",
2586
+ create: "Create",
2587
+ copy_to: "Copy to",
2588
+ select: "Select",
2589
+ record_full: "Record as fully paid",
2590
+ change_unit: "Change Unit of measure",
2591
+ photos: "Photos",
2592
+ restore: "Restore",
2593
+ move_to_trash: "Move to trash",
2594
+ moved_to_trash: "Moved to trash",
2595
+ custom: "Custom",
2596
+ last_1: "Last 1 year",
2597
+ user_acc: "User Account",
2598
+ sent_to_reset: function sent_to_reset(e) {
2599
+ return "Email has been sent to “" + e + "” to reset your password.";
2600
+ },
2601
+ trashed_item: "Trashed Item",
2602
+ trash: "Trash",
2603
+ nothing_in_trash: "There is nothing in the Trash!",
2604
+ empty_trash: "Empty trash",
2605
+ disconnect_stripe: "Disconnect Stripe account",
2606
+ import_data: "Import Data",
2607
+ import_msg: "You are currently an InvoiceBee user. Would you like to import your data from InvoiceBee?",
2608
+ agree_tc_pp: "You accept and agree to our terms of services and privacy policy.",
2609
+ agree: "Agree",
2610
+ view: "View",
2611
+ document_signed: "Document was signed",
2612
+ signed: "Signed",
2613
+ sign_added_success: "Customer's signature has been successfully added.",
2614
+ finger_scan: "Scan fingerprint",
2615
+ place_finger: "Place your finger over the touch sensor and press scan",
2616
+ scan: "Scan",
2617
+ re_upload_logo: "Re-upload your logo in Settings.",
2618
+ re_upload_sign: "Re-upload your signature in Settings.",
2619
+ cannot_delete_dc: "This category cannot be deleted.",
2620
+ clear_all_dc: "Clear all documents and trashes before you delete it.",
2621
+ tap_to_resort: "Tap & hold to re-sort items",
2622
+ email_exists: "This user ID already exists.",
2623
+ go_to_login: "Would you like to go to the login page? (You can use your InvoiceBee login )",
2624
+ i_agree: ["By tapping 'Get Started', I agree to the ", "Terms of Service ", "and ", "Privacy Policy", "."],
2625
+ doc_list: ["Quote", "Estimate", "Credit Note", "Delivery Note", "Debit Note", "Purchase Order"],
2626
+ report: "Report",
2627
+ tell_company: "Enter company name for invoice.",
2628
+ tell_email: "Enter displayed email address on invoice.",
2629
+ setup_pw: "Set your password.",
2630
+ new_cate_added: "A new category has been successfully added.",
2631
+ doc_name_required: "The document name is required",
2632
+ history: "History",
2633
+ setup_acc_first: "Set up your payment account first",
2634
+ setup_acc_content: "Go to Settings > Customer Payment Option > Accept Credit Card.",
2635
+ pay_title: function pay_title(x) {
2636
+ return "Would you like to pay " + x + " with this card?";
2637
+ },
2638
+ pay_content: function pay_content(x) {
2639
+ return "Please note that the above amount includes " + x + "% surcharge.";
2640
+ },
2641
+ payment_success: "Payment has been made successfully.",
2642
+ sign_here: "Sign here",
2643
+ new_logo_applied: "The new logo will only be applied to updated or new invoices.",
2644
+ tutorials: "Tutorial videos",
2645
+ goback: "Go back",
2646
+ help: "Help",
2647
+ use_commas: "Use commas(,) for multiple recipients",
2648
+ tell_friend: "Tell a friend",
2649
+ including_tax: "Including tax",
2650
+ tell_friend_msg: "I use this to send free invoices and estimates in seconds, save time and get paid faster. \nDownload Bookipi for FREE at bookipi.com.",
2651
+ view_more_tutorials: "View More Tutorials",
2652
+ try_expense: "Try Bookipi Expense app",
2653
+ sync_expense: "Sync perfectly with Bookipi Invoice.\nTrack income and expenses!\nWould you like to try?",
2654
+ download: "Download",
2655
+ net: "Net",
2656
+ feature_request: "Bug Report / Feature Request",
2657
+ want_contact_us: "Do you want to contact Bookipi support?",
2658
+ expense: "Expense",
2659
+ set_overdue_reminder: "Set up the automatic overdue reminder",
2660
+ on_due: "On due date",
2661
+ after_3: "After 3 days",
2662
+ after_7: "After 7 days",
2663
+ currency_format: "Currency Format",
2664
+ "default": "Default",
2665
+ change_email: "Change email",
2666
+ get_started_with_huawei: "Get Started with Huawei ID",
2667
+ login_with_huawei: "Log in with Huawei ID",
2668
+ after_tax: "After-tax",
2669
+ due: "due",
2670
+ due_in_days: function due_in_days(x) {
2671
+ return "Due in " + (Math.abs(x) + (Math.abs(x) === 1 ? " day" : " days"));
2672
+ },
2673
+ overdue_days: function overdue_days(x) {
2674
+ return "Overdue " + (Math.abs(x) + (Math.abs(x) === 1 ? " day" : " days"));
2675
+ },
2676
+ inbox: "Inbox",
2677
+ archived: "Archived",
2678
+ get_started: "Get Started",
2679
+ its_free: ["it's free", "like forever..."],
2680
+ enter_company: ["Enter company name", "for invoice."],
2681
+ enable_face_id: "Enable Face ID",
2682
+ enable_touch_id: "Enable Touch ID",
2683
+ almost_done: "Almost done",
2684
+ skip: "Skip",
2685
+ type_of_business: "Type of business",
2686
+ enter_email: ["Enter displayed email", "address on invoice."],
2687
+ finish_setup: "Finish Setup",
2688
+ biz_type_100: "Art, Photography & Creative Services",
2689
+ biz_type_200: "Construction",
2690
+ biz_type_300: "Home Improvement",
2691
+ biz_type_400: "Home Maintenance",
2692
+ biz_type_500: "Financial Services & Insurance",
2693
+ biz_type_600: "Hair, Spa & Aesthetics",
2694
+ biz_type_700: "Medical, Dental & Health",
2695
+ biz_type_800: "Non-profits, Associations & Groups",
2696
+ biz_type_900: "Retailers, Resellers & Sales",
2697
+ biz_type_1000: "Web, Tech & Media",
2698
+ biz_type_1100: "Food & Catering",
2699
+ biz_type_1200: "Care Services (eg. childcare, aged care)",
2700
+ biz_type_1300: "Consulting & Professional Services",
2701
+ biz_type_1400: "Agriculture",
2702
+ biz_type_1500: "Transport",
2703
+ biz_type_1600: "Education",
2704
+ biz_type_1700: "Travel & Recreation",
2705
+ biz_type_1800: "Other: I provide a SERVICE",
2706
+ biz_type_1900: "Other: I make or sell a PRODUCT",
2707
+ archive: "Archive",
2708
+ unarchive: "Unarchive",
2709
+ create_new_customer: "Create new customer",
2710
+ view_all: "View all",
2711
+ import_from_contacts: "Import from your contacts",
2712
+ did_you_send: "Did you send this document?",
2713
+ mark_as_sent: "Mark as Sent",
2714
+ add_note: "Add Note",
2715
+ city: "City",
2716
+ state: "State",
2717
+ zip: "Zip",
2718
+ country: "Country",
2719
+ add: "Add",
2720
+ search_company: "Search customer",
2721
+ search_item: "Search item"
2722
+ };
2723
+
2724
+ var InvoiceCompatHtml = function InvoiceCompatHtml(invoice, lang) {
2725
+ if (lang === void 0) {
2726
+ lang = defaultLang;
2727
+ }
2728
+
2729
+ return invoiceHtml({
2730
+ invoice: _extends({}, invoice, {
2731
+ document: InvoiceCompat(invoice.document),
2732
+ company: CompanyCompat(invoice.company)
2733
+ }),
2734
+ lang: lang
2735
+ });
2736
+ };
2737
+
2738
+ var PreviewDocumentCompat = function PreviewDocumentCompat(_ref) {
2739
+ var previewDocument = _ref.invoice,
2740
+ _ref$lang = _ref.lang,
2741
+ lang = _ref$lang === void 0 ? defaultLang : _ref$lang;
2742
+ return /*#__PURE__*/React.createElement("div", {
2743
+ dangerouslySetInnerHTML: {
2744
+ __html: InvoiceCompatHtml(previewDocument, lang)
2745
+ }
2746
+ });
2747
+ };
2748
+
2749
+ export { PreviewDocument as Invoice, PreviewDocumentCompat as InvoiceCompat, InvoiceCompatHtml, invoiceHtml as InvoiceHtml };
2023
2750
  //# sourceMappingURL=index.modern.js.map