@bookipi/htmlgenerator 1.1.5 → 1.1.7

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.
@@ -1654,12 +1654,397 @@ var nl2br = function nl2br(str, is_xhtml) {
1654
1654
  return (str + "").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, "$1" + breakTag + "$2");
1655
1655
  };
1656
1656
 
1657
+ var defaultLang = {
1658
+ terms: "Terms and conditions",
1659
+ privacy: "Privacy Policy",
1660
+ firstname: "First Name",
1661
+ lastname: "Last Name",
1662
+ optional: "Optional",
1663
+ whats_name: "What's your name?",
1664
+ username: "USERNAME",
1665
+ already_have_id: "Already have a user ID?",
1666
+ submit: "Submit",
1667
+ password: "Password",
1668
+ company_name_required: "Company name is required.",
1669
+ email_required: "Email address is required.",
1670
+ email_not_valid: "Email address is invalid.",
1671
+ password_required: "Password is required.",
1672
+ password_length_check: "Password must be at least 8 characters.",
1673
+ get_started_with_google: "Get Started with Google",
1674
+ forgot_password: "Forgot Password",
1675
+ signup: "Sign Up",
1676
+ login: "Log In",
1677
+ login_with_google: "Log in with Google",
1678
+ reset_password: "Reset your password",
1679
+ enter_email_to_reset: "Please enter your email address and we'll send you an email to reset your password.",
1680
+ send_email: "Send Email",
1681
+ next: "Next",
1682
+ done: "Done",
1683
+ upload_logo: "Upload your logo",
1684
+ "export": "Export",
1685
+ export_to_csv: "Export data to CSV",
1686
+ time_period: "Time Period",
1687
+ start_date: "Start Date",
1688
+ end_date: "End Date",
1689
+ select_action: "Select Action",
1690
+ more: "More",
1691
+ "new": "New",
1692
+ cancel: "Cancel",
1693
+ save: "Save",
1694
+ menu: "Menu",
1695
+ options: "Options",
1696
+ invoice: "Invoice",
1697
+ Estimate: "Estimate",
1698
+ customer: "Customer",
1699
+ settings: "Settings",
1700
+ support: "Support",
1701
+ desktop_app: "MAC/PC App",
1702
+ logout: "Logout",
1703
+ overdue: "Overdue",
1704
+ paid: "Paid",
1705
+ partial: "Partial",
1706
+ unpaid: "Unpaid",
1707
+ sent: "Sent",
1708
+ saved: "Saved",
1709
+ read: "Read",
1710
+ undelivered: "Undelivered",
1711
+ search: "Search",
1712
+ details: "Details",
1713
+ number: "Number",
1714
+ prefix: "Prefix",
1715
+ date: "Date",
1716
+ due_in: "Due in (days)",
1717
+ sameday: "Same day",
1718
+ due_date: "Due date",
1719
+ remove_due_date: "Remove due date",
1720
+ due_on: "Due on",
1721
+ po_number: "PO #",
1722
+ enter_date: "Enter date",
1723
+ add_customer: "Add Customer",
1724
+ item: "Item",
1725
+ add_item: "Add Item",
1726
+ total: "Total",
1727
+ subtotal: "Subtotal",
1728
+ discount: "Discount",
1729
+ amount_due: "Amount Due",
1730
+ grand_total: "Grand Total",
1731
+ sign: "Sign",
1732
+ mysign: "My Signature",
1733
+ clientsign: "Client's Signature",
1734
+ note: "Note",
1735
+ signed_on: "Signed on",
1736
+ leave_with_out_saving: "Are you sure you want to leave without saving?",
1737
+ included: "included",
1738
+ company_name: "Company Name",
1739
+ email: "Email",
1740
+ phone_number: "Phone Number",
1741
+ address: "Address",
1742
+ import_contact: "Import Contact",
1743
+ from_mobile_contacts: "From mobile contacts",
1744
+ from_saved_customers: "From saved customers",
1745
+ "import": "Import",
1746
+ item_name: "Name",
1747
+ price: "Price",
1748
+ quantity: "Quantity",
1749
+ taxable: "Taxable",
1750
+ non_taxable: "Non-taxable",
1751
+ description: "Description",
1752
+ amount: "Amount",
1753
+ save_for_future_invoices: "Save for future invoices",
1754
+ tax_discount: "Tax & Discount",
1755
+ tax: "Tax",
1756
+ tax_label: "Tax label",
1757
+ tax_rate: "Tax %",
1758
+ second: "Second",
1759
+ inclusive: "Inclusive",
1760
+ deductible: "Deductible",
1761
+ none: "None",
1762
+ preview: "Preview",
1763
+ send: "Send",
1764
+ payment: "Payment",
1765
+ copy: "Copy",
1766
+ print: "Print",
1767
+ share: "Share",
1768
+ record: "Record",
1769
+ recipient: "Recipient",
1770
+ message: "Message",
1771
+ record_payment: "Record Payment",
1772
+ get_paid_with_credit_card: "Get paid with credit card",
1773
+ fully_paid: "Fully paid",
1774
+ amount_paid: "Amount paid",
1775
+ date_paid: "Date paid",
1776
+ signature: "Signature",
1777
+ add_photo: "Add Photo",
1778
+ logo: "Logo",
1779
+ company: "Company",
1780
+ company_info: "Company Information",
1781
+ payment_instruction: "Payment Instruction",
1782
+ accept_debit_or_credit_card: "Accept Credit Card",
1783
+ currency: "Currency",
1784
+ default_note: "Default Note",
1785
+ default_email_message: "Default Email Message",
1786
+ Send_me_a_copy: "Send me a copy",
1787
+ rename_fields: "Rename Fields",
1788
+ general: "General",
1789
+ passcode: "Passcode",
1790
+ set_passcode: "Set your passcode",
1791
+ language: "Language",
1792
+ purchase_subscription: "Purchase Subscription",
1793
+ credit_card_surcharge: "Credit Card Surcharge",
1794
+ click_to_pay: "Please click the following link if you would like to pay with a credit card.",
1795
+ imposing_surcharge_available: "Imposing surcharge to your customers available",
1796
+ surcharge_rate: "Surcharge Rate",
1797
+ surcharge: "Surcharge",
1798
+ see_transaction_fees: "See available countries and fees",
1799
+ prepare_followings: "Prepare the followings",
1800
+ 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)",
1801
+ "delete": "Delete",
1802
+ surcharge_shoulbe_be_0_5: "Surcharge rate should be between 0% and 5%.",
1803
+ email_address_on_the_invoice: "Email address on the invoice",
1804
+ display_payment_instruction: "Display payment instruction",
1805
+ symbol_at_start: "Symbol at start",
1806
+ tax_info: "Tax Information",
1807
+ bn_abbreviation: "Abbreviation",
1808
+ business_number: "Business Number",
1809
+ name: "Name",
1810
+ color_theme: "Color Theme",
1811
+ set_color_theme: "Set color theme",
1812
+ date_format: "Date Format",
1813
+ error: "Error!",
1814
+ are_you_sure: "Are you sure?",
1815
+ customer_required: "Customer Required",
1816
+ item_required: "Item Required",
1817
+ subscribe_now: "Subscribe Now",
1818
+ subscribe: "Subscribe",
1819
+ later: "Later",
1820
+ problem_processing: "Sorry, there was a problem processing your request. Please try again.",
1821
+ yes: "Yes!",
1822
+ no: "No",
1823
+ sub_status: "Subscription Status",
1824
+ sub_info: "Subscription Information",
1825
+ subscribed_on: "You have already subscribed to Bookipi on ",
1826
+ enjoying_bookipi: "Enjoying Bookipi?",
1827
+ not_really: "Not really",
1828
+ giving_me_some_feedback: "Would you mind giving us some feedback?",
1829
+ rate_us: "Rate us",
1830
+ no_thanks: "No, thanks",
1831
+ ok_sure: "Ok, sure!",
1832
+ dont_ask_me_again: "Don't ask me again",
1833
+ want_send_email: "Would you like to send a receipt?",
1834
+ provide_email_for_receipt: "Provide email address to send a receipt.",
1835
+ receipt_sent_successfully: "Receipt has been sent successfully.",
1836
+ sent_successfully: "Sent successfully.",
1837
+ thank_you_for_subscribing: "Thank you for subscribing to Bookipi. Enjoy your business journey with us!",
1838
+ by_signing: "By signing this document, the customer agrees to the services and conditions described in this document.",
1839
+ bill_to: "BILL TO",
1840
+ ship_to: "SHIP TO",
1841
+ shipping: "Shipping",
1842
+ shipping_address: "Shipping Address",
1843
+ add_info: "Additional information",
1844
+ add_info_ci: "Additional information",
1845
+ add_recipients_email: "Please add recipient's email address.",
1846
+ Recipient_email_not_your_email: "Recipient's email address shouldn't be your email address.",
1847
+ thank_you_for_your_business: "Thank you for your business.",
1848
+ alert: "Alert",
1849
+ payment_greater_than_zero: "Payment amount must be greater than zero",
1850
+ overdue_reminder: "Overdue Reminder",
1851
+ overdue_msg: "This is a reminder that your payment is now overdue. If you have already sent your payment, please disregard this email.",
1852
+ tips: "Helpful tips",
1853
+ pull_down_refresh: "Pull down to refresh data",
1854
+ send_reminder: "Send a reminder for overdue invoices",
1855
+ "40_inv_yr": "FREE 40 invoices & estimates per year",
1856
+ "5_in_30": "Max. 5 within 30 days",
1857
+ you_user: function you_user(xx) {
1858
+ return "You are a " + xx + " user";
1859
+ },
1860
+ how_about_rating: function how_about_rating(appStore) {
1861
+ return "Would you like to rate us on " + appStore + "?";
1862
+ },
1863
+ give_5: "Give us a 5 star rating",
1864
+ payment_on: function payment_on(date, brand, endNumber) {
1865
+ if (brand && endNumber) {
1866
+ return "Paid on " + date + " using " + brand + " ending in " + endNumber;
1867
+ } else if (brand && !endNumber) {
1868
+ return "Paid on " + date + " using " + brand;
1869
+ } else {
1870
+ return "Paid on " + date;
1871
+ }
1872
+ },
1873
+ sign_doc_appear: "“Sign the document“ button will appear on sent email.",
1874
+ max_10_sign_free: "Maximum of 10 client's signatures for free",
1875
+ reached_max_limit: "You have reached the maximum limit.\n\nTo use this function, please subscribe at bookipi.com.",
1876
+ click_to_sign: "Click below to sign.",
1877
+ not_found: function not_found(q) {
1878
+ return "We couldn't find anything for “" + q + "“";
1879
+ },
1880
+ get_signature: "Get Signature",
1881
+ sign_directly: "Your client can also sign directly on the app.",
1882
+ how_to_sign: '(Tap on "More" > "Get Signature")',
1883
+ enter_paypal: "Enter a PayPal email address",
1884
+ receive_pay_online: "Receive Payment Online",
1885
+ accept_paypal: "Accept PayPal",
1886
+ payment_option: "Payment Option",
1887
+ customer_payment_option: "Customer Payment Option",
1888
+ already_signed: "This document has already been signed",
1889
+ add_note_question: "Would you like to add the default note to the note field?",
1890
+ freq_used: "Frequently used",
1891
+ empty: "It's empty",
1892
+ notification: "Notification",
1893
+ notified_once_read: "Would you like to get notified once your customer read your invoice?",
1894
+ tap_to_add: "Tap on + button to add a document",
1895
+ by_date: "By Date",
1896
+ by_no: "By Number",
1897
+ call: "Call",
1898
+ add_new_type: "Add a new category",
1899
+ name_doc: "Document name",
1900
+ type_doc_name: "Type the name of the document you want to create.",
1901
+ create: "Create",
1902
+ copy_to: "Copy to",
1903
+ select: "Select",
1904
+ record_full: "Record as fully paid",
1905
+ change_unit: "Change Unit of measure",
1906
+ photos: "Photos",
1907
+ restore: "Restore",
1908
+ move_to_trash: "Move to trash",
1909
+ moved_to_trash: "Moved to trash",
1910
+ custom: "Custom",
1911
+ last_1: "Last 1 year",
1912
+ user_acc: "User Account",
1913
+ sent_to_reset: function sent_to_reset(e) {
1914
+ return "Email has been sent to “" + e + "” to reset your password.";
1915
+ },
1916
+ trashed_item: "Trashed Item",
1917
+ trash: "Trash",
1918
+ nothing_in_trash: "There is nothing in the Trash!",
1919
+ empty_trash: "Empty trash",
1920
+ disconnect_stripe: "Disconnect Stripe account",
1921
+ import_data: "Import Data",
1922
+ import_msg: "You are currently an InvoiceBee user. Would you like to import your data from InvoiceBee?",
1923
+ agree_tc_pp: "You accept and agree to our terms of services and privacy policy.",
1924
+ agree: "Agree",
1925
+ view: "View",
1926
+ document_signed: "Document was signed",
1927
+ signed: "Signed",
1928
+ sign_added_success: "Customer's signature has been successfully added.",
1929
+ finger_scan: "Scan fingerprint",
1930
+ place_finger: "Place your finger over the touch sensor and press scan",
1931
+ scan: "Scan",
1932
+ re_upload_logo: "Re-upload your logo in Settings.",
1933
+ re_upload_sign: "Re-upload your signature in Settings.",
1934
+ cannot_delete_dc: "This category cannot be deleted.",
1935
+ clear_all_dc: "Clear all documents and trashes before you delete it.",
1936
+ tap_to_resort: "Tap & hold to re-sort items",
1937
+ email_exists: "This user ID already exists.",
1938
+ go_to_login: "Would you like to go to the login page? (You can use your InvoiceBee login )",
1939
+ i_agree: ["By tapping 'Get Started', I agree to the ", "Terms of Service ", "and ", "Privacy Policy", "."],
1940
+ doc_list: ["Quote", "Estimate", "Credit Note", "Delivery Note", "Debit Note", "Purchase Order"],
1941
+ report: "Report",
1942
+ tell_company: "Enter company name for invoice.",
1943
+ tell_email: "Enter displayed email address on invoice.",
1944
+ setup_pw: "Set your password.",
1945
+ new_cate_added: "A new category has been successfully added.",
1946
+ doc_name_required: "The document name is required",
1947
+ history: "History",
1948
+ setup_acc_first: "Set up your payment account first",
1949
+ setup_acc_content: "Go to Settings > Customer Payment Option > Accept Credit Card.",
1950
+ pay_title: function pay_title(x) {
1951
+ return "Would you like to pay " + x + " with this card?";
1952
+ },
1953
+ pay_content: function pay_content(x) {
1954
+ return "Please note that the above amount includes " + x + "% surcharge.";
1955
+ },
1956
+ payment_success: "Payment has been made successfully.",
1957
+ sign_here: "Sign here",
1958
+ new_logo_applied: "The new logo will only be applied to updated or new invoices.",
1959
+ tutorials: "Tutorial videos",
1960
+ goback: "Go back",
1961
+ help: "Help",
1962
+ use_commas: "Use commas(,) for multiple recipients",
1963
+ tell_friend: "Tell a friend",
1964
+ including_tax: "Including tax",
1965
+ 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.",
1966
+ view_more_tutorials: "View More Tutorials",
1967
+ try_expense: "Try Bookipi Expense app",
1968
+ sync_expense: "Sync perfectly with Bookipi Invoice.\nTrack income and expenses!\nWould you like to try?",
1969
+ download: "Download",
1970
+ net: "Net",
1971
+ feature_request: "Bug Report / Feature Request",
1972
+ want_contact_us: "Do you want to contact Bookipi support?",
1973
+ expense: "Expense",
1974
+ set_overdue_reminder: "Set up the automatic overdue reminder",
1975
+ on_due: "On due date",
1976
+ after_3: "After 3 days",
1977
+ after_7: "After 7 days",
1978
+ currency_format: "Currency Format",
1979
+ "default": "Default",
1980
+ change_email: "Change email",
1981
+ get_started_with_huawei: "Get Started with Huawei ID",
1982
+ login_with_huawei: "Log in with Huawei ID",
1983
+ after_tax: "After-tax",
1984
+ due: "due",
1985
+ due_in_days: function due_in_days(x) {
1986
+ return "Due in " + (Math.abs(x) + (Math.abs(x) === 1 ? " day" : " days"));
1987
+ },
1988
+ overdue_days: function overdue_days(x) {
1989
+ return "Overdue " + (Math.abs(x) + (Math.abs(x) === 1 ? " day" : " days"));
1990
+ },
1991
+ inbox: "Inbox",
1992
+ archived: "Archived",
1993
+ get_started: "Get Started",
1994
+ its_free: ["it's free", "like forever..."],
1995
+ enter_company: ["Enter company name", "for invoice."],
1996
+ enable_face_id: "Enable Face ID",
1997
+ enable_touch_id: "Enable Touch ID",
1998
+ almost_done: "Almost done",
1999
+ skip: "Skip",
2000
+ type_of_business: "Type of business",
2001
+ enter_email: ["Enter displayed email", "address on invoice."],
2002
+ finish_setup: "Finish Setup",
2003
+ biz_type_100: "Art, Photography & Creative Services",
2004
+ biz_type_200: "Construction",
2005
+ biz_type_300: "Home Improvement",
2006
+ biz_type_400: "Home Maintenance",
2007
+ biz_type_500: "Financial Services & Insurance",
2008
+ biz_type_600: "Hair, Spa & Aesthetics",
2009
+ biz_type_700: "Medical, Dental & Health",
2010
+ biz_type_800: "Non-profits, Associations & Groups",
2011
+ biz_type_900: "Retailers, Resellers & Sales",
2012
+ biz_type_1000: "Web, Tech & Media",
2013
+ biz_type_1100: "Food & Catering",
2014
+ biz_type_1200: "Care Services (eg. childcare, aged care)",
2015
+ biz_type_1300: "Consulting & Professional Services",
2016
+ biz_type_1400: "Agriculture",
2017
+ biz_type_1500: "Transport",
2018
+ biz_type_1600: "Education",
2019
+ biz_type_1700: "Travel & Recreation",
2020
+ biz_type_1800: "Other: I provide a SERVICE",
2021
+ biz_type_1900: "Other: I make or sell a PRODUCT",
2022
+ archive: "Archive",
2023
+ unarchive: "Unarchive",
2024
+ create_new_customer: "Create new customer",
2025
+ view_all: "View all",
2026
+ import_from_contacts: "Import from your contacts",
2027
+ did_you_send: "Did you send this document?",
2028
+ mark_as_sent: "Mark as Sent",
2029
+ add_note: "Add Note",
2030
+ city: "City",
2031
+ state: "State",
2032
+ zip: "Zip",
2033
+ country: "Country",
2034
+ add: "Add",
2035
+ search_company: "Search customer",
2036
+ search_item: "Search item"
2037
+ };
2038
+
1657
2039
  var invoiceHtmlWithDetails = (function (_ref) {
1658
2040
  var invoice = _ref.invoice,
1659
- lang = _ref.lang,
2041
+ _ref$lang = _ref.lang,
2042
+ lang = _ref$lang === void 0 ? defaultLang : _ref$lang,
1660
2043
  referral = _ref.referral,
1661
2044
  _ref$companyLogoBase = _ref.companyLogoBase,
1662
- companyLogoBase = _ref$companyLogoBase === void 0 ? 'https://s3.amazonaws.com/bookipi/' : _ref$companyLogoBase;
2045
+ companyLogoBase = _ref$companyLogoBase === void 0 ? 'https://s3.amazonaws.com/bookipi/' : _ref$companyLogoBase,
2046
+ _ref$isDeposit = _ref.isDeposit,
2047
+ isDeposit = _ref$isDeposit === void 0 ? false : _ref$isDeposit;
1663
2048
  var company = invoice.company;
1664
2049
  var document = invoice.document;
1665
2050
  var logoBase64 = invoice.logoBase64;
@@ -1810,7 +2195,7 @@ var invoiceHtmlWithDetails = (function (_ref) {
1810
2195
 
1811
2196
  var signatureContainer = document.sd && "\n <div class=\"col-6\" style=\"text-align: center\">\n <strong>" + (document.cs || customerSignBase64 ? company.c : "") + "</strong>\n <div style=\"height:130px;border-bottom:2px solid #dee2e6; margin-right:40px; margin-left:40px\">\n " + (signatureBase64 && "<img src=" + signatureBase64 + " style=\"width:220px;margin-top:20px;\" />" || "") + "\n </div>\n <div>" + (document.sd ? formatDate(document.sd) : "") + "</div>\n </div>" || "";
1812
2197
  var clientSignature = (document.cs || customerSignBase64) && "\n <div class=\"col-6\" style=\"text-align: center\">\n <strong>" + document.cu.c + "</strong>\n <div style=\"height:130px;border-bottom:2px solid #dee2e6; margin-right:40px; margin-left:40px\">\n " + (customerSignBase64 && "<img src=" + customerSignBase64 + " style=\"width:220px;margin-top: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>" || "";
1813
- var html = "\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>" : '') + "\n " + (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 \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";
2198
+ var html = "\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\">" + (isDeposit ? FormatCurrency(document.depositAmount, company.cr, company.la, company.cf) : 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>" : '') + "\n " + (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 \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";
1814
2199
  return {
1815
2200
  html: html,
1816
2201
  timeZone: timeZone,
@@ -1821,15 +2206,19 @@ var invoiceHtmlWithDetails = (function (_ref) {
1821
2206
 
1822
2207
  var invoiceHtml = (function (_ref) {
1823
2208
  var invoice = _ref.invoice,
1824
- lang = _ref.lang,
2209
+ _ref$lang = _ref.lang,
2210
+ lang = _ref$lang === void 0 ? defaultLang : _ref$lang,
1825
2211
  referral = _ref.referral,
1826
2212
  _ref$companyLogoBase = _ref.companyLogoBase,
1827
- companyLogoBase = _ref$companyLogoBase === void 0 ? 'https://s3.amazonaws.com/bookipi/' : _ref$companyLogoBase;
2213
+ companyLogoBase = _ref$companyLogoBase === void 0 ? 'https://s3.amazonaws.com/bookipi/' : _ref$companyLogoBase,
2214
+ _ref$isDeposit = _ref.isDeposit,
2215
+ isDeposit = _ref$isDeposit === void 0 ? false : _ref$isDeposit;
1828
2216
  return invoiceHtmlWithDetails({
1829
2217
  invoice: invoice,
1830
2218
  lang: lang,
1831
2219
  referral: referral,
1832
- companyLogoBase: companyLogoBase
2220
+ companyLogoBase: companyLogoBase,
2221
+ isDeposit: isDeposit
1833
2222
  }).html;
1834
2223
  });
1835
2224
 
@@ -1837,517 +2226,175 @@ var docTypeMapping = new Map([[0, 'estimate'], [1, 'invoice'], [2, 'credit_note'
1837
2226
 
1838
2227
  var ItemCompat = function ItemCompat(item) {
1839
2228
  var mapping = new Map([['name', 'n'], ['description', 'dsc'], ['price', 'p'], ['quantity', 'q'], ['tax', 'tx'], ['tax2', 'tx2'], ['discount', 'dc'], ['total', 't']]);
1840
- return Object.fromEntries(Object.entries(item).map(function (_ref) {
1841
- var k = _ref[0],
1842
- v = _ref[1];
1843
- return [mapping.get(k) || k, v];
1844
- }));
1845
- };
1846
-
1847
- var PaymentCompat = function PaymentCompat(payment) {
1848
- var mapping = new Map([['amount', 'a'], ['date', 'd'], ['chargeId', 'cid'], ['surchargeRate', 'sr'], ['last4', 'l'], ['brand', 'b']]);
1849
- return Object.fromEntries(Object.entries(payment).map(function (_ref2) {
1850
- var k = _ref2[0],
1851
- v = _ref2[1];
1852
- return [mapping.get(k) || k, v];
1853
- }));
1854
- };
1855
-
1856
- var CustomerCompat = function CustomerCompat(customer) {
1857
- 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']]);
1858
- return Object.fromEntries(Object.entries(customer).map(function (_ref3) {
1859
- var k = _ref3[0],
1860
- v = _ref3[1];
1861
- return [mapping.get(k) || k, v];
1862
- }));
1863
- };
1864
-
1865
- var InvoiceCompat = function InvoiceCompat(doc) {
1866
- 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']]);
1867
- return Object.fromEntries(Object.entries(doc).map(function (_ref4) {
1868
- var k = _ref4[0],
1869
- v = _ref4[1];
1870
- var mapV = mapping.get(k);
1871
-
1872
- if (!mapV) {
1873
- return [k, v];
1874
- } else if (!Array.isArray(mapV)) {
1875
- return [mapV || k, v];
1876
- } else {
1877
- if (Array.isArray(v)) {
1878
- return [mapV[0] || k, v.map(function (val) {
1879
- return mapV[1](val);
1880
- })];
1881
- } else {
1882
- return [mapV[0] || k, mapV[1](v)];
1883
- }
1884
- }
1885
- }));
1886
- };
1887
-
1888
- var TemplateCompat = function TemplateCompat(template) {
1889
- 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']]);
1890
- return Object.fromEntries(Object.entries(template).map(function (_ref5) {
1891
- var k = _ref5[0],
1892
- v = _ref5[1];
1893
- return [mapping.get(k) || k, v];
1894
- }));
1895
- };
1896
-
1897
- var CompanyCompat = function CompanyCompat(doc) {
1898
- 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'], ['logoExists', 'lg']]);
1899
- var rootMapping = new Map([['template', TemplateCompat]]);
1900
- var newCompany = Object.fromEntries(Object.entries(doc).map(function (_ref6) {
1901
- var k = _ref6[0],
1902
- v = _ref6[1];
1903
- return [mapping.get(k) || k, v];
1904
- }));
1905
- var subDoc = {};
1906
- Object.entries(newCompany).forEach(function (_ref7) {
1907
- var k = _ref7[0],
1908
- v = _ref7[1];
1909
-
1910
- if (rootMapping.get(k)) {
1911
- var mapped = rootMapping.get(k)(v);
1912
- delete mapped.__typename;
1913
- subDoc = _extends({}, subDoc, mapped);
1914
- }
1915
- });
1916
- newCompany = _extends({}, newCompany, subDoc);
1917
-
1918
- var documentDefinitionCompat = function documentDefinitionCompat(doc) {
1919
- if (!doc.documentDefinitions) {
1920
- return {
1921
- value: []
1922
- };
1923
- }
1924
-
1925
- doc.ms = [];
1926
- doc.pf = [];
1927
- doc.tc = [];
1928
- var ret = doc.documentDefinitions.map(function (def, idx) {
1929
- var enabled = false;
1930
-
1931
- if (typeof def.enabled === 'undefined') {
1932
- if (def.name) {
1933
- enabled = true;
1934
- }
1935
- } else {
1936
- enabled = def.enabled;
1937
- }
2229
+ return Object.fromEntries(Object.entries(item).map(function (_ref) {
2230
+ var k = _ref[0],
2231
+ v = _ref[1];
2232
+ return [mapping.get(k) || k, v];
2233
+ }));
2234
+ };
1938
2235
 
1939
- var obj = {
1940
- n: def.name,
1941
- enabled: enabled,
1942
- ty: docTypeMapping.get(def.type),
1943
- note: def.note,
1944
- docType: def.docType
1945
- };
1946
- doc.ms.push(obj.defaultMessage);
1947
- doc.pf.push(obj.prefix);
1948
- doc.tc.push(obj.terms);
1949
- return obj;
1950
- });
1951
- return ret;
1952
- };
2236
+ var PaymentCompat = function PaymentCompat(payment) {
2237
+ var mapping = new Map([['amount', 'a'], ['date', 'd'], ['chargeId', 'cid'], ['surchargeRate', 'sr'], ['last4', 'l'], ['brand', 'b']]);
2238
+ return Object.fromEntries(Object.entries(payment).map(function (_ref2) {
2239
+ var k = _ref2[0],
2240
+ v = _ref2[1];
2241
+ return [mapping.get(k) || k, v];
2242
+ }));
2243
+ };
1953
2244
 
1954
- newCompany.documentDefinitions = documentDefinitionCompat(newCompany);
1955
- return newCompany;
2245
+ var CustomerCompat = function CustomerCompat(customer) {
2246
+ 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']]);
2247
+ return Object.fromEntries(Object.entries(customer).map(function (_ref3) {
2248
+ var k = _ref3[0],
2249
+ v = _ref3[1];
2250
+ return [mapping.get(k) || k, v];
2251
+ }));
1956
2252
  };
1957
2253
 
1958
- var defaultLang = {
1959
- terms: "Terms and conditions",
1960
- privacy: "Privacy Policy",
1961
- firstname: "First Name",
1962
- lastname: "Last Name",
1963
- optional: "Optional",
1964
- whats_name: "What's your name?",
1965
- username: "USERNAME",
1966
- already_have_id: "Already have a user ID?",
1967
- submit: "Submit",
1968
- password: "Password",
1969
- company_name_required: "Company name is required.",
1970
- email_required: "Email address is required.",
1971
- email_not_valid: "Email address is invalid.",
1972
- password_required: "Password is required.",
1973
- password_length_check: "Password must be at least 8 characters.",
1974
- get_started_with_google: "Get Started with Google",
1975
- forgot_password: "Forgot Password",
1976
- signup: "Sign Up",
1977
- login: "Log In",
1978
- login_with_google: "Log in with Google",
1979
- reset_password: "Reset your password",
1980
- enter_email_to_reset: "Please enter your email address and we'll send you an email to reset your password.",
1981
- send_email: "Send Email",
1982
- next: "Next",
1983
- done: "Done",
1984
- upload_logo: "Upload your logo",
1985
- "export": "Export",
1986
- export_to_csv: "Export data to CSV",
1987
- time_period: "Time Period",
1988
- start_date: "Start Date",
1989
- end_date: "End Date",
1990
- select_action: "Select Action",
1991
- more: "More",
1992
- "new": "New",
1993
- cancel: "Cancel",
1994
- save: "Save",
1995
- menu: "Menu",
1996
- options: "Options",
1997
- invoice: "Invoice",
1998
- estimate: "Estimate",
1999
- customer: "Customer",
2000
- settings: "Settings",
2001
- support: "Support",
2002
- desktop_app: "MAC/PC App",
2003
- logout: "Logout",
2004
- overdue: "Overdue",
2005
- paid: "Paid",
2006
- partial: "Partial",
2007
- unpaid: "Unpaid",
2008
- sent: "Sent",
2009
- saved: "Saved",
2010
- read: "Read",
2011
- undelivered: "Undelivered",
2012
- search: "Search",
2013
- details: "Details",
2014
- number: "Number",
2015
- prefix: "Prefix",
2016
- date: "Date",
2017
- due_in: "Due in (days)",
2018
- sameday: "Same day",
2019
- due_date: "Due date",
2020
- remove_due_date: "Remove due date",
2021
- due_on: "Due on",
2022
- po_number: "PO #",
2023
- enter_date: "Enter date",
2024
- add_customer: "Add Customer",
2025
- item: "Item",
2026
- add_item: "Add Item",
2027
- total: "Total",
2028
- subtotal: "Subtotal",
2029
- discount: "Discount",
2030
- amount_due: "Amount Due",
2031
- grand_total: "Grand Total",
2032
- sign: "Sign",
2033
- mysign: "My Signature",
2034
- clientsign: "Client's Signature",
2035
- note: "Note",
2036
- signed_on: "Signed on",
2037
- leave_with_out_saving: "Are you sure you want to leave without saving?",
2038
- included: "included",
2039
- company_name: "Company Name",
2040
- email: "Email",
2041
- phone_number: "Phone Number",
2042
- address: "Address",
2043
- import_contact: "Import Contact",
2044
- from_mobile_contacts: "From mobile contacts",
2045
- from_saved_customers: "From saved customers",
2046
- "import": "Import",
2047
- item_name: "Name",
2048
- price: "Price",
2049
- quantity: "Quantity",
2050
- taxable: "Taxable",
2051
- non_taxable: "Non-taxable",
2052
- description: "Description",
2053
- amount: "Amount",
2054
- save_for_future_invoices: "Save for future invoices",
2055
- tax_discount: "Tax & Discount",
2056
- tax: "Tax",
2057
- tax_label: "Tax label",
2058
- tax_rate: "Tax %",
2059
- second: "Second",
2060
- inclusive: "Inclusive",
2061
- deductible: "Deductible",
2062
- none: "None",
2063
- preview: "Preview",
2064
- send: "Send",
2065
- payment: "Payment",
2066
- copy: "Copy",
2067
- print: "Print",
2068
- share: "Share",
2069
- record: "Record",
2070
- recipient: "Recipient",
2071
- message: "Message",
2072
- record_payment: "Record Payment",
2073
- get_paid_with_credit_card: "Get paid with credit card",
2074
- fully_paid: "Fully paid",
2075
- amount_paid: "Amount paid",
2076
- date_paid: "Date paid",
2077
- signature: "Signature",
2078
- add_photo: "Add Photo",
2079
- logo: "Logo",
2080
- company: "Company",
2081
- company_info: "Company Information",
2082
- payment_instruction: "Payment Instruction",
2083
- accept_debit_or_credit_card: "Accept Credit Card",
2084
- currency: "Currency",
2085
- default_note: "Default Note",
2086
- default_email_message: "Default Email Message",
2087
- Send_me_a_copy: "Send me a copy",
2088
- rename_fields: "Rename Fields",
2089
- general: "General",
2090
- passcode: "Passcode",
2091
- set_passcode: "Set your passcode",
2092
- language: "Language",
2093
- purchase_subscription: "Purchase Subscription",
2094
- credit_card_surcharge: "Credit Card Surcharge",
2095
- click_to_pay: "Please click the following link if you would like to pay with a credit card.",
2096
- imposing_surcharge_available: "Imposing surcharge to your customers available",
2097
- surcharge_rate: "Surcharge Rate",
2098
- surcharge: "Surcharge",
2099
- see_transaction_fees: "See available countries and fees",
2100
- prepare_followings: "Prepare the followings",
2101
- 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)",
2102
- "delete": "Delete",
2103
- surcharge_shoulbe_be_0_5: "Surcharge rate should be between 0% and 5%.",
2104
- email_address_on_the_invoice: "Email address on the invoice",
2105
- display_payment_instruction: "Display payment instruction",
2106
- symbol_at_start: "Symbol at start",
2107
- tax_info: "Tax Information",
2108
- bn_abbreviation: "Abbreviation",
2109
- business_number: "Business Number",
2110
- name: "Name",
2111
- color_theme: "Color Theme",
2112
- set_color_theme: "Set color theme",
2113
- date_format: "Date Format",
2114
- error: "Error!",
2115
- are_you_sure: "Are you sure?",
2116
- customer_required: "Customer Required",
2117
- item_required: "Item Required",
2118
- subscribe_now: "Subscribe Now",
2119
- subscribe: "Subscribe",
2120
- later: "Later",
2121
- problem_processing: "Sorry, there was a problem processing your request. Please try again.",
2122
- yes: "Yes!",
2123
- no: "No",
2124
- sub_status: "Subscription Status",
2125
- sub_info: "Subscription Information",
2126
- subscribed_on: "You have already subscribed to Bookipi on ",
2127
- enjoying_bookipi: "Enjoying Bookipi?",
2128
- not_really: "Not really",
2129
- giving_me_some_feedback: "Would you mind giving us some feedback?",
2130
- rate_us: "Rate us",
2131
- no_thanks: "No, thanks",
2132
- ok_sure: "Ok, sure!",
2133
- dont_ask_me_again: "Don't ask me again",
2134
- want_send_email: "Would you like to send a receipt?",
2135
- provide_email_for_receipt: "Provide email address to send a receipt.",
2136
- receipt_sent_successfully: "Receipt has been sent successfully.",
2137
- sent_successfully: "Sent successfully.",
2138
- thank_you_for_subscribing: "Thank you for subscribing to Bookipi. Enjoy your business journey with us!",
2139
- by_signing: "By signing this document, the customer agrees to the services and conditions described in this document.",
2140
- bill_to: "BILL TO",
2141
- ship_to: "SHIP TO",
2142
- shipping: "Shipping",
2143
- shipping_address: "Shipping Address",
2144
- add_info: "Additional information",
2145
- add_info_ci: "Additional information",
2146
- add_recipients_email: "Please add recipient's email address.",
2147
- Recipient_email_not_your_email: "Recipient's email address shouldn't be your email address.",
2148
- thank_you_for_your_business: "Thank you for your business.",
2149
- alert: "Alert",
2150
- payment_greater_than_zero: "Payment amount must be greater than zero",
2151
- overdue_reminder: "Overdue Reminder",
2152
- overdue_msg: "This is a reminder that your payment is now overdue. If you have already sent your payment, please disregard this email.",
2153
- tips: "Helpful tips",
2154
- pull_down_refresh: "Pull down to refresh data",
2155
- send_reminder: "Send a reminder for overdue invoices",
2156
- "40_inv_yr": "FREE 40 invoices & estimates per year",
2157
- "5_in_30": "Max. 5 within 30 days",
2158
- you_user: function you_user(xx) {
2159
- return "You are a " + xx + " user";
2160
- },
2161
- how_about_rating: function how_about_rating(appStore) {
2162
- return "Would you like to rate us on " + appStore + "?";
2163
- },
2164
- give_5: "Give us a 5 star rating",
2165
- payment_on: function payment_on(date, brand, endNumber) {
2166
- if (brand && endNumber) {
2167
- return "Paid on " + date + " using " + brand + " ending in " + endNumber;
2168
- } else if (brand && !endNumber) {
2169
- return "Paid on " + date + " using " + brand;
2254
+ var InvoiceCompat = function InvoiceCompat(doc) {
2255
+ 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']]);
2256
+ return Object.fromEntries(Object.entries(doc).map(function (_ref4) {
2257
+ var k = _ref4[0],
2258
+ v = _ref4[1];
2259
+ var mapV = mapping.get(k);
2260
+
2261
+ if (!mapV) {
2262
+ return [k, v];
2263
+ } else if (!Array.isArray(mapV)) {
2264
+ return [mapV || k, v];
2170
2265
  } else {
2171
- return "Paid on " + date;
2266
+ if (Array.isArray(v)) {
2267
+ return [mapV[0] || k, v.map(function (val) {
2268
+ return mapV[1](val);
2269
+ })];
2270
+ } else {
2271
+ return [mapV[0] || k, mapV[1](v)];
2272
+ }
2172
2273
  }
2173
- },
2174
- sign_doc_appear: "“Sign the document“ button will appear on sent email.",
2175
- max_10_sign_free: "Maximum of 10 client's signatures for free",
2176
- reached_max_limit: "You have reached the maximum limit.\n\nTo use this function, please subscribe at bookipi.com.",
2177
- click_to_sign: "Click below to sign.",
2178
- not_found: function not_found(q) {
2179
- return "We couldn't find anything for “" + q + "“";
2180
- },
2181
- get_signature: "Get Signature",
2182
- sign_directly: "Your client can also sign directly on the app.",
2183
- how_to_sign: '(Tap on "More" > "Get Signature")',
2184
- enter_paypal: "Enter a PayPal email address",
2185
- receive_pay_online: "Receive Payment Online",
2186
- accept_paypal: "Accept PayPal",
2187
- payment_option: "Payment Option",
2188
- customer_payment_option: "Customer Payment Option",
2189
- already_signed: "This document has already been signed",
2190
- add_note_question: "Would you like to add the default note to the note field?",
2191
- freq_used: "Frequently used",
2192
- empty: "It's empty",
2193
- notification: "Notification",
2194
- notified_once_read: "Would you like to get notified once your customer read your invoice?",
2195
- tap_to_add: "Tap on + button to add a document",
2196
- by_date: "By Date",
2197
- by_no: "By Number",
2198
- call: "Call",
2199
- add_new_type: "Add a new category",
2200
- name_doc: "Document name",
2201
- type_doc_name: "Type the name of the document you want to create.",
2202
- create: "Create",
2203
- copy_to: "Copy to",
2204
- select: "Select",
2205
- record_full: "Record as fully paid",
2206
- change_unit: "Change Unit of measure",
2207
- photos: "Photos",
2208
- restore: "Restore",
2209
- move_to_trash: "Move to trash",
2210
- moved_to_trash: "Moved to trash",
2211
- custom: "Custom",
2212
- last_1: "Last 1 year",
2213
- user_acc: "User Account",
2214
- sent_to_reset: function sent_to_reset(e) {
2215
- return "Email has been sent to “" + e + "” to reset your password.";
2216
- },
2217
- trashed_item: "Trashed Item",
2218
- trash: "Trash",
2219
- nothing_in_trash: "There is nothing in the Trash!",
2220
- empty_trash: "Empty trash",
2221
- disconnect_stripe: "Disconnect Stripe account",
2222
- import_data: "Import Data",
2223
- import_msg: "You are currently an InvoiceBee user. Would you like to import your data from InvoiceBee?",
2224
- agree_tc_pp: "You accept and agree to our terms of services and privacy policy.",
2225
- agree: "Agree",
2226
- view: "View",
2227
- document_signed: "Document was signed",
2228
- signed: "Signed",
2229
- sign_added_success: "Customer's signature has been successfully added.",
2230
- finger_scan: "Scan fingerprint",
2231
- place_finger: "Place your finger over the touch sensor and press scan",
2232
- scan: "Scan",
2233
- re_upload_logo: "Re-upload your logo in Settings.",
2234
- re_upload_sign: "Re-upload your signature in Settings.",
2235
- cannot_delete_dc: "This category cannot be deleted.",
2236
- clear_all_dc: "Clear all documents and trashes before you delete it.",
2237
- tap_to_resort: "Tap & hold to re-sort items",
2238
- email_exists: "This user ID already exists.",
2239
- go_to_login: "Would you like to go to the login page? (You can use your InvoiceBee login )",
2240
- i_agree: ["By tapping 'Get Started', I agree to the ", "Terms of Service ", "and ", "Privacy Policy", "."],
2241
- doc_list: ["Quote", "Estimate", "Credit Note", "Delivery Note", "Debit Note", "Purchase Order"],
2242
- report: "Report",
2243
- tell_company: "Enter company name for invoice.",
2244
- tell_email: "Enter displayed email address on invoice.",
2245
- setup_pw: "Set your password.",
2246
- new_cate_added: "A new category has been successfully added.",
2247
- doc_name_required: "The document name is required",
2248
- history: "History",
2249
- setup_acc_first: "Set up your payment account first",
2250
- setup_acc_content: "Go to Settings > Customer Payment Option > Accept Credit Card.",
2251
- pay_title: function pay_title(x) {
2252
- return "Would you like to pay " + x + " with this card?";
2253
- },
2254
- pay_content: function pay_content(x) {
2255
- return "Please note that the above amount includes " + x + "% surcharge.";
2256
- },
2257
- payment_success: "Payment has been made successfully.",
2258
- sign_here: "Sign here",
2259
- new_logo_applied: "The new logo will only be applied to updated or new invoices.",
2260
- tutorials: "Tutorial videos",
2261
- goback: "Go back",
2262
- help: "Help",
2263
- use_commas: "Use commas(,) for multiple recipients",
2264
- tell_friend: "Tell a friend",
2265
- including_tax: "Including tax",
2266
- 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.",
2267
- view_more_tutorials: "View More Tutorials",
2268
- try_expense: "Try Bookipi Expense app",
2269
- sync_expense: "Sync perfectly with Bookipi Invoice.\nTrack income and expenses!\nWould you like to try?",
2270
- download: "Download",
2271
- net: "Net",
2272
- feature_request: "Bug Report / Feature Request",
2273
- want_contact_us: "Do you want to contact Bookipi support?",
2274
- expense: "Expense",
2275
- set_overdue_reminder: "Set up the automatic overdue reminder",
2276
- on_due: "On due date",
2277
- after_3: "After 3 days",
2278
- after_7: "After 7 days",
2279
- currency_format: "Currency Format",
2280
- "default": "Default",
2281
- change_email: "Change email",
2282
- get_started_with_huawei: "Get Started with Huawei ID",
2283
- login_with_huawei: "Log in with Huawei ID",
2284
- after_tax: "After-tax",
2285
- due: "due",
2286
- due_in_days: function due_in_days(x) {
2287
- return "Due in " + (Math.abs(x) + (Math.abs(x) === 1 ? " day" : " days"));
2288
- },
2289
- overdue_days: function overdue_days(x) {
2290
- return "Overdue " + (Math.abs(x) + (Math.abs(x) === 1 ? " day" : " days"));
2291
- },
2292
- inbox: "Inbox",
2293
- archived: "Archived",
2294
- get_started: "Get Started",
2295
- its_free: ["it's free", "like forever..."],
2296
- enter_company: ["Enter company name", "for invoice."],
2297
- enable_face_id: "Enable Face ID",
2298
- enable_touch_id: "Enable Touch ID",
2299
- almost_done: "Almost done",
2300
- skip: "Skip",
2301
- type_of_business: "Type of business",
2302
- enter_email: ["Enter displayed email", "address on invoice."],
2303
- finish_setup: "Finish Setup",
2304
- biz_type_100: "Art, Photography & Creative Services",
2305
- biz_type_200: "Construction",
2306
- biz_type_300: "Home Improvement",
2307
- biz_type_400: "Home Maintenance",
2308
- biz_type_500: "Financial Services & Insurance",
2309
- biz_type_600: "Hair, Spa & Aesthetics",
2310
- biz_type_700: "Medical, Dental & Health",
2311
- biz_type_800: "Non-profits, Associations & Groups",
2312
- biz_type_900: "Retailers, Resellers & Sales",
2313
- biz_type_1000: "Web, Tech & Media",
2314
- biz_type_1100: "Food & Catering",
2315
- biz_type_1200: "Care Services (eg. childcare, aged care)",
2316
- biz_type_1300: "Consulting & Professional Services",
2317
- biz_type_1400: "Agriculture",
2318
- biz_type_1500: "Transport",
2319
- biz_type_1600: "Education",
2320
- biz_type_1700: "Travel & Recreation",
2321
- biz_type_1800: "Other: I provide a SERVICE",
2322
- biz_type_1900: "Other: I make or sell a PRODUCT",
2323
- archive: "Archive",
2324
- unarchive: "Unarchive",
2325
- create_new_customer: "Create new customer",
2326
- view_all: "View all",
2327
- import_from_contacts: "Import from your contacts",
2328
- did_you_send: "Did you send this document?",
2329
- mark_as_sent: "Mark as Sent",
2330
- add_note: "Add Note",
2331
- city: "City",
2332
- state: "State",
2333
- zip: "Zip",
2334
- country: "Country",
2335
- add: "Add",
2336
- search_company: "Search customer",
2337
- search_item: "Search item"
2274
+ }));
2275
+ };
2276
+
2277
+ var TemplateCompat = function TemplateCompat(template) {
2278
+ 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']]);
2279
+ return Object.fromEntries(Object.entries(template).map(function (_ref5) {
2280
+ var k = _ref5[0],
2281
+ v = _ref5[1];
2282
+ return [mapping.get(k) || k, v];
2283
+ }));
2338
2284
  };
2339
2285
 
2340
- var InvoiceCompatHtml = function InvoiceCompatHtml(invoice, lang) {
2341
- if (lang === void 0) {
2342
- lang = defaultLang;
2286
+ var DocumentDefinitionCompat = function DocumentDefinitionCompat(dd) {
2287
+ 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]]);
2288
+ var docs = [];
2289
+ var ms = [];
2290
+ var nt = [];
2291
+ var tc = [];
2292
+ var pf = [];
2293
+
2294
+ for (var _iterator = _createForOfIteratorHelperLoose(dd), _step; !(_step = _iterator()).done;) {
2295
+ var doc = _step.value;
2296
+ docs.push({
2297
+ n: doc.name,
2298
+ ty: docTypeMapping.get(doc.type),
2299
+ note: doc.note,
2300
+ docType: doc.docType,
2301
+ enabled: doc.enabled
2302
+ });
2303
+ ms.push(doc.defaultMessage);
2304
+ nt.push(doc.note);
2305
+ tc.push(doc.terms);
2306
+ pf.push(doc.prefix);
2343
2307
  }
2344
2308
 
2309
+ return {
2310
+ doc: docs,
2311
+ ms: ms,
2312
+ nt: nt,
2313
+ tc: tc,
2314
+ pf: pf
2315
+ };
2316
+ };
2317
+
2318
+ var CompanyCompat = function CompanyCompat(doc) {
2319
+ 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'], ['logoExists', 'lg']]);
2320
+ var rootMapping = new Map([['template', TemplateCompat], ['documentDefinitions', DocumentDefinitionCompat]]);
2321
+ var newCompany = Object.fromEntries(Object.entries(doc).map(function (_ref6) {
2322
+ var k = _ref6[0],
2323
+ v = _ref6[1];
2324
+ var mapV = mapping.get(k);
2325
+
2326
+ if (mapV && Array.isArray(mapV)) {
2327
+ return [mapV[0] || k, mapV[1](v)];
2328
+ } else {
2329
+ return [mapping.get(k) || k, v];
2330
+ }
2331
+ }));
2332
+ var subDoc = {};
2333
+ Object.entries(newCompany).forEach(function (_ref7) {
2334
+ var k = _ref7[0],
2335
+ v = _ref7[1];
2336
+
2337
+ if (rootMapping.get(k)) {
2338
+ var mapped = rootMapping.get(k)(v);
2339
+ delete mapped.__typename;
2340
+ subDoc = _extends({}, subDoc, mapped);
2341
+ }
2342
+ });
2343
+ newCompany = _extends({}, newCompany, subDoc);
2344
+
2345
+ var documentDefinitionCompat = function documentDefinitionCompat(doc) {
2346
+ if (!doc.documentDefinitions) {
2347
+ return {
2348
+ value: []
2349
+ };
2350
+ }
2351
+
2352
+ doc.ms = [];
2353
+ doc.pf = [];
2354
+ doc.tc = [];
2355
+ var ret = doc.documentDefinitions.map(function (def, idx) {
2356
+ var enabled = false;
2357
+
2358
+ if (typeof def.enabled === 'undefined') {
2359
+ if (def.name) {
2360
+ enabled = true;
2361
+ }
2362
+ } else {
2363
+ enabled = def.enabled;
2364
+ }
2365
+
2366
+ var obj = {
2367
+ n: def.name,
2368
+ enabled: enabled,
2369
+ ty: docTypeMapping.get(def.type),
2370
+ note: def.note,
2371
+ docType: def.docType
2372
+ };
2373
+ doc.ms.push(obj.defaultMessage);
2374
+ doc.pf.push(obj.prefix);
2375
+ doc.tc.push(obj.terms);
2376
+ return obj;
2377
+ });
2378
+ return ret;
2379
+ };
2380
+
2381
+ newCompany.documentDefinitions = documentDefinitionCompat(newCompany);
2382
+ return newCompany;
2383
+ };
2384
+
2385
+ var InvoiceCompatHtml = function InvoiceCompatHtml(_ref) {
2386
+ var invoice = _ref.invoice,
2387
+ _ref$lang = _ref.lang,
2388
+ lang = _ref$lang === void 0 ? defaultLang : _ref$lang,
2389
+ _ref$isDeposit = _ref.isDeposit,
2390
+ isDeposit = _ref$isDeposit === void 0 ? false : _ref$isDeposit;
2345
2391
  return invoiceHtml({
2346
2392
  invoice: _extends({}, invoice, {
2347
2393
  document: InvoiceCompat(invoice.document),
2348
2394
  company: CompanyCompat(invoice.company)
2349
2395
  }),
2350
- lang: lang
2396
+ lang: lang,
2397
+ isDeposit: isDeposit
2351
2398
  });
2352
2399
  };
2353
2400