Skip to content

Instantly share code, notes, and snippets.

@dennisnissle
Created May 21, 2024 15:41
Show Gist options
  • Save dennisnissle/1ecec6d17e04ef797a5ba96423ba4392 to your computer and use it in GitHub Desktop.
Save dennisnissle/1ecec6d17e04ef797a5ba96423ba4392 to your computer and use it in GitHub Desktop.
Use Fremdleistungen § 13b instead of Innergemeinschaftliche Lieferung as lexoffice category
<?php
add_filter( 'storeabill_external_sync_lexoffice_voucher_item_category_id', 'my_child_adjust_lexoffice_category_id', 10, 3 );
function my_child_adjust_lexoffice_category_id( $category, $item, $invoice ) {
$categories = array(
'reverse_charge' => '9075a4e3-66de-4795-a016-3889feca0d20',
'fremdleistungen' => '380a20cb-d04c-426e-b49c-84c22adfa362',
);
// Only adjust reverse charge category
if ( $categories['reverse_charge'] === $category ) {
$category = $categories['fremdleistungen'];
}
return $category;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment