Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New: adds UBL as additional output format for documents #521

Merged
merged 131 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from 123 commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
59d71de
Adds PDF & UBL tabs in each document settings
alexmigf May 26, 2023
7c44392
Generate minified JS and CSS files
alexmigf May 26, 2023
e568080
Apply the default pdf output
alexmigf May 26, 2023
38487ad
Load Invoice settings fields for each output
alexmigf May 26, 2023
90fc062
Tweaks
alexmigf May 26, 2023
18cc6f3
Small fixes
alexmigf May 26, 2023
c70cf41
Update class-wcpdf-settings-documents.php
alexmigf May 26, 2023
7bd928b
Re-organize plugin PDF output
alexmigf May 29, 2023
1fb27b1
Rename dir Outputs to Makers
alexmigf May 29, 2023
58ee102
More work
alexmigf May 29, 2023
458ce6e
Generate minified JS and CSS files
alexmigf May 29, 2023
db56c88
Improved class loading and ubl structure
alexmigf May 29, 2023
ac9a8fc
Improvements getting the output format
alexmigf May 30, 2023
6b956f6
Add UBL bulk actions
alexmigf May 30, 2023
5039b26
Work on UBL settings tab
alexmigf May 30, 2023
c583ee3
Improvements on UBL bulk actions
alexmigf May 30, 2023
90df1ab
Generate minified JS and CSS files
alexmigf May 30, 2023
fbee180
Implements ubl save order taxes
alexmigf May 30, 2023
77f5852
Attach ubl to emails implementation
alexmigf May 30, 2023
1082cba
Small tweaks
alexmigf May 30, 2023
7568d70
Move ubl general settings
alexmigf May 31, 2023
ed84298
Generate minified JS and CSS files
alexmigf May 31, 2023
13fce0c
Delete plugin.php
alexmigf May 31, 2023
0f198ec
Tweaks
alexmigf May 31, 2023
698af9a
Link new general settings to ubl
alexmigf May 31, 2023
a7788eb
Update class-wcpdf-packing-slip.php
alexmigf May 31, 2023
1a5a5d6
Tweaks to ubl address data
alexmigf May 31, 2023
354e0ac
Adds preview for ubl
alexmigf Jun 1, 2023
30ef8cc
Generate minified JS and CSS files
alexmigf Jun 1, 2023
17a8167
Remove XML format function, causes issues and slow down the preview r…
alexmigf Jun 1, 2023
0d84247
Generate minified JS and CSS files
alexmigf Jun 1, 2023
193a836
Adds ubl action buttons in order listing
alexmigf Jun 1, 2023
ac90893
Generate minified JS and CSS files
alexmigf Jun 1, 2023
995bc19
Update abstract-wcpdf-order-document.php
alexmigf Jun 1, 2023
87bc8dc
Merge branch 'main' into 481-ubl-integration
alexmigf Jun 1, 2023
a8d02e7
Generate minified JS and CSS files
alexmigf Jun 1, 2023
f758be9
Fix ubl email attachment issue
alexmigf Jun 1, 2023
20e31c0
Fix ubl bulk action export
alexmigf Jun 1, 2023
5b9fbfa
Generate minified JS and CSS files
alexmigf Jun 1, 2023
acf3e04
Tweaks
alexmigf Jun 1, 2023
43cd536
Generate minified JS and CSS files
alexmigf Jun 1, 2023
08677ba
UBL addon detection and deactivation on upgrade
alexmigf Jun 2, 2023
2eb62f5
Update woocommerce-pdf-invoices-packingslips.php
alexmigf Jun 2, 2023
c18df90
Legacy ubl addon settings migration
alexmigf Jun 2, 2023
c4552b7
Update class-wcpdf-install.php
alexmigf Jun 2, 2023
b05b3e2
Add ubl beta labels in settings
alexmigf Jun 2, 2023
ffb256a
Generate minified JS and CSS files
alexmigf Jun 2, 2023
8d5043b
Fix ubl taxes table styles/code
alexmigf Jun 2, 2023
809f0e9
Small tweaks to ubl taxes
alexmigf Jun 2, 2023
89f5088
Generate minified JS and CSS files
alexmigf Jun 2, 2023
1343150
Updates sabre\xml to version 2.2.5 which supports php 7.1+
alexmigf Jun 2, 2023
3dd5c6a
Merge branch '481-ubl-integration' of github.com:wpovernight/woocomme…
alexmigf Jun 2, 2023
78cbc81
Adds condition to display the order meta box for UBL
alexmigf Jun 5, 2023
5745d26
Small tweaks
alexmigf Jun 5, 2023
b9e2d77
Update class-wcpdf-documents.php
alexmigf Jun 5, 2023
5a60765
Improvements
alexmigf Jun 5, 2023
701e9d1
Update wcpdf-functions.php
alexmigf Jun 5, 2023
b0cefb9
Fix preview bug
alexmigf Jun 5, 2023
19bcf66
Generate minified JS and CSS files
alexmigf Jun 5, 2023
9a932ac
Adds support for UBL document import/export settings
alexmigf Jun 5, 2023
de3583e
Fixes bug on ubl bulk actions
alexmigf Jun 5, 2023
a7b6407
Generate minified JS and CSS files
alexmigf Jun 5, 2023
ab24b62
Update settings-styles.css
alexmigf Jun 5, 2023
30b4592
Generate minified JS and CSS files
alexmigf Jun 5, 2023
01f1e69
Merge branch 'main' into 481-ubl-integration
alexmigf Jun 16, 2023
b72a883
Merge branch 'main' into 481-ubl-integration
alexmigf Jun 19, 2023
64b18b3
Merge branch 'main' into 481-ubl-integration
alexmigf Jun 26, 2023
66c666b
Merge branch 'main' into 481-ubl-integration
alexmigf Jul 26, 2023
01adb53
Merge branch 'main' into 481-ubl-integration
alexmigf Aug 17, 2023
b0e48a5
Generate minified JS and CSS files
alexmigf Aug 17, 2023
fee28cf
Required fixes from main merge
alexmigf Aug 17, 2023
e4fabb2
Tweaks
alexmigf Aug 17, 2023
f451bb4
Composer update
alexmigf Aug 17, 2023
4b75231
Fix composer.json and update
alexmigf Aug 17, 2023
1233807
Update abstract-wcpdf-order-document.php
alexmigf Aug 17, 2023
dd68320
Tweaks
alexmigf Aug 17, 2023
c122b6c
Fixes issues when multiple Credit Notes exist for a single order
alexmigf Aug 17, 2023
be22956
Update class-wcpdf-bulk-document.php
alexmigf Aug 17, 2023
3dd9304
Update class-wcpdf-invoice.php
alexmigf Aug 17, 2023
e21f6be
Update class-ubl-maker.php
alexmigf Aug 17, 2023
7ef4c0d
Fix beta version
alexmigf Aug 17, 2023
96e1bf0
Update wcpdf-functions.php
alexmigf Aug 17, 2023
db537ef
Update wcpdf-functions.php
alexmigf Aug 17, 2023
05deb7e
Update wcpdf-functions.php
alexmigf Aug 17, 2023
603cdcb
Update class-wcpdf-documents.php
alexmigf Aug 17, 2023
1175aab
Merge branch 'main' into 481-ubl-integration
alexmigf Aug 17, 2023
98994fe
Update class-wcpdf-settings-documents.php
alexmigf Aug 17, 2023
c0565a3
Update order-script.js
alexmigf Aug 18, 2023
d372eaf
Generate minified JS and CSS files
alexmigf Aug 18, 2023
20e0700
Update class-wcpdf-settings-documents.php
alexmigf Aug 18, 2023
ccce29c
Update class-wcpdf-settings-documents.php
alexmigf Aug 18, 2023
55a95cd
Update beta version
alexmigf Aug 18, 2023
0d3b3b5
Merge branch 'main' into 481-ubl-integration
alexmigf Aug 22, 2023
135d37c
Migrates UBL addon `company_name` to General settings `shop_name`
alexmigf Aug 22, 2023
a664013
Update class-wcpdf-install.php
alexmigf Aug 22, 2023
c103017
Update abstract-wcpdf-order-document.php
alexmigf Aug 22, 2023
f2bfc64
Force ubl addon deactivation
alexmigf Aug 22, 2023
fff6ff7
Fix UBL Tax Settings
alexmigf Aug 22, 2023
179741a
Update order-script.js
alexmigf Aug 22, 2023
19f112f
Generate minified JS and CSS files
alexmigf Aug 22, 2023
882b694
Show UBL action buttons if correspondent PDF exists
alexmigf Aug 22, 2023
f599ce7
Generate minified JS and CSS files
alexmigf Aug 22, 2023
8bf04c8
Merge branch 'main' into 481-ubl-integration
alexmigf Aug 23, 2023
62e0985
Fix UBL Tax settings import and reset
alexmigf Aug 23, 2023
d6491af
Update class-wcpdf-admin.php
alexmigf Aug 23, 2023
dadf5a4
Merge branch 'main' into 481-ubl-integration
alexmigf Aug 23, 2023
d66c60f
Update abstract-wcpdf-order-document.php
alexmigf Aug 23, 2023
d7bb529
Update abstract-wcpdf-order-document.php
alexmigf Aug 23, 2023
ca68001
Update class-ubl-maker.php
alexmigf Aug 23, 2023
49fd720
Update class-ubl-maker.php
alexmigf Aug 23, 2023
0b4b14a
Update class-ubl-maker.php
alexmigf Aug 23, 2023
04fc4aa
Tweaks
alexmigf Aug 23, 2023
bd75cd9
Update class-wcpdf-documents.php
alexmigf Aug 23, 2023
8180c0c
Update abstract-wcpdf-order-document.php
alexmigf Aug 23, 2023
1b7bfaf
WPCS on UBL
alexmigf Aug 23, 2023
170ef8c
Tweaks
alexmigf Aug 23, 2023
1469a63
Merge branch 'main' into 481-ubl-integration
alexmigf Aug 25, 2023
6c4cc13
Update class-wcpdf-settings-debug.php
alexmigf Aug 25, 2023
6e3670a
Update class-wcpdf-settings-debug.php
alexmigf Aug 25, 2023
ce3a3fb
Fixes on PR comments
alexmigf Aug 28, 2023
e54c026
Rename UBL functions to snake case
alexmigf Aug 28, 2023
051359d
Merge branch 'main' into 481-ubl-integration
alexmigf Sep 6, 2023
7d65a2d
Generate minified JS and CSS files
alexmigf Sep 6, 2023
4be095f
Merge branch 'main' into 481-ubl-integration
alexmigf Sep 12, 2023
7841fa1
Update UblDocument.php
alexmigf Sep 12, 2023
02b964a
Update class-wcpdf-settings-general.php
alexmigf Sep 13, 2023
6b949bd
Adds notice for missing VAT or CoC number when using Invoice UBL
alexmigf Sep 13, 2023
9c9ee9d
Update woocommerce-pdf-invoices-packingslips.php
alexmigf Sep 13, 2023
f1daa30
Adds UBL to tags and plugin description
alexmigf Sep 13, 2023
62994e1
Tweak
alexmigf Sep 13, 2023
28cfb2f
Tweaks
alexmigf Sep 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion assets/css/order-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,22 @@
fill: #2aad2a;
}

.type-shop_order .column-wc_actions a.button.wpo_wcpdf.ubl > svg.icon-ubl,
.woocommerce_page_wc-orders .column-wc_actions a.button.wpo_wcpdf.ubl > svg.icon-ubl {
left: auto;
right: 2px;
fill: black;
}

.type-shop_order .column-wc_actions a.button.wpo_wcpdf.printed > svg.icon-printed,
.woocommerce_page_wc-orders .column-wc_actions a.button.wpo_wcpdf.printed > svg.icon-printed {
left: 2px;
right: auto;
fill: #51266b;
}

.wpo_wcpdf-actions a.button.exists > svg {
.wpo_wcpdf-actions a.button.exists > svg,
.wpo_wcpdf-ubl-actions a.button.exists > svg {
width: 14px;
height: 14px;
line-height: 30px;
Expand Down
2 changes: 1 addition & 1 deletion assets/css/order-styles.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 38 additions & 13 deletions assets/css/settings-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ table.wcpdf_documents_settings_list td.title {
}

.wcpdf_document_settings_sections {
margin-bottom: 40px;
position: relative;
}

Expand Down Expand Up @@ -221,6 +220,10 @@ table.wcpdf_documents_settings_list td.title {
color: #222;
}

.wcpdf_document_settings_document_output_formats {
margin-bottom: 30px;
}

.edit-next-number {
opacity:0.5;
}
Expand Down Expand Up @@ -309,18 +312,18 @@ body.woocommerce_page_wpo_wcpdf_options_page {
max-width: none;
}

#wpo-wcpdf-preview-wrapper .sidebar .form-table,
#wpo-wcpdf-preview-wrapper .sidebar .form-table > tr,
#wpo-wcpdf-preview-wrapper .sidebar .form-table > tr > th,
#wpo-wcpdf-preview-wrapper .sidebar .form-table > tr > td,
#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 > th,
#wpo-wcpdf-preview-wrapper .sidebar .form-table > tbody > tr > td {
display: block;
width: 100%;
padding: 0;
}
#wpo-wcpdf-preview-wrapper .sidebar .form-table,
#wpo-wcpdf-preview-wrapper .sidebar .form-table > tr,
#wpo-wcpdf-preview-wrapper .sidebar .form-table > tr > th,
#wpo-wcpdf-preview-wrapper .sidebar .form-table > tr > td,
#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 > th,
#wpo-wcpdf-preview-wrapper .sidebar .form-table > tbody > tr > td {
display: block;
width: 100%;
padding: 0;
}

#wpo-wcpdf-preview-wrapper .sidebar .form-table > tr > th,
#wpo-wcpdf-preview-wrapper .sidebar .form-table > tbody > tr > th {
Expand Down Expand Up @@ -504,6 +507,15 @@ body.woocommerce_page_wpo_wcpdf_options_page {
padding-right: 5%;
}

.preview-document .preview > #preview-ubl {
width: 100%;
height: 100%;
overflow-wrap: anywhere;
background-color: #222;
color: white;
padding: 2em;
}

.preview-document .preview > #preview-canvas {
display: block;
max-width: 800px;
Expand Down Expand Up @@ -691,6 +703,7 @@ body.woocommerce_page_wpo_wcpdf_options_page {
-webkit-box-shadow: 0 0 25px -10px rgba(0,0,0,0.2);
padding: 20px 0;
background-color: white;
z-index: 99;
}

.preview-document .preview-data #preview-order-search-results a {
Expand Down Expand Up @@ -867,6 +880,18 @@ body.woocommerce_page_wpo_wcpdf_options_page {
width: 100%!important;
}

.wcpdf_ubl_settings_sections {
margin-bottom: 4em;
}

sup.wcpdf_beta {
background-color: #51266b;
color: white;
font-size: 7pt;
padding: 1px 2px;
border-radius: 2px;
}

@media screen and (min-width: 1920px) {
.preview-document .preview > #preview-canvas {
max-width: 900px;
Expand Down
2 changes: 1 addition & 1 deletion assets/css/settings-styles.min.css

Large diffs are not rendered by default.

22 changes: 18 additions & 4 deletions assets/js/admin-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,18 @@ jQuery( function( $ ) {
let $preview = $( '#wpo-wcpdf-preview-wrapper .preview' );
let $previewOrderIdInput = $( '#wpo-wcpdf-preview-wrapper input[name="order_id"]' );
let $previewDocumentTypeInput = $( '#wpo-wcpdf-preview-wrapper input[name="document_type"]' );
let $previewOutputFormatInput = $( '#wpo-wcpdf-preview-wrapper input[name="output_format"]' );
let $previewNonceInput = $( '#wpo-wcpdf-preview-wrapper input[name="nonce"]' );
let $previewSettingsForm = $( '#wpo-wcpdf-settings' );
let previewXhr = null;

// variables
let previewOrderId, previewDocumentType, previewNonce, previewSettingsFormData, previewTimeout, previewSearchTimeout, previousWindowWidth;
let previewOrderId, previewDocumentType, previewOutputFormat, previewNonce, previewSettingsFormData, previewTimeout, previewSearchTimeout, previousWindowWidth;

function loadPreviewData() {
previewOrderId = $previewOrderIdInput.val();
previewDocumentType = $previewDocumentTypeInput.val();
previewOutputFormat = $previewOutputFormatInput.val();
previewNonce = $previewNonceInput.val();
previewSettingsFormData = $previewSettingsForm.serialize();
}
Expand Down Expand Up @@ -424,6 +426,7 @@ jQuery( function( $ ) {
security: previewNonce,
order_id: previewOrderId,
document_type: previewDocumentType,
output_format: previewOutputFormat,
data: previewSettingsFormData,
};

Expand Down Expand Up @@ -452,10 +455,21 @@ jQuery( function( $ ) {
if ( response.data.error ) {
$( '#'+canvasId ).remove();
$preview.append( '<div class="notice notice-error inline"><p>'+response.data.error+'</p></div>' );
} else if ( response.data.pdf_data ) {
} else if ( response.data.preview_data && response.data.output_format ) {
$( '#'+canvasId ).remove();
$preview.append( '<canvas id="'+canvasId+'" style="width:100%;"></canvas>' );
renderPdf( worker, canvasId, response.data.pdf_data );

switch ( response.data.output_format ) {
default:
case 'pdf':
$preview.append( '<canvas id="'+canvasId+'" style="width:100%;"></canvas>' );
renderPdf( worker, canvasId, response.data.preview_data );
break;
case 'ubl':
let xml = response.data.preview_data;
let xml_escaped = xml.replace( /&/g,'&amp;' ).replace( /</g,'&lt;' ).replace( />/g,'&gt;' ).replace( / /g, '&nbsp;' ).replace( /\n/g,'<br />' );
$preview.html( '<div id="preview-ubl">'+xml_escaped+'</div>' );
break;
}
}

$preview.unblock();
Expand Down
Loading