diff --git a/.distignore b/.distignore index 7c3358cc5..afbd84d6c 100644 --- a/.distignore +++ b/.distignore @@ -7,5 +7,8 @@ *.gitmodules *.distignore *.gitattributes +*.editorconfig *composer.json *composer.lock +*strauss.phar +*strauss.md diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 51c4ed0d3..16aee144a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,7 +17,7 @@ jobs: strategy: matrix: operating-system: ['ubuntu-latest'] - php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1'] + php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] steps: - name: Checkout Git repository diff --git a/assets/css/settings-styles.css b/assets/css/settings-styles.css index 6fa0e958f..7393c06da 100644 --- a/assets/css/settings-styles.css +++ b/assets/css/settings-styles.css @@ -941,6 +941,15 @@ body.woocommerce_page_wpo_wcpdf_options_page { margin-bottom: 4em; } +#wpo-wcpdf-preview-wrapper input#due_date_days { + text-align: right; +} + +#wpo-wcpdf-preview-wrapper input#due_date_days:disabled { + background-color: #eaeaea; + color: #999; +} + sup.wcpdf_beta { background-color: #51266b; color: white; @@ -1120,7 +1129,8 @@ div.upgrade-table-description a, font-size: 0.8em; } -#upgrade-table .upgrade-links a.upgrade_button { +#upgrade-table .upgrade-links a.upgrade_button, +#plugin-recommendations a.upgrade_button { display: inline-block; background: white; padding: 1em 3em 1em 2em; @@ -1131,7 +1141,8 @@ div.upgrade-table-description a, position: relative; } -#upgrade-table .upgrade-links a.upgrade_button:after { +#upgrade-table .upgrade-links a.upgrade_button:after, +#plugin-recommendations a.upgrade_button:after { content: ' \2192'; /* ASCII code for right arrow */ display: block; position: absolute; @@ -1140,18 +1151,92 @@ div.upgrade-table-description a, transition: 0.5s; } -#upgrade-table .upgrade-links a.upgrade_button:hover:after { +#upgrade-table .upgrade-links a.upgrade_button:hover:after, +#plugin-recommendations a.upgrade_button:hover:after { right: 1.1em; font-weight: bold; } - #upgrade-table .upgrade-links a.upgrade_button:focus, -#upgrade-table .upgrade-links a.upgrade_button:hover { +#upgrade-table .upgrade-links a.upgrade_button:hover, +#plugin-recommendations a.upgrade_button:focus, +#plugin-recommendations a.upgrade_button:hover { background: #6e1edc; color: #fcfbf7; } +#plugin-recommendations { + border-radius: 8px; + background-color: #f1e9fc; + padding: 4em 3em; +} + +#plugin-recommendations .card-container { + max-width: 1100px; + display: grid; + grid-template-columns: repeat(3, 1fr); + grid-gap: 3em; + padding: 2em 0; +} + +#plugin-recommendations .recommendation-card { + margin-top: 0; + border-radius: 6px; + background-color: white; + box-shadow: 0 0 25px -10px rgba(0,0,0,0.2); + box-sizing: border-box; + font-size: 15px; + overflow: hidden; + transition: 0.2s; +} + +#plugin-recommendations .recommendation-card:nth-child(n+4) { + display: none; +} + +#plugin-recommendations .recommendation-card:hover { + scale: 1.02; +} + +#plugin-recommendations .recommendation-card.currently-installed { + opacity: 0.5; +} + +#plugin-recommendations .recommendation-card .card-content{ + padding: 0 4em 3em 2em; +} + +#plugin-recommendations .recommendation-card img { + width: 100%; +} + +#plugin-recommendations .recommendation-card h5 { + text-align: left; + font-size: 1.4em; + line-height: 1.3em; + font-weight: bold; + margin: 1em 0; +} + +#plugin-recommendations .recommendation-card p { + text-align: left; + padding-bottom: 10px; +} + +#plugin-recommendations .recommendation-card a.upgrade_button { + margin: 0; +} + +#plugin-recommendations .recommendation-card span.currently-installed { + font-size: 0.7em; + color: white; + background-color: #6e1edc; + padding: 1em 2em; + border-radius: 12px; + margin: 0; + display: inline-block; +} + @media screen and (max-width: 1100px) { #upgrade-table { font-size: 1em; @@ -1173,21 +1258,36 @@ div.upgrade-table-description a, #upgrade-table td.feature-label span.description { padding-top: 6px; } + + #plugin-recommendations .card-container { + grid-gap: 2em; + } +} + +@media screen and (max-width: 968px) { + #plugin-recommendations .card-container { + grid-template-columns: repeat(1, 1fr); + padding-right: 40%; + } } @media screen and (max-width: 767px) { #upgrade-table td.feature-label span.description { display: none; } - + #upgrade-table th:not(.last), #upgrade-table td:not(.last) { width: 20%; } - + #upgrade-table td.first { width: 40%; } + + #plugin-recommendations .card-container { + padding-right: 0; + } } @media screen and (max-width: 649px) { @@ -1223,4 +1323,8 @@ div.upgrade-table-description a, #upgrade-table .upgrade-links a:after { display: none; } + + #plugin-recommendations .card-container { + justify-content: center; + } } diff --git a/assets/css/settings-styles.min.css b/assets/css/settings-styles.min.css index 9cee17fdf..749e50aa0 100644 --- a/assets/css/settings-styles.min.css +++ b/assets/css/settings-styles.min.css @@ -1 +1 @@ -span.wpo-warning{display:inline-block;border:1px solid red;border-left:4px solid red;padding:5px 15px;background-color:#fff}.wcpdf-extensions-ad,.wcpdf-promo-ad{position:relative;min-height:90px;border:1px solid #6e1edc;background-color:#f1e9fc;padding:15px;padding-left:100px;margin-top:30px}img.wpo-helper{position:absolute;bottom:0;left:3px}.wcpdf-extensions-ad h3,.wcpdf-promo-ad h3{margin:0;padding:20px;font-weight:400;font-family:serif;letter-spacing:-1px;font-size:2.25em}.wcpdf-promo-ad p{margin:0;padding:0 20px;font-size:1.15em}.wcpdf-promo-ad p.upgrade-tab{margin-top:30px;font-style:italic;font-size:1em}.wcpdf-promo-ad p.expiration{font-size:.8em;padding-top:8px}.wcpdf-extensions-ad a,.wcpdf-promo-ad a{color:#6e1edc}.wcpdf-extensions-ad a.dismiss,.wcpdf-promo-ad a.dismiss{padding:10px 20px}.wcpdf-promo-ad p strong.code{font-size:1.3em;font-family:serif;padding:.1em .4em;background:#6e1edc;color:#fff;border-radius:5px;font-weight:400}.wcpdf-extensions-ad i{padding-left:20px}.wcpdf-extensions-ad ul,.wcpdf-promo-ad ul{margin:0;margin-left:40px}.wcpdf-extensions li{margin:0}.wcpdf-extensions li ul{list-style-type:square;margin-top:.5em;margin-bottom:.5em}.wcpdf-extensions>li:before{content:"";border-color:transparent transparent transparent #111;border-style:solid;border-width:.35em .35em .35em .45em;display:block;height:0;width:0;left:-1em;top:.9em;position:relative}.wcpdf-extensions li:not(.expanded){cursor:pointer}.wcpdf-extensions .expanded:before{border-color:#111 transparent transparent transparent;left:-1.17em;border-width:.45em .45em .35em .35em!important}.wcpdf-extensions .more{padding:10px;background-color:#fff;border:1px solid #ccc;border-radius:5px}.wcpdf-extensions table td{vertical-align:top}.dropbox-logo{margin-bottom:-10px;margin-right:10px}.cloud-logo{margin-bottom:-10px;margin-top:-5px;margin-right:10px}#img-header_logo{max-height:200px;width:auto;max-width:100%}.multiple-text-input label{padding-right:1em}table.multiple-text-input td{padding:0}table.wcpdf_documents_settings_list{width:100%;border-collapse:collapse;border-spacing:0;background-color:#fff;border-top:2px solid #000}table.wcpdf_documents_settings_list tr.odd{background-color:#ebf5ff}table.wcpdf_documents_settings_list td{padding:5px}table.wcpdf_documents_settings_list a{text-decoration:none}table.wcpdf_documents_settings_list td.settings-icon{text-align:right}table.wcpdf_documents_settings_list td.title{font-weight:700}.wcpdf-settings-sections ul{height:3em}.wcpdf-settings-sections ul li{float:left;margin-right:10px}.wcpdf-settings-sections ul li a{text-decoration:none;display:inline-block;padding:.8em 1em;color:#50575e;border:1px solid #c3c4c7;box-sizing:border-box}.wcpdf-settings-sections ul li a.active{border:2px solid #51266b;padding:calc(.8em - 1px) calc(1em - 1px);color:#000}.wcpdf_document_settings_sections{position:relative}.wcpdf_document_settings_sections>h2{cursor:pointer;padding:1em .8em;margin:0;border:1px solid #eaeaea}.wcpdf_document_settings_sections ul{background:#fff;list-style:none;margin:0;padding:0;width:100%;display:block;height:auto;display:none;box-sizing:border-box;position:absolute;border-left:1px solid #eaeaea;border-right:1px solid #eaeaea;z-index:1000;box-shadow:0 35px 35px -8px rgba(0,0,0,.1);-webkit-box-shadow:0 35px 35px -8px rgba(0,0,0,.1)}.wcpdf_document_settings_sections ul.active{display:block}.wcpdf_document_settings_sections ul li{box-sizing:border-box;padding:0;margin-bottom:0;border-bottom:1px solid #eaeaea;font-size:1.1em}.wcpdf_document_settings_sections ul li:hover{cursor:pointer;background:#51266b;color:#fff}.wcpdf_document_settings_sections ul li:hover a{color:#fff}.wcpdf_document_settings_sections ul li a{color:#000;text-decoration:none;padding:1.2em 1.6em;display:block}.wcpdf_document_settings_sections .arrow-down{font-size:.7em;color:#999;margin-left:8px;font-weight:400;float:right}.wcpdf_document_settings_sections p:hover,.wcpdf_document_settings_sections p:hover>.arrow-down{color:#222}.wcpdf_advanced_numbers_choose_table{margin-top:20px}.wcpdf_document_settings_document_output_formats{margin-bottom:30px}.edit-next-number{opacity:.5}.edit-next-number:hover{opacity:1;cursor:pointer}.wpo-wcpdf-pointer.wp-pointer-top .wp-pointer-arrow,.wpo-wcpdf-pointer.wp-pointer-top .wp-pointer-arrow-inner{border-bottom-color:#51266b}.wpo-wcpdf-pointer .wp-pointer-content h3{border-color:#51266b;background:#51266b}.wpo-wcpdf-pointer .wp-pointer-content h3:before{color:#51266b}body.woocommerce_page_wpo_wcpdf_options_page{background:#fff}.wrap [class$=icon32]+h2{font-size:18px;padding:1em}.wrap .notice{margin:15px 0 0}.nav-tab-wrapper:not(.wcpdf_debug_settings_sections>.nav-tab-wrapper) a.nav-tab{background:0 0;border:none;border-bottom:3px solid transparent;padding:1em 0;margin:0 1.2em;font-size:15px}.nav-tab-wrapper:not(.wcpdf_debug_settings_sections>.nav-tab-wrapper) a.nav-tab.nav-tab-active{border-bottom:3px solid #51266b}#wpo-wcpdf-preview-wrapper{width:100%;height:auto;position:relative;display:flex;align-items:flex-start}#wpo-wcpdf-preview-wrapper .preview-document,#wpo-wcpdf-preview-wrapper .sidebar{transition:.3s ease-in-out}#wpo-wcpdf-preview-wrapper .sidebar{height:auto;padding:4em 0 0 0;box-sizing:border-box;background:0 0;flex:0 0 35%;overflow-x:hidden}#wpo-wcpdf-preview-wrapper .sidebar>form{background:0 0!important;overflow:visible;padding:0;margin-left:2em;box-sizing:border-box;width:calc(100% - 4em);max-width:50vw}#wpo-wcpdf-preview-wrapper .sidebar>form.editor{max-width:none}#wpo-wcpdf-preview-wrapper .sidebar .form-table,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>th,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr>td,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr>th{display:block;width:100%;padding:0}#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>th,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr>th{padding-bottom:.6em}#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr>td{padding-bottom:2.4em}#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td p.description,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr>td>p.description{font-size:.85em;padding-top:.7em}#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td>input[type=text],#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td>input[type=url],#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td>select,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td>textarea,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr>td>input[type=text],#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr>td>input[type=url],#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr>td>select,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr>td>textarea{max-width:none;width:100%}#wpo-wcpdf-preview-wrapper input[type=text][size],#wpo-wcpdf-preview-wrapper input[type=url][size]{width:auto!important;max-width:100%!important}#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td>input#next_invoice_number{width:auto!important}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .sidebar .form-table,#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .sidebar .form-table,#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .sidebar .form-table{display:table}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .sidebar .form-table tbody,#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .sidebar .form-table tbody,#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .sidebar .form-table tbody{display:table-row-group}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .sidebar .form-table tbody tr,#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .sidebar .form-table tr,#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .sidebar .form-table tbody tr,#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .sidebar .form-table tr,#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .sidebar .form-table tbody tr,#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .sidebar .form-table tr{display:table-row}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .sidebar .form-table>tbody>tr>td,#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .sidebar .form-table>tbody>tr>th,#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .sidebar .form-table>tbody>tr>td,#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .sidebar .form-table>tbody>tr>th,#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .sidebar .form-table>tbody>tr>td,#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .sidebar .form-table>tbody>tr>th{display:table-cell;padding:15px 10px 15px 0;width:auto}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .sidebar .form-table>tbody>tr>th,#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .sidebar .form-table>tbody>tr>th,#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .sidebar .form-table>tbody>tr>th{width:300px!important}#wpo-wcpdf-settings .form-table .ui-tabs-nav{padding-left:0!important;margin-left:0!important}#wpo-wcpdf-settings .translations input,#wpo-wcpdf-settings .translations textarea{width:100%}#wpo-wcpdf-settings .wcpdf-attachment-settings-hint{border-left:4px solid #51266b}#wpo-wcpdf-settings .notice-info.inline{border-left-color:#51266b}#wpo-wcpdf-settings table#document-link-access-type{margin-top:-15px}#wpo-wcpdf-settings table#document-link-access-type td.option{padding-left:0}#wpo-wcpdf-settings table#document-link-access-type td{padding-top:0;padding-bottom:6px;font-size:12px}#wpo-wcpdf-settings .system-status-table{margin-top:2em}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .sidebar{flex:0 0 100%}#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .sidebar{flex:0 0 95%}#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=full] .sidebar{flex:0 0 95%;margin-left:-95%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .sidebar{flex:0 0 95%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=sidebar] .sidebar{flex:0 0 35%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=full] .sidebar{margin-left:-35%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-from-preview-state=full] .sidebar{transition-delay:.4s}#wpo-wcpdf-preview-wrapper .preview-document{padding:0;box-sizing:border-box;position:sticky;top:2.4em;flex:0 0 60%}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .preview-document{display:none}#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .preview-document{display:none}#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=full] .preview-document{flex:0 0 95%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .preview-document{flex:0 0 60%;margin-right:-60%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=sidebar] .preview-document{flex:0 0 60%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=full] .preview-document{flex:0 0 95%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-from-preview-state=full] .preview-document{transition-delay:.4s}.preview-document .preview{width:100%;box-sizing:border-box;padding-right:5%}.preview-document .preview>#preview-ubl{width:100%;height:100%;overflow-wrap:anywhere;background-color:#222;color:#fff;padding:2em}.preview-document .preview>#preview-canvas{display:block;max-width:800px;max-height:85vh;width:auto!important;margin:0 auto;background:#fff;box-shadow:0 0 35px -8px rgba(0,0,0,.12);-webkit-box-shadow:0 0 35px -8px rgba(0,0,0,.12)}#wpo-wcpdf-preview-wrapper[data-preview-states="2"] #preview-canvas{max-height:170vh}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-from-preview-state=sidebar] #preview-canvas{max-height:170vh;transition:max-height .4s ease-in-out .3s}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-from-preview-state=full] #preview-canvas{transition:max-height .4s ease-in-out 0s}.preview-document .preview-data-wrapper{width:100%;height:4em}.preview-document .preview-data-wrapper .preview-document-type,.preview-document .preview-data-wrapper .preview-order-data{float:right}.preview-document .preview-data-wrapper .preview-document-type{margin-right:30px}.preview-document .preview-data-wrapper .preview-document-type ul>li{text-decoration:none;color:initial;padding:1.4em 1.6em}.preview-document .preview-data-wrapper .preview-document-type ul>li:hover{color:#fff!important}.preview-document .preview-data-wrapper .save-settings{padding:1em 0 0 0;float:right;overflow:hidden;position:relative}.preview-document .preview-data-wrapper .save-settings p{padding:0;margin:0 0 0 2em;position:relative;margin-right:-200px;transition:margin-right .3s ease-out}.preview-document .preview-data-wrapper .save-settings p:after{content:'';display:block;pointer-events:none;position:absolute;box-sizing:border-box;border-radius:3px;right:0;top:0;background:0 0;width:100%;height:100%;z-index:10;border:0 solid #fff;animation:border-pulse 4s infinite}@keyframes border-pulse{0%{border-color:rgba(255,255,255,0);border-width:8px}50%{border-color:#fff;border-width:0}}.preview-document .preview-data-wrapper .save-settings p input:focus{outline-width:0;box-shadow:none}.preview-document .preview-data p{padding:1.4em 0;margin:0;color:#666;text-align:right;cursor:pointer;font-weight:lighter;float:right}.preview-document .preview-data p.order-search{display:none}.preview-document .preview-data input{float:right;margin:1em 0 0 1em;padding:.1em .5em;width:20ch;margin-right:-25ch;display:none}.preview-document .preview-data input.active{margin-right:0;display:inline-block}.preview-document .preview-data ul{position:absolute;right:0;top:4em;background:#fff;box-shadow:0 0 25px -10px rgba(0,0,0,.2);-webkit-box-shadow:0 0 25px -10px rgba(0,0,0,.2);list-style:none;margin:0;padding:0;min-width:24em;display:block;height:0;overflow:hidden}.preview-document .preview-data ul.active{height:auto;z-index:1}.preview-document .preview-data ul li{box-sizing:border-box;padding:0;margin-bottom:0;border-bottom:1px solid #eaeaea;font-size:1.1em}.preview-document .preview-data ul li:hover{cursor:pointer;background:#51266b;color:#fff}.preview-document .preview-data ul li a,.preview-document .preview-data.preview-order-data ul li{display:block;padding:1.4em 1.6em}.preview-document .preview-data .arrow-down{font-size:.8em;color:#999;margin-left:8px}.preview-document .preview-data p:hover,.preview-document .preview-data p:hover>.arrow-down{color:#222}.preview-document .preview-data #preview-order-search-results{display:none;position:absolute;right:0;top:4em;width:300px;box-shadow:0 0 25px -10px rgba(0,0,0,.2);-webkit-box-shadow:0 0 25px -10px rgba(0,0,0,.2);padding:20px 0;background-color:#fff;z-index:99}.preview-document .preview-data #preview-order-search-results a{display:block;border-left:1px solid #999;border-right:1px solid #999;border-top:1px solid #999;color:#000;padding:10px;margin:0 20px;text-decoration:none;cursor:pointer}.preview-document .preview-data #preview-order-search-results a:last-child{border-bottom:1px solid #999}.preview-document .preview-data #preview-order-search-results a:hover{background-color:#51266b;color:#fff}.preview-document .preview-data #preview-order-search-results .order-number{font-weight:700}.preview-document .preview-data #preview-order-search-results .date,.preview-document .preview-data #preview-order-search-results .total{margin-top:6px;display:inline-block}.preview-document .preview-data #preview-order-search-results .total{float:right}.preview-document .preview-data #preview-order-search-results .error{margin:0 20px}.preview-document .preview-order-search-wrapper{position:relative;float:right}.preview-document .preview-order-search-wrapper img.preview-order-search-clear{position:absolute;width:30px;height:16px;top:22px;right:6px;display:none;cursor:pointer}#wpo-wcpdf-preview-wrapper .gutter{flex:0 0 5%;position:sticky;top:2.4em;height:170vh}#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .gutter .slide-left,#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .gutter .slide-left{float:right}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=sidebar] .gutter .slide-left{border:none}#wpo-wcpdf-preview-wrapper .slider{box-sizing:border-box;padding-top:2.4em;color:#999;font-weight:700;cursor:pointer;font-size:.7em;line-height:1em;width:50%;height:100%;float:left}#wpo-wcpdf-preview-wrapper .slider.slide-left{text-align:right;padding-right:10px;border-right:1px solid #ccc}#wpo-wcpdf-preview-wrapper .slider.slide-right{text-align:left;padding-left:10px;border-left:1px solid #ccc;display:none}#wpo-wcpdf-preview-wrapper .gutter-arrow{width:0;height:0;border-top:3px solid transparent;border-bottom:3px solid transparent;display:block}#wpo-wcpdf-preview-wrapper .arrow-left{border-right:7px solid #999;float:right}#wpo-wcpdf-preview-wrapper .arrow-right{border-left:7px solid #999}#wpo-wcpdf-preview-wrapper .slider:hover>.arrow-left{border-right:7px solid #222}#wpo-wcpdf-preview-wrapper .slider:hover>.arrow-right{border-left:7px solid #222}#wpo-wcpdf-preview-wrapper .slider.slide-left:after{position:absolute;top:1.55em;right:2em;font-size:1.4em;display:none}#wpo-wcpdf-preview-wrapper .slider.slide-right:after{position:absolute;top:1.55em;left:2em;font-size:1.4em;display:none}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .gutter{display:none}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=sidebar] .gutter{height:100vh}#wpo-wcpdf-preview-wrapper[data-preview-state=full] .slide-right:after{display:inline-block}#wpo-wcpdf-preview-wrapper[data-preview-state=closed] .slide-left:after{display:inline-block}#wpo-wcpdf-preview-wrapper.static .gutter,#wpo-wcpdf-preview-wrapper.static .preview-document{position:static!important}#wpo-wcpdf-preview-wrapper.static .sidebar{height:170vh!important;overflow:hidden}#wpo-wcpdf-preview-wrapper input.readonly,#wpo-wcpdf-preview-wrapper input[readonly],#wpo-wcpdf-preview-wrapper textarea.readonly,#wpo-wcpdf-preview-wrapper textarea[readonly]{background-color:#f8f8f8}#wpo-wcpdf-preview-wrapper[data-preview-state=sidebar] .select2.select2-container{width:100%!important}.wcpdf_ubl_settings_sections{margin-bottom:4em}sup.wcpdf_beta{background-color:#51266b;color:#fff;font-size:7pt;padding:1px 2px;border-radius:2px}@media screen and (min-width:1920px){.preview-document .preview>#preview-canvas{max-width:900px}}@media screen and (max-width:1200px){.preview-document .preview>#preview-canvas{max-width:680px}.nav-tab-wrapper a.nav-tab{padding:1em 2em;margin:0 .5em .5em 0;border:1px solid #ccc;box-sizing:border-box;height:4em}.nav-tab-wrapper a.nav-tab.nav-tab-active{border:3px solid #51266b}}@media screen and (max-width:960px){.preview-document .preview>#preview-canvas{width:80vw!important}#wpo-wcpdf-preview-wrapper .sidebar>form{max-width:100%}#wpo-wcpdf-preview-wrapper[data-preview-state=closed] .select2.select2-container{width:100%!important}#wpo-wcpdf-preview-wrapper .sidebar .form-table,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>th,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr>td,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr>th{display:block!important}.preview-document .preview-data-wrapper{height:6em}.preview-document .preview-data p{padding:2.2em 0}#wpo-wcpdf-preview-wrapper .slider.slide-left:after,#wpo-wcpdf-preview-wrapper .slider.slide-right:after{top:1.5em;padding:1em;background:#fff;border:1px solid #ccc}#wpo-wcpdf-preview-wrapper .slider.slide-right:after{left:0}#wpo-wcpdf-preview-wrapper .slider.slide-left:after{right:0}#wpo-wcpdf-preview-wrapper .multiple-text-input tr td:nth-child(2),#wpo-wcpdf-preview-wrapper .multiple-text-input tr td:nth-child(3){float:left;margin-bottom:10px}#wpo-wcpdf-preview-wrapper .multiple-text-input tr td .woocommerce-help-tip:after{padding:.5em .8em;font-size:1.2em;line-height:inherit}}div.upgrade-table-description{padding:0 0 3em 1em}div.upgrade-table-description h1{font-family:serif;letter-spacing:-1px;font-size:3em}div.upgrade-table-description p{font-size:1.1em}#upgrade-table{width:100%;border-collapse:collapse;font-size:1.2em;margin-bottom:3em}#upgrade-table td,#upgrade-table th{padding:.8em 2em;border-bottom:1px solid #ccc;text-align:center}#upgrade-table th{font-weight:400;font-size:1.1em}#upgrade-table td:not(.last),#upgrade-table th:not(.last){width:200px}#upgrade-table tr:last-child td{border:none}#upgrade-table td.feature-label{text-align:left;padding-left:1em;font-weight:700;width:500px}#upgrade-table td.feature-label span.description{display:inline-block;padding-top:10px;font-size:.8em;line-height:1.4em;font-weight:400;color:#555}#upgrade-table td span.feature-available{display:inline-block;width:24px;height:24px;background-repeat:no-repeat;background-size:cover}#upgrade-table a,div.upgrade-table-description a{color:#6e1edc;white-space:nowrap}#upgrade-table .upgrade-links h4{margin:1em 0 .5em 0}#upgrade-table .upgrade-links p{margin:0;font-style:oblique;font-size:.8em}#upgrade-table .upgrade-links a.upgrade_button{display:inline-block;background:#fff;padding:1em 3em 1em 2em;border-radius:12px;border:1px solid #6e1edc;text-decoration:none;margin:2em 0;position:relative}#upgrade-table .upgrade-links a.upgrade_button:after{content:' \2192';display:block;position:absolute;right:1.8em;top:1.1em;transition:.5s}#upgrade-table .upgrade-links a.upgrade_button:hover:after{right:1.1em;font-weight:700}#upgrade-table .upgrade-links a.upgrade_button:focus,#upgrade-table .upgrade-links a.upgrade_button:hover{background:#6e1edc;color:#fcfbf7}@media screen and (max-width:1100px){#upgrade-table{font-size:1em;line-height:1.2em}#upgrade-table td:not(.last),#upgrade-table th:not(.last){width:25%;padding:.8em 1em}#upgrade-table td.last,#upgrade-table th.last{width:0;padding:0}#upgrade-table td.feature-label span.description{padding-top:6px}}@media screen and (max-width:767px){#upgrade-table td.feature-label span.description{display:none}#upgrade-table td:not(.last),#upgrade-table th:not(.last){width:20%}#upgrade-table td.first{width:40%}}@media screen and (max-width:649px){div.upgrade-table-description{padding-left:.8em}div.upgrade-table-description p{font-size:1em}#upgrade-table{font-size:.8em}#upgrade-table td,#upgrade-table th{padding:.5em .8em!important}#upgrade-table td span.feature-available{width:18px;height:18px}#upgrade-table .upgrade-links a{white-space:normal;padding:.6em .8em;border-radius:6px}#upgrade-table .upgrade-links a:after{display:none}} \ No newline at end of file +span.wpo-warning{display:inline-block;border:1px solid red;border-left:4px solid red;padding:5px 15px;background-color:#fff}.wcpdf-extensions-ad,.wcpdf-promo-ad{position:relative;min-height:90px;border:1px solid #6e1edc;background-color:#f1e9fc;padding:15px;padding-left:100px;margin-top:30px}img.wpo-helper{position:absolute;bottom:0;left:3px}.wcpdf-extensions-ad h3,.wcpdf-promo-ad h3{margin:0;padding:20px;font-weight:400;font-family:serif;letter-spacing:-1px;font-size:2.25em}.wcpdf-promo-ad p{margin:0;padding:0 20px;font-size:1.15em}.wcpdf-promo-ad p.upgrade-tab{margin-top:30px;font-style:italic;font-size:1em}.wcpdf-promo-ad p.expiration{font-size:.8em;padding-top:8px}.wcpdf-extensions-ad a,.wcpdf-promo-ad a{color:#6e1edc}.wcpdf-extensions-ad a.dismiss,.wcpdf-promo-ad a.dismiss{padding:10px 20px}.wcpdf-promo-ad p strong.code{font-size:1.3em;font-family:serif;padding:.1em .4em;background:#6e1edc;color:#fff;border-radius:5px;font-weight:400}.wcpdf-extensions-ad i{padding-left:20px}.wcpdf-extensions-ad ul,.wcpdf-promo-ad ul{margin:0;margin-left:40px}.wcpdf-extensions li{margin:0}.wcpdf-extensions li ul{list-style-type:square;margin-top:.5em;margin-bottom:.5em}.wcpdf-extensions>li:before{content:"";border-color:transparent transparent transparent #111;border-style:solid;border-width:.35em .35em .35em .45em;display:block;height:0;width:0;left:-1em;top:.9em;position:relative}.wcpdf-extensions li:not(.expanded){cursor:pointer}.wcpdf-extensions .expanded:before{border-color:#111 transparent transparent transparent;left:-1.17em;border-width:.45em .45em .35em .35em!important}.wcpdf-extensions .more{padding:10px;background-color:#fff;border:1px solid #ccc;border-radius:5px}.wcpdf-extensions table td{vertical-align:top}.dropbox-logo{margin-bottom:-10px;margin-right:10px}.cloud-logo{margin-bottom:-10px;margin-top:-5px;margin-right:10px}#img-header_logo{max-height:200px;width:auto;max-width:100%}.multiple-text-input label{padding-right:1em}table.multiple-text-input td{padding:0}table.wcpdf_documents_settings_list{width:100%;border-collapse:collapse;border-spacing:0;background-color:#fff;border-top:2px solid #000}table.wcpdf_documents_settings_list tr.odd{background-color:#ebf5ff}table.wcpdf_documents_settings_list td{padding:5px}table.wcpdf_documents_settings_list a{text-decoration:none}table.wcpdf_documents_settings_list td.settings-icon{text-align:right}table.wcpdf_documents_settings_list td.title{font-weight:700}.wcpdf-settings-sections ul{height:3em}.wcpdf-settings-sections ul li{float:left;margin-right:10px}.wcpdf-settings-sections ul li a{text-decoration:none;display:inline-block;padding:.8em 1em;color:#50575e;border:1px solid #c3c4c7;box-sizing:border-box}.wcpdf-settings-sections ul li a.active{border:2px solid #51266b;padding:calc(.8em - 1px) calc(1em - 1px);color:#000}.wcpdf_document_settings_sections{position:relative}.wcpdf_document_settings_sections>h2{cursor:pointer;padding:1em .8em;margin:0;border:1px solid #eaeaea}.wcpdf_document_settings_sections ul{background:#fff;list-style:none;margin:0;padding:0;width:100%;display:block;height:auto;display:none;box-sizing:border-box;position:absolute;border-left:1px solid #eaeaea;border-right:1px solid #eaeaea;z-index:1000;box-shadow:0 35px 35px -8px rgba(0,0,0,.1);-webkit-box-shadow:0 35px 35px -8px rgba(0,0,0,.1)}.wcpdf_document_settings_sections ul.active{display:block}.wcpdf_document_settings_sections ul li{box-sizing:border-box;padding:0;margin-bottom:0;border-bottom:1px solid #eaeaea;font-size:1.1em}.wcpdf_document_settings_sections ul li:hover{cursor:pointer;background:#51266b;color:#fff}.wcpdf_document_settings_sections ul li:hover a{color:#fff}.wcpdf_document_settings_sections ul li a{color:#000;text-decoration:none;padding:1.2em 1.6em;display:block}.wcpdf_document_settings_sections .arrow-down{font-size:.7em;color:#999;margin-left:8px;font-weight:400;float:right}.wcpdf_document_settings_sections p:hover,.wcpdf_document_settings_sections p:hover>.arrow-down{color:#222}.wcpdf_advanced_numbers_choose_table{margin-top:20px}.wcpdf_document_settings_document_output_formats{margin-bottom:30px}.edit-next-number{opacity:.5}.edit-next-number:hover{opacity:1;cursor:pointer}.wpo-wcpdf-pointer.wp-pointer-top .wp-pointer-arrow,.wpo-wcpdf-pointer.wp-pointer-top .wp-pointer-arrow-inner{border-bottom-color:#51266b}.wpo-wcpdf-pointer .wp-pointer-content h3{border-color:#51266b;background:#51266b}.wpo-wcpdf-pointer .wp-pointer-content h3:before{color:#51266b}body.woocommerce_page_wpo_wcpdf_options_page{background:#fff}.wrap [class$=icon32]+h2{font-size:18px;padding:1em}.wrap .notice{margin:15px 0 0}.nav-tab-wrapper:not(.wcpdf_debug_settings_sections>.nav-tab-wrapper) a.nav-tab{background:0 0;border:none;border-bottom:3px solid transparent;padding:1em 0;margin:0 1.2em;font-size:15px}.nav-tab-wrapper:not(.wcpdf_debug_settings_sections>.nav-tab-wrapper) a.nav-tab.nav-tab-active{border-bottom:3px solid #51266b}#wpo-wcpdf-preview-wrapper{width:100%;height:auto;position:relative;display:flex;align-items:flex-start}#wpo-wcpdf-preview-wrapper .preview-document,#wpo-wcpdf-preview-wrapper .sidebar{transition:.3s ease-in-out}#wpo-wcpdf-preview-wrapper .sidebar{height:auto;padding:4em 0 0 0;box-sizing:border-box;background:0 0;flex:0 0 35%;overflow-x:hidden}#wpo-wcpdf-preview-wrapper .sidebar>form{background:0 0!important;overflow:visible;padding:0;margin-left:2em;box-sizing:border-box;width:calc(100% - 4em);max-width:50vw}#wpo-wcpdf-preview-wrapper .sidebar>form.editor{max-width:none}#wpo-wcpdf-preview-wrapper .sidebar .form-table,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>th,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr>td,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr>th{display:block;width:100%;padding:0}#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>th,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr>th{padding-bottom:.6em}#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr>td{padding-bottom:2.4em}#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td p.description,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr>td>p.description{font-size:.85em;padding-top:.7em}#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td>input[type=text],#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td>input[type=url],#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td>select,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td>textarea,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr>td>input[type=text],#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr>td>input[type=url],#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr>td>select,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr>td>textarea{max-width:none;width:100%}#wpo-wcpdf-preview-wrapper input[type=text][size],#wpo-wcpdf-preview-wrapper input[type=url][size]{width:auto!important;max-width:100%!important}#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td>input#next_invoice_number{width:auto!important}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .sidebar .form-table,#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .sidebar .form-table,#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .sidebar .form-table{display:table}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .sidebar .form-table tbody,#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .sidebar .form-table tbody,#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .sidebar .form-table tbody{display:table-row-group}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .sidebar .form-table tbody tr,#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .sidebar .form-table tr,#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .sidebar .form-table tbody tr,#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .sidebar .form-table tr,#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .sidebar .form-table tbody tr,#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .sidebar .form-table tr{display:table-row}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .sidebar .form-table>tbody>tr>td,#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .sidebar .form-table>tbody>tr>th,#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .sidebar .form-table>tbody>tr>td,#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .sidebar .form-table>tbody>tr>th,#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .sidebar .form-table>tbody>tr>td,#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .sidebar .form-table>tbody>tr>th{display:table-cell;padding:15px 10px 15px 0;width:auto}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .sidebar .form-table>tbody>tr>th,#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .sidebar .form-table>tbody>tr>th,#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .sidebar .form-table>tbody>tr>th{width:300px!important}#wpo-wcpdf-settings .form-table .ui-tabs-nav{padding-left:0!important;margin-left:0!important}#wpo-wcpdf-settings .translations input,#wpo-wcpdf-settings .translations textarea{width:100%}#wpo-wcpdf-settings .wcpdf-attachment-settings-hint{border-left:4px solid #51266b}#wpo-wcpdf-settings .notice-info.inline{border-left-color:#51266b}#wpo-wcpdf-settings table#document-link-access-type{margin-top:-15px}#wpo-wcpdf-settings table#document-link-access-type td.option{padding-left:0}#wpo-wcpdf-settings table#document-link-access-type td{padding-top:0;padding-bottom:6px;font-size:12px}#wpo-wcpdf-settings .system-status-table{margin-top:2em}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .sidebar{flex:0 0 100%}#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .sidebar{flex:0 0 95%}#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=full] .sidebar{flex:0 0 95%;margin-left:-95%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .sidebar{flex:0 0 95%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=sidebar] .sidebar{flex:0 0 35%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=full] .sidebar{margin-left:-35%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-from-preview-state=full] .sidebar{transition-delay:.4s}#wpo-wcpdf-preview-wrapper .preview-document{padding:0;box-sizing:border-box;position:sticky;top:2.4em;flex:0 0 60%}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .preview-document{display:none}#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .preview-document{display:none}#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=full] .preview-document{flex:0 0 95%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .preview-document{flex:0 0 60%;margin-right:-60%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=sidebar] .preview-document{flex:0 0 60%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=full] .preview-document{flex:0 0 95%}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-from-preview-state=full] .preview-document{transition-delay:.4s}.preview-document .preview{width:100%;box-sizing:border-box;padding-right:5%}.preview-document .preview>#preview-ubl{width:100%;height:100%;overflow-wrap:anywhere;background-color:#222;color:#fff;padding:2em}.preview-document .preview>#preview-canvas{display:block;max-width:800px;max-height:85vh;width:auto!important;margin:0 auto;background:#fff;box-shadow:0 0 35px -8px rgba(0,0,0,.12);-webkit-box-shadow:0 0 35px -8px rgba(0,0,0,.12)}#wpo-wcpdf-preview-wrapper[data-preview-states="2"] #preview-canvas{max-height:170vh}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-from-preview-state=sidebar] #preview-canvas{max-height:170vh;transition:max-height .4s ease-in-out .3s}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-from-preview-state=full] #preview-canvas{transition:max-height .4s ease-in-out 0s}.preview-document .preview-data-wrapper{width:100%;height:4em}.preview-document .preview-data-wrapper .preview-document-type,.preview-document .preview-data-wrapper .preview-order-data{float:right}.preview-document .preview-data-wrapper .preview-document-type{margin-right:30px}.preview-document .preview-data-wrapper .preview-document-type ul>li{text-decoration:none;color:initial;padding:1.4em 1.6em}.preview-document .preview-data-wrapper .preview-document-type ul>li:hover{color:#fff!important}.preview-document .preview-data-wrapper .save-settings{padding:1em 0 0 0;float:right;overflow:hidden;position:relative}.preview-document .preview-data-wrapper .save-settings p{padding:0;margin:0 0 0 2em;position:relative;margin-right:-200px;transition:margin-right .3s ease-out}.preview-document .preview-data-wrapper .save-settings p:after{content:'';display:block;pointer-events:none;position:absolute;box-sizing:border-box;border-radius:3px;right:0;top:0;background:0 0;width:100%;height:100%;z-index:10;border:0 solid #fff;animation:border-pulse 4s infinite}@keyframes border-pulse{0%{border-color:rgba(255,255,255,0);border-width:8px}50%{border-color:#fff;border-width:0}}.preview-document .preview-data-wrapper .save-settings p input:focus{outline-width:0;box-shadow:none}.preview-document .preview-data p{padding:1.4em 0;margin:0;color:#666;text-align:right;cursor:pointer;font-weight:lighter;float:right}.preview-document .preview-data p.order-search{display:none}.preview-document .preview-data input{float:right;margin:1em 0 0 1em;padding:.1em .5em;width:20ch;margin-right:-25ch;display:none}.preview-document .preview-data input.active{margin-right:0;display:inline-block}.preview-document .preview-data ul{position:absolute;right:0;top:4em;background:#fff;box-shadow:0 0 25px -10px rgba(0,0,0,.2);-webkit-box-shadow:0 0 25px -10px rgba(0,0,0,.2);list-style:none;margin:0;padding:0;min-width:24em;display:block;height:0;overflow:hidden}.preview-document .preview-data ul.active{height:auto;z-index:1}.preview-document .preview-data ul li{box-sizing:border-box;padding:0;margin-bottom:0;border-bottom:1px solid #eaeaea;font-size:1.1em}.preview-document .preview-data ul li:hover{cursor:pointer;background:#51266b;color:#fff}.preview-document .preview-data ul li a,.preview-document .preview-data.preview-order-data ul li{display:block;padding:1.4em 1.6em}.preview-document .preview-data .arrow-down{font-size:.8em;color:#999;margin-left:8px}.preview-document .preview-data p:hover,.preview-document .preview-data p:hover>.arrow-down{color:#222}.preview-document .preview-data #preview-order-search-results{display:none;position:absolute;right:0;top:4em;width:300px;box-shadow:0 0 25px -10px rgba(0,0,0,.2);-webkit-box-shadow:0 0 25px -10px rgba(0,0,0,.2);padding:20px 0;background-color:#fff;z-index:99}.preview-document .preview-data #preview-order-search-results a{display:block;border-left:1px solid #999;border-right:1px solid #999;border-top:1px solid #999;color:#000;padding:10px;margin:0 20px;text-decoration:none;cursor:pointer}.preview-document .preview-data #preview-order-search-results a:last-child{border-bottom:1px solid #999}.preview-document .preview-data #preview-order-search-results a:hover{background-color:#51266b;color:#fff}.preview-document .preview-data #preview-order-search-results .order-number{font-weight:700}.preview-document .preview-data #preview-order-search-results .date,.preview-document .preview-data #preview-order-search-results .total{margin-top:6px;display:inline-block}.preview-document .preview-data #preview-order-search-results .total{float:right}.preview-document .preview-data #preview-order-search-results .error{margin:0 20px}.preview-document .preview-order-search-wrapper{position:relative;float:right}.preview-document .preview-order-search-wrapper img.preview-order-search-clear{position:absolute;width:30px;height:16px;top:22px;right:6px;display:none;cursor:pointer}#wpo-wcpdf-preview-wrapper .gutter{flex:0 0 5%;position:sticky;top:2.4em;height:170vh}#wpo-wcpdf-preview-wrapper[data-preview-states="2"][data-preview-state=closed] .gutter .slide-left,#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=closed] .gutter .slide-left{float:right}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=sidebar] .gutter .slide-left{border:none}#wpo-wcpdf-preview-wrapper .slider{box-sizing:border-box;padding-top:2.4em;color:#999;font-weight:700;cursor:pointer;font-size:.7em;line-height:1em;width:50%;height:100%;float:left}#wpo-wcpdf-preview-wrapper .slider.slide-left{text-align:right;padding-right:10px;border-right:1px solid #ccc}#wpo-wcpdf-preview-wrapper .slider.slide-right{text-align:left;padding-left:10px;border-left:1px solid #ccc;display:none}#wpo-wcpdf-preview-wrapper .gutter-arrow{width:0;height:0;border-top:3px solid transparent;border-bottom:3px solid transparent;display:block}#wpo-wcpdf-preview-wrapper .arrow-left{border-right:7px solid #999;float:right}#wpo-wcpdf-preview-wrapper .arrow-right{border-left:7px solid #999}#wpo-wcpdf-preview-wrapper .slider:hover>.arrow-left{border-right:7px solid #222}#wpo-wcpdf-preview-wrapper .slider:hover>.arrow-right{border-left:7px solid #222}#wpo-wcpdf-preview-wrapper .slider.slide-left:after{position:absolute;top:1.55em;right:2em;font-size:1.4em;display:none}#wpo-wcpdf-preview-wrapper .slider.slide-right:after{position:absolute;top:1.55em;left:2em;font-size:1.4em;display:none}#wpo-wcpdf-preview-wrapper[data-preview-states="1"] .gutter{display:none}#wpo-wcpdf-preview-wrapper[data-preview-states="3"][data-preview-state=sidebar] .gutter{height:100vh}#wpo-wcpdf-preview-wrapper[data-preview-state=full] .slide-right:after{display:inline-block}#wpo-wcpdf-preview-wrapper[data-preview-state=closed] .slide-left:after{display:inline-block}#wpo-wcpdf-preview-wrapper.static .gutter,#wpo-wcpdf-preview-wrapper.static .preview-document{position:static!important}#wpo-wcpdf-preview-wrapper.static .sidebar{height:170vh!important;overflow:hidden}#wpo-wcpdf-preview-wrapper input.readonly,#wpo-wcpdf-preview-wrapper input[readonly],#wpo-wcpdf-preview-wrapper textarea.readonly,#wpo-wcpdf-preview-wrapper textarea[readonly]{background-color:#f8f8f8}#wpo-wcpdf-preview-wrapper[data-preview-state=sidebar] .select2.select2-container{width:100%!important}.wcpdf_ubl_settings_sections{margin-bottom:4em}#wpo-wcpdf-preview-wrapper input#due_date_days{text-align:right}#wpo-wcpdf-preview-wrapper input#due_date_days:disabled{background-color:#eaeaea;color:#999}sup.wcpdf_beta{background-color:#51266b;color:#fff;font-size:7pt;padding:1px 2px;border-radius:2px}@media screen and (min-width:1920px){.preview-document .preview>#preview-canvas{max-width:900px}}@media screen and (max-width:1200px){.preview-document .preview>#preview-canvas{max-width:680px}.nav-tab-wrapper a.nav-tab{padding:1em 2em;margin:0 .5em .5em 0;border:1px solid #ccc;box-sizing:border-box;height:4em}.nav-tab-wrapper a.nav-tab.nav-tab-active{border:3px solid #51266b}}@media screen and (max-width:960px){.preview-document .preview>#preview-canvas{width:80vw!important}#wpo-wcpdf-preview-wrapper .sidebar>form{max-width:100%}#wpo-wcpdf-preview-wrapper[data-preview-state=closed] .select2.select2-container{width:100%!important}#wpo-wcpdf-preview-wrapper .sidebar .form-table,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>td,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tbody>tr>th,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr>td,#wpo-wcpdf-preview-wrapper .sidebar .form-table>tr>th{display:block!important}.preview-document .preview-data-wrapper{height:6em}.preview-document .preview-data p{padding:2.2em 0}#wpo-wcpdf-preview-wrapper .slider.slide-left:after,#wpo-wcpdf-preview-wrapper .slider.slide-right:after{top:1.5em;padding:1em;background:#fff;border:1px solid #ccc}#wpo-wcpdf-preview-wrapper .slider.slide-right:after{left:0}#wpo-wcpdf-preview-wrapper .slider.slide-left:after{right:0}#wpo-wcpdf-preview-wrapper .multiple-text-input tr td:nth-child(2),#wpo-wcpdf-preview-wrapper .multiple-text-input tr td:nth-child(3){float:left;margin-bottom:10px}#wpo-wcpdf-preview-wrapper .multiple-text-input tr td .woocommerce-help-tip:after{padding:.5em .8em;font-size:1.2em;line-height:inherit}}div.upgrade-table-description{padding:0 0 3em 1em}div.upgrade-table-description h1{font-family:serif;letter-spacing:-1px;font-size:3em}div.upgrade-table-description p{font-size:1.1em}#upgrade-table{width:100%;border-collapse:collapse;font-size:1.2em;margin-bottom:3em}#upgrade-table td,#upgrade-table th{padding:.8em 2em;border-bottom:1px solid #ccc;text-align:center}#upgrade-table th{font-weight:400;font-size:1.1em}#upgrade-table td:not(.last),#upgrade-table th:not(.last){width:200px}#upgrade-table tr:last-child td{border:none}#upgrade-table td.feature-label{text-align:left;padding-left:1em;font-weight:700;width:500px}#upgrade-table td.feature-label span.description{display:inline-block;padding-top:10px;font-size:.8em;line-height:1.4em;font-weight:400;color:#555}#upgrade-table td span.feature-available{display:inline-block;width:24px;height:24px;background-repeat:no-repeat;background-size:cover}#upgrade-table a,div.upgrade-table-description a{color:#6e1edc;white-space:nowrap}#upgrade-table .upgrade-links h4{margin:1em 0 .5em 0}#upgrade-table .upgrade-links p{margin:0;font-style:oblique;font-size:.8em}#plugin-recommendations a.upgrade_button,#upgrade-table .upgrade-links a.upgrade_button{display:inline-block;background:#fff;padding:1em 3em 1em 2em;border-radius:12px;border:1px solid #6e1edc;text-decoration:none;margin:2em 0;position:relative}#plugin-recommendations a.upgrade_button:after,#upgrade-table .upgrade-links a.upgrade_button:after{content:' \2192';display:block;position:absolute;right:1.8em;top:1.1em;transition:.5s}#plugin-recommendations a.upgrade_button:hover:after,#upgrade-table .upgrade-links a.upgrade_button:hover:after{right:1.1em;font-weight:700}#plugin-recommendations a.upgrade_button:focus,#plugin-recommendations a.upgrade_button:hover,#upgrade-table .upgrade-links a.upgrade_button:focus,#upgrade-table .upgrade-links a.upgrade_button:hover{background:#6e1edc;color:#fcfbf7}#plugin-recommendations{border-radius:8px;background-color:#f1e9fc;padding:4em 3em}#plugin-recommendations .card-container{max-width:1100px;display:grid;grid-template-columns:repeat(3,1fr);grid-gap:3em;padding:2em 0}#plugin-recommendations .recommendation-card{margin-top:0;border-radius:6px;background-color:#fff;box-shadow:0 0 25px -10px rgba(0,0,0,.2);box-sizing:border-box;font-size:15px;overflow:hidden;transition:.2s}#plugin-recommendations .recommendation-card:nth-child(n+4){display:none}#plugin-recommendations .recommendation-card:hover{scale:1.02}#plugin-recommendations .recommendation-card.currently-installed{opacity:.5}#plugin-recommendations .recommendation-card .card-content{padding:0 4em 3em 2em}#plugin-recommendations .recommendation-card img{width:100%}#plugin-recommendations .recommendation-card h5{text-align:left;font-size:1.4em;line-height:1.3em;font-weight:700;margin:1em 0}#plugin-recommendations .recommendation-card p{text-align:left;padding-bottom:10px}#plugin-recommendations .recommendation-card a.upgrade_button{margin:0}#plugin-recommendations .recommendation-card span.currently-installed{font-size:.7em;color:#fff;background-color:#6e1edc;padding:1em 2em;border-radius:12px;margin:0;display:inline-block}@media screen and (max-width:1100px){#upgrade-table{font-size:1em;line-height:1.2em}#upgrade-table td:not(.last),#upgrade-table th:not(.last){width:25%;padding:.8em 1em}#upgrade-table td.last,#upgrade-table th.last{width:0;padding:0}#upgrade-table td.feature-label span.description{padding-top:6px}#plugin-recommendations .card-container{grid-gap:2em}}@media screen and (max-width:968px){#plugin-recommendations .card-container{grid-template-columns:repeat(1,1fr);padding-right:40%}}@media screen and (max-width:767px){#upgrade-table td.feature-label span.description{display:none}#upgrade-table td:not(.last),#upgrade-table th:not(.last){width:20%}#upgrade-table td.first{width:40%}#plugin-recommendations .card-container{padding-right:0}}@media screen and (max-width:649px){div.upgrade-table-description{padding-left:.8em}div.upgrade-table-description p{font-size:1em}#upgrade-table{font-size:.8em}#upgrade-table td,#upgrade-table th{padding:.5em .8em!important}#upgrade-table td span.feature-available{width:18px;height:18px}#upgrade-table .upgrade-links a{white-space:normal;padding:.6em .8em;border-radius:6px}#upgrade-table .upgrade-links a:after{display:none}#plugin-recommendations .card-container{justify-content:center}} \ No newline at end of file diff --git a/assets/images/generic_document.svg b/assets/images/generic_document.svg new file mode 100644 index 000000000..bf9272cd9 --- /dev/null +++ b/assets/images/generic_document.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/images/wc-reminder-emails-thumbnail-400x400.jpg b/assets/images/wc-reminder-emails-thumbnail-400x400.jpg new file mode 100644 index 000000000..0b1b43c4c Binary files /dev/null and b/assets/images/wc-reminder-emails-thumbnail-400x400.jpg differ diff --git a/assets/images/woocommerce-address-labels-thumbnail-400x400.jpg b/assets/images/woocommerce-address-labels-thumbnail-400x400.jpg new file mode 100644 index 000000000..04e88ba72 Binary files /dev/null and b/assets/images/woocommerce-address-labels-thumbnail-400x400.jpg differ diff --git a/assets/images/woocommerce-order-list-thumbnail-400x400.jpg b/assets/images/woocommerce-order-list-thumbnail-400x400.jpg new file mode 100644 index 000000000..e936cf06a Binary files /dev/null and b/assets/images/woocommerce-order-list-thumbnail-400x400.jpg differ diff --git a/assets/images/woocommerce-printnode-thumbnail-400x400.jpg b/assets/images/woocommerce-printnode-thumbnail-400x400.jpg new file mode 100644 index 000000000..59b4f2bbd Binary files /dev/null and b/assets/images/woocommerce-printnode-thumbnail-400x400.jpg differ diff --git a/assets/images/woocommerce-ultimate-barcodes-thumbnail-400x400.jpg b/assets/images/woocommerce-ultimate-barcodes-thumbnail-400x400.jpg new file mode 100644 index 000000000..887cbb5a6 Binary files /dev/null and b/assets/images/woocommerce-ultimate-barcodes-thumbnail-400x400.jpg differ diff --git a/assets/images/wp-menu-cart-pro-thumbnail-400x400.jpg b/assets/images/wp-menu-cart-pro-thumbnail-400x400.jpg new file mode 100644 index 000000000..86d366ef7 Binary files /dev/null and b/assets/images/wp-menu-cart-pro-thumbnail-400x400.jpg differ diff --git a/assets/js/admin-script.js b/assets/js/admin-script.js index 54208b27b..6b518a481 100644 --- a/assets/js/admin-script.js +++ b/assets/js/admin-script.js @@ -105,6 +105,17 @@ jQuery( function( $ ) { 'delay': 200 } ); + $( '#wpo-wcpdf-preview-wrapper #due_date' ).on( 'change', function() { + const $due_date_checkbox = $( '#wpo-wcpdf-preview-wrapper #due_date' ); + const $due_date_days_input = $( '#wpo-wcpdf-preview-wrapper #due_date_days' ); + + if ( $due_date_checkbox.is( ':checked' ) ) { + $due_date_days_input.prop( 'disabled', false ); + } else { + $due_date_days_input.prop( 'disabled', true ); + } + } ).trigger( 'change' ); + //----------> Preview <----------// // objects let $previewWrapper = $( '#wpo-wcpdf-preview-wrapper' ); diff --git a/assets/js/admin-script.min.js b/assets/js/admin-script.min.js index 52e429b6c..4887d2b0c 100644 --- a/assets/js/admin-script.min.js +++ b/assets/js/admin-script.min.js @@ -1 +1 @@ -jQuery(function(a){function b(){m=w.val(),n=x.val(),o=y.val(),p=z.val(),q=A.serialize()}function c(){w.val("").trigger("change")}function d(){!1==u.attr("data-preview-states-lock")&&(1200>=a(this).width()&&(1200=t||a(this).width()==t)&&("full"==u.attr("data-preview-state")?(u.find(".preview-document").show(),u.find(".sidebar").hide(),u.find(".slide-left").hide(),u.find(".slide-right").show(),u.attr("data-preview-states",3),u.attr("data-preview-state","full"),u.attr("data-from-preview-state","sidebar"),u.addClass("static")):"closed"==u.attr("data-preview-state")&&a(this).width()!==t?(u.find(".preview-document").hide(),u.find(".sidebar").show(),u.find(".slide-left").show(),u.find(".slide-right").hide(),u.attr("data-preview-states",3),u.attr("data-preview-state","closed"),u.attr("data-from-preview-state",""),u.removeClass("static")):(u.find(".preview-document, .sidebar").show(),u.find(".slide-left, .slide-right").show(),u.attr("data-preview-states",3),u.attr("data-preview-state","sidebar"),u.attr("data-from-preview-state",""),u.removeClass("static")))),t=a(this).width()}function e(a){window.scrollTo(0,0);let b=a;setTimeout(function(){b.addClass("static")},300)}function f(b,c){g();let d=a(b.target);if(!i(d.attr("name"))){if(d.hasClass("remove-requirement")||"disable_for"==d.attr("id"))return;if(-1!==jQuery.inArray(b.type,["keyup","paste"])){if(d.is("input[type=\"checkbox\"], select"))return;c="keyup"==b.type?1e3:0}h(c)}}function g(b){a(".preview-data-wrapper .save-settings p").css("margin-right","0")}function h(a){a="number"==typeof a?a:0,b(),clearTimeout(r),r=setTimeout(function(){j()},a)}function i(b){let c=!1;if(!b)return c;let d=b.includes("[")?b.match(/\[(.*?)\]/)[1]:b;return-1!==a.inArray(d,wpo_wcpdf_admin.preview_excluded_settings)&&(c=!0),c}function j(){let b=wpo_wcpdf_admin.pdfjs_worker,c="preview-canvas",d={action:"wpo_wcpdf_preview",security:p,order_id:m,document_type:n,output_format:o,data:q};v.children(".notice").remove(),v.block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),B=a.ajax({type:"POST",url:wpo_wcpdf_admin.ajaxurl,data:d,beforeSend:function(a,b){null!=B&&B.abort()},success:function(d,e,f){if(d.data.error)a("#"+c).remove(),v.append("

"+d.data.error+"

");else if(d.data.preview_data&&d.data.output_format)switch(a("#"+c).remove(),d.data.output_format){default:case"pdf":v.append(""),k(b,c,d.data.preview_data);break;case"ubl":let a=d.data.preview_data,e=a.replace(/&/g,"&").replace(//g,">").replace(/ /g," ").replace(/\n/g,"
");v.html("
"+e+"
")}v.unblock()},error:function(b,d,e){if("abort"!=d){let d=b.status+": "+b.statusText;a("#"+c).remove(),v.append("

"+d+"

"),v.unblock()}}})}function k(a,b,c){c=window.atob(c),pdfjsLib.GlobalWorkerOptions.workerSrc=a;let d=pdfjsLib.getDocument({data:c});d.promise.then(function(a){let c=1;a.getPage(1).then(function(a){let c=2,d=a.getViewport({scale:2}),e=document.getElementById(b),f=e.getContext("2d");e.height=d.height,e.width=d.width;let g={canvasContext:f,viewport:d},h=a.render(g);h.promise.then(function(){})})},function(a){console.error(a)})}function l(b){let c=b.closest(".preview-data").find("#preview-order-search-results"),d=b.val(),e=b.data("nonce"),f="wpo_wcpdf_preview_order_search",g={security:e,action:f,search:d,document_type:n};c.parent().find("img.preview-order-search-clear").hide(),c.children(".error").remove(),c.children("a").remove(),c.hide(),a.ajax({type:"POST",url:wpo_wcpdf_admin.ajaxurl,data:g,success:function(d){d.data&&(d.data.error?(c.append(""+d.data.error+""),c.show()):a.each(d.data,function(a,b){let d="#"+b.order_number+" - "+b.billing_first_name+" "+b.billing_last_name;0"+b.date_created+""+b.total+"";c.append(d+e),c.show()})),b.removeClass("ajax-waiting"),b.closest("div").find("img.preview-order-search-clear").show()}})}a(".wcpdf-extensions .more").hide(),a(".wcpdf-extensions > li").on("click",function(b){a(this).toggleClass("expanded"),a(this).find(".more").slideToggle()}),a(".edit-next-number").on("click",function(b){a(this).hide(),a(this).siblings("input").prop("disabled",!1),a(this).siblings(".save-next-number.button").show()}),a(".save-next-number").on("click",function(b){$input=a(this).siblings("input"),$input.addClass("ajax-waiting");let c=$input.val();if(0 h2").on("click",function(){a(this).parent().find("ul").toggleClass("active")}),a.each(wpo_wcpdf_admin.pointers,function(b,c){a(c.target).pointer({content:c.content,position:{edge:c.position.edge,align:c.position.align},pointerClass:c.pointer_class,pointerWidth:c.pointer_width,close:function(){jQuery.post(wpo_wcpdf_admin.ajaxurl,{pointer:b,action:"dismiss-wp-pointer"})}}),-1===a.inArray(b,wpo_wcpdf_admin.dismissed_pointers.split(","))&&a(c.target).pointer("open")}),a(".woocommerce-help-tip").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200});let m,n,o,p,q,r,s,t,u=a("#wpo-wcpdf-preview-wrapper"),v=a("#wpo-wcpdf-preview-wrapper .preview"),w=a("#wpo-wcpdf-preview-wrapper input[name=\"order_id\"]"),x=a("#wpo-wcpdf-preview-wrapper input[name=\"document_type\"]"),y=a("#wpo-wcpdf-preview-wrapper input[name=\"output_format\"]"),z=a("#wpo-wcpdf-preview-wrapper input[name=\"nonce\"]"),A=a("#wpo-wcpdf-settings"),B=null;(function a(){x.val(x.data("default")).trigger("change")})(),c(),b(),t=a(window).width(),d(),a(window).on("resize",d),a(".slide-left").on("click",function(){let a=u.attr("data-preview-states"),b=u.attr("data-preview-state");u.find(".preview-data-wrapper ul").removeClass("active"),3==a?"closed"==b?(u.find(".preview-document").show(),u.find(".slide-right").show(),u.attr("data-preview-state","sidebar"),u.attr("data-from-preview-state","closed")):(u.find(".slide-left").hide(),u.find(".sidebar").delay(300).hide(0),u.attr("data-preview-state","full"),u.attr("data-from-preview-state","sidebar"),e(u)):(u.find(".preview-document").show(),u.find(".slide-left").hide(),u.find(".slide-right").show(),u.attr("data-preview-state","full"),u.attr("data-from-preview-state","closed"),e(u))}),a(".slide-right").on("click",function(){let a=u.attr("data-preview-states"),b=u.attr("data-preview-state");u.find(".preview-data-wrapper ul").removeClass("active"),3==a?"full"==b?(u.find(".slide-left").delay(400).show(0),u.find(".sidebar").show(),u.attr("data-preview-state","sidebar"),u.attr("data-from-preview-state","full")):(u.find(".preview-document").hide(300),u.find(".slide-right").hide(),u.attr("data-preview-state","closed"),u.attr("data-from-preview-state","sidebar")):(u.find(".preview-document").hide(300),u.find(".slide-left").show(),u.find(".slide-right").hide(),u.attr("data-preview-state","closed"),u.attr("data-from-preview-state","full")),u.removeClass("static")}),a(".preview-document .preview-data p").on("click",function(){let b=a(this).closest(".preview-data");b.siblings(".preview-data").find("ul").removeClass("active"),b.find("ul").toggleClass("active")}),a(".preview-document .preview-data ul > li").on("click",function(){let b=a(this).closest(".preview-data");b.find("ul").toggleClass("active"),a(this).hasClass("order-search")?(b.find("p.last-order").hide(),b.find("input[name=\"preview-order-search\"]").addClass("active"),b.find("p.order-search").show().find(".order-search-label").text(a(this).text())):(b.find("p.last-order").show(),b.find("p.order-search").hide(),b.find("input[name=\"preview-order-search\"]").removeClass("active").val(""),b.find("#preview-order-search-results").hide(),b.find("img.preview-order-search-clear").hide(),c(),h())}),h(),a(document).on("wpo-wcpdf-settings-changed",function(a,b){g(),h(b)}),a(document).on("wpo-wcpdf-refresh-preview wpo_wcpdf_refresh_preview",function(a,b){h(b)}),a(document).on("click","#preview-order-search-results a",function(b){b.preventDefault(),a(".preview-document .order-search-label").text("#"+a(this).data("order_id")),w.val(a(this).data("order_id")).trigger("change"),a(this).closest("div").hide(),a(this).closest("div").children("a").remove(),h()}),a(document).on("keyup paste","#wpo-wcpdf-settings input, #wpo-wcpdf-settings textarea",f),a(document).on("change","#wpo-wcpdf-settings input[type=\"checkbox\"], #wpo-wcpdf-settings input[type=\"radio\"], #wpo-wcpdf-settings select",function(a){a.isTrigger||f(a)}),a(document).on("select2:select select2:unselect","#wpo-wcpdf-settings select.wc-enhanced-select",f),a(document.body).on("wpo-wcpdf-media-upload-setting-updated",f),a(document).on("click",".wpo_remove_image_button, #wpo-wcpdf-settings .remove-requirement",f),a(document.body).on("click",".preview-data-wrapper .save-settings p input",function(b){a("#wpo-wcpdf-settings input#submit").trigger("click")}),a(document).on("click","img.preview-order-search-clear",function(b){b.preventDefault(),a(this).closest("div").find("input#preview-order-search").val(""),a(this).closest(".preview-data").find("#preview-order-search-results").children("a").remove(),a(this).closest(".preview-data").find("#preview-order-search-results").children(".error").remove(),a(this).closest(".preview-data").find("#preview-order-search-results").hide(),a(this).hide()}),a("#wpo-wcpdf-preview-wrapper ul.preview-data-option-list li").on("click",function(){let b=a(this).closest("ul").data("input-name"),c=a("#wpo-wcpdf-preview-wrapper :input[name="+b+"]");c.val(a(this).data("value")).trigger("change")}),x.on("change",function(){let b=a(this).val();if(b.length){let c=a(this).attr("name"),d=a("#wpo-wcpdf-preview-wrapper ul.preview-data-option-list[data-input-name="+c+"]"),e=d.find("li[data-value="+b+"]");d.parent().find(".current-label").text(e.text()),h()}}).trigger("change"),w.on("change",function(){h()}).trigger("change"),a("#preview-order-search").on("keyup paste",function(c){let d=a(this);d.addClass("ajax-waiting");let e="keyup"==c.type?1e3:0;b(),clearTimeout(s),s=setTimeout(function(){l(d)},e)})}); \ No newline at end of file +jQuery(function(a){function b(){m=w.val(),n=x.val(),o=y.val(),p=z.val(),q=A.serialize()}function c(){w.val("").trigger("change")}function d(){!1==u.attr("data-preview-states-lock")&&(1200>=a(this).width()&&(1200=t||a(this).width()==t)&&("full"==u.attr("data-preview-state")?(u.find(".preview-document").show(),u.find(".sidebar").hide(),u.find(".slide-left").hide(),u.find(".slide-right").show(),u.attr("data-preview-states",3),u.attr("data-preview-state","full"),u.attr("data-from-preview-state","sidebar"),u.addClass("static")):"closed"==u.attr("data-preview-state")&&a(this).width()!==t?(u.find(".preview-document").hide(),u.find(".sidebar").show(),u.find(".slide-left").show(),u.find(".slide-right").hide(),u.attr("data-preview-states",3),u.attr("data-preview-state","closed"),u.attr("data-from-preview-state",""),u.removeClass("static")):(u.find(".preview-document, .sidebar").show(),u.find(".slide-left, .slide-right").show(),u.attr("data-preview-states",3),u.attr("data-preview-state","sidebar"),u.attr("data-from-preview-state",""),u.removeClass("static")))),t=a(this).width()}function e(a){window.scrollTo(0,0);let b=a;setTimeout(function(){b.addClass("static")},300)}function f(b,c){g();let d=a(b.target);if(!i(d.attr("name"))){if(d.hasClass("remove-requirement")||"disable_for"==d.attr("id"))return;if(-1!==jQuery.inArray(b.type,["keyup","paste"])){if(d.is("input[type=\"checkbox\"], select"))return;c="keyup"==b.type?1e3:0}h(c)}}function g(b){a(".preview-data-wrapper .save-settings p").css("margin-right","0")}function h(a){a="number"==typeof a?a:0,b(),clearTimeout(r),r=setTimeout(function(){j()},a)}function i(b){let c=!1;if(!b)return c;let d=b.includes("[")?b.match(/\[(.*?)\]/)[1]:b;return-1!==a.inArray(d,wpo_wcpdf_admin.preview_excluded_settings)&&(c=!0),c}function j(){let b=wpo_wcpdf_admin.pdfjs_worker,c="preview-canvas",d={action:"wpo_wcpdf_preview",security:p,order_id:m,document_type:n,output_format:o,data:q};v.children(".notice").remove(),v.block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),B=a.ajax({type:"POST",url:wpo_wcpdf_admin.ajaxurl,data:d,beforeSend:function(a,b){null!=B&&B.abort()},success:function(d,e,f){if(d.data.error)a("#"+c).remove(),v.append("

"+d.data.error+"

");else if(d.data.preview_data&&d.data.output_format)switch(a("#"+c).remove(),d.data.output_format){default:case"pdf":v.append(""),k(b,c,d.data.preview_data);break;case"ubl":let a=d.data.preview_data,e=a.replace(/&/g,"&").replace(//g,">").replace(/ /g," ").replace(/\n/g,"
");v.html("
"+e+"
")}v.unblock()},error:function(b,d,e){if("abort"!=d){let d=b.status+": "+b.statusText;a("#"+c).remove(),v.append("

"+d+"

"),v.unblock()}}})}function k(a,b,c){c=window.atob(c),pdfjsLib.GlobalWorkerOptions.workerSrc=a;let d=pdfjsLib.getDocument({data:c});d.promise.then(function(a){let c=1;a.getPage(1).then(function(a){let c=2,d=a.getViewport({scale:2}),e=document.getElementById(b),f=e.getContext("2d");e.height=d.height,e.width=d.width;let g={canvasContext:f,viewport:d},h=a.render(g);h.promise.then(function(){})})},function(a){console.error(a)})}function l(b){let c=b.closest(".preview-data").find("#preview-order-search-results"),d=b.val(),e=b.data("nonce"),f="wpo_wcpdf_preview_order_search",g={security:e,action:f,search:d,document_type:n};c.parent().find("img.preview-order-search-clear").hide(),c.children(".error").remove(),c.children("a").remove(),c.hide(),a.ajax({type:"POST",url:wpo_wcpdf_admin.ajaxurl,data:g,success:function(d){d.data&&(d.data.error?(c.append(""+d.data.error+""),c.show()):a.each(d.data,function(a,b){let d="#"+b.order_number+" - "+b.billing_first_name+" "+b.billing_last_name;0"+b.date_created+""+b.total+"";c.append(d+e),c.show()})),b.removeClass("ajax-waiting"),b.closest("div").find("img.preview-order-search-clear").show()}})}a(".wcpdf-extensions .more").hide(),a(".wcpdf-extensions > li").on("click",function(b){a(this).toggleClass("expanded"),a(this).find(".more").slideToggle()}),a(".edit-next-number").on("click",function(b){a(this).hide(),a(this).siblings("input").prop("disabled",!1),a(this).siblings(".save-next-number.button").show()}),a(".save-next-number").on("click",function(b){$input=a(this).siblings("input"),$input.addClass("ajax-waiting");let c=$input.val();if(0 h2").on("click",function(){a(this).parent().find("ul").toggleClass("active")}),a.each(wpo_wcpdf_admin.pointers,function(b,c){a(c.target).pointer({content:c.content,position:{edge:c.position.edge,align:c.position.align},pointerClass:c.pointer_class,pointerWidth:c.pointer_width,close:function(){jQuery.post(wpo_wcpdf_admin.ajaxurl,{pointer:b,action:"dismiss-wp-pointer"})}}),-1===a.inArray(b,wpo_wcpdf_admin.dismissed_pointers.split(","))&&a(c.target).pointer("open")}),a(".woocommerce-help-tip").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200}),a("#wpo-wcpdf-preview-wrapper #due_date").on("change",function(){const b=a("#wpo-wcpdf-preview-wrapper #due_date"),c=a("#wpo-wcpdf-preview-wrapper #due_date_days");b.is(":checked")?c.prop("disabled",!1):c.prop("disabled",!0)}).trigger("change");let m,n,o,p,q,r,s,t,u=a("#wpo-wcpdf-preview-wrapper"),v=a("#wpo-wcpdf-preview-wrapper .preview"),w=a("#wpo-wcpdf-preview-wrapper input[name=\"order_id\"]"),x=a("#wpo-wcpdf-preview-wrapper input[name=\"document_type\"]"),y=a("#wpo-wcpdf-preview-wrapper input[name=\"output_format\"]"),z=a("#wpo-wcpdf-preview-wrapper input[name=\"nonce\"]"),A=a("#wpo-wcpdf-settings"),B=null;(function a(){x.val(x.data("default")).trigger("change")})(),c(),b(),t=a(window).width(),d(),a(window).on("resize",d),a(".slide-left").on("click",function(){let a=u.attr("data-preview-states"),b=u.attr("data-preview-state");u.find(".preview-data-wrapper ul").removeClass("active"),3==a?"closed"==b?(u.find(".preview-document").show(),u.find(".slide-right").show(),u.attr("data-preview-state","sidebar"),u.attr("data-from-preview-state","closed")):(u.find(".slide-left").hide(),u.find(".sidebar").delay(300).hide(0),u.attr("data-preview-state","full"),u.attr("data-from-preview-state","sidebar"),e(u)):(u.find(".preview-document").show(),u.find(".slide-left").hide(),u.find(".slide-right").show(),u.attr("data-preview-state","full"),u.attr("data-from-preview-state","closed"),e(u))}),a(".slide-right").on("click",function(){let a=u.attr("data-preview-states"),b=u.attr("data-preview-state");u.find(".preview-data-wrapper ul").removeClass("active"),3==a?"full"==b?(u.find(".slide-left").delay(400).show(0),u.find(".sidebar").show(),u.attr("data-preview-state","sidebar"),u.attr("data-from-preview-state","full")):(u.find(".preview-document").hide(300),u.find(".slide-right").hide(),u.attr("data-preview-state","closed"),u.attr("data-from-preview-state","sidebar")):(u.find(".preview-document").hide(300),u.find(".slide-left").show(),u.find(".slide-right").hide(),u.attr("data-preview-state","closed"),u.attr("data-from-preview-state","full")),u.removeClass("static")}),a(".preview-document .preview-data p").on("click",function(){let b=a(this).closest(".preview-data");b.siblings(".preview-data").find("ul").removeClass("active"),b.find("ul").toggleClass("active")}),a(".preview-document .preview-data ul > li").on("click",function(){let b=a(this).closest(".preview-data");b.find("ul").toggleClass("active"),a(this).hasClass("order-search")?(b.find("p.last-order").hide(),b.find("input[name=\"preview-order-search\"]").addClass("active"),b.find("p.order-search").show().find(".order-search-label").text(a(this).text())):(b.find("p.last-order").show(),b.find("p.order-search").hide(),b.find("input[name=\"preview-order-search\"]").removeClass("active").val(""),b.find("#preview-order-search-results").hide(),b.find("img.preview-order-search-clear").hide(),c(),h())}),h(),a(document).on("wpo-wcpdf-settings-changed",function(a,b){g(),h(b)}),a(document).on("wpo-wcpdf-refresh-preview wpo_wcpdf_refresh_preview",function(a,b){h(b)}),a(document).on("click","#preview-order-search-results a",function(b){b.preventDefault(),a(".preview-document .order-search-label").text("#"+a(this).data("order_id")),w.val(a(this).data("order_id")).trigger("change"),a(this).closest("div").hide(),a(this).closest("div").children("a").remove(),h()}),a(document).on("keyup paste","#wpo-wcpdf-settings input, #wpo-wcpdf-settings textarea",f),a(document).on("change","#wpo-wcpdf-settings input[type=\"checkbox\"], #wpo-wcpdf-settings input[type=\"radio\"], #wpo-wcpdf-settings select",function(a){a.isTrigger||f(a)}),a(document).on("select2:select select2:unselect","#wpo-wcpdf-settings select.wc-enhanced-select",f),a(document.body).on("wpo-wcpdf-media-upload-setting-updated",f),a(document).on("click",".wpo_remove_image_button, #wpo-wcpdf-settings .remove-requirement",f),a(document.body).on("click",".preview-data-wrapper .save-settings p input",function(b){a("#wpo-wcpdf-settings input#submit").trigger("click")}),a(document).on("click","img.preview-order-search-clear",function(b){b.preventDefault(),a(this).closest("div").find("input#preview-order-search").val(""),a(this).closest(".preview-data").find("#preview-order-search-results").children("a").remove(),a(this).closest(".preview-data").find("#preview-order-search-results").children(".error").remove(),a(this).closest(".preview-data").find("#preview-order-search-results").hide(),a(this).hide()}),a("#wpo-wcpdf-preview-wrapper ul.preview-data-option-list li").on("click",function(){let b=a(this).closest("ul").data("input-name"),c=a("#wpo-wcpdf-preview-wrapper :input[name="+b+"]");c.val(a(this).data("value")).trigger("change")}),x.on("change",function(){let b=a(this).val();if(b.length){let c=a(this).attr("name"),d=a("#wpo-wcpdf-preview-wrapper ul.preview-data-option-list[data-input-name="+c+"]"),e=d.find("li[data-value="+b+"]");d.parent().find(".current-label").text(e.text()),h()}}).trigger("change"),w.on("change",function(){h()}).trigger("change"),a("#preview-order-search").on("keyup paste",function(c){let d=a(this);d.addClass("ajax-waiting");let e="keyup"==c.type?1e3:0;b(),clearTimeout(s),s=setTimeout(function(){l(d)},e)})}); \ No newline at end of file diff --git a/assets/js/debug-script.js b/assets/js/debug-script.js index a9b5e0c10..0304af526 100644 --- a/assets/js/debug-script.js +++ b/assets/js/debug-script.js @@ -69,6 +69,7 @@ jQuery( function( $ ) { default: if ( response.success && response.data.message ) { $notice.addClass( 'notice-success' ); + $form.find( '> .notice-warning' ).remove(); } else if ( ! response.success && response.data.message ) { $notice.addClass( 'notice-error' ); } diff --git a/assets/js/debug-script.min.js b/assets/js/debug-script.min.js index 502026d30..17d2696e1 100644 --- a/assets/js/debug-script.min.js +++ b/assets/js/debug-script.min.js @@ -1 +1 @@ -jQuery(function(a){function b(b,c,d){let e=d.find("fieldset > .notice");switch(e.hide(),e.removeClass("notice-error"),e.removeClass("notice-success"),b){case"export_settings":if(c.success&&c.data.filename&&c.data.settings){d.find(".download_file").remove();let b={type:d.find("select[name=\"type\"").val(),settings:c.data.settings};b="data:text/plain;charset=utf-8,"+encodeURIComponent(JSON.stringify(b)),d.append(a("
"+c.data.filename+"
"))}else!c.success&&c.data.message&&(e.addClass("notice-error"),e.find("p").text(c.data.message),e.show());break;default:c.success&&c.data.message?e.addClass("notice-success"):!c.success&&c.data.message&&e.addClass("notice-error"),e.find("p").text(c.data.message),e.show()}}function c(b,d,e,f,g,h,i){let j={action:"wpo_wcpdf_danger_zone_tools",delete_or_renumber:i,document_type:b,date_type:d,date_from:e,date_to:f,page_count:g,document_count:h,nonce:wpo_wcpdf_debug.nonce};a.ajax({type:"POST",url:wpo_wcpdf_debug.ajaxurl,data:j,dataType:"json",success:function(j){if(!1===j.data.finished)g=j.data.pageCount,h=j.data.documentCount,c(b,d,e,f,g,h,i);else{a(".renumber-spinner, .delete-spinner").css("visibility","hidden"),a("#renumber-documents-btn, #delete-documents-btn").removeAttr("disabled"),a("#renumber-document-type, #renumber-date-from, #renumber-date-to, #delete-document-type, #delete-date-from, #delete-date-to").prop("disabled",!1);let b=j.data.message;alert(h+b)}},error:function(a,b,c){alert(a.status+":"+c)}})}if(a("#debug-tools .tool").on("click","input[type=\"submit\"]",function(c){c.preventDefault();let d=a(this).closest("form"),e=d.find("input[name=\"debug_tool\"]").val(),f=new FormData(d[0]);f.append("action","wpo_wcpdf_debug_tools"),f.append("nonce",wpo_wcpdf_debug.nonce),d.closest(".tool").block({message:null,overlayCSS:{background:"#fff",opacity:.6}});let g=!1;g="reset-settings"!==e||window.confirm(wpo_wcpdf_debug.confirm_reset),g&&a.ajax({url:wpo_wcpdf_debug.ajaxurl,data:f,type:"POST",cache:!1,processData:!1,contentType:!1,success(a){b(e,a,d),d.closest(".tool").unblock()},error(){d.closest(".tool").unblock()}})}),a("[name='wpo_wcpdf_settings_debug[document_access_denied_redirect_page]']").on("change",function(){let b=a(this).closest("table").find("#document_custom_redirect_page"),c=b.closest("td").find(".description");"custom_page"===a(this).val()?(b.show(),c.show()):(b.hide(),c.hide())}).trigger("change"),!0===wpo_wcpdf_debug.danger_zone.enabled){let b="

"+wpo_wcpdf_debug.danger_zone.message+"

";a("input#enable_danger_zone_tools").closest("td").find(".description").append(b)}a(document.body).on("click","#wpo-wcpdf-settings a.number-search-button",function(b){b.preventDefault();let c=a(this).closest("div").find(":input[name=\"number_search_input\"]").val();window.location.href=window.location.href+"&s="+c}),a("#renumber-date-from, #renumber-date-to, #delete-date-from, #delete-date-to").datepicker({dateFormat:"yy-mm-dd"}),a(document.body).on("click","#debug-tools .number-tools-btn",function(b){b.preventDefault();let d="",e="",f="",g="";return"renumber-documents-btn"===this.id?(d=a("#renumber-document-type").val(),dateType=a("#renumber-date-type").val(),e=a("#renumber-date-from").val(),f=a("#renumber-date-to").val(),g="renumber"):"delete-documents-btn"===this.id&&(d=a("#delete-document-type").val(),dateType=a("#delete-date-type").val(),e=a("#delete-date-from").val(),f=a("#delete-date-to").val(),g="delete"),""===d||"undefined"===d?void alert(wpo_wcpdf_debug.select_document_type):void("renumber"===g?a(".renumber-spinner").css("visibility","visible"):"delete"===g&&a(".delete-spinner").css("visibility","visible"),a("#renumber-documents-btn, #delete-documents-btn").attr("disabled",!0),a("#renumber-document-type, #renumber-date-from, #renumber-date-to, #delete-document-type, #delete-date-from, #delete-date-to").prop("disabled",!0),c(d,dateType,e,f,1,0,g))}),a("#debug-tools #delete-document-type").on("change",function(b){b.preventDefault(),"all"===a(this).val()?a(this).closest("form").find("#delete-date-type option[value=\"document_date\"]").prop("disabled",!0):a(this).closest("form").find("#delete-date-type option[value=\"document_date\"]").prop("disabled",!1)}).trigger("change"),a("#debug-tools #delete-date-type").on("change",function(b){b.preventDefault();let c=a(this).closest("form").find("#delete-document-type");""===c.val()||"all"===c.val()?a(this).find("option[value=\"document_date\"]").prop("disabled",!0):a(this).find("option[value=\"document_date\"]").prop("disabled",!1)}).trigger("change")}); \ No newline at end of file +jQuery(function(a){function b(b,c,d){let e=d.find("fieldset > .notice");switch(e.hide(),e.removeClass("notice-error"),e.removeClass("notice-success"),b){case"export_settings":if(c.success&&c.data.filename&&c.data.settings){d.find(".download_file").remove();let b={type:d.find("select[name=\"type\"").val(),settings:c.data.settings};b="data:text/plain;charset=utf-8,"+encodeURIComponent(JSON.stringify(b)),d.append(a("
"+c.data.filename+"
"))}else!c.success&&c.data.message&&(e.addClass("notice-error"),e.find("p").text(c.data.message),e.show());break;default:c.success&&c.data.message?(e.addClass("notice-success"),d.find("> .notice-warning").remove()):!c.success&&c.data.message&&e.addClass("notice-error"),e.find("p").text(c.data.message),e.show()}}function c(b,d,e,f,g,h,i){let j={action:"wpo_wcpdf_danger_zone_tools",delete_or_renumber:i,document_type:b,date_type:d,date_from:e,date_to:f,page_count:g,document_count:h,nonce:wpo_wcpdf_debug.nonce};a.ajax({type:"POST",url:wpo_wcpdf_debug.ajaxurl,data:j,dataType:"json",success:function(j){if(!1===j.data.finished)g=j.data.pageCount,h=j.data.documentCount,c(b,d,e,f,g,h,i);else{a(".renumber-spinner, .delete-spinner").css("visibility","hidden"),a("#renumber-documents-btn, #delete-documents-btn").removeAttr("disabled"),a("#renumber-document-type, #renumber-date-from, #renumber-date-to, #delete-document-type, #delete-date-from, #delete-date-to").prop("disabled",!1);let b=j.data.message;alert(h+b)}},error:function(a,b,c){alert(a.status+":"+c)}})}if(a("#debug-tools .tool").on("click","input[type=\"submit\"]",function(c){c.preventDefault();let d=a(this).closest("form"),e=d.find("input[name=\"debug_tool\"]").val(),f=new FormData(d[0]);f.append("action","wpo_wcpdf_debug_tools"),f.append("nonce",wpo_wcpdf_debug.nonce),d.closest(".tool").block({message:null,overlayCSS:{background:"#fff",opacity:.6}});let g=!1;g="reset-settings"!==e||window.confirm(wpo_wcpdf_debug.confirm_reset),g&&a.ajax({url:wpo_wcpdf_debug.ajaxurl,data:f,type:"POST",cache:!1,processData:!1,contentType:!1,success(a){b(e,a,d),d.closest(".tool").unblock()},error(){d.closest(".tool").unblock()}})}),a("[name='wpo_wcpdf_settings_debug[document_access_denied_redirect_page]']").on("change",function(){let b=a(this).closest("table").find("#document_custom_redirect_page"),c=b.closest("td").find(".description");"custom_page"===a(this).val()?(b.show(),c.show()):(b.hide(),c.hide())}).trigger("change"),!0===wpo_wcpdf_debug.danger_zone.enabled){let b="

"+wpo_wcpdf_debug.danger_zone.message+"

";a("input#enable_danger_zone_tools").closest("td").find(".description").append(b)}a(document.body).on("click","#wpo-wcpdf-settings a.number-search-button",function(b){b.preventDefault();let c=a(this).closest("div").find(":input[name=\"number_search_input\"]").val();window.location.href=window.location.href+"&s="+c}),a("#renumber-date-from, #renumber-date-to, #delete-date-from, #delete-date-to").datepicker({dateFormat:"yy-mm-dd"}),a(document.body).on("click","#debug-tools .number-tools-btn",function(b){b.preventDefault();let d="",e="",f="",g="";return"renumber-documents-btn"===this.id?(d=a("#renumber-document-type").val(),dateType=a("#renumber-date-type").val(),e=a("#renumber-date-from").val(),f=a("#renumber-date-to").val(),g="renumber"):"delete-documents-btn"===this.id&&(d=a("#delete-document-type").val(),dateType=a("#delete-date-type").val(),e=a("#delete-date-from").val(),f=a("#delete-date-to").val(),g="delete"),""===d||"undefined"===d?void alert(wpo_wcpdf_debug.select_document_type):void("renumber"===g?a(".renumber-spinner").css("visibility","visible"):"delete"===g&&a(".delete-spinner").css("visibility","visible"),a("#renumber-documents-btn, #delete-documents-btn").attr("disabled",!0),a("#renumber-document-type, #renumber-date-from, #renumber-date-to, #delete-document-type, #delete-date-from, #delete-date-to").prop("disabled",!0),c(d,dateType,e,f,1,0,g))}),a("#debug-tools #delete-document-type").on("change",function(b){b.preventDefault(),"all"===a(this).val()?a(this).closest("form").find("#delete-date-type option[value=\"document_date\"]").prop("disabled",!0):a(this).closest("form").find("#delete-date-type option[value=\"document_date\"]").prop("disabled",!1)}).trigger("change"),a("#debug-tools #delete-date-type").on("change",function(b){b.preventDefault();let c=a(this).closest("form").find("#delete-document-type");""===c.val()||"all"===c.val()?a(this).find("option[value=\"document_date\"]").prop("disabled",!0):a(this).find("option[value=\"document_date\"]").prop("disabled",!1)}).trigger("change")}); \ No newline at end of file diff --git a/composer.json b/composer.json index bd2623869..e868d95c7 100644 --- a/composer.json +++ b/composer.json @@ -1,19 +1,50 @@ { "name": "wpovernight/woocommerce-pdf-invoices-packing-slips", "description": "PDF Invoices & Packing Slips for WooCommerce", - "license": "GPL-3.0-or-later", "autoload": { "psr-4": { - "WPO\\WC\\UBL\\": "ubl/" + "WPO\\IPS\\": "includes/", + "WPO\\IPS\\UBL\\": "ubl/" }, - "classmap": [ "includes/" ] + "classmap": [ + "vendor/" + ] }, "require": { "dompdf/dompdf": "^3.0", - "symfony/polyfill-mbstring": "^1.2", - "symfony/polyfill-iconv": "^1.2", + "symfony/polyfill-mbstring": "^1.27", + "symfony/polyfill-iconv": "^1.27", "sabre/xml": "^2.2.5" }, + "extra": { + "strauss": { + "target_directory": "vendor", + "namespace_prefix": "WPO\\IPS\\Vendor\\", + "classmap_prefix": "WPO_IPS_Vendor_", + "constant_prefix": "WPO_IPS_VENDOR_", + "packages": [], + "update_call_sites": false, + "override_autoload": {}, + "exclude_from_copy": { + "packages": [], + "namespaces": [], + "file_patterns": [ + "/^psr.*$/" + ] + }, + "exclude_from_prefix": { + "packages": [ + "symfony/polyfill-mbstring", + "symfony/polyfill-iconv" + ], + "namespaces": [], + "file_patterns": [] + }, + "namespace_replacement_patterns": {}, + "delete_vendor_packages": false, + "delete_vendor_files": false + } + }, "config": { "platform-check": false } diff --git a/composer.lock b/composer.lock index 8ed6c81a1..7817dda4a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "069ac98791fc877d640b9042be7cc2be", + "content-hash": "5e30e7e90c4071957ab0506a12f5f4fd", "packages": [ { "name": "dompdf/dompdf", @@ -230,16 +230,16 @@ }, { "name": "sabberworm/php-css-parser", - "version": "v8.5.1", + "version": "v8.6.0", "source": { "type": "git", "url": "https://github.com/MyIntervals/PHP-CSS-Parser.git", - "reference": "4a3d572b0f8b28bb6fd016ae8bbfc445facef152" + "reference": "d2fb94a9641be84d79c7548c6d39bbebba6e9a70" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/MyIntervals/PHP-CSS-Parser/zipball/4a3d572b0f8b28bb6fd016ae8bbfc445facef152", - "reference": "4a3d572b0f8b28bb6fd016ae8bbfc445facef152", + "url": "https://api.github.com/repos/MyIntervals/PHP-CSS-Parser/zipball/d2fb94a9641be84d79c7548c6d39bbebba6e9a70", + "reference": "d2fb94a9641be84d79c7548c6d39bbebba6e9a70", "shasum": "" }, "require": { @@ -289,9 +289,9 @@ ], "support": { "issues": "https://github.com/MyIntervals/PHP-CSS-Parser/issues", - "source": "https://github.com/MyIntervals/PHP-CSS-Parser/tree/v8.5.1" + "source": "https://github.com/MyIntervals/PHP-CSS-Parser/tree/v8.6.0" }, - "time": "2024-02-15T16:41:13+00:00" + "time": "2024-07-01T07:33:21+00:00" }, { "name": "sabre/uri", @@ -355,16 +355,16 @@ }, { "name": "sabre/xml", - "version": "2.2.7", + "version": "2.2.9", "source": { "type": "git", "url": "https://github.com/sabre-io/xml.git", - "reference": "f1d53d55976bbd4cf3e640dda6ebc31120c71a4e" + "reference": "88288712d45f694be3679a0db7dfb3770f08d4f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/xml/zipball/f1d53d55976bbd4cf3e640dda6ebc31120c71a4e", - "reference": "f1d53d55976bbd4cf3e640dda6ebc31120c71a4e", + "url": "https://api.github.com/repos/sabre-io/xml/zipball/88288712d45f694be3679a0db7dfb3770f08d4f0", + "reference": "88288712d45f694be3679a0db7dfb3770f08d4f0", "shasum": "" }, "require": { @@ -378,7 +378,7 @@ "require-dev": { "friendsofphp/php-cs-fixer": "~2.17.1", "phpstan/phpstan": "^0.12", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.0" + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6" }, "type": "library", "autoload": { @@ -420,20 +420,20 @@ "issues": "https://github.com/sabre-io/xml/issues", "source": "https://github.com/fruux/sabre-xml" }, - "time": "2024-04-18T10:15:43+00:00" + "time": "2024-07-26T12:32:40+00:00" }, { "name": "symfony/polyfill-iconv", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-iconv.git", - "reference": "cd4226d140ecd3d0f13d32ed0a4a095ffe871d2f" + "reference": "c027e6a3c6aee334663ec21f5852e89738abc805" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/cd4226d140ecd3d0f13d32ed0a4a095ffe871d2f", - "reference": "cd4226d140ecd3d0f13d32ed0a4a095ffe871d2f", + "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/c027e6a3c6aee334663ec21f5852e89738abc805", + "reference": "c027e6a3c6aee334663ec21f5852e89738abc805", "shasum": "" }, "require": { @@ -484,7 +484,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-iconv/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-iconv/tree/v1.30.0" }, "funding": [ { @@ -500,20 +500,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", "shasum": "" }, "require": { @@ -564,7 +564,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" }, "funding": [ { @@ -580,7 +580,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-06-19T12:30:46+00:00" } ], "packages-dev": [], diff --git a/includes/class-wcpdf-admin.php b/includes/Admin.php similarity index 99% rename from includes/class-wcpdf-admin.php rename to includes/Admin.php index bd6ee63d7..56a563b13 100644 --- a/includes/class-wcpdf-admin.php +++ b/includes/Admin.php @@ -1,6 +1,6 @@ invoice_columns_enabled() ) { // prevents the expensive hooks below to be attached. Improves Order List page loading speed - add_filter( 'manage_woocommerce_page_wc-orders_columns', array( $this, 'add_invoice_columns' ), 999 ); // WC 7.1+ + add_filter( 'manage_woocommerce_page_wc-orders_columns', array( $this, 'add_invoice_columns' ), 200 ); // WC 7.1+ (we lowered the priority to 200 to make sure it works with Admin Columns plugin: https://www.admincolumns.com/) add_action( 'manage_woocommerce_page_wc-orders_custom_column', array( $this, 'invoice_columns_data' ), 10, 2 ); // WC 7.1+ add_filter( 'manage_woocommerce_page_wc-orders_sortable_columns', array( $this, 'invoice_columns_sortable' ) ); // WC 7.1+ add_filter( 'woocommerce_shop_order_list_table_sortable_columns', array( $this, 'add_invoice_column_to_sortable_columns' ) ); add_filter( 'woocommerce_order_list_table_prepare_items_query_args', array( $this, 'adjust_order_list_query_args' ) ); - add_filter( 'manage_edit-shop_order_columns', array( $this, 'add_invoice_columns' ), 999 ); + add_filter( 'manage_edit-shop_order_columns', array( $this, 'add_invoice_columns' ), 200 ); // (we lowered the priority to 200 to make sure it works with Admin Columns plugin: https://www.admincolumns.com/) add_action( 'manage_shop_order_posts_custom_column', array( $this, 'invoice_columns_data' ), 10, 2 ); add_filter( 'manage_edit-shop_order_sortable_columns', array( $this, 'invoice_columns_sortable' ) ); add_action( 'pre_get_posts', array( $this, 'sort_orders_by_numeric_invoice_number' ) ); @@ -184,7 +184,7 @@ public function setup_wizard() { // Setup/welcome if ( ! empty( $_GET['page'] ) && $_GET['page'] == 'wpo-wcpdf-setup' ) { delete_transient( 'wpo_wcpdf_new_install' ); - Setup_Wizard::instance(); + SetupWizard::instance(); } } @@ -218,7 +218,7 @@ public function add_listing_actions( $order ) { foreach ( $documents as $document ) { $document_title = $document->get_title(); $document_type = $document->get_type(); - $icon = ! empty( $document->icon ) ? $document->icon : WPO_WCPDF()->plugin_url() . "/assets/images/generic_document.png"; + $icon = ! empty( $document->icon ) ? $document->icon : WPO_WCPDF()->plugin_url() . '/assets/images/generic_document.svg'; if ( $document = wcpdf_get_document( $document_type, $order ) ) { foreach ( $document->output_formats as $output_format ) { diff --git a/includes/class-wcpdf-assets.php b/includes/Assets.php similarity index 98% rename from includes/class-wcpdf-assets.php rename to includes/Assets.php index 41032d349..c0eb10227 100644 --- a/includes/class-wcpdf-assets.php +++ b/includes/Assets.php @@ -1,11 +1,11 @@ documents['\WPO\WC\PDF_Invoices\Documents\Invoice'] = new \WPO\WC\PDF_Invoices\Documents\Invoice(); - $this->documents['\WPO\WC\PDF_Invoices\Documents\Packing_Slip'] = new \WPO\WC\PDF_Invoices\Documents\Packing_Slip(); + $this->documents['\WPO\IPS\Documents\Invoice'] = new \WPO\IPS\Documents\Invoice(); + $this->documents['\WPO\IPS\Documents\PackingSlip'] = new \WPO\IPS\Documents\PackingSlip(); // Allow plugins to add their own documents $this->documents = apply_filters( 'wpo_wcpdf_document_classes', $this->documents ); diff --git a/includes/documents/class-wcpdf-bulk-document.php b/includes/Documents/BulkDocument.php similarity index 95% rename from includes/documents/class-wcpdf-bulk-document.php rename to includes/Documents/BulkDocument.php index a6db5514f..5ccd0f304 100644 --- a/includes/documents/class-wcpdf-bulk-document.php +++ b/includes/Documents/BulkDocument.php @@ -1,11 +1,11 @@ is_bulk = true; // output formats (placed after parent construct to override the abstract default) - $this->output_formats = apply_filters( "wpo_wcpdf_{$this->slug}_output_formats", array( 'pdf' ), $this ); + $this->output_formats = apply_filters( 'wpo_wcpdf_document_output_formats', array( 'pdf' ), $this ); } public function exists() { diff --git a/includes/documents/class-wcpdf-document-number.php b/includes/Documents/DocumentNumber.php similarity index 97% rename from includes/documents/class-wcpdf-document-number.php rename to includes/Documents/DocumentNumber.php index 12b943ddf..3d95f2fd8 100644 --- a/includes/documents/class-wcpdf-document-number.php +++ b/includes/Documents/DocumentNumber.php @@ -1,13 +1,13 @@ output_formats = apply_filters( "wpo_wcpdf_{$this->slug}_output_formats", array( 'pdf', 'ubl' ), $this ); + $this->output_formats = apply_filters( 'wpo_wcpdf_document_output_formats', array( 'pdf', 'ubl' ), $this ); } public function use_historical_settings() { @@ -51,9 +46,50 @@ public function storing_settings_enabled() { return apply_filters( 'wpo_wcpdf_document_store_settings', true, $this ); } + /** + * Get the document title + * + * @return string + */ public function get_title() { // override/not using $this->title to allow for language switching! - return apply_filters( "wpo_wcpdf_{$this->slug}_title", __( 'Invoice', 'woocommerce-pdf-invoices-packing-slips' ), $this ); + $title = __( 'Invoice', 'woocommerce-pdf-invoices-packing-slips' ); + $title = apply_filters_deprecated( "wpo_wcpdf_{$this->slug}_title", array( $title, $this ), '3.8.7', 'wpo_wcpdf_document_title' ); // deprecated + return apply_filters( 'wpo_wcpdf_document_title', $title, $this ); + } + + /** + * Get the document number title + * + * @return string + */ + public function get_number_title() { + // override to allow for language switching! + $title = __( 'Invoice Number:', 'woocommerce-pdf-invoices-packing-slips' ); + $title = apply_filters_deprecated( "wpo_wcpdf_{$this->slug}_number_title", array( $title, $this ), '3.8.7', 'wpo_wcpdf_document_number_title' ); // deprecated + return apply_filters( 'wpo_wcpdf_document_number_title', $title, $this ); + } + + /** + * Get the document date title + * + * @return string + */ + public function get_date_title() { + // override to allow for language switching! + $title = __( 'Invoice Date:', 'woocommerce-pdf-invoices-packing-slips' ); + $title = apply_filters_deprecated( "wpo_wcpdf_{$this->slug}_date_title", array( $title, $this ), '3.8.7', 'wpo_wcpdf_document_date_title' ); // deprecated + return apply_filters( 'wpo_wcpdf_document_date_title', $title, $this ); + } + + /** + * Get the shipping address title + * + * @return string + */ + public function get_shipping_address_title(): string { + // override to allow for language switching! + return apply_filters( 'wpo_wcpdf_document_shipping_address_title', __( 'Ship To:', 'woocommerce-pdf-invoices-packing-slips' ), $this ); } public function init() { @@ -286,18 +322,16 @@ public function get_pdf_settings_fields( $option_name ) { 'type' => 'setting', 'id' => 'due_date', 'title' => __( 'Display due date', 'woocommerce-pdf-invoices-packing-slips' ), - 'callback' => 'select', + 'callback' => 'checkbox_text_input', 'section' => $this->type, 'args' => array( - 'option_name' => $option_name, - 'id' => 'due_date', - 'options' => apply_filters( 'wpo_wcpdf_due_date_options', array( - '' => __( 'No', 'woocommerce-pdf-invoices-packing-slips' ), - '1' => __( '1 day', 'woocommerce-pdf-invoices-packing-slips' ), - '7' => __( '7 days', 'woocommerce-pdf-invoices-packing-slips' ), - '30' => __( '30 days', 'woocommerce-pdf-invoices-packing-slips' ), - ), $this->type ), - 'description' => __( 'Displays a due date below the order data.', 'woocommerce-pdf-invoices-packing-slips' ), + 'option_name' => $option_name, + 'id' => 'due_date', + /* translators: number of days */ + 'text_input_wrap' => __( '%s days', 'woocommerce-pdf-invoices-packing-slips' ), + 'text_input_size' => 3, + 'text_input_id' => 'due_date_days', + 'text_input_default' => 30, ) ), array( @@ -585,22 +619,6 @@ public function get_ubl_settings_fields( $option_name ) { return apply_filters( "wpo_wcpdf_{$this->type}_ubl_settings_fields", $settings_fields, $option_name, $this ); } - /** - * Document number title - */ - public function get_number_title() { - $number_title = __( 'Invoice Number:', 'woocommerce-pdf-invoices-packing-slips' ); - return apply_filters( "wpo_wcpdf_{$this->slug}_number_title", $number_title, $this ); - } - - /** - * Document date title - */ - public function get_date_title() { - $date_title = __( 'Invoice Date:', 'woocommerce-pdf-invoices-packing-slips' ); - return apply_filters( "wpo_wcpdf_{$this->slug}_date_title", $date_title, $this ); - } - } endif; // class_exists diff --git a/includes/documents/abstract-wcpdf-order-document.php b/includes/Documents/OrderDocument.php similarity index 83% rename from includes/documents/abstract-wcpdf-order-document.php rename to includes/Documents/OrderDocument.php index 05af5151d..738d02275 100644 --- a/includes/documents/abstract-wcpdf-order-document.php +++ b/includes/Documents/OrderDocument.php @@ -1,15 +1,15 @@ slug = ! empty( $this->type ) ? str_replace( '-', '_', $this->type ) : ''; // output formats - $this->output_formats = apply_filters( "wpo_wcpdf_{$this->slug}_output_formats", array( 'pdf' ), $this ); + $this->output_formats = apply_filters( 'wpo_wcpdf_document_output_formats', array( 'pdf' ), $this ); + $this->output_formats = apply_filters_deprecated( "wpo_wcpdf_{$this->slug}_output_formats", array( $this->output_formats, $this ), '3.8.7', 'wpo_wcpdf_document_output_formats' ); // load data if ( $this->order ) { @@ -245,7 +246,7 @@ public function initiate_number( $force_new_number = false ) { } if ( ! empty( $document_number ) ) { // overridden by plugin or set to order number - if ( ! is_numeric( $document_number ) && ! ( $document_number instanceof Document_Number ) ) { + if ( ! is_numeric( $document_number ) && ! ( $document_number instanceof DocumentNumber ) ) { // document number is not numeric, treat as formatted // try to extract meaningful number data $formatted_number = $document_number; @@ -584,43 +585,360 @@ public function get_creation_trigger( $document_type = '', $order = null, $conte return $this->get_data( 'creation_trigger', $document_type, $order, $context ); } + /** + * Get the document title + * + * @return string + */ public function get_title() { - return apply_filters( "wpo_wcpdf_{$this->slug}_title", $this->title, $this ); + return $this->get_title_for( 'document' ); } + /** + * Print the document number title + * + * @return void + */ public function title() { echo $this->get_title(); } + /** + * Get the document number title + * + * @return string + */ public function get_number_title() { - /* translators: %s: document name */ - $number_title = sprintf( __( '%s Number:', 'woocommerce-pdf-invoices-packing-slips' ), $this->title ); - return apply_filters( "wpo_wcpdf_{$this->slug}_number_title", $number_title, $this ); + return $this->get_title_for( 'document_number' ); } + /** + * Print the document number title + * + * @return void + */ public function number_title() { echo $this->get_number_title(); } + /** + * Get the document date title + * + * @return string + */ public function get_date_title() { - /* translators: %s: document name */ - $date_title = sprintf( __( '%s Date:', 'woocommerce-pdf-invoices-packing-slips' ), $this->title ); - return apply_filters( "wpo_wcpdf_{$this->slug}_date_title", $date_title, $this ); + return $this->get_title_for( 'document_date' ); } + /** + * Print the document date title + * + * @return void + */ public function date_title() { echo $this->get_date_title(); } + /** + * Get the document due date title + * + * @return string + */ public function get_due_date_title() { - $due_date_title = __( 'Due Date:', 'woocommerce-pdf-invoices-packing-slips' ); - return apply_filters( "wpo_wcpdf_{$this->slug}_due_date_title", $due_date_title, $this ); + return $this->get_title_for( 'document_due_date' ); } + /** + * Print the document due date title + * + * @return void + */ public function due_date_title() { echo $this->get_due_date_title(); } + /** + * Get the billing address title + * + * @return string + */ + public function get_billing_address_title(): string { + return $this->get_title_for( 'billing_address' ); + } + + /** + * Print the billing address title + * + * @return void + */ + public function billing_address_title(): void { + echo $this->get_billing_address_title(); + } + + /** + * Get the shipping address title + * + * @return string + */ + public function get_shipping_address_title(): string { + return $this->get_title_for( 'shipping_address' ); + } + + /** + * Print the shipping address title + * + * @return void + */ + public function shipping_address_title(): void { + echo $this->get_shipping_address_title(); + } + + /** + * Get the order number title + * + * @return string + */ + public function get_order_number_title(): string { + return $this->get_title_for( 'order_number' ); + } + + /** + * Print the order number title + * + * @return void + */ + public function order_number_title(): void { + echo $this->get_order_number_title(); + } + + /** + * Get the order date title + * + * @return string + */ + public function get_order_date_title(): string { + return $this->get_title_for( 'order_date' ); + } + + /** + * Print the order date title + * + * @return void + */ + public function order_date_title(): void { + echo $this->get_order_date_title(); + } + + /** + * Get the payment method title + * + * @return string + */ + public function get_payment_method_title(): string { + return $this->get_title_for( 'payment_method' ); + } + + /** + * Print the payment method title + * + * @return void + */ + public function payment_method_title(): void { + echo $this->get_payment_method_title(); + } + + /** + * Get the payment date title + * + * @return string + */ + public function get_payment_date_title(): string { + return $this->get_title_for( 'payment_date' ); + } + + /** + * Print the payment date title + * + * @return void + */ + public function payment_date_title(): void { + echo $this->get_payment_date_title(); + } + + /** + * Get the shipping method title + * + * @return string + */ + public function get_shipping_method_title(): string { + return $this->get_title_for( 'shipping_method' ); + } + + /** + * Print the shipping method title + * + * @return void + */ + public function shipping_method_title(): void { + echo $this->get_shipping_method_title(); + } + + /** + * Get the SKU title + * + * @return string + */ + public function get_sku_title(): string { + return $this->get_title_for( 'sku' ); + } + + /** + * Print the SKU title + * + * @return void + */ + public function sku_title(): void { + echo $this->get_sku_title(); + } + + /** + * Get the weight title + * + * @return string + */ + public function get_weight_title(): string { + return $this->get_title_for( 'weight' ); + } + + /** + * Print the weight title + * + * @return void + */ + public function weight_title(): void { + echo $this->get_weight_title(); + } + + /** + * Get the notes title + * + * @return string + */ + public function get_notes_title(): string { + return $this->get_title_for( 'notes' ); + } + + /** + * Print the notes title + * + * @return void + */ + public function notes_title(): void { + echo $this->get_notes_title(); + } + + /** + * Get the customer notes title + * + * @return string + */ + public function get_customer_notes_title(): string { + return $this->get_title_for( 'customer_notes' ); + } + + /** + * Print the customer notes title + * + * @return void + */ + public function customer_notes_title(): void { + echo $this->get_customer_notes_title(); + } + + /** + * Get the title for a specific slug + * + * @param string $slug + * @return string + */ + public function get_title_for( string $slug ): string { + switch ( $slug ) { + case 'document': + $title = apply_filters_deprecated( "wpo_wcpdf_{$this->slug}_title", array( $this->title, $this ), '3.8.7', 'wpo_wcpdf_document_title' ); + break; + case 'document_number': + $title = sprintf( + /* translators: %s: document name */ + __( '%s Number:', 'woocommerce-pdf-invoices-packing-slips' ), + $this->title + ); + $title = apply_filters_deprecated( "wpo_wcpdf_{$this->slug}_number_title", array( $title, $this ), '3.8.7', 'wpo_wcpdf_document_number_title' ); + break; + case 'document_date': + $title = sprintf( + /* translators: %s: document name */ + __( '%s Date:', 'woocommerce-pdf-invoices-packing-slips' ), + $this->title + ); + $title = apply_filters_deprecated( "wpo_wcpdf_{$this->slug}_date_title", array( $title, $this ), '3.8.7', 'wpo_wcpdf_document_date_title' ); + break; + case 'document_due_date': + $title = __( 'Due Date:', 'woocommerce-pdf-invoices-packing-slips' ); + $title = apply_filters_deprecated( "wpo_wcpdf_{$this->slug}_due_date_title", array( $title, $this ), '3.8.7', 'wpo_wcpdf_document_due_date_title' ); + break; + case 'billing_address': + $title = __( 'Billing Address:', 'woocommerce-pdf-invoices-packing-slips' ); + break; + case 'shipping_address': + $title = __( 'Shipping Address:', 'woocommerce-pdf-invoices-packing-slips' ); + break; + case 'order_number': + $title = __( 'Order Number:', 'woocommerce-pdf-invoices-packing-slips' ); + break; + case 'order_date': + $title = __( 'Order Date:', 'woocommerce-pdf-invoices-packing-slips' ); + break; + case 'payment_method': + $title = __( 'Payment Method:', 'woocommerce-pdf-invoices-packing-slips' ); + break; + case 'payment_date': + $title = __( 'Payment Date:', 'woocommerce-pdf-invoices-packing-slips' ); + break; + case 'shipping_method': + $title = __( 'Shipping Method:', 'woocommerce-pdf-invoices-packing-slips' ); + break; + case 'sku': + $title = __( 'SKU:', 'woocommerce-pdf-invoices-packing-slips' ); + break; + case 'weight': + $title = __( 'Weight:', 'woocommerce-pdf-invoices-packing-slips' ); + break; + case 'notes': + $title = __( 'Notes:', 'woocommerce-pdf-invoices-packing-slips' ); + break; + case 'customer_notes': + $title = __( 'Customer Notes:', 'woocommerce-pdf-invoices-packing-slips' ); + break; + default: + $title = ''; + break; + } + + $title = apply_filters( 'wpo_wcpdf_title_for', $title, $slug, $this ); // used by Pro to translate strings + + return apply_filters( "wpo_wcpdf_{$slug}_title", $title, $this ); + } + + /** + * Prints the due date. + * + * @return void + */ + public function due_date(): void { + $due_date_timestamp = $this->get_due_date(); + echo apply_filters( "wpo_wcpdf_{$this->slug}_formatted_due_date", date_i18n( wcpdf_date_format( $this, 'due_date' ), $due_date_timestamp ), $due_date_timestamp, $this ); + } + /* |-------------------------------------------------------------------------- | Data setters @@ -694,15 +1012,15 @@ public function set_number( $value, $order = null ) { if ( empty( $value ) || ( is_array( $value ) && empty( $filtered_value ) ) ) { $document_number = null; - } elseif ( $value instanceof Document_Number ) { + } elseif ( $value instanceof DocumentNumber ) { // WCPDF 2.0 number data $document_number = $value; } elseif ( is_array( $value ) ) { // WCPDF 2.0 number data as array - $document_number = new Document_Number( $value, $this->get_number_settings(), $this, $order ); + $document_number = new DocumentNumber( $value, $this->get_number_settings(), $this, $order ); } else { // plain number - $document_number = new Document_Number( $value, $this->get_number_settings(), $this, $order ); + $document_number = new DocumentNumber( $value, $this->get_number_settings(), $this, $order ); } $this->data[ 'number' ] = $document_number; @@ -1255,7 +1573,7 @@ public function get_wc_order_status_list() { /** * Get the Sequential Number Store class that handles invoice number generation/consumption * - * @return Sequential_Number_Store + * @return SequentialNumberStore */ public function get_sequential_number_store() { $reset_number_yearly = isset( $this->settings['reset_number_yearly'] ) ? true : false; @@ -1274,7 +1592,7 @@ public function get_sequential_number_store() { } $store_name = $this->get_sequential_number_store_name( $date, $method, $reset_number_yearly ); - $number_store = new Sequential_Number_Store( $store_name, $method ); + $number_store = new SequentialNumberStore( $store_name, $method ); if ( $number_store->is_new ) { $number_store->set_next( apply_filters( 'wpo_wcpdf_reset_number_yearly_start', 1, $this ) ); @@ -1282,7 +1600,7 @@ public function get_sequential_number_store() { // reset: off } else { $store_name = $this->get_sequential_number_store_name( $now, $method, $reset_number_yearly ); - $number_store = new Sequential_Number_Store( $store_name, $method ); + $number_store = new SequentialNumberStore( $store_name, $method ); } return $number_store; @@ -1463,23 +1781,53 @@ public function get_number_store_year( $table_name ) { * @return int */ public function get_due_date(): int { - $due_date = $this->get_setting( 'due_date' ); + $due_date = $this->get_setting( 'due_date' ); + $due_date_days = $this->get_setting( 'due_date_days' ); - if ( empty( $this->order ) || empty( $due_date ) ) { + if ( empty( $this->order ) || empty( $due_date ) || empty( $due_date_days ) ) { return 0; } - $due_date_days = apply_filters( 'wpo_wcpdf_due_date_days', $due_date, $this->type, $this ); + $due_date_days = apply_filters_deprecated( + 'wpo_wcpdf_due_date_days', + array( $due_date_days, $this->get_type(), $this ), + '3.8.7', + 'wpo_wcpdf_document_due_date_days' + ); + $due_date_days = apply_filters( 'wpo_wcpdf_document_due_date_days', $due_date_days, $this ); if ( 0 >= intval( $due_date_days ) ) { return 0; } - $base_date = apply_filters( 'wpo_wcpdf_due_date_base_date', $this->order->get_date_created(), $this->type, $this ); - $due_date_datetime = clone $base_date; - $due_date_datetime = $due_date_datetime->modify( "+$due_date_days days" ); + $document_creation_date = $this->get_date( $this->get_type(), $this->order ) ?? new \WC_DateTime( 'now', new \DateTimeZone( 'UTC' ) ); + $base_date = apply_filters_deprecated( + 'wpo_wcpdf_due_date_base_date', + array( $document_creation_date, $this->get_type(), $this ), + '3.8.7', + 'wpo_wcpdf_document_due_date_base_date' + ); + $base_date = apply_filters( 'wpo_wcpdf_document_due_date_base_date', $base_date, $this ); + $due_date_datetime = clone $base_date; + $due_date_datetime = $due_date_datetime->modify( "+$due_date_days days" ); + + $due_date = apply_filters_deprecated( + 'wpo_wcpdf_due_date', + array( $due_date_datetime->getTimestamp() ?? 0, $this->get_type(), $this ), + '3.8.7', + 'wpo_wcpdf_document_due_date' + ); - return apply_filters( 'wpo_wcpdf_due_date', $due_date_datetime->getTimestamp() ?? 0, $this->type, $this ); + return apply_filters( 'wpo_wcpdf_document_due_date', $due_date ?? 0, $this ); + } + + /** + * Check if due date should be shown + * + * @return bool + */ + public function show_due_date(): bool { + return $this->get_due_date() > 0; } protected function add_filters( $filters ) { diff --git a/includes/documents/abstract-wcpdf-order-document-methods.php b/includes/Documents/OrderDocumentMethods.php similarity index 96% rename from includes/documents/abstract-wcpdf-order-document-methods.php rename to includes/Documents/OrderDocumentMethods.php index 5910af0ff..eddc6aff8 100644 --- a/includes/documents/abstract-wcpdf-order-document-methods.php +++ b/includes/Documents/OrderDocumentMethods.php @@ -1,11 +1,11 @@ get_type(); @@ -1313,6 +1313,51 @@ public function get_display_date_label( $date_string ) { } } + + /** + * Get the invoice number title, + * this allows other documents to use + * the invoice number title. Example: Receipt document + * + * @return string + */ + public function get_invoice_number_title() { + $title = __( 'Invoice Number:', 'woocommerce-pdf-invoices-packing-slips' ); + return apply_filters_deprecated( "wpo_wcpdf_invoice_number_title", array( $title, $this ), '3.8.7', 'wpo_wcpdf_document_number_title' ); + } + + /** + * Print the invoice number title, + * this allows other documents to use + * the invoice number title. Example: Receipt document + * + * @return void + */ + public function invoice_number_title() { + echo $this->get_invoice_number_title(); + } + + /** + * Get the title for the refund reason, + * used by the Credit Note document. + * (Later we can move this to the Pro extension.) + * + * @return string + */ + public function get_refund_reason_title(): string { + return apply_filters( 'wpo_wcpdf_refund_reason_title', __( 'Reason for refund:', 'woocommerce-pdf-invoices-packing-slips' ), $this ); + } + + /** + * Display the title for the refund reason, + * used by the Credit Note document. + * (Later we can move this to the Pro extension.) + * + * @return void + */ + public function refund_reason_title(): void { + echo $this->get_refund_reason_title(); + } } diff --git a/includes/documents/class-wcpdf-packing-slip.php b/includes/Documents/PackingSlip.php similarity index 80% rename from includes/documents/class-wcpdf-packing-slip.php rename to includes/Documents/PackingSlip.php index e8913cc81..2f46ad98d 100644 --- a/includes/documents/class-wcpdf-packing-slip.php +++ b/includes/Documents/PackingSlip.php @@ -1,17 +1,17 @@ output_formats = apply_filters( "wpo_wcpdf_{$this->slug}_output_formats", array( 'pdf' ), $this ); + $this->output_formats = apply_filters( 'wpo_wcpdf_document_output_formats', array( 'pdf' ), $this ); } + /** + * Get the document title + * + * @return string + */ public function get_title() { // override/not using $this->title to allow for language switching! - return apply_filters( "wpo_wcpdf_{$this->slug}_title", __( 'Packing Slip', 'woocommerce-pdf-invoices-packing-slips' ), $this ); + $title = __( 'Packing Slip', 'woocommerce-pdf-invoices-packing-slips' ); + $title = apply_filters_deprecated( "wpo_wcpdf_{$this->slug}_title", array( $title, $this ), '3.8.7', 'wpo_wcpdf_document_title' ); // deprecated + return apply_filters( 'wpo_wcpdf_document_title', $title, $this ); + } + + /** + * Get the document number title + * + * @return string + */ + public function get_number_title() { + // override to allow for language switching! + $title = __( 'Packing Slip Number:', 'woocommerce-pdf-invoices-packing-slips' ); + $title = apply_filters_deprecated( "wpo_wcpdf_{$this->slug}_number_title", array( $title, $this ), '3.8.7', 'wpo_wcpdf_document_number_title' ); // deprecated + return apply_filters( 'wpo_wcpdf_document_number_title', $title, $this ); + } + + /** + * Get the document date title + * + * @return string + */ + public function get_date_title() { + // override to allow for language switching! + $title = __( 'Packing Slip Date:', 'woocommerce-pdf-invoices-packing-slips' ); + $title = apply_filters_deprecated( "wpo_wcpdf_{$this->slug}_date_title", array( $title, $this ), '3.8.7', 'wpo_wcpdf_document_date_title' ); // deprecated + return apply_filters( 'wpo_wcpdf_document_date_title', $title, $this ); } public function get_filename( $context = 'download', $args = array() ) { @@ -177,22 +208,6 @@ public function init_settings() { } - /** - * Document number title - */ - public function get_number_title() { - $number_title = __( 'Packing Slip Number:', 'woocommerce-pdf-invoices-packing-slips' ); - return apply_filters( "wpo_wcpdf_{$this->slug}_number_title", $number_title, $this ); - } - - /** - * Document date title - */ - public function get_date_title() { - $date_title = __( 'Packing Slip Date:', 'woocommerce-pdf-invoices-packing-slips' ); - return apply_filters( "wpo_wcpdf_{$this->slug}_date_title", $date_title, $this ); - } - } endif; // class_exists diff --git a/includes/documents/class-wcpdf-sequential-number-store.php b/includes/Documents/SequentialNumberStore.php similarity index 97% rename from includes/documents/class-wcpdf-sequential-number-store.php rename to includes/Documents/SequentialNumberStore.php index ae6428e50..4c214ee72 100644 --- a/includes/documents/class-wcpdf-sequential-number-store.php +++ b/includes/Documents/SequentialNumberStore.php @@ -1,17 +1,17 @@ set_next( (int) $next_number ); } // we're not deleting this option yet to make downgrading possible diff --git a/includes/class-wcpdf-main.php b/includes/Main.php similarity index 97% rename from includes/class-wcpdf-main.php rename to includes/Main.php index 41fcc5964..0220db27d 100644 --- a/includes/class-wcpdf-main.php +++ b/includes/Main.php @@ -1,15 +1,16 @@ getMessage(), 'critical', $e ); continue; - } catch ( \Dompdf\Exception $e ) { + } catch ( DompdfException $e ) { wcpdf_log_error( 'DOMPDF exception: '.$e->getMessage(), 'critical', $e ); continue; - } catch ( \WPO\WC\UBL\Exceptions\FileWriteException $e ) { + } catch ( FileWriteException $e ) { wcpdf_log_error( 'UBL FileWrite exception: '.$e->getMessage(), 'critical', $e ); continue; } catch ( \Error $e ) { @@ -534,11 +536,11 @@ public function generate_document_ajax() { ); wcpdf_safe_redirect_or_die( null, $message ); } - } catch ( \Dompdf\Exception $e ) { + } catch ( DompdfException $e ) { $message = 'DOMPDF Exception: '.$e->getMessage(); wcpdf_log_error( $message, 'critical', $e ); wcpdf_output_error( $message, 'critical', $e ); - } catch ( \WPO\WC\UBL\Exceptions\FileWriteException $e ) { + } catch ( FileWriteException $e ) { $message = 'UBL FileWrite Exception: '.$e->getMessage(); wcpdf_log_error( $message, 'critical', $e ); wcpdf_output_error( $message, 'critical', $e ); @@ -949,7 +951,8 @@ private function tmp_folders_exist_and_writable() */ public function copy_fonts( $path = '', $merge_with_local = true ) { // only copy fonts if the bundled dompdf library is used! - $default_pdf_maker = ( defined( 'WPO_WCPDF_VERSION' ) && version_compare( WPO_WCPDF_VERSION, '3.7.0-beta-1', '<' ) ) ? '\\WPO\\WC\\PDF_Invoices\\PDF_Maker' : '\\WPO\\WC\\PDF_Invoices\\Makers\\PDF_Maker'; + $default_pdf_maker = '\\WPO\\IPS\\Makers\\PDFMaker'; + if ( $default_pdf_maker !== apply_filters( 'wpo_wcpdf_pdf_maker', $default_pdf_maker ) ) { return; } @@ -1560,11 +1563,13 @@ public function get_document_printed_data( $document ) { } /** - * Enable PHP error output + * Enable PHP error output for administrators. */ - public function enable_debug () { - error_reporting( E_ALL ); - ini_set( 'display_errors', 1 ); + public function enable_debug() { + if ( \WPO_WCPDF()->settings->user_can_manage_settings() ) { + error_reporting( E_ALL ); + ini_set( 'display_errors', 1 ); + } } public function wc_webhook_topic_hooks( $topic_hooks, $wc_webhook ) { @@ -1599,16 +1604,36 @@ public function wc_webhook_trigger( $document, $order ) { } /** + * Display due date table row in the order data section for legacy templates. + * * @param null|string $document_type - * @param null|\WC_Order|\WC_Order_Refund $order + * @param null|\WC_Abstract_Order $order * * @return void */ - public function display_due_date( string $document_type = null, $order = null ): void { + public function display_due_date_table_row( ?string $document_type = null, ?\WC_Abstract_Order $order = null ): void { if ( empty( $order ) || empty( $document_type ) ) { return; } + $current_template_path = explode( '/', WPO_WCPDF()->settings->get_template_path() ); + $current_template = end( $current_template_path ); + $premium_templates = array( 'Simple Premium', 'Modern', 'Business' ); + + // Return if the Simple template is selected. Due date is displayed through template. + if ( 'Simple' === $current_template ) { + return; + } + + // Return if the Updated Premium Template is selected. Due date is displayed through template. + if ( + function_exists( 'WPO_WCPDF_Templates' ) && + version_compare( WPO_WCPDF_Templates()->version, '2.21.9', '>' ) && + in_array( $current_template, $premium_templates, true ) + ) { + return; + } + $document = wcpdf_get_document( $document_type, $order ); if ( ! $document ) { diff --git a/includes/makers/class-pdf-maker.php b/includes/Makers/PDFMaker.php similarity index 92% rename from includes/makers/class-pdf-maker.php rename to includes/Makers/PDFMaker.php index e6515bb38..0a79cc790 100644 --- a/includes/makers/class-pdf-maker.php +++ b/includes/Makers/PDFMaker.php @@ -1,16 +1,16 @@ query( $wpdb->prepare( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s AND option_value = '0'", - $wpdb->esc_like( self::$option_prefix ) . '%' + $wpdb->esc_like( $option_prefix ) . '%' ) ); } @@ -279,15 +290,19 @@ public static function cleanup_released_locks(): void { /** * Count the number of released locks in the database * + * @param bool $legacy - whether to count legacy locks + * * @return int - the number of released locks */ - public static function count_released_locks(): int { + public static function count_released_locks( bool $legacy = false ): int { global $wpdb; + $option_prefix = $legacy ? self::$legacy_option_prefix : self::$option_prefix; + $count = (int) $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$wpdb->options} WHERE option_name LIKE %s AND option_value = '0'", - $wpdb->esc_like( self::$option_prefix ) . '%' + $wpdb->esc_like( $option_prefix ) . '%' ) ); diff --git a/includes/class-wcpdf-settings.php b/includes/Settings.php similarity index 97% rename from includes/class-wcpdf-settings.php rename to includes/Settings.php index 4991c1475..bb9afac78 100644 --- a/includes/class-wcpdf-settings.php +++ b/includes/Settings.php @@ -1,14 +1,19 @@ callbacks = \WPO\WC\PDF_Invoices\Settings\Settings_Callbacks::instance(); - $this->general = \WPO\WC\PDF_Invoices\Settings\Settings_General::instance(); - $this->documents = \WPO\WC\PDF_Invoices\Settings\Settings_Documents::instance(); - $this->debug = \WPO\WC\PDF_Invoices\Settings\Settings_Debug::instance(); - $this->ubl = \WPO\WC\PDF_Invoices\Settings\Settings_UBL::instance(); - $this->upgrade = \WPO\WC\PDF_Invoices\Settings\Settings_Upgrade::instance(); + $this->callbacks = SettingsCallbacks::instance(); + $this->general = SettingsGeneral::instance(); + $this->documents = SettingsDocuments::instance(); + $this->debug = SettingsDebug::instance(); + $this->ubl = SettingsUbl::instance(); + $this->upgrade = SettingsUpgrade::instance(); $this->general_settings = get_option( 'wpo_wcpdf_settings_general' ); $this->debug_settings = get_option( 'wpo_wcpdf_settings_debug' ); @@ -195,13 +200,8 @@ public function settings_page() { $default_tab = apply_filters( 'wpo_wcpdf_settings_tabs_default', ! empty( $settings_tabs['general'] ) ? 'general' : key( $settings_tabs ) ); $active_tab = isset( $_GET[ 'tab' ] ) ? sanitize_text_field( $_GET[ 'tab' ] ) : $default_tab; $active_section = isset( $_GET[ 'section' ] ) ? sanitize_text_field( $_GET[ 'section' ] ) : ''; - $bundle = $this->upgrade ? $this->upgrade->bundle_is_active() : false; - if ( $bundle ) { - unset( $settings_tabs['upgrade'] ); - } - - include( 'views/settings-page.php' ); + include( WPO_WCPDF()->plugin_path() . '/views/settings-page.php' ); } public function maybe_disable_preview_on_settings_tabs( $settings_tabs ) { @@ -305,7 +305,7 @@ public function ajax_preview() { $document->set_date( current_time( 'timestamp', true ) ); $number_store_method = $this->get_sequential_number_store_method(); $number_store_name = apply_filters( 'wpo_wcpdf_document_sequential_number_store', "{$document->slug}_number", $document ); - $number_store = new Sequential_Number_Store( $number_store_name, $number_store_method ); + $number_store = new SequentialNumberStore( $number_store_name, $number_store_method ); $document->set_number( $number_store->get_next() ); } @@ -766,7 +766,7 @@ public function set_number_store() { $number = ! empty( $_POST['number'] ) ? (int) $_POST['number'] : 0; if ( $number > 0 ) { $number_store_method = $this->get_sequential_number_store_method(); - $number_store = new Sequential_Number_Store( $_POST['store'], $number_store_method ); + $number_store = new SequentialNumberStore( $_POST['store'], $number_store_method ); $number_store->set_next( $number ); echo wp_kses_post( "next number ({$_POST['store']}) set to {$number}" ); } diff --git a/includes/settings/class-wcpdf-settings-callbacks.php b/includes/Settings/SettingsCallbacks.php similarity index 98% rename from includes/settings/class-wcpdf-settings-callbacks.php rename to includes/Settings/SettingsCallbacks.php index 5ee721141..d6c18f43b 100644 --- a/includes/settings/class-wcpdf-settings-callbacks.php +++ b/includes/Settings/SettingsCallbacks.php @@ -1,15 +1,15 @@ get_next(); $store = $store->store_name; // legacy } else { $number_store_method = WPO_WCPDF()->settings->get_sequential_number_store_method(); - $number_store = new Sequential_Number_Store( $store, $number_store_method ); + $number_store = new SequentialNumberStore( $store, $number_store_method ); $next_number = $number_store->get_next(); } diff --git a/includes/settings/class-wcpdf-settings-debug.php b/includes/Settings/SettingsDebug.php similarity index 97% rename from includes/settings/class-wcpdf-settings-debug.php rename to includes/Settings/SettingsDebug.php index db962eeed..b54363e2e 100644 --- a/includes/settings/class-wcpdf-settings-debug.php +++ b/includes/Settings/SettingsDebug.php @@ -1,15 +1,15 @@ plugin_path() . '/includes/views/advanced-status.php' ); + include( WPO_WCPDF()->plugin_path() . '/views/advanced-status.php' ); } public function display_tools() { - include( WPO_WCPDF()->plugin_path() . '/includes/views/advanced-tools.php' ); + include( WPO_WCPDF()->plugin_path() . '/views/advanced-tools.php' ); } public function display_numbers() { @@ -101,10 +101,10 @@ public function display_numbers() { $document_type = $this->get_document_type_from_store_table_name( esc_attr( $_GET['table_name'] ) ); - $list_table = new Number_Store_List_Table(); + $list_table = new NumberStoreListTable(); $list_table->prepare_items(); - include( WPO_WCPDF()->plugin_path() . '/includes/views/advanced-numbers.php' ); + include( WPO_WCPDF()->plugin_path() . '/views/advanced-numbers.php' ); } public function get_number_store_tables() { @@ -252,6 +252,14 @@ private function clear_released_semaphore_locks( $data ) { wp_send_json_success( compact( 'message' ) ); } + private function clear_released_legacy_semaphore_locks( $data ) { + \WPO\WC\PDF_Invoices\Updraft_Semaphore_3_0::cleanup_released_locks( true ); + + $message = esc_html__( 'Released legacy semaphore locks have been cleaned up!', 'woocommerce-pdf-invoices-packing-slips' ); + wcpdf_log_error( $message, 'info' ); + wp_send_json_success( compact( 'message' ) ); + } + private function clear_extensions_license_cache( $data ) { WPO_WCPDF()->settings->upgrade->clear_extensions_license_cache(); diff --git a/includes/settings/class-wcpdf-settings-documents.php b/includes/Settings/SettingsDocuments.php similarity index 95% rename from includes/settings/class-wcpdf-settings-documents.php rename to includes/Settings/SettingsDocuments.php index 3d7541eed..a79a95daa 100644 --- a/includes/settings/class-wcpdf-settings-documents.php +++ b/includes/Settings/SettingsDocuments.php @@ -1,13 +1,13 @@ get_type() == 'invoice' ) { $invoice_email_ids = $document->get_attach_to_email_ids(); if ( empty( $invoice_email_ids ) ) { - include_once( WPO_WCPDF()->plugin_path() . '/includes/views/attachment-settings-hint.php' ); + include_once( WPO_WCPDF()->plugin_path() . '/views/attachment-settings-hint.php' ); } } } diff --git a/includes/settings/class-wcpdf-settings-ubl.php b/includes/Settings/SettingsUbl.php similarity index 96% rename from includes/settings/class-wcpdf-settings-ubl.php rename to includes/Settings/SettingsUbl.php index 6e63aa96d..d84561803 100644 --- a/includes/settings/class-wcpdf-settings-ubl.php +++ b/includes/Settings/SettingsUbl.php @@ -1,15 +1,15 @@ output(); break; } diff --git a/includes/settings/class-wcpdf-settings-upgrade.php b/includes/Settings/SettingsUpgrade.php similarity index 69% rename from includes/settings/class-wcpdf-settings-upgrade.php rename to includes/Settings/SettingsUpgrade.php index 98f8e1524..233e4bcda 100644 --- a/includes/settings/class-wcpdf-settings-upgrade.php +++ b/includes/Settings/SettingsUpgrade.php @@ -1,13 +1,13 @@ extensions = array( 'pro', 'templates' ); + $this->extensions = array( 'pro' ); add_action( 'wpo_wcpdf_before_settings_page', array( $this, 'extensions_license_cache_notice' ), 10, 2 ); add_action( 'wpo_wcpdf_after_settings_page', array( $this, 'extension_overview' ), 10, 2 ); @@ -100,7 +100,7 @@ public function extension_overview( $tab, $section ) { 'https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/using-the-customizer/', __( 'Learn more', 'woocommerce-pdf-invoices-packing-slips' ) ), - 'extensions' => array( 'templates', 'bundle' ), + 'extensions' => array( 'bundle' ), ), array( 'label' => __( 'Add custom data to your documents', 'woocommerce-pdf-invoices-packing-slips' ), @@ -110,23 +110,81 @@ public function extension_overview( $tab, $section ) { 'https://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/using-custom-blocks/', __( 'Learn more', 'woocommerce-pdf-invoices-packing-slips' ) ), - 'extensions' => array( 'templates', 'bundle' ), + 'extensions' => array( 'bundle' ), ), array( 'label' => __( 'Additional PDF templates', 'woocommerce-pdf-invoices-packing-slips' ), 'description' => __( 'Make use of our Business or Modern template designs.', 'woocommerce-pdf-invoices-packing-slips' ), - 'extensions' => array( 'templates', 'bundle' ), + 'extensions' => array( 'bundle' ), ), array( 'label' => __( 'Add styling', 'woocommerce-pdf-invoices-packing-slips' ), 'description' => __( 'Easily change the look and feel of your documents by adding some custom CSS.', 'woocommerce-pdf-invoices-packing-slips' ), - 'extensions' => array( 'templates', 'bundle' ), + 'extensions' => array( 'bundle' ), ), ); $extension_license_infos = $this->get_extension_license_infos(); - include( WPO_WCPDF()->plugin_path() . '/includes/views/upgrade-table.php' ); + $plugin_recommendations = array( + array( + 'plugin_path' => 'wc-reminder-emails/wc-reminder-emails.php', + 'thumbnail' => WPO_WCPDF()->plugin_url().'/assets/images/wc-reminder-emails-thumbnail-400x400.jpg', + 'title' => __( 'WooCommerce Smart Reminder Emails', 'woocommerce-pdf-invoices-packing-slips' ), + 'description' => __( 'Automatically schedule and send Reminder Emails for WooCommerce orders.', 'woocommerce-pdf-invoices-packing-slips' ), + 'url' => 'https://wpovernight.com/downloads/woocommerce-reminder-emails-payment-reminders?utm_medium=plugin&utm_source=ips&utm_campaign=upgrade-tab&content=reminder-emails-cross' + ), + array( + 'plugin_path' => 'woocommerce-address-labels/woocommerce-address-labels.php', + 'thumbnail' => WPO_WCPDF()->plugin_url().'/assets/images/woocommerce-address-labels-thumbnail-400x400.jpg', + 'title' => __( 'WooCommerce Print Address Labels', 'woocommerce-pdf-invoices-packing-slips' ), + 'description' => __( 'Print out address labels for selected orders straight from WooCommerce.', 'woocommerce-pdf-invoices-packing-slips' ), + 'url' => 'https://wpovernight.com/downloads/woocommerce-print-address-labels?utm_medium=plugin&utm_source=ips&utm_campaign=upgrade-tab&content=address-labels-cross' + ), + array( + 'plugin_path' => 'woocommerce-printnode/print-orders.php', + 'thumbnail' => WPO_WCPDF()->plugin_url().'/assets/images/woocommerce-printnode-thumbnail-400x400.jpg', + 'title' => __( 'WooCommerce Automatic Printing - PrintNode', 'woocommerce-pdf-invoices-packing-slips' ), + 'description' => __( 'A plugin to automatically print completed orders via PrintNode.', 'woocommerce-pdf-invoices-packing-slips' ), + 'url' => 'https://wpovernight.com/downloads/woocommerce-automatic-order-printing-printnode?utm_medium=plugin&utm_source=ips&utm_campaign=upgrade-tab&content=order-printing-cross' + ), + array( + 'plugin_path' => 'woocommerce-ultimate-barcodes/woocommerce-ultimate-barcodes.php', + 'thumbnail' => WPO_WCPDF()->plugin_url().'/assets/images/woocommerce-ultimate-barcodes-thumbnail-400x400.jpg', + 'title' => __( 'WooCommerce Ultimate Barcodes', 'woocommerce-pdf-invoices-packing-slips' ), + 'description' => __( 'Generate barcodes (ZATCA, QR-codes, C128, EAN-13 and more) for your orders, products and even invoices & packing slips.', 'woocommerce-pdf-invoices-packing-slips' ), + 'url' => 'https://wpovernight.com/downloads/woocommerce-ultimate-barcodes?utm_medium=plugin&utm_source=ips&utm_campaign=upgrade-tab&content=ultimate-barcodes-cross' + ), + array( + 'plugin_path' => 'woocommerce-order-list/woocommerce-order-list.php', + 'thumbnail' => WPO_WCPDF()->plugin_url().'/assets/images/woocommerce-order-list-thumbnail-400x400.jpg', + 'title' => __( 'WooCommerce Print Order List', 'woocommerce-pdf-invoices-packing-slips' ), + 'description' => __( 'This plugin lets you quickly print a list of your WooCommerce orders. Great for order picking.', 'woocommerce-pdf-invoices-packing-slips' ), + 'url' => 'https://wpovernight.com/downloads/woocommerce-print-order-list?utm_medium=plugin&utm_source=ips&utm_campaign=upgrade-tab&content=order-list-cross' + ), + array( + 'plugin_path' => 'wp-menu-cart-pro/wp-menu-cart-pro.php', + 'thumbnail' => WPO_WCPDF()->plugin_url().'/assets/images/wp-menu-cart-pro-thumbnail-400x400.jpg', + 'title' => __( 'Menu Cart Pro', 'woocommerce-pdf-invoices-packing-slips' ), + 'description' => __( 'Integrates seamlessly with WooCommerce to add a shopping cart to your menu.', 'woocommerce-pdf-invoices-packing-slips' ), + 'url' => 'https://wpovernight.com/downloads/menu-cart-pro?utm_medium=plugin&utm_source=ips&utm_campaign=upgrade-tab&content=menu-cart-pro-cross' + ), + ); + + // Sort recommendations based on if the plugin is installed + $installed_plugins = get_plugins(); + $sorted_plugin_recommendations = array(); + + foreach ( array_reverse( $plugin_recommendations ) as $plugin ) { + if ( isset( $installed_plugins[ $plugin['plugin_path'] ] ) ) { + $plugin['installed'] = true; + $sorted_plugin_recommendations[] = $plugin; + } else { + array_unshift( $sorted_plugin_recommendations, $plugin ); + } + } + + include( WPO_WCPDF()->plugin_path() . '/views/upgrade-table.php' ); } } @@ -248,13 +306,10 @@ public function get_extension_license_infos( $ignore_cache = false ) { } else { switch ( $extension ) { case 'pro': - $license_info[$extension]['url'] = 'https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-professional/'; - break; - case 'templates': - $license_info[$extension]['url'] = 'https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-premium-templates/'; + $license_info[$extension]['url'] = 'https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-professional?utm_medium=plugin&utm_source=ips&utm_campaign=upgrade-tab&content=ips-pro-upgrade'; break; case 'bundle': - $license_info[$extension]['url'] = 'https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-bundle/'; + $license_info[$extension]['url'] = 'https://wpovernight.com/downloads/woocommerce-pdf-invoices-packing-slips-bundle?utm_medium=plugin&utm_source=ips&utm_campaign=upgrade-tab&content=ips-bundle-upgrade'; break; } } @@ -301,6 +356,10 @@ public function get_extensions_license_data( string $type = 'cached' ): array { } } + if ( isset( $data['templates'] ) ) { + unset( $data['templates'] ); + } + return $data; } @@ -322,32 +381,6 @@ public function are_any_extensions_installed() { return $installed; } - /** - * Check if bundle (Pro + Templates) is active - * - * @return bool - */ - public function bundle_is_active() { - $extension_license_infos = $this->get_extension_license_infos(); - $bundle = false; - - if ( ! empty( $extension_license_infos ) ) { - $bundle = true; - - foreach ( $this->extensions as $extension ) { - if ( - ( isset( $extension_license_infos[ $extension ]['status'] ) && 'valid' !== $extension_license_infos[ $extension ]['status'] ) || - ! isset( $extension_license_infos[ $extension ]['status'] ) - ) { - $bundle = false; - break; - } - } - } - - return $bundle; - } - } endif; // class_exists diff --git a/includes/class-wcpdf-setup-wizard.php b/includes/SetupWizard.php similarity index 92% rename from includes/class-wcpdf-setup-wizard.php rename to includes/SetupWizard.php index 809bf3cef..2486dd693 100644 --- a/includes/class-wcpdf-setup-wizard.php +++ b/includes/SetupWizard.php @@ -1,13 +1,13 @@ steps = array( 'shop-name' => array( 'name' => __( 'Shop Name', 'woocommerce-pdf-invoices-packing-slips' ), - 'view' => WPO_WCPDF()->plugin_path() . '/includes/views/setup-wizard/shop-name.php', + 'view' => WPO_WCPDF()->plugin_path() . '/views/setup-wizard/shop-name.php', ), 'logo' => array( 'name' => __( 'Your logo', 'woocommerce-pdf-invoices-packing-slips' ), - 'view' => WPO_WCPDF()->plugin_path() . '/includes/views/setup-wizard/logo.php', + 'view' => WPO_WCPDF()->plugin_path() . '/views/setup-wizard/logo.php', ), 'attach-to' => array( 'name' => __( 'Attachments', 'woocommerce-pdf-invoices-packing-slips' ), - 'view' => WPO_WCPDF()->plugin_path() . '/includes/views/setup-wizard/attach-to.php', + 'view' => WPO_WCPDF()->plugin_path() . '/views/setup-wizard/attach-to.php', ), 'display-options' => array( 'name' => __( 'Display options', 'woocommerce-pdf-invoices-packing-slips' ), - 'view' => WPO_WCPDF()->plugin_path() . '/includes/views/setup-wizard/display-options.php', + 'view' => WPO_WCPDF()->plugin_path() . '/views/setup-wizard/display-options.php', ), 'paper-format' => array( 'name' => __( 'Paper format', 'woocommerce-pdf-invoices-packing-slips' ), - 'view' => WPO_WCPDF()->plugin_path() . '/includes/views/setup-wizard/paper-format.php', + 'view' => WPO_WCPDF()->plugin_path() . '/views/setup-wizard/paper-format.php', ), 'show-action-buttons' => array( 'name' => __( 'Action buttons', 'woocommerce-pdf-invoices-packing-slips' ), - 'view' => WPO_WCPDF()->plugin_path() . '/includes/views/setup-wizard/show-action-buttons.php', + 'view' => WPO_WCPDF()->plugin_path() . '/views/setup-wizard/show-action-buttons.php', ), 'good-to-go' => array( 'name' => __( 'Ready!', 'woocommerce-pdf-invoices-packing-slips' ), - 'view' => WPO_WCPDF()->plugin_path() . '/includes/views/setup-wizard/good-to-go.php', + 'view' => WPO_WCPDF()->plugin_path() . '/views/setup-wizard/good-to-go.php', ), ); $this->step = isset( $_GET['step'] ) ? sanitize_key( $_GET['step'] ) : current( array_keys( $this->steps ) ); diff --git a/includes/tables/class-wcpdf-number-store-list-table.php b/includes/Tables/NumberStoreListTable.php similarity index 98% rename from includes/tables/class-wcpdf-number-store-list-table.php rename to includes/Tables/NumberStoreListTable.php index 21af9b446..a39dbf65f 100644 --- a/includes/tables/class-wcpdf-number-store-list-table.php +++ b/includes/Tables/NumberStoreListTable.php @@ -1,5 +1,5 @@ \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-07-15T12:35:46+02:00\n" +"POT-Creation-Date: 2024-10-07T11:13:49+02:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.7.1\n" "X-Domain: woocommerce-pdf-invoices-packing-slips\n" @@ -49,14 +49,14 @@ msgid "Yes you deserve it!" msgstr "" #: includes/class-wcpdf-admin.php:124 -#: includes/class-wcpdf-main.php:893 +#: includes/class-wcpdf-main.php:852 #: includes/views/attachment-settings-hint.php:12 #: includes/views/extensions.php:121 #: includes/views/promo.php:34 -#: woocommerce-pdf-invoices-packingslips.php:340 -#: woocommerce-pdf-invoices-packingslips.php:399 -#: woocommerce-pdf-invoices-packingslips.php:437 -#: woocommerce-pdf-invoices-packingslips.php:527 +#: woocommerce-pdf-invoices-packingslips.php:341 +#: woocommerce-pdf-invoices-packingslips.php:400 +#: woocommerce-pdf-invoices-packingslips.php:438 +#: woocommerce-pdf-invoices-packingslips.php:528 msgid "Hide this message" msgstr "" @@ -77,8 +77,8 @@ msgid "Jumpstart the plugin by following our wizard!" msgstr "" #: includes/class-wcpdf-admin.php:167 -#: includes/views/advanced-tools.php:62 -#: includes/views/advanced-tools.php:64 +#: includes/views/advanced-tools.php:150 +#: includes/views/advanced-tools.php:152 msgid "Run the Setup Wizard" msgstr "" @@ -87,18 +87,18 @@ msgid "I am the wizard" msgstr "" #: includes/class-wcpdf-admin.php:322 -#: includes/class-wcpdf-admin.php:1334 -#: includes/class-wcpdf-assets.php:228 -#: includes/class-wcpdf-main.php:1276 -#: includes/documents/class-wcpdf-invoice.php:314 +#: includes/class-wcpdf-admin.php:1342 +#: includes/class-wcpdf-assets.php:229 +#: includes/class-wcpdf-main.php:1235 +#: includes/documents/class-wcpdf-invoice.php:342 #: includes/views/setup-wizard/display-options.php:81 msgid "Invoice Number" msgstr "" #: includes/class-wcpdf-admin.php:323 -#: includes/class-wcpdf-main.php:1277 +#: includes/class-wcpdf-main.php:1236 #: includes/documents/abstract-wcpdf-order-document-methods.php:1306 -#: includes/documents/class-wcpdf-invoice.php:280 +#: includes/documents/class-wcpdf-invoice.php:310 #: includes/views/setup-wizard/display-options.php:60 msgid "Invoice Date" msgstr "" @@ -159,139 +159,139 @@ msgstr "" msgid "Notes (printed in the invoice):" msgstr "" -#: includes/class-wcpdf-admin.php:859 +#: includes/class-wcpdf-admin.php:867 msgid "View more details" msgstr "" -#: includes/class-wcpdf-admin.php:860 +#: includes/class-wcpdf-admin.php:868 msgid "Hide details" msgstr "" #. translators: document title -#: includes/class-wcpdf-admin.php:872 +#: includes/class-wcpdf-admin.php:880 msgid "Set %s number & date" msgstr "" -#: includes/class-wcpdf-admin.php:877 +#: includes/class-wcpdf-admin.php:885 msgid "You do not have sufficient permissions to edit this document." msgstr "" -#: includes/class-wcpdf-admin.php:889 +#: includes/class-wcpdf-admin.php:897 msgid "unformatted!" msgstr "" -#: includes/class-wcpdf-admin.php:931 +#: includes/class-wcpdf-admin.php:939 msgid "Save changes" msgstr "" -#: includes/class-wcpdf-admin.php:932 +#: includes/class-wcpdf-admin.php:940 msgid "Cancel" msgstr "" #. translators: %s: email title -#: includes/class-wcpdf-admin.php:1054 +#: includes/class-wcpdf-admin.php:1062 msgid "%s email notification manually sent." msgstr "" -#: includes/class-wcpdf-admin.php:1102 +#: includes/class-wcpdf-admin.php:1110 msgid "Nonce expired!" msgstr "" -#: includes/class-wcpdf-admin.php:1108 +#: includes/class-wcpdf-admin.php:1116 msgid "Bad action!" msgstr "" -#: includes/class-wcpdf-admin.php:1114 +#: includes/class-wcpdf-admin.php:1122 msgid "Incomplete request!" msgstr "" -#: includes/class-wcpdf-admin.php:1120 +#: includes/class-wcpdf-admin.php:1128 msgid "No permissions!" msgstr "" -#: includes/class-wcpdf-admin.php:1144 +#: includes/class-wcpdf-admin.php:1152 msgid "Document data saved!" msgstr "" -#: includes/class-wcpdf-admin.php:1145 +#: includes/class-wcpdf-admin.php:1153 msgid "An error occurred while saving the document data!" msgstr "" -#: includes/class-wcpdf-admin.php:1148 +#: includes/class-wcpdf-admin.php:1156 msgid "Document regenerated!" msgstr "" -#: includes/class-wcpdf-admin.php:1149 +#: includes/class-wcpdf-admin.php:1157 msgid "An error occurred while regenerating the document!" msgstr "" -#: includes/class-wcpdf-admin.php:1152 +#: includes/class-wcpdf-admin.php:1160 msgid "Document deleted!" msgstr "" -#: includes/class-wcpdf-admin.php:1153 +#: includes/class-wcpdf-admin.php:1161 msgid "An error occurred while deleting the document!" msgstr "" -#: includes/class-wcpdf-admin.php:1209 +#: includes/class-wcpdf-admin.php:1217 msgid "Document does not exist." msgstr "" -#: includes/class-wcpdf-admin.php:1223 +#: includes/class-wcpdf-admin.php:1231 msgid "Document is empty." msgstr "" -#: includes/class-wcpdf-admin.php:1254 +#: includes/class-wcpdf-admin.php:1262 msgid "DEBUG output enabled" msgstr "" -#: includes/class-wcpdf-assets.php:86 +#: includes/class-wcpdf-assets.php:87 msgid "You have to select order(s) first!" msgstr "" -#: includes/class-wcpdf-assets.php:87 +#: includes/class-wcpdf-assets.php:88 msgid "Are you sure you want to delete this document? This cannot be undone." msgstr "" -#: includes/class-wcpdf-assets.php:88 +#: includes/class-wcpdf-assets.php:89 msgid "Are you sure you want to regenerate this document? This will make the document reflect the most current settings (such as footer text, document name, etc.) rather than using historical settings." msgstr "" -#: includes/class-wcpdf-assets.php:117 +#: includes/class-wcpdf-assets.php:118 msgid "Preview" msgstr "" -#: includes/class-wcpdf-assets.php:120 -#: includes/settings/class-wcpdf-settings-debug.php:913 +#: includes/class-wcpdf-assets.php:121 +#: includes/settings/class-wcpdf-settings-debug.php:929 msgid "Settings" msgstr "" -#: includes/class-wcpdf-assets.php:175 +#: includes/class-wcpdf-assets.php:176 msgid "Document settings" msgstr "" -#: includes/class-wcpdf-assets.php:176 +#: includes/class-wcpdf-assets.php:177 msgid "Select a document in the dropdown menu above to edit its settings." msgstr "" -#: includes/class-wcpdf-assets.php:187 +#: includes/class-wcpdf-assets.php:188 msgid "The number should be smaller than 2147483647. Please note you should add your next document number without prefix, suffix or padding." msgstr "" -#: includes/class-wcpdf-assets.php:261 +#: includes/class-wcpdf-assets.php:262 msgid "Download" msgstr "" -#: includes/class-wcpdf-assets.php:262 +#: includes/class-wcpdf-assets.php:263 msgid "Are you sure you want to reset this settings? This cannot be undone." msgstr "" -#: includes/class-wcpdf-assets.php:263 +#: includes/class-wcpdf-assets.php:264 msgid "Please select a document type" msgstr "" #. translators: 1. open anchor tag, 2. close anchor tag -#: includes/class-wcpdf-assets.php:268 +#: includes/class-wcpdf-assets.php:269 msgid "Enabled: %1$sclick here%2$s to start using the tools." msgstr "" @@ -300,215 +300,215 @@ msgstr "" msgid "Download %s (PDF)" msgstr "" -#: includes/class-wcpdf-main.php:401 +#: includes/class-wcpdf-main.php:360 msgid "You do not have sufficient permissions to access this page. Reason: empty access key" msgstr "" -#: includes/class-wcpdf-main.php:407 +#: includes/class-wcpdf-main.php:366 msgid "You do not have sufficient permissions to access this page. Reason: empty action" msgstr "" -#: includes/class-wcpdf-main.php:413 +#: includes/class-wcpdf-main.php:372 msgid "You do not have sufficient permissions to access this page. Reason: invalid nonce" msgstr "" -#: includes/class-wcpdf-main.php:423 +#: includes/class-wcpdf-main.php:382 msgid "You haven't selected any orders" msgstr "" -#: includes/class-wcpdf-main.php:428 +#: includes/class-wcpdf-main.php:387 msgid "Some of the export parameters are missing." msgstr "" -#: includes/class-wcpdf-main.php:447 +#: includes/class-wcpdf-main.php:406 msgid "You have to save the order before generating a PDF document for it." msgstr "" #. translators: %s: Order ID -#: includes/class-wcpdf-main.php:452 +#: includes/class-wcpdf-main.php:411 msgid "Could not find the order #%s." msgstr "" -#: includes/class-wcpdf-main.php:519 -#: includes/class-wcpdf-settings.php:239 -#: includes/class-wcpdf-settings.php:387 +#: includes/class-wcpdf-main.php:478 +#: includes/class-wcpdf-settings.php:223 +#: includes/class-wcpdf-settings.php:371 msgid "You do not have sufficient permissions to access this page." msgstr "" #. translators: document type -#: includes/class-wcpdf-main.php:574 +#: includes/class-wcpdf-main.php:533 msgid "Document of type '%s' for the selected order(s) could not be generated" msgstr "" #. translators: 1. plugin name, 2. directory path -#: includes/class-wcpdf-main.php:891 +#: includes/class-wcpdf-main.php:850 msgid "The %1$s directory %2$s couldn't be created or is not writable!" msgstr "" -#: includes/class-wcpdf-main.php:892 +#: includes/class-wcpdf-main.php:851 msgid "Please check your directories write permissions or contact your hosting service provider." msgstr "" #. translators: 1,2. file count -#: includes/class-wcpdf-main.php:1229 +#: includes/class-wcpdf-main.php:1188 msgid "Unable to delete %1$d files! (deleted %2$d)" msgstr "" #. translators: file count -#: includes/class-wcpdf-main.php:1233 +#: includes/class-wcpdf-main.php:1192 msgid "Successfully deleted %d files!" msgstr "" -#: includes/class-wcpdf-main.php:1237 +#: includes/class-wcpdf-main.php:1196 msgid "Nothing to delete!" msgstr "" #. translators: 1. document title, 2. creation trigger -#: includes/class-wcpdf-main.php:1313 +#: includes/class-wcpdf-main.php:1272 msgid "PDF %1$s created via %2$s." msgstr "" #. translators: document title -#: includes/class-wcpdf-main.php:1329 +#: includes/class-wcpdf-main.php:1288 msgid "PDF %s deleted." msgstr "" -#: includes/class-wcpdf-main.php:1344 +#: includes/class-wcpdf-main.php:1303 msgid "manually" msgstr "" #. translators: 1. document title, 2. creation trigger -#: includes/class-wcpdf-main.php:1350 +#: includes/class-wcpdf-main.php:1309 msgid "%1$s document marked as printed via %2$s." msgstr "" #. translators: 1. document title, 2. creation trigger -#: includes/class-wcpdf-main.php:1366 +#: includes/class-wcpdf-main.php:1325 msgid "%1$s document unmark printed." msgstr "" -#: includes/class-wcpdf-main.php:1451 +#: includes/class-wcpdf-main.php:1410 msgid "single order action" msgstr "" -#: includes/class-wcpdf-main.php:1452 +#: includes/class-wcpdf-main.php:1411 msgid "bulk order action" msgstr "" -#: includes/class-wcpdf-main.php:1453 +#: includes/class-wcpdf-main.php:1412 msgid "my account" msgstr "" -#: includes/class-wcpdf-main.php:1454 +#: includes/class-wcpdf-main.php:1413 msgid "email attachment" msgstr "" -#: includes/class-wcpdf-main.php:1455 +#: includes/class-wcpdf-main.php:1414 msgid "order document data (number and/or date set manually)" msgstr "" #. translators: 1. document type, 2. mark/unmark -#: includes/class-wcpdf-main.php:1539 +#: includes/class-wcpdf-main.php:1498 msgid "Document of type %1$s for the selected order could not be %2$s as printed." msgstr "" #. translators: document title -#: includes/class-wcpdf-main.php:1634 +#: includes/class-wcpdf-main.php:1595 msgid "Order %s Saved" msgstr "" -#: includes/class-wcpdf-main.php:1667 -#: includes/documents/abstract-wcpdf-order-document.php:652 +#: includes/class-wcpdf-main.php:1648 +#: includes/documents/abstract-wcpdf-order-document.php:886 msgid "Due Date:" msgstr "" -#: includes/class-wcpdf-settings.php:102 -#: includes/class-wcpdf-settings.php:103 +#: includes/class-wcpdf-settings.php:91 +#: includes/class-wcpdf-settings.php:92 msgid "PDF Invoices" msgstr "" -#: includes/class-wcpdf-settings.php:128 +#: includes/class-wcpdf-settings.php:117 msgid "Documentation" msgstr "" -#: includes/class-wcpdf-settings.php:129 +#: includes/class-wcpdf-settings.php:118 msgid "Support Forum" msgstr "" #. translators: database row value -#: includes/class-wcpdf-settings.php:168 +#: includes/class-wcpdf-settings.php:157 msgid "Warning! Your database has an AUTO_INCREMENT step size of %d, your invoice numbers may not be sequential. Enable the 'Calculate document numbers (slow)' setting in the Advanced tab to use an alternate method." msgstr "" -#: includes/class-wcpdf-settings.php:180 -#: includes/settings/class-wcpdf-settings-debug.php:653 +#: includes/class-wcpdf-settings.php:169 +#: includes/settings/class-wcpdf-settings-debug.php:669 msgid "General" msgstr "" -#: includes/class-wcpdf-settings.php:184 +#: includes/class-wcpdf-settings.php:173 msgid "Documents" msgstr "" -#: includes/class-wcpdf-settings.php:188 +#: includes/class-wcpdf-settings.php:177 msgid "UBL" msgstr "" -#: includes/class-wcpdf-settings.php:196 +#: includes/class-wcpdf-settings.php:185 msgid "Advanced" msgstr "" -#: includes/class-wcpdf-settings.php:201 +#: includes/class-wcpdf-settings.php:190 msgid "Upgrade" msgstr "" -#: includes/class-wcpdf-settings.php:279 +#: includes/class-wcpdf-settings.php:263 msgid "Order not found!" msgstr "" -#: includes/class-wcpdf-settings.php:282 +#: includes/class-wcpdf-settings.php:266 msgid "Object found is not an order!" msgstr "" #. translators: order ID -#: includes/class-wcpdf-settings.php:354 +#: includes/class-wcpdf-settings.php:338 msgid "Document not available for order #%s, try selecting a different order." msgstr "" -#: includes/class-wcpdf-settings.php:361 +#: includes/class-wcpdf-settings.php:345 msgid "No WooCommerce orders found! Please consider adding your first order to see this preview." msgstr "" #. translators: error message -#: includes/class-wcpdf-settings.php:371 +#: includes/class-wcpdf-settings.php:355 msgid "Error trying to generate document: %s" msgstr "" -#: includes/class-wcpdf-settings.php:445 +#: includes/class-wcpdf-settings.php:429 #: includes/tables/class-wcpdf-number-store-list-table.php:122 msgid "Date" msgstr "" -#: includes/class-wcpdf-settings.php:446 +#: includes/class-wcpdf-settings.php:430 #: includes/documents/abstract-wcpdf-order-document-methods.php:1111 #: ubl/Settings/TaxesSettings.php:170 msgid "Total" msgstr "" -#: includes/class-wcpdf-settings.php:453 +#: includes/class-wcpdf-settings.php:437 msgid "No order(s) found!" msgstr "" -#: includes/class-wcpdf-settings.php:456 +#: includes/class-wcpdf-settings.php:440 msgid "An error occurred when trying to process your request!" msgstr "" #. translators: error message -#: includes/class-wcpdf-settings.php:463 +#: includes/class-wcpdf-settings.php:447 msgid "Error trying to get orders: %s" msgstr "" #. translators: total scheduled actions -#: includes/class-wcpdf-settings.php:953 +#: includes/class-wcpdf-settings.php:937 msgid "Only 1 scheduled action should exist for the yearly reset of the numbering system, but %s were found" msgstr "" @@ -569,7 +569,7 @@ msgstr "" msgid "Finish" msgstr "" -#: includes/compatibility/class-wcpdf-compatibility-third-party-plugins.php:374 +#: includes/compatibility/class-wcpdf-compatibility-third-party-plugins.php:391 #: includes/views/setup-wizard/display-options.php:73 msgid "Invoice number" msgstr "" @@ -596,91 +596,152 @@ msgid "Total ex. VAT" msgstr "" #: includes/documents/abstract-wcpdf-order-document-methods.php:1307 -#: includes/documents/class-wcpdf-invoice.php:281 +#: includes/documents/class-wcpdf-invoice.php:311 #: includes/views/setup-wizard/display-options.php:61 msgid "Order Date" msgstr "" +#: includes/documents/abstract-wcpdf-order-document-methods.php:1325 +#: includes/documents/class-wcpdf-invoice.php:66 +msgid "Invoice Number:" +msgstr "" + +#: includes/documents/abstract-wcpdf-order-document-methods.php:1348 +msgid "Reason for refund:" +msgstr "" + #. translators: 1. credit note title, 2. refund id -#: includes/documents/abstract-wcpdf-order-document.php:506 +#: includes/documents/abstract-wcpdf-order-document.php:471 msgid "%1$s (refund #%2$s) was regenerated." msgstr "" #. translators: 1. credit note title, 2. refund id -#: includes/documents/abstract-wcpdf-order-document.php:506 +#: includes/documents/abstract-wcpdf-order-document.php:471 msgid "%s was regenerated" msgstr "" #. translators: %s: document name -#: includes/documents/abstract-wcpdf-order-document.php:633 +#: includes/documents/abstract-wcpdf-order-document.php:872 msgid "%s Number:" msgstr "" #. translators: %s: document name -#: includes/documents/abstract-wcpdf-order-document.php:643 +#: includes/documents/abstract-wcpdf-order-document.php:880 msgid "%s Date:" msgstr "" -#: includes/documents/abstract-wcpdf-order-document.php:1267 +#: includes/documents/abstract-wcpdf-order-document.php:890 +msgid "Billing Address:" +msgstr "" + +#: includes/documents/abstract-wcpdf-order-document.php:893 +msgid "Shipping Address:" +msgstr "" + +#: includes/documents/abstract-wcpdf-order-document.php:896 +msgid "Order Number:" +msgstr "" + +#: includes/documents/abstract-wcpdf-order-document.php:899 +msgid "Order Date:" +msgstr "" + +#: includes/documents/abstract-wcpdf-order-document.php:902 +msgid "Payment Method:" +msgstr "" + +#: includes/documents/abstract-wcpdf-order-document.php:905 +#: languages/strings.php:6 +msgid "Payment Date:" +msgstr "" + +#: includes/documents/abstract-wcpdf-order-document.php:908 +msgid "Shipping Method:" +msgstr "" + +#: includes/documents/abstract-wcpdf-order-document.php:911 +msgid "SKU:" +msgstr "" + +#: includes/documents/abstract-wcpdf-order-document.php:914 +msgid "Weight:" +msgstr "" + +#: includes/documents/abstract-wcpdf-order-document.php:917 +msgid "Notes:" +msgstr "" + +#: includes/documents/abstract-wcpdf-order-document.php:920 +msgid "Customer Notes:" +msgstr "" + +#: includes/documents/abstract-wcpdf-order-document.php:1545 msgid "Admin email" msgstr "" -#: includes/documents/abstract-wcpdf-order-document.php:1270 +#: includes/documents/abstract-wcpdf-order-document.php:1548 msgid "Manual email" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:29 +#: includes/documents/class-wcpdf-invoice.php:24 #: includes/documents/class-wcpdf-invoice.php:56 #: includes/views/settings-page.php:127 msgid "Invoice" msgstr "" +#: includes/documents/class-wcpdf-invoice.php:76 +msgid "Invoice Date:" +msgstr "" + +#: includes/documents/class-wcpdf-invoice.php:86 +msgid "Ship To:" +msgstr "" + #. translators: document type -#: includes/documents/class-wcpdf-invoice.php:95 -#: includes/documents/class-wcpdf-invoice.php:353 -#: includes/documents/class-wcpdf-invoice.php:362 -#: includes/documents/class-wcpdf-invoice.php:370 -#: includes/documents/class-wcpdf-invoice.php:374 +#: includes/documents/class-wcpdf-invoice.php:125 +#: includes/documents/class-wcpdf-invoice.php:381 +#: includes/documents/class-wcpdf-invoice.php:390 +#: includes/documents/class-wcpdf-invoice.php:398 +#: includes/documents/class-wcpdf-invoice.php:402 msgid "invoice" msgid_plural "invoices" msgstr[0] "" msgstr[1] "" -#: includes/documents/class-wcpdf-invoice.php:180 -#: includes/documents/class-wcpdf-invoice.php:549 -#: includes/documents/class-wcpdf-packing-slip.php:85 +#: includes/documents/class-wcpdf-invoice.php:210 +#: includes/documents/class-wcpdf-invoice.php:577 +#: includes/documents/class-wcpdf-packing-slip.php:110 msgid "Enable" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:191 -#: includes/documents/class-wcpdf-invoice.php:560 -#: includes/documents/class-wcpdf-packing-slip.php:160 +#: includes/documents/class-wcpdf-invoice.php:221 +#: includes/documents/class-wcpdf-invoice.php:588 +#: includes/documents/class-wcpdf-packing-slip.php:185 msgid "Attach to:" msgstr "" #. translators: directory path -#: includes/documents/class-wcpdf-invoice.php:199 -#: includes/documents/class-wcpdf-invoice.php:568 +#: includes/documents/class-wcpdf-invoice.php:229 +#: includes/documents/class-wcpdf-invoice.php:596 msgid "It looks like the temp folder (%s) is not writable, check the permissions for this folder! Without having write access to this folder, the plugin will not be able to email invoices." msgstr "" -#: includes/documents/class-wcpdf-invoice.php:205 +#: includes/documents/class-wcpdf-invoice.php:235 msgid "Disable for:" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:214 +#: includes/documents/class-wcpdf-invoice.php:244 msgid "Select one or more statuses" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:220 +#: includes/documents/class-wcpdf-invoice.php:250 msgid "Display shipping address" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:227 -#: includes/documents/class-wcpdf-invoice.php:279 -#: includes/documents/class-wcpdf-invoice.php:295 -#: includes/documents/class-wcpdf-invoice.php:313 -#: includes/documents/class-wcpdf-packing-slip.php:103 +#: includes/documents/class-wcpdf-invoice.php:257 +#: includes/documents/class-wcpdf-invoice.php:309 +#: includes/documents/class-wcpdf-invoice.php:341 +#: includes/documents/class-wcpdf-packing-slip.php:128 #: includes/views/advanced-status.php:169 #: includes/views/advanced-status.php:173 #: includes/views/advanced-status.php:204 @@ -691,294 +752,275 @@ msgstr "" msgid "No" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:228 +#: includes/documents/class-wcpdf-invoice.php:258 #: includes/views/setup-wizard/display-options.php:21 msgid "Only when different from billing address" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:229 -#: includes/documents/class-wcpdf-invoice.php:400 -#: includes/documents/class-wcpdf-packing-slip.php:105 +#: includes/documents/class-wcpdf-invoice.php:259 +#: includes/documents/class-wcpdf-invoice.php:428 +#: includes/documents/class-wcpdf-packing-slip.php:130 #: includes/views/setup-wizard/display-options.php:22 msgid "Always" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:237 -#: includes/documents/class-wcpdf-packing-slip.php:113 +#: includes/documents/class-wcpdf-invoice.php:267 +#: includes/documents/class-wcpdf-packing-slip.php:138 msgid "Display email address" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:248 -#: includes/documents/class-wcpdf-packing-slip.php:124 +#: includes/documents/class-wcpdf-invoice.php:278 +#: includes/documents/class-wcpdf-packing-slip.php:149 msgid "Display phone number" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:259 -#: includes/documents/class-wcpdf-packing-slip.php:135 +#: includes/documents/class-wcpdf-invoice.php:289 +#: includes/documents/class-wcpdf-packing-slip.php:160 msgid "Display customer notes" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:272 +#: includes/documents/class-wcpdf-invoice.php:302 msgid "Display invoice date" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:288 +#: includes/documents/class-wcpdf-invoice.php:318 msgid "Display due date" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:296 -msgid "1 day" -msgstr "" - -#: includes/documents/class-wcpdf-invoice.php:297 -msgid "7 days" -msgstr "" - -#: includes/documents/class-wcpdf-invoice.php:298 -msgid "30 days" -msgstr "" - -#: includes/documents/class-wcpdf-invoice.php:300 -msgid "Displays a due date below the order data." +#. translators: number of days +#: includes/documents/class-wcpdf-invoice.php:325 +msgid "%s days" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:306 +#: includes/documents/class-wcpdf-invoice.php:334 msgid "Display invoice number" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:315 +#: includes/documents/class-wcpdf-invoice.php:343 #: includes/views/setup-wizard/display-options.php:82 msgid "Order Number" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:319 +#: includes/documents/class-wcpdf-invoice.php:347 msgid "Warning!" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:320 +#: includes/documents/class-wcpdf-invoice.php:348 msgid "Using the Order Number as invoice number is not recommended as this may lead to gaps in the invoice number sequence (even when order numbers are sequential)." msgstr "" -#: includes/documents/class-wcpdf-invoice.php:321 +#: includes/documents/class-wcpdf-invoice.php:349 msgid "More information" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:328 +#: includes/documents/class-wcpdf-invoice.php:356 msgid "Next invoice number (without prefix/suffix etc.)" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:334 +#: includes/documents/class-wcpdf-invoice.php:362 msgid "This is the number that will be used for the next document. By default, numbering starts from 1 and increases for every new document. Note that if you override this and set it lower than the current/highest number, this could create duplicate numbers!" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:340 +#: includes/documents/class-wcpdf-invoice.php:368 msgid "Number format" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:348 +#: includes/documents/class-wcpdf-invoice.php:376 msgid "Prefix" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:350 +#: includes/documents/class-wcpdf-invoice.php:378 msgid "If set, this value will be used as number prefix." msgstr "" #. translators: 1. document type, 2-3 placeholders -#: includes/documents/class-wcpdf-invoice.php:352 -#: includes/documents/class-wcpdf-invoice.php:361 +#: includes/documents/class-wcpdf-invoice.php:380 +#: includes/documents/class-wcpdf-invoice.php:389 msgid "You can use the %1$s year and/or month with the %2$s or %3$s placeholders respectively." msgstr "" -#: includes/documents/class-wcpdf-invoice.php:354 -#: includes/documents/class-wcpdf-invoice.php:363 +#: includes/documents/class-wcpdf-invoice.php:382 +#: includes/documents/class-wcpdf-invoice.php:391 msgid "Check the Docs article below to see all the available placeholders for prefix/suffix." msgstr "" -#: includes/documents/class-wcpdf-invoice.php:357 +#: includes/documents/class-wcpdf-invoice.php:385 msgid "Suffix" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:359 +#: includes/documents/class-wcpdf-invoice.php:387 msgid "If set, this value will be used as number suffix." msgstr "" -#: includes/documents/class-wcpdf-invoice.php:366 +#: includes/documents/class-wcpdf-invoice.php:394 msgid "Padding" msgstr "" #. translators: document type -#: includes/documents/class-wcpdf-invoice.php:370 +#: includes/documents/class-wcpdf-invoice.php:398 msgid "Enter the number of digits you want to use as padding. For instance, enter 6 to display the %s number 123 as 000123, filling it with zeros until the number set as padding is reached." msgstr "" #. translators: document type -#: includes/documents/class-wcpdf-invoice.php:374 +#: includes/documents/class-wcpdf-invoice.php:402 msgid "For more information about setting up the number format and see the available placeholders for the prefix and suffix, check this article:" msgstr "" #. translators: document type -#: includes/documents/class-wcpdf-invoice.php:374 +#: includes/documents/class-wcpdf-invoice.php:402 msgid "Number format explained" msgstr "" #. translators: document type -#: includes/documents/class-wcpdf-invoice.php:374 +#: includes/documents/class-wcpdf-invoice.php:402 msgid "Note: Changes made to the number format will only be reflected on new orders. Also, if you have already created a custom %s number format with a filter, the above settings will be ignored." msgstr "" -#: includes/documents/class-wcpdf-invoice.php:380 +#: includes/documents/class-wcpdf-invoice.php:408 msgid "Reset invoice number yearly" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:391 +#: includes/documents/class-wcpdf-invoice.php:419 msgid "Allow My Account invoice download" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:398 +#: includes/documents/class-wcpdf-invoice.php:426 msgid "Only when an invoice is already created/emailed" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:399 +#: includes/documents/class-wcpdf-invoice.php:427 msgid "Only for specific order statuses (define below)" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:401 +#: includes/documents/class-wcpdf-invoice.php:429 msgid "Never" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:416 +#: includes/documents/class-wcpdf-invoice.php:444 msgid "Enable invoice number column in the orders list" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:427 +#: includes/documents/class-wcpdf-invoice.php:455 msgid "Enable invoice date column in the orders list" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:438 +#: includes/documents/class-wcpdf-invoice.php:466 msgid "Enable invoice number search in the orders list" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:444 +#: includes/documents/class-wcpdf-invoice.php:472 msgid "The search process may be slower on non-HPOS stores. For a more efficient search, you can utilize the HPOS feature, allowing you to search orders by invoice numbers using the search type selector." msgstr "" -#: includes/documents/class-wcpdf-invoice.php:450 +#: includes/documents/class-wcpdf-invoice.php:478 msgid "Disable for free orders" msgstr "" #. translators: zero number -#: includes/documents/class-wcpdf-invoice.php:457 +#: includes/documents/class-wcpdf-invoice.php:485 msgid "Disable document when the order total is %s" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:463 +#: includes/documents/class-wcpdf-invoice.php:491 msgid "Mark as printed" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:471 +#: includes/documents/class-wcpdf-invoice.php:499 msgid "Manually" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:474 +#: includes/documents/class-wcpdf-invoice.php:502 msgid "On single order action" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:475 +#: includes/documents/class-wcpdf-invoice.php:503 msgid "On bulk order action" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:476 +#: includes/documents/class-wcpdf-invoice.php:504 msgid "On my account" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:477 +#: includes/documents/class-wcpdf-invoice.php:505 msgid "On email attachment" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:478 +#: includes/documents/class-wcpdf-invoice.php:506 msgid "On order document data (number and/or date set manually)" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:483 +#: includes/documents/class-wcpdf-invoice.php:511 msgid "Allows you to mark the document as printed, manually (in the order page) or automatically (based on the document creation context you have selected)." msgstr "" -#: includes/documents/class-wcpdf-invoice.php:489 +#: includes/documents/class-wcpdf-invoice.php:517 msgid "Unmark as printed" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:495 +#: includes/documents/class-wcpdf-invoice.php:523 msgid "Adds a link in the order page to allow to remove the printed mark." msgstr "" -#: includes/documents/class-wcpdf-invoice.php:501 +#: includes/documents/class-wcpdf-invoice.php:529 msgid "Always use most current settings" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:507 +#: includes/documents/class-wcpdf-invoice.php:535 msgid "When enabled, the document will always reflect the most current settings (such as footer text, document name, etc.) rather than using historical settings." msgstr "" -#: includes/documents/class-wcpdf-invoice.php:509 +#: includes/documents/class-wcpdf-invoice.php:537 msgid "Caution: enabling this will also mean that if you change your company name or address in the future, previously generated documents will also be affected." msgstr "" -#: includes/documents/class-wcpdf-invoice.php:522 +#: includes/documents/class-wcpdf-invoice.php:550 msgid "Invoice numbers are created by a third-party extension." msgstr "" #. translators: link -#: includes/documents/class-wcpdf-invoice.php:525 +#: includes/documents/class-wcpdf-invoice.php:553 msgid "Configure it here." msgstr "" -#: includes/documents/class-wcpdf-invoice.php:574 +#: includes/documents/class-wcpdf-invoice.php:602 msgid "Include encrypted PDF:" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:580 +#: includes/documents/class-wcpdf-invoice.php:608 msgid "Include the PDF Invoice file encrypted in the UBL file." msgstr "" -#: includes/documents/class-wcpdf-invoice.php:592 -msgid "Invoice Number:" +#: includes/documents/class-wcpdf-packing-slip.php:24 +#: includes/documents/class-wcpdf-packing-slip.php:41 +msgid "Packing Slip" msgstr "" -#: includes/documents/class-wcpdf-invoice.php:600 -msgid "Invoice Date:" +#: includes/documents/class-wcpdf-packing-slip.php:51 +msgid "Packing Slip Number:" msgstr "" -#: includes/documents/class-wcpdf-packing-slip.php:24 -#: includes/documents/class-wcpdf-packing-slip.php:36 -msgid "Packing Slip" +#: includes/documents/class-wcpdf-packing-slip.php:61 +msgid "Packing Slip Date:" msgstr "" -#: includes/documents/class-wcpdf-packing-slip.php:42 +#: includes/documents/class-wcpdf-packing-slip.php:67 msgid "packing-slip" msgid_plural "packing-slips" msgstr[0] "" msgstr[1] "" -#: includes/documents/class-wcpdf-packing-slip.php:96 +#: includes/documents/class-wcpdf-packing-slip.php:121 msgid "Display billing address" msgstr "" -#: includes/documents/class-wcpdf-packing-slip.php:104 +#: includes/documents/class-wcpdf-packing-slip.php:129 msgid "Only when different from shipping address" msgstr "" -#: includes/documents/class-wcpdf-packing-slip.php:151 +#: includes/documents/class-wcpdf-packing-slip.php:176 msgid "Upgrade to our Professional extension to attach packing slips to any email!" msgstr "" -#: includes/documents/class-wcpdf-packing-slip.php:184 -msgid "Packing Slip Number:" -msgstr "" - -#: includes/documents/class-wcpdf-packing-slip.php:192 -msgid "Packing Slip Date:" -msgstr "" - #: includes/settings/class-wcpdf-settings-callbacks.php:37 msgid "Warning! The settings below are meant for debugging/development only. Do not use them on a live website!" msgstr "" @@ -1012,270 +1054,278 @@ msgid "Yearly reset numbering system rescheduled!" msgstr "" #: includes/settings/class-wcpdf-settings-debug.php:250 +msgid "Released semaphore locks have been cleaned up!" +msgstr "" + +#: includes/settings/class-wcpdf-settings-debug.php:258 +msgid "Released legacy semaphore locks have been cleaned up!" +msgstr "" + +#: includes/settings/class-wcpdf-settings-debug.php:266 msgid "Extensions' license cache cleared successfully!" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:278 +#: includes/settings/class-wcpdf-settings-debug.php:294 msgid "Export settings type is empty!" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:315 +#: includes/settings/class-wcpdf-settings-debug.php:331 msgid "Exported settings data is empty!" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:334 +#: includes/settings/class-wcpdf-settings-debug.php:350 msgid "Failed to get contents from JSON file!" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:341 +#: includes/settings/class-wcpdf-settings-debug.php:357 msgid "JSON file not found!" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:347 +#: includes/settings/class-wcpdf-settings-debug.php:363 msgid "The JSON file data is corrupted!" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:358 +#: includes/settings/class-wcpdf-settings-debug.php:374 msgid "The JSON file settings type is not supported on this store!" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:383 +#: includes/settings/class-wcpdf-settings-debug.php:399 msgid "Couldn't determine the settings option for the import!" msgstr "" #. translators: settings type -#: includes/settings/class-wcpdf-settings-debug.php:392 +#: includes/settings/class-wcpdf-settings-debug.php:408 msgid "%s settings imported successfully!" msgstr "" #. translators: settings type -#: includes/settings/class-wcpdf-settings-debug.php:400 +#: includes/settings/class-wcpdf-settings-debug.php:416 msgid "The %s settings file you are trying to import is identical to your current settings, therefore, the settings were not imported." msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:412 +#: includes/settings/class-wcpdf-settings-debug.php:428 msgid "Reset settings type is empty!" msgstr "" #. translators: settings type -#: includes/settings/class-wcpdf-settings-debug.php:451 +#: includes/settings/class-wcpdf-settings-debug.php:467 msgid "%s settings reset not supported!" msgstr "" #. translators: settings type -#: includes/settings/class-wcpdf-settings-debug.php:464 +#: includes/settings/class-wcpdf-settings-debug.php:480 msgid "%s settings are already reset!" msgstr "" #. translators: settings type -#: includes/settings/class-wcpdf-settings-debug.php:476 +#: includes/settings/class-wcpdf-settings-debug.php:492 msgid "%s settings reset successfully!" msgstr "" #. translators: settings type -#: includes/settings/class-wcpdf-settings-debug.php:484 +#: includes/settings/class-wcpdf-settings-debug.php:500 msgid "An error occurred when trying to reset the %s settings." msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:498 +#: includes/settings/class-wcpdf-settings-debug.php:514 msgid "One or more request parameters missing." msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:510 +#: includes/settings/class-wcpdf-settings-debug.php:526 msgid "documents deleted." msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:510 +#: includes/settings/class-wcpdf-settings-debug.php:526 msgid "documents renumbered." msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:541 +#: includes/settings/class-wcpdf-settings-debug.php:557 msgid "Wrong date type selected." msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:556 +#: includes/settings/class-wcpdf-settings-debug.php:572 msgid "Unexpected results from the orders query." msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:654 +#: includes/settings/class-wcpdf-settings-debug.php:670 msgid "Debug" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:655 +#: includes/settings/class-wcpdf-settings-debug.php:671 msgid "UBL Taxes" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:691 +#: includes/settings/class-wcpdf-settings-debug.php:707 msgid "Document link access type" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:699 +#: includes/settings/class-wcpdf-settings-debug.php:715 msgid "Logged in (recommended)" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:700 -#: includes/settings/class-wcpdf-settings-debug.php:900 +#: includes/settings/class-wcpdf-settings-debug.php:716 +#: includes/settings/class-wcpdf-settings-debug.php:916 msgid "Guest" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:701 -#: includes/settings/class-wcpdf-settings-debug.php:904 +#: includes/settings/class-wcpdf-settings-debug.php:717 +#: includes/settings/class-wcpdf-settings-debug.php:920 msgid "Full" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:718 +#: includes/settings/class-wcpdf-settings-debug.php:734 msgid "Document access denied redirect page" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:726 +#: includes/settings/class-wcpdf-settings-debug.php:742 msgid "Blank page with message (default)" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:727 +#: includes/settings/class-wcpdf-settings-debug.php:743 msgid "Login page" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:728 +#: includes/settings/class-wcpdf-settings-debug.php:744 msgid "My Account page" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:729 +#: includes/settings/class-wcpdf-settings-debug.php:745 msgid "Custom page (enter below)" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:731 +#: includes/settings/class-wcpdf-settings-debug.php:747 msgid "Select a frontend page to be used to redirect users when the document access is denied." msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:744 +#: includes/settings/class-wcpdf-settings-debug.php:760 msgid "Custom external URLs not allowed." msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:750 +#: includes/settings/class-wcpdf-settings-debug.php:766 msgid "Pretty document links" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:756 +#: includes/settings/class-wcpdf-settings-debug.php:772 msgid "Changes the document links to a prettier URL scheme." msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:762 +#: includes/settings/class-wcpdf-settings-debug.php:778 msgid "Calculate document numbers (slow)" msgstr "" #. translators: 1. AUTO_INCREMENT, 2. one -#: includes/settings/class-wcpdf-settings-debug.php:770 +#: includes/settings/class-wcpdf-settings-debug.php:786 msgid "Document numbers (such as invoice numbers) are generated using %1$s by default. Use this setting if your database auto increments with more than %2$s." msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:779 +#: includes/settings/class-wcpdf-settings-debug.php:795 msgid "Enable debug output" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:785 +#: includes/settings/class-wcpdf-settings-debug.php:801 msgid "Enable this option to output plugin errors if you're getting a blank page or other PDF generation issues." msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:786 +#: includes/settings/class-wcpdf-settings-debug.php:802 msgid "Caution! This setting may reveal errors (from other plugins) in other places on your site too, therefore this is not recommended to leave it enabled on live sites." msgstr "" #. translators: &debug=true -#: includes/settings/class-wcpdf-settings-debug.php:789 +#: includes/settings/class-wcpdf-settings-debug.php:805 msgid "You can also add %s to the URL to apply this on a per-order basis." msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:797 +#: includes/settings/class-wcpdf-settings-debug.php:813 msgid "Enable automatic cleanup" msgstr "" #. translators: number of days -#: includes/settings/class-wcpdf-settings-debug.php:804 +#: includes/settings/class-wcpdf-settings-debug.php:820 msgid "every %s days" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:808 +#: includes/settings/class-wcpdf-settings-debug.php:824 msgid "Automatically clean up PDF files stored in the temporary folder (used for email attachments)" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:814 +#: includes/settings/class-wcpdf-settings-debug.php:830 msgid "Output to HTML" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:820 +#: includes/settings/class-wcpdf-settings-debug.php:836 msgid "Send the template output as HTML to the browser instead of creating a PDF." msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:821 +#: includes/settings/class-wcpdf-settings-debug.php:837 msgid "You can also add &output=html to the URL to apply this on a per-order basis." msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:827 +#: includes/settings/class-wcpdf-settings-debug.php:843 msgid "Embed Images" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:833 +#: includes/settings/class-wcpdf-settings-debug.php:849 msgid "Embed images only if you are experiencing issues with them loading in your PDF. Please note that this option can significantly increase the file size." msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:839 +#: includes/settings/class-wcpdf-settings-debug.php:855 msgid "Log to order notes" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:845 +#: includes/settings/class-wcpdf-settings-debug.php:861 msgid "Log PDF document creation, deletion, and mark/unmark as printed to order notes." msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:851 +#: includes/settings/class-wcpdf-settings-debug.php:867 msgid "Disable document preview" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:857 +#: includes/settings/class-wcpdf-settings-debug.php:873 msgid "Disables the document preview on the plugin settings pages." msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:863 +#: includes/settings/class-wcpdf-settings-debug.php:879 msgid "Enable semaphore logs" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:869 +#: includes/settings/class-wcpdf-settings-debug.php:885 msgid "Our plugin uses a semaphore class that prevents race conditions in multiple places in the code. Enable this setting only if you are having issues with document numbers, yearly reset or documents being assigned to the wrong order." msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:875 +#: includes/settings/class-wcpdf-settings-debug.php:891 msgid "Enable danger zone tools" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:881 +#: includes/settings/class-wcpdf-settings-debug.php:897 msgid "Enables the danger zone tools. The actions performed by these tools are irreversible!" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:896 +#: includes/settings/class-wcpdf-settings-debug.php:912 msgid "Logged in" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:897 +#: includes/settings/class-wcpdf-settings-debug.php:913 msgid "Document can be accessed by logged in users only." msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:901 +#: includes/settings/class-wcpdf-settings-debug.php:917 msgid "Document can be accessed by logged in and guest users." msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:905 +#: includes/settings/class-wcpdf-settings-debug.php:921 msgid "Document can be accessed by everyone with the link." msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:914 +#: includes/settings/class-wcpdf-settings-debug.php:930 #: includes/views/advanced-status.php:325 msgid "Status" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:915 +#: includes/settings/class-wcpdf-settings-debug.php:931 msgid "Tools" msgstr "" -#: includes/settings/class-wcpdf-settings-debug.php:916 +#: includes/settings/class-wcpdf-settings-debug.php:932 msgid "Numbers" msgstr "" @@ -1530,7 +1580,7 @@ msgstr "" #: includes/settings/class-wcpdf-settings-upgrade.php:91 #: includes/settings/class-wcpdf-settings-upgrade.php:101 #: includes/settings/class-wcpdf-settings-upgrade.php:111 -#: includes/views/upgrade-table.php:56 +#: includes/views/upgrade-table.php:54 msgid "Learn more" msgstr "" @@ -1566,6 +1616,54 @@ msgstr "" msgid "Easily change the look and feel of your documents by adding some custom CSS." msgstr "" +#: includes/settings/class-wcpdf-settings-upgrade.php:133 +msgid "WooCommerce Smart Reminder Emails" +msgstr "" + +#: includes/settings/class-wcpdf-settings-upgrade.php:134 +msgid "Automatically schedule and send Reminder Emails for WooCommerce orders." +msgstr "" + +#: includes/settings/class-wcpdf-settings-upgrade.php:140 +msgid "WooCommerce Print Address Labels" +msgstr "" + +#: includes/settings/class-wcpdf-settings-upgrade.php:141 +msgid "Print out address labels for selected orders straight from WooCommerce." +msgstr "" + +#: includes/settings/class-wcpdf-settings-upgrade.php:147 +msgid "WooCommerce Automatic Printing - PrintNode" +msgstr "" + +#: includes/settings/class-wcpdf-settings-upgrade.php:148 +msgid "A plugin to automatically print completed orders via PrintNode." +msgstr "" + +#: includes/settings/class-wcpdf-settings-upgrade.php:154 +msgid "WooCommerce Ultimate Barcodes" +msgstr "" + +#: includes/settings/class-wcpdf-settings-upgrade.php:155 +msgid "Generate barcodes (ZATCA, QR-codes, C128, EAN-13 and more) for your orders, products and even invoices & packing slips." +msgstr "" + +#: includes/settings/class-wcpdf-settings-upgrade.php:161 +msgid "WooCommerce Print Order List" +msgstr "" + +#: includes/settings/class-wcpdf-settings-upgrade.php:162 +msgid "This plugin lets you quickly print a list of your WooCommerce orders. Great for order picking." +msgstr "" + +#: includes/settings/class-wcpdf-settings-upgrade.php:168 +msgid "Menu Cart Pro" +msgstr "" + +#: includes/settings/class-wcpdf-settings-upgrade.php:169 +msgid "Integrates seamlessly with WooCommerce to add a shopping cart to your menu." +msgstr "" + #: includes/tables/class-wcpdf-number-store-list-table.php:80 msgid "Refund:" msgstr "" @@ -1616,7 +1714,7 @@ msgid "Search number" msgstr "" #: includes/views/advanced-numbers.php:39 -#: includes/views/advanced-tools.php:123 +#: includes/views/advanced-tools.php:211 msgid "Reset" msgstr "" @@ -1853,140 +1951,187 @@ msgstr "" msgid "Clean up the PDF files stored in the temporary folder (used for email attachments)." msgstr "" +#: includes/views/advanced-tools.php:62 +msgid "Remove released semaphore locks" +msgstr "" + #: includes/views/advanced-tools.php:63 +msgid "Clean up the released semaphore locks from the database." +msgstr "" + +#: includes/views/advanced-tools.php:66 +msgid "Remove released locks" +msgstr "" + +#. translators: 1: number of released semaphore locks +#: includes/views/advanced-tools.php:78 +msgid "There is %s released semaphore lock in the database." +msgid_plural "There are %s released semaphore locks in the database." +msgstr[0] "" +msgstr[1] "" + +#: includes/views/advanced-tools.php:91 +msgid "There are no released semaphore locks in the database." +msgstr "" + +#. translators: 1: next run date +#: includes/views/advanced-tools.php:105 +msgid "The next cleanup action is scheduled to run on %s." +msgstr "" + +#: includes/views/advanced-tools.php:120 +msgid "Remove released legacy semaphore locks" +msgstr "" + +#: includes/views/advanced-tools.php:121 +msgid "Clean up the released legacy semaphore locks from the database." +msgstr "" + +#: includes/views/advanced-tools.php:124 +msgid "Remove released legacy locks" +msgstr "" + +#. translators: 1: number of released legacy semaphore locks +#: includes/views/advanced-tools.php:134 +msgid "There is %s released legacy semaphore lock in the database." +msgid_plural "There are %s released legacy semaphore locks in the database." +msgstr[0] "" +msgstr[1] "" + +#: includes/views/advanced-tools.php:151 msgid "Set up your basic invoice workflow via our Wizard." msgstr "" -#: includes/views/advanced-tools.php:69 +#: includes/views/advanced-tools.php:157 msgid "Export Settings" msgstr "" -#: includes/views/advanced-tools.php:70 +#: includes/views/advanced-tools.php:158 msgid "Download plugin settings in JSON format to easily export your current setup." msgstr "" -#: includes/views/advanced-tools.php:83 +#: includes/views/advanced-tools.php:171 msgid "Export" msgstr "" -#: includes/views/advanced-tools.php:93 +#: includes/views/advanced-tools.php:181 msgid "Import Settings" msgstr "" -#: includes/views/advanced-tools.php:94 +#: includes/views/advanced-tools.php:182 msgid "Import plugin settings in JSON format." msgstr "" -#: includes/views/advanced-tools.php:99 +#: includes/views/advanced-tools.php:187 msgid "Import" msgstr "" -#: includes/views/advanced-tools.php:109 +#: includes/views/advanced-tools.php:197 msgid "Reset Settings" msgstr "" -#: includes/views/advanced-tools.php:110 +#: includes/views/advanced-tools.php:198 msgid "This will clear all your selected settings data. Please do a backup first using the export tool above." msgstr "" -#: includes/views/advanced-tools.php:134 +#: includes/views/advanced-tools.php:222 msgid "Clear extensions license caching" msgstr "" -#: includes/views/advanced-tools.php:135 +#: includes/views/advanced-tools.php:223 msgid "This will clear all extensions' license caching. This could be required to update the license status in the Upgrade tab or for new Cloud Storage activations (Professional extension)." msgstr "" -#: includes/views/advanced-tools.php:138 +#: includes/views/advanced-tools.php:226 msgid "Clear licenses cache" msgstr "" -#: includes/views/advanced-tools.php:153 +#: includes/views/advanced-tools.php:241 msgid "Order date created" msgstr "" -#: includes/views/advanced-tools.php:154 +#: includes/views/advanced-tools.php:242 msgid "Order date modified" msgstr "" -#: includes/views/advanced-tools.php:155 +#: includes/views/advanced-tools.php:243 msgid "Order date completed" msgstr "" -#: includes/views/advanced-tools.php:156 +#: includes/views/advanced-tools.php:244 msgid "Order date paid" msgstr "" -#: includes/views/advanced-tools.php:157 +#: includes/views/advanced-tools.php:245 msgid "Document date" msgstr "" -#: includes/views/advanced-tools.php:163 +#: includes/views/advanced-tools.php:251 msgid "DANGER ZONE: Create a backup before using these tools, the actions they perform are irreversible!" msgstr "" -#: includes/views/advanced-tools.php:168 +#: includes/views/advanced-tools.php:256 msgid "Renumber existing documents" msgstr "" -#: includes/views/advanced-tools.php:169 +#: includes/views/advanced-tools.php:257 msgid "This tool will renumber existing documents within the selected order date range, while keeping the assigned document date." msgstr "" #. translators: step-by-step instructions -#: includes/views/advanced-tools.php:174 +#: includes/views/advanced-tools.php:262 msgid "Set the next document number setting %s to the number you want to use for the first document. " msgstr "" -#: includes/views/advanced-tools.php:182 -#: includes/views/advanced-tools.php:230 +#: includes/views/advanced-tools.php:270 +#: includes/views/advanced-tools.php:318 msgid "Document type:" msgstr "" -#: includes/views/advanced-tools.php:185 -#: includes/views/advanced-tools.php:233 +#: includes/views/advanced-tools.php:273 +#: includes/views/advanced-tools.php:321 msgid "Select" msgstr "" -#: includes/views/advanced-tools.php:193 -#: includes/views/advanced-tools.php:242 +#: includes/views/advanced-tools.php:281 +#: includes/views/advanced-tools.php:330 msgid "Date type:" msgstr "" -#: includes/views/advanced-tools.php:205 -#: includes/views/advanced-tools.php:254 +#: includes/views/advanced-tools.php:293 +#: includes/views/advanced-tools.php:342 msgid "From:" msgstr "" -#: includes/views/advanced-tools.php:206 -#: includes/views/advanced-tools.php:210 -#: includes/views/advanced-tools.php:255 -#: includes/views/advanced-tools.php:259 +#: includes/views/advanced-tools.php:294 +#: includes/views/advanced-tools.php:298 +#: includes/views/advanced-tools.php:343 +#: includes/views/advanced-tools.php:347 msgid "(as: yyyy-mm-dd)" msgstr "" -#: includes/views/advanced-tools.php:209 -#: includes/views/advanced-tools.php:258 +#: includes/views/advanced-tools.php:297 +#: includes/views/advanced-tools.php:346 msgid "To:" msgstr "" -#: includes/views/advanced-tools.php:215 +#: includes/views/advanced-tools.php:303 msgid "Renumber documents" msgstr "" -#: includes/views/advanced-tools.php:225 +#: includes/views/advanced-tools.php:313 msgid "Delete existing documents" msgstr "" -#: includes/views/advanced-tools.php:226 +#: includes/views/advanced-tools.php:314 msgid "This tool will delete existing documents within the selected order date range." msgstr "" -#: includes/views/advanced-tools.php:237 +#: includes/views/advanced-tools.php:325 msgid "All" msgstr "" -#: includes/views/advanced-tools.php:264 +#: includes/views/advanced-tools.php:352 msgid "Delete documents" msgstr "" @@ -2253,47 +2398,72 @@ msgstr "" msgid "Show action buttons" msgstr "" -#: includes/views/upgrade-table.php:12 +#: includes/views/upgrade-table.php:11 msgid "Wait, there is more..." msgstr "" -#: includes/views/upgrade-table.php:14 +#: includes/views/upgrade-table.php:13 msgid "A quick overview of the features our PDF Invoices & Packing Slips extensions have to offer." msgstr "" -#: includes/views/upgrade-table.php:15 +#: includes/views/upgrade-table.php:14 msgid "If you have any questions feel free to send us an email at" msgstr "" -#: includes/views/upgrade-table.php:22 +#: includes/views/upgrade-table.php:21 msgid "Professional" msgstr "" -#: includes/views/upgrade-table.php:23 -msgid "Premium Templates" -msgstr "" - -#: includes/views/upgrade-table.php:24 +#: includes/views/upgrade-table.php:22 msgid "Bundle" msgstr "" -#: includes/views/upgrade-table.php:51 +#: includes/views/upgrade-table.php:49 +#: includes/views/upgrade-table.php:116 msgid "Currently installed" msgstr "" #. translators: learn more link -#: includes/views/upgrade-table.php:55 +#: includes/views/upgrade-table.php:53 msgid "License not yet activated: %s" msgstr "" -#: includes/views/upgrade-table.php:77 +#: includes/views/upgrade-table.php:75 msgid "Upgrade now" msgstr "" +#: includes/views/upgrade-table.php:98 +msgid "You might also like these plugins..." +msgstr "" + +#: includes/views/upgrade-table.php:101 +msgid "Wow! It looks like you own all of our recommendations. Check out our shop for even more plugins." +msgstr "" + +#: includes/views/upgrade-table.php:102 +msgid "Visit shop" +msgstr "" + +#: includes/views/upgrade-table.php:118 +msgid "Buy now" +msgstr "" + #: includes/wcpdf-functions.php:353 msgid "Error creating PDF, please contact the site owner." msgstr "" +#: includes/wcpdf-functions.php:971 +msgid "Product" +msgstr "" + +#: includes/wcpdf-functions.php:972 +msgid "Quantity" +msgstr "" + +#: includes/wcpdf-functions.php:973 +msgid "Price" +msgstr "" + #: languages/strings.php:3 msgid "VAT" msgstr "" @@ -2306,10 +2476,6 @@ msgstr "" msgid "Payment date" msgstr "" -#: languages/strings.php:6 -msgid "Payment Date:" -msgstr "" - #: languages/strings.php:7 msgid "Payment method" msgstr "" @@ -2330,84 +2496,6 @@ msgstr "" msgid "SKU" msgstr "" -#: languages/strings.php:14 -#: templates/Simple/invoice.php:40 -#: templates/Simple/packing-slip.php:53 -msgid "Billing Address:" -msgstr "" - -#: languages/strings.php:15 -#: templates/Simple/packing-slip.php:40 -msgid "Shipping Address:" -msgstr "" - -#: languages/strings.php:16 -#: templates/Simple/invoice.php:53 -msgid "Ship To:" -msgstr "" - -#: languages/strings.php:17 -#: templates/Simple/invoice.php:78 -#: templates/Simple/packing-slip.php:66 -msgid "Order Number:" -msgstr "" - -#: languages/strings.php:18 -#: templates/Simple/invoice.php:82 -#: templates/Simple/packing-slip.php:70 -msgid "Order Date:" -msgstr "" - -#: languages/strings.php:19 -#: templates/Simple/invoice.php:87 -msgid "Payment Method:" -msgstr "" - -#: languages/strings.php:20 -#: templates/Simple/packing-slip.php:75 -msgid "Shipping Method:" -msgstr "" - -#: languages/strings.php:21 -#: templates/Simple/invoice.php:102 -#: templates/Simple/packing-slip.php:90 -msgid "Product" -msgstr "" - -#: languages/strings.php:22 -#: templates/Simple/invoice.php:103 -#: templates/Simple/packing-slip.php:91 -msgid "Quantity" -msgstr "" - -#: languages/strings.php:23 -#: templates/Simple/invoice.php:104 -msgid "Price" -msgstr "" - -#: languages/strings.php:24 -#: templates/Simple/invoice.php:115 -#: templates/Simple/packing-slip.php:102 -msgid "SKU:" -msgstr "" - -#: languages/strings.php:25 -#: templates/Simple/invoice.php:116 -#: templates/Simple/packing-slip.php:103 -msgid "Weight:" -msgstr "" - -#: languages/strings.php:26 -#: templates/Simple/invoice.php:131 -msgid "Notes" -msgstr "" - -#: languages/strings.php:27 -#: templates/Simple/invoice.php:139 -#: templates/Simple/packing-slip.php:120 -msgid "Customer Notes" -msgstr "" - #: ubl/Settings/TaxesSettings.php:54 msgid "Tax Scheme" msgstr "" @@ -2690,54 +2778,54 @@ msgid "Services outside scope of tax" msgstr "" #. translators: 1. open anchor tag, 2. close anchor tag, 3. Woo version -#: woocommerce-pdf-invoices-packingslips.php:194 +#: woocommerce-pdf-invoices-packingslips.php:195 msgid "PDF Invoices & Packing Slips for WooCommerce requires %1$sWooCommerce%2$s version %3$s or higher to be installed & activated!" msgstr "" #. translators: PHP version -#: woocommerce-pdf-invoices-packingslips.php:239 +#: woocommerce-pdf-invoices-packingslips.php:240 msgid "PDF Invoices & Packing Slips for WooCommerce requires PHP %s or higher." msgstr "" #. translators: tags -#: woocommerce-pdf-invoices-packingslips.php:245 +#: woocommerce-pdf-invoices-packingslips.php:246 msgid "We strongly recommend to %1$supdate your PHP version%2$s." msgstr "" #. translators: directory path -#: woocommerce-pdf-invoices-packingslips.php:337 +#: woocommerce-pdf-invoices-packingslips.php:338 msgid "The PDF files in %s are not currently protected due to your site running on NGINX." msgstr "" -#: woocommerce-pdf-invoices-packingslips.php:338 +#: woocommerce-pdf-invoices-packingslips.php:339 msgid "To protect them, you must click the button below." msgstr "" -#: woocommerce-pdf-invoices-packingslips.php:339 +#: woocommerce-pdf-invoices-packingslips.php:340 msgid "Generate random temporary folder name" msgstr "" -#: woocommerce-pdf-invoices-packingslips.php:396 +#: woocommerce-pdf-invoices-packingslips.php:397 msgid "When sending emails with MailPoet 3 and the active sending method is MailPoet Sending Service or Your web host / web server, MailPoet does not include the PDF Invoices & Packing Slips for WooCommerce attachments in the emails." msgstr "" -#: woocommerce-pdf-invoices-packingslips.php:397 +#: woocommerce-pdf-invoices-packingslips.php:398 msgid "To fix this you should select The default WordPress sending method (default) on the Advanced tab." msgstr "" -#: woocommerce-pdf-invoices-packingslips.php:398 +#: woocommerce-pdf-invoices-packingslips.php:399 msgid "Change MailPoet sending method to WordPress (default)" msgstr "" -#: woocommerce-pdf-invoices-packingslips.php:435 +#: woocommerce-pdf-invoices-packingslips.php:436 msgid "PDF Invoices & Packing Slips for WooCommerce detected that your current site locale is right-to-left (RTL) which the current PDF engine does not support it. Please consider installing our mPDF extension that is compatible." msgstr "" -#: woocommerce-pdf-invoices-packingslips.php:436 +#: woocommerce-pdf-invoices-packingslips.php:437 msgid "Download mPDF extension" msgstr "" #. translators: legacy addon name -#: woocommerce-pdf-invoices-packingslips.php:522 +#: woocommerce-pdf-invoices-packingslips.php:523 msgid "While updating the PDF Invoices & Packing Slips for WooCommerce plugin we've noticed our legacy %s add-on was active on your site. This functionality is now incorporated into the core plugin. We've deactivated the add-on for you, and you are free to uninstall it." msgstr "" diff --git a/readme.txt b/readme.txt index 037d99cd3..b6215053e 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: woocommerce, pdf, ubl, invoices, packing slips Requires at least: 4.4 Tested up to: 6.6 Requires PHP: 7.2 -Stable tag: 3.8.6 +Stable tag: 3.9.0-beta-3 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -102,6 +102,29 @@ There's a setting on the Advanced tab of the settings page that allows you to to == Changelog == += 3.8.8 (2024-10-08) = +* Fix: adds missing deprecated filters to document title methods + += 3.8.7 (2024-10-07) = +* New: Add full compatibility with mPDF to the Simple Template. +* New: Add refund reason and invoice number titles to the document methods abstract class. +* New: Improve template titles registration. +* New: Improve invoice due date setting. +* New: Add "You might also like these plugins" section to the Upgrade tab. +* New: Function to determine if checkout is using block: `wpo_wcpdf_checkout_is_block()`. +* New: Clean legacy Semaphore locks tool. +* New: Automatic cleanup of unlocked Semaphore locks and other improvements. +* New: Tool to remove expired Semaphore locks. +* New: Filter to modify PDF document data fields: `wpo_wcpdf_document_data_meta_box_fields`. +* Tweak: Lower hook priority (200) for invoice columns in WooCommerce orders list. +* Fix: Replace deprecated jQuery `change()` function usage. +* Fix: Correct path to generic document icon. +* Fix: Check user capabilities in the `enable_debug()` function. +* Fix: Load plugin translations later on the `init` hook. +* Fix: Unblock UI when a tool button is clicked. +* Translations: Update translation template (POT). +* Tested up to WooCommerce 9.4. + = 3.8.6 (2024-07-18) = * Fix: function `add_yith_product_bundles_classes()` errors * Fix: `get_header_logo_id()` return type fatal error diff --git a/strauss.md b/strauss.md new file mode 100644 index 000000000..26ade7a04 --- /dev/null +++ b/strauss.md @@ -0,0 +1,113 @@ +# Instructions to Install and Update Composer Libraries with Strauss for PDF Invoices & Packing Slips for WooCommerce + +This guide provides detailed steps to correctly install and update Composer libraries in the [PDF Invoices & Packing Slips for WooCommerce](https://github.com/wpovernight/woocommerce-pdf-invoices-packing-slips) plugin using [Strauss](https://github.com/BrianHenryIE/strauss) for class prefixing. + +## Prerequisites + +- PHP installed on your system. +- Composer installed on your system. +- `strauss.phar` file located in the plugin root directory. + +## Steps to Install Composer Libraries + +1. **Install Composer Dependencies** + + First, ensure all your dependencies are installed using Composer: + + ```sh + composer install + ``` + +2. **Run Strauss to Apply Class Prefixing** + + Use the Strauss PHAR file to prefix the classes as configured in your `composer.json`: + + ```sh + php strauss.phar + ``` + +3. **Do Not Run `composer dump-autoload` After Strauss** + + Avoid running `composer dump-autoload` after running Strauss, as it will regenerate the autoload files and potentially undo the prefixing work done by Strauss. + +## Steps to Update Composer Libraries + +1. **Update Composer Dependencies** + + Use Composer to update your dependencies: + + ```sh + composer update + ``` + +2. **Run Strauss to Apply Class Prefixing** + + After updating the dependencies, run Strauss again to apply the necessary class prefixing: + + ```sh + php strauss.phar + ``` + +3. **Do Not Run `composer dump-autoload` After Strauss** + + Similar to the installation step, do not run `composer dump-autoload` after running Strauss. + +## Example `composer.json` Configuration + +Ensure your `composer.json` is configured correctly for Strauss. Below is an example configuration: + +```json +{ + "name": "wpovernight/woocommerce-pdf-invoices-packing-slips", + "description": "PDF Invoices & Packing Slips for WooCommerce", + "autoload": { + "psr-4": { + "WPO\\IPS\\": "includes/", + "WPO\\IPS\\UBL\\": "ubl/" + }, + "classmap": [ + "vendor/" + ] + }, + "require": { + "dompdf/dompdf": "^3.0", + "symfony/polyfill-mbstring": "^1.27", + "symfony/polyfill-iconv": "^1.27", + "sabre/xml": "^2.2.5" + }, + "extra": { + "strauss": { + "target_directory": "vendor", + "namespace_prefix": "WPO\\IPS\\Vendor\\", + "classmap_prefix": "WPO_IPS_Vendor_", + "constant_prefix": "WPO_IPS_VENDOR_", + "packages": [], + "update_call_sites": false, + "override_autoload": {}, + "exclude_from_copy": { + "packages": [], + "namespaces": [], + "file_patterns": [ + "/^psr.*$/" + ] + }, + "exclude_from_prefix": { + "packages": [ + "symfony/polyfill-mbstring", + "symfony/polyfill-iconv", + "masterminds/html5" + ], + "namespaces": [], + "file_patterns": [] + }, + "namespace_replacement_patterns": {}, + "delete_vendor_packages": false, + "delete_vendor_files": false + } + }, + "config": { + "platform-check": false + } +} + +``` diff --git a/strauss.phar b/strauss.phar new file mode 100644 index 000000000..16fd22b2d Binary files /dev/null and b/strauss.phar differ diff --git a/templates/Simple/invoice.php b/templates/Simple/invoice.php index baa789f32..297342298 100644 --- a/templates/Simple/invoice.php +++ b/templates/Simple/invoice.php @@ -37,7 +37,6 @@ + show_due_date() ) : ?> + + + + + - + - + get_payment_method() ) : ?> - + @@ -97,24 +102,35 @@ get_type(), $this->order ); ?>
- get_type(), $this->order ); ?>

billing_address(); ?>

get_type(), $this->order ); ?> @@ -50,7 +49,7 @@
show_shipping_address() ) : ?> -

+

shipping_address_title(); ?>

get_type(), $this->order ); ?>

shipping_address(); ?>

get_type(), $this->order ); ?> @@ -74,17 +73,23 @@
date( $this->get_type() ); ?>
due_date_title(); ?>due_date(); ?>
order_number_title(); ?> order_number(); ?>
order_date_title(); ?> order_date(); ?>
payment_method_title(); ?> payment_method(); ?>
+ - - - + $column_title ) { + printf( '', $column_class, $column_title ); + } + ?> get_order_items() as $item_id => $item ) : ?> - + @@ -122,27 +138,30 @@ - +
%s
- +

get_type(), $item, $this->order ); ?> - -
-
-
-
+
+ +

sku_title(); ?>

+ + +

weight_title(); ?>

+ + + + + + +
get_type(), $item, $this->order ); ?>
+ + + - - - +
+ get_type(), $this->order ); ?> -
- get_document_notes() ) : ?> -

+ get_document_notes() ) : ?> +
+

notes_title(); ?>

document_notes(); ?> - -
+
+ get_type(), $this->order ); ?> get_type(), $this->order ); ?> -
- get_shipping_notes() ) : ?> -

+ get_shipping_notes() ) : ?> +
+

customer_notes_title(); ?>

shipping_notes(); ?> - -
+
+ get_type(), $this->order ); ?>
+ get_woocommerce_totals() as $key => $total ) : ?> @@ -155,13 +174,13 @@
-
- get_type(), $this->order ); ?> +
+ get_footer() ) : ?>