Changeset 3285646
- Timestamp:
- 05/01/2025 01:57:31 PM (11 months ago)
- Location:
- run-my-accounts-for-woocommerce
- Files:
-
- 26 added
- 4 edited
-
tags/1.9.0 (added)
-
tags/1.9.0/LICENSE (added)
-
tags/1.9.0/README.md (added)
-
tags/1.9.0/assets (added)
-
tags/1.9.0/assets/css (added)
-
tags/1.9.0/assets/css/select2.min.css (added)
-
tags/1.9.0/assets/js (added)
-
tags/1.9.0/assets/js/admin.js (added)
-
tags/1.9.0/assets/js/select2.min.js (added)
-
tags/1.9.0/classes (added)
-
tags/1.9.0/classes/class-RMA_WC_API.php (added)
-
tags/1.9.0/classes/class-RMA_WC_Backend.php (added)
-
tags/1.9.0/classes/class-RMA_WC_Backend_Abstract.php (added)
-
tags/1.9.0/classes/class-RMA_WC_Collective_Invoicing.php (added)
-
tags/1.9.0/classes/class-RMA_WC_Frontend.php (added)
-
tags/1.9.0/classes/class-RMA_WC_Payment.php (added)
-
tags/1.9.0/classes/class-RMA_WC_Rental_And_Booking.php (added)
-
tags/1.9.0/classes/class-RMA_WC_Settings_Page.php (added)
-
tags/1.9.0/index.php (added)
-
tags/1.9.0/readme.txt (added)
-
tags/1.9.0/rma-wc-main.php (added)
-
tags/1.9.0/rma-wc.php (added)
-
tags/1.9.0/templates (added)
-
tags/1.9.0/templates/email (added)
-
tags/1.9.0/templates/email/error-email-template.php (added)
-
tags/1.9.0/uninstall.php (added)
-
trunk/classes/class-RMA_WC_API.php (modified) (4 diffs)
-
trunk/classes/class-RMA_WC_Settings_Page.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/rma-wc.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
run-my-accounts-for-woocommerce/trunk/classes/class-RMA_WC_API.php
r3267740 r3285646 490 490 $order_payment_method = $order->get_payment_method(); 491 491 492 // if order is done without user account 492 $option_billing = get_option( 'wc_rma_settings' ); 493 494 // transfer price net 495 if( isset( $option_billing[ 'rma-tax-transfer' ] ) && 'net' == $option_billing[ 'rma-tax-transfer' ] ) { 496 $tax_included = 'false'; 497 } 498 // transfer price gross 499 elseif( isset( $option_billing[ 'rma-tax-transfer' ] ) && 'gross' == $option_billing[ 'rma-tax-transfer' ] ) { 500 $tax_included = 'true'; 501 } 502 // get the settings from WooCommerce 503 else { 504 $tax_included = $order->get_prices_include_tax() ? 'true' : 'false'; 505 } 506 507 // if the order is done without a user account 493 508 if ( 0 == $order->get_meta( '_customer_user', true ) ) { 494 509 … … 499 514 $rma_customer_id = (new RMA_WC_API)->create_rma_customer('order', $order_id ); 500 515 501 if ( false == $rma_customer_id) {516 if ( ! $rma_customer_id) { 502 517 503 518 $log_values = array( … … 517 532 518 533 // customer id is equal to predefined catch all guest account 519 $rma_customer_id = $settings['rma-guest-catch-all'];520 521 } 522 523 } 524 // ...or with user account534 $rma_customer_id = $settings[ 'rma-guest-catch-all' ]; 535 536 } 537 538 } 539 // ...or with a user account 525 540 else { 526 541 527 $rma_customer_id = get_user_meta( $order->get_customer_id(), 'rma_customer', true );542 $rma_customer_id = get_user_meta( $order->get_customer_id(), 'rma_customer', true ); 528 543 529 544 } … … 532 547 $order_details[ 'currency' ] = $order->get_currency(); 533 548 $order_details[ 'orderdate' ] = wc_format_datetime( $order->get_date_created(),'d.m.Y' ); 534 $order_details[ 'taxincluded' ] = $ order->get_prices_include_tax() ? 'true' : 'false';549 $order_details[ 'taxincluded' ] = $tax_included; 535 550 $order_details[ 'customernumber' ] = $rma_customer_id; 536 551 $order_details[ 'ar_accno' ] = isset( $option_accounting[ $order_payment_method ] ) && !empty( $option_accounting[ $order_payment_method ] ) ? $option_accounting[ $order_payment_method ] : ''; -
run-my-accounts-for-woocommerce/trunk/classes/class-RMA_WC_Settings_Page.php
r3262812 r3285646 47 47 48 48 add_action( 'admin_menu', array( $this, 'add_plugin_page' ) ); 49 49 50 } 50 51 … … 374 375 ); 375 376 377 $id = 'rma-tax-transfer'; 378 add_settings_field( 379 $id, 380 esc_html__( 'Price transfer with tax', 'run-my-accounts-for-woocommerce'), 381 array( $this, 'option_select_cb'), 382 $this->option_page_general, 383 $section, 384 array( 385 'option_group' => $this->option_group_general, 386 'id' => $id, 387 'options' => $this->options_general, 388 'select_options' => array( 389 '' => esc_html__( 'WooCommerce settings','run-my-accounts-for-woocommerce') , 390 'net' => esc_html__( 'Item prices net (excl. VAT)','run-my-accounts-for-woocommerce' ), 391 'gross' => esc_html__( 'Item prices gross (incl. VAT)','run-my-accounts-for-woocommerce' ), 392 ), 393 'description' => esc_html__( 'How should the item prices be transferred in relation to VAT? The WooCommerce settings are related to WooCommerce > Settings > Tax > Tax options.', 'run-my-accounts-for-woocommerce' ) 394 ) 395 ); 396 376 397 } 377 398 … … 408 429 'class' => 'payment-trigger', 409 430 'description' => esc_html__('When should the payment be booked in Run My Accounts', 'run-my-accounts-for-woocommerce' ), 410 411 431 ) 412 432 ); … … 1108 1128 */ 1109 1129 public function option_select_cb( $args ) { 1110 $option_group = (isset($args['option_group'])) ? $args['option_group'] : ''; 1111 $id = (isset($args['id'])) ? $args['id'] : ''; 1112 $options = (isset($args['options'])) ? $args['options'] : ''; 1113 $select_options = (isset($args['select_options'])) ? $args['select_options'] : array(); 1114 $description = (isset($args['description'])) ? $args['description'] : ''; 1115 $class = (isset($args['class'])) ? $args['class'] : ''; 1116 1117 echo '<select name="' . $option_group . '[' . $id . ']"' . ( !empty( $class) ? 'id="'. $id .'" class="' . $class . '"' : '' ) . '>'; 1130 $option_group = ( isset( $args[ 'option_group'] ) ) ? $args[ 'option_group' ] : ''; 1131 $id = ( isset( $args[ 'id'] ) ) ? $args[ 'id' ] : ''; 1132 $options = ( isset( $args[ 'options'] ) ) ? $args[ 'options' ] : ''; 1133 $select_options = ( isset( $args[ 'select_options'] ) ) ? $args[ 'select_options' ] : array(); 1134 $description = ( isset( $args[ 'description'] ) ) ? $args[ 'description' ] : ''; 1135 $class = ( isset( $args[ 'class'] ) ) ? $args[ 'class' ] : ''; 1136 $style = ( isset( $args[ 'style'] ) ) ? $args[ 'style' ] : ''; 1137 1138 echo '<select name="' . $option_group . '[' . $id . ']"' . ( !empty( $id) ? 'id="'. $id .'"' : '' ) . ( !empty( $class) ? ' class="' . $class . '"' : '' ) . ( !empty( $style) ? ' style="' . $style . '"' : '' ) . '>'; 1118 1139 1119 1140 foreach ( $select_options as $value => $text ) { -
run-my-accounts-for-woocommerce/trunk/readme.txt
r3267740 r3285646 4 4 * Requires at least: 6.2 5 5 * Tested up to: 6.8 6 * Stable tag: 1. 8.16 * Stable tag: 1.9.0 7 7 * Requires PHP: 7.2 8 8 * License: GPLv2 … … 45 45 == Screenshots == 46 46 1. General settings. 47 2. Settings for dedicated receivable account for each payment gateway.48 3. Settings on user page.47 2. Settings for a dedicated receivable account for each payment gateway. 48 3. Settings on the user page. 49 49 50 50 == Known issues == 51 * Discount codes do esnot be reflected on the invoice.51 * Discount codes do not be reflected on the invoice. 52 52 * Credits are not created in Run My Accounts. 53 53 * The collective invoice only works with available products. If a product was deleted between the order and the invoice, the product cannot be included in the invoice anymore. 54 54 55 55 == Changelog == 56 = 1.9.0 = 57 * Added the option to select separately whether the prices transferred to Run My Accounts include VAT or not. 58 56 59 = 1.8.1 = 57 60 * Added compatibility with price rules plugins -
run-my-accounts-for-woocommerce/trunk/rma-wc.php
r3267740 r3285646 11 11 * 12 12 * Plugin Name: Run my Accounts for WooCommerce 13 * Version: 1. 8.113 * Version: 1.9.0 14 14 * Description: This plug-in connects WooCommerce to <a href="https://www.runmyaccounts.ch/">Run my Accounts</a>. Create customers and invoices as soon as you get an order in your WooCommerce shop. 15 15 * Requires at least: 6.2
Note: See TracChangeset
for help on using the changeset viewer.