Skip to content

Commit

Permalink
New: adds Due Date option to the Invoice settings (#637)
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamadNateqi authored Nov 3, 2023
1 parent 83e3451 commit 70e2ff5
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 2 deletions.
22 changes: 22 additions & 0 deletions assets/js/admin-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,28 @@ jQuery( function( $ ) {
'delay': 200
} );

function toggle_due_date_custom_days_field() {
const due_date_value = $( '#due_date' ).val();
const due_date_custom_days = $( '#due_date_custom_days' );
const due_date_base_date = $( '#due_date_base_date' );

if ( '' === due_date_value ) {
due_date_custom_days.closest( 'tr' ).hide();
due_date_base_date.closest( 'tr' ).hide();
}
else if ( 'custom' === due_date_value ) {
due_date_custom_days.closest( 'tr' ).show();
due_date_base_date.closest( 'tr' ).show();
} else {
due_date_custom_days.closest( 'tr' ).hide();
due_date_base_date.closest( 'tr' ).show();
}
}

toggle_due_date_custom_days_field();

$( '#due_date' ).change( toggle_due_date_custom_days_field );

//----------> Preview <----------//
// objects
let $previewWrapper = $( '#wpo-wcpdf-preview-wrapper' );
Expand Down
Loading

0 comments on commit 70e2ff5

Please sign in to comment.