zacctmgr_commission_new_value ) ? $data->zacctmgr_commission_new_value : '' ) . '"/>'; $value2 = ''; $type1 = ''; $type1 .= ''; $type2 = ''; $type2 .= ''; $order_count = ( isset( $data->zacctmgr_commission_order_count ) && (int) $data->zacctmgr_commission_order_count > 1 ) ? (int) $data->zacctmgr_commission_order_count : 1; $order1 = ''; /* Apply 1 */ $apply1 = ''; $style_fixed = 'style="display: block;"'; $style_percentage = 'style="display: none;"'; if ( isset( $data->zacctmgr_commission_new_type ) && $data->zacctmgr_commission_new_type == 'percentage' ) { $style_fixed = 'style="display: none;"'; $style_percentage = 'style="display: block;"'; } $zacctmgr_commission_new_exclude_options = isset( $data->zacctmgr_commission_new_exclude_options ) ? $data->zacctmgr_commission_new_exclude_options : []; $apply1 .= '
'; $apply1 .= '

Order Total

'; $apply1 .= '
'; foreach ( ZACCTMGR_EXCLUDE_OPTIONS as $key => $label ) { $extra = in_array( $key, $zacctmgr_commission_new_exclude_options ) ? 'checked="checked"' : ''; $apply1 .= '
'; $apply1 .= ''; $apply1 .= ''; $apply1 .= '
'; } $apply1 .= '
'; $apply1 .= '
'; $apply1 .= '
'; $apply1 .= '

Fixed Value Amount

'; $apply1 .= '
'; /* Apply 1 End */ /* Apply 2 */ $apply2 = ''; $style_fixed = 'style="display: block;"'; $style_percentage = 'style="display: none;"'; if ( isset( $data->zacctmgr_commission_existing_type ) && $data->zacctmgr_commission_existing_type == 'percentage' ) { $style_fixed = 'style="display: none;"'; $style_percentage = 'style="display: block;"'; } $zacctmgr_commission_existing_exclude_options = isset( $data->zacctmgr_commission_existing_exclude_options ) ? $data->zacctmgr_commission_existing_exclude_options : []; $apply2 .= '
'; $apply2 .= '

Order Total

'; $apply2 .= '
'; foreach ( ZACCTMGR_EXCLUDE_OPTIONS as $key => $label ) { $extra = in_array( $key, $zacctmgr_commission_existing_exclude_options ) ? 'checked="checked"' : ''; $apply2 .= '
'; $apply2 .= ''; $apply2 .= ''; $apply2 .= '
'; } $apply2 .= '
'; $apply2 .= '
'; $apply2 .= '
'; $apply2 .= '

Fixed Value Amount

'; $apply2 .= '
'; /* Apply 2 End */ if ( isset( $_GET['_wpnonce'] ) && wp_verify_nonce( $_GET['_wpnonce'], 'zacctmgr_edit_commission' ) ) { echo '

Account Manager commission updated.
← Back to Commission

'; } echo '
'; echo '
'; echo '

Account Manager Commission Edit

'; global $wpdb; $table_name = $wpdb->prefix . 'zacctmgr_acm_commissions_mapping'; $last_commission_rate_query = $wpdb->get_results( "SELECT * FROM $table_name WHERE manager_id=$manager_id AND customer_account_level=0 ORDER BY timestamp DESC LIMIT 1;" ); if ( count( $last_commission_rate_query ) != 0 ) { $new_value = trim( $last_commission_rate_query[0]->new_order_commission_value ); $new_type = $last_commission_rate_query[0]->new_order_commission_fixed_type == 1 ? 'fixed' : 'percentage'; $existing_value = trim( $last_commission_rate_query[0]->existing_order_commission_value ); $existing_type = $last_commission_rate_query[0]->existing_order_commission_fixed_type == 1 ? 'fixed' : 'percentage'; $order_limit = $last_commission_rate_query[0]->new_order_commission_limit; } else { $new_type = 'fixed'; $existing_type = 'fixed'; $new_value = 0; $existing_value = 0; $order_limit = 0; } $report = zacctmgr_get_manager_report( $manager_id ); $commissionData = zacctmgr_get_total_commission_by_manager( $manager_data ); $order_level_commission = zacctmgr_get_latest_order_level( $manager_id ); $accounts_number = zacctmgr_get_account_type_number( $manager_id ); ?>

first_name . ' ' . $manager_data->last_name; ?>

Accounts
Order Level

Accounts
Customer Account Level

new_order_commission_percentage_type == 1 ) { $o = ''; if ( $order_level_commission->new_order_exclude_coupon_amount == 1 ) { $o .= 'Exclude Coupon Amount
'; } if ( $order_level_commission->new_order_exclude_taxes_amount == 1 ) { $o .= 'Exclude Taxes Amount
'; } if ( $order_level_commission->new_order_exclude_shipping_costs == 1 ) { $o .= 'Exclude Shipping Costs Amount
'; } if ( $order_level_commission->new_order_exclude_shipping_tax_amount == 1 ) { $o .= 'Exclude Shipping Tax Amount
'; } if ( $o == '' ) { $o = 'Percentage Value Amount'; } } else { if ( $order_level_commission->new_order_commission_fixed_type == 1 ) { $o = 'Fixed Value Amount'; } } ?>
existing_order_commission_percentage_type == 1 ) { $o = ''; if ( $order_level_commission->existing_order_exclude_coupon_amount == 1 ) { $o .= 'Exclude Coupon Amount
'; } if ( $order_level_commission->existing_order_exclude_taxes_amount == 1 ) { $o .= 'Exclude Taxes Amount
'; } if ( $order_level_commission->existing_order_exclude_shipping_costs == 1 ) { $o .= 'Exclude Shipping Costs Amount
'; } if ( $order_level_commission->existing_order_exclude_shipping_tax_amount == 1 ) { $o .= 'Exclude Shipping Tax Amount
'; } if ( $o == '' ) { $o = 'Percentage Value Amount'; } } else { if ( $order_level_commission->existing_order_commission_fixed_type == 1 ) { $o = 'Fixed Value Amount'; } } ?>
Order Level Rates Apply to Value Calculated by
New Orders new_order_commission_limit; ?> new_order_commission_value . ( $order_level_commission->new_order_commission_percentage_type == 1 ? '%' : '' ); ?>
Existing Orders existing_order_commission_value . ( $order_level_commission->new_order_commission_percentage_type == 1 ? '%' : '' ); ?>
Total Commission New
Total Commission Existing
Total Commission

Oops, No Data for Time Period Selected

Try another data range