Skip to content

Commit

Permalink
Adds support for multiple UBL formats
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmigf committed Dec 13, 2024
1 parent 0b73234 commit 10e0301
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions includes/Documents/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ public function get_ubl_settings_fields( $option_name ) {
$settings_fields = array(
array(
'type' => 'section',
'id' => $this->type.'_ubl',
'id' => $this->type . '_ubl',
'title' => '',
'callback' => 'section',
),
Expand All @@ -588,18 +588,32 @@ public function get_ubl_settings_fields( $option_name ) {
'id' => 'enabled',
'title' => __( 'Enable', 'woocommerce-pdf-invoices-packing-slips' ),
'callback' => 'checkbox',
'section' => $this->type.'_ubl',
'section' => $this->type . '_ubl',
'args' => array(
'option_name' => $option_name,
'id' => 'enabled',
)
),
array(
'type' => 'setting',
'id' => 'ubl_format',
'title' => __( 'Format', 'woocommerce-pdf-invoices-packing-slips' ),
'callback' => 'select',
'section' => $this->type . '_ubl',
'args' => array(
'option_name' => $option_name,
'id' => 'format',
'options' => apply_filters( 'wpo_wcpdf_ubl_formats', array(
'ubl_2_1' => __( 'UBL 2.1' , 'woocommerce-pdf-invoices-packing-slips' ),
) ),
)
),
array(
'type' => 'setting',
'id' => 'attach_to_email_ids',
'title' => __( 'Attach to:', 'woocommerce-pdf-invoices-packing-slips' ),
'callback' => 'multiple_checkboxes',
'section' => $this->type.'_ubl',
'section' => $this->type . '_ubl',
'args' => array(
'option_name' => $option_name,
'id' => 'attach_to_email_ids',
Expand All @@ -613,7 +627,7 @@ public function get_ubl_settings_fields( $option_name ) {
'id' => 'include_encrypted_pdf',
'title' => __( 'Include encrypted PDF:', 'woocommerce-pdf-invoices-packing-slips' ),
'callback' => 'checkbox',
'section' => $this->type.'_ubl',
'section' => $this->type . '_ubl',
'args' => array(
'option_name' => $option_name,
'id' => 'include_encrypted_pdf',
Expand Down Expand Up @@ -687,6 +701,7 @@ public function get_settings_categories( string $output_format ): array {
'title' => __( 'General', 'woocommerce-pdf-invoices-packing-slips' ),
'members' => array(
'enabled',
'ubl_format',
'attach_to_email_ids',
'include_encrypted_pdf',
),
Expand Down

0 comments on commit 10e0301

Please sign in to comment.