Changeset 3415143
- Timestamp:
- 12/09/2025 09:50:57 AM (2 months ago)
- Location:
- jne-shipping-official
- Files:
-
- 9 edited
- 34 copied
-
tags/1.2.2 (copied) (copied from jne-shipping-official/trunk)
-
tags/1.2.2/LICENSE.txt (copied) (copied from jne-shipping-official/trunk/LICENSE.txt)
-
tags/1.2.2/admin (copied) (copied from jne-shipping-official/trunk/admin)
-
tags/1.2.2/admin/class-jne-woocommerce-admin.php (copied) (copied from jne-shipping-official/trunk/admin/class-jne-woocommerce-admin.php)
-
tags/1.2.2/admin/includes/class-jne-admin-dashboard.php (copied) (copied from jne-shipping-official/trunk/admin/includes/class-jne-admin-dashboard.php) (5 diffs)
-
tags/1.2.2/admin/includes/class-jne-admin-generate-awb.php (copied) (copied from jne-shipping-official/trunk/admin/includes/class-jne-admin-generate-awb.php) (1 diff)
-
tags/1.2.2/admin/includes/class-jne-admin-generate-cnote.php (copied) (copied from jne-shipping-official/trunk/admin/includes/class-jne-admin-generate-cnote.php) (2 diffs)
-
tags/1.2.2/admin/includes/class-jne-admin-order-helper.php (copied) (copied from jne-shipping-official/trunk/admin/includes/class-jne-admin-order-helper.php)
-
tags/1.2.2/admin/includes/class-jne-admin-order-list.php (copied) (copied from jne-shipping-official/trunk/admin/includes/class-jne-admin-order-list.php)
-
tags/1.2.2/admin/includes/class-jne-admin-shipping-cost-adjustment.php (copied) (copied from jne-shipping-official/trunk/admin/includes/class-jne-admin-shipping-cost-adjustment.php) (2 diffs)
-
tags/1.2.2/admin/includes/class-jne-admin-shipping-method.php (copied) (copied from jne-shipping-official/trunk/admin/includes/class-jne-admin-shipping-method.php) (1 diff)
-
tags/1.2.2/admin/partials/jne-woocommerce-admin-dashboard-display.php (copied) (copied from jne-shipping-official/trunk/admin/partials/jne-woocommerce-admin-dashboard-display.php)
-
tags/1.2.2/admin/partials/jne-woocommerce-admin-shipping-cost-adjustments-display.php (copied) (copied from jne-shipping-official/trunk/admin/partials/jne-woocommerce-admin-shipping-cost-adjustments-display.php)
-
tags/1.2.2/admin/partials/jne-woocommerce-admin-support-display.php (copied) (copied from jne-shipping-official/trunk/admin/partials/jne-woocommerce-admin-support-display.php)
-
tags/1.2.2/admin/partials/jne-woocommerce-admin-webhook-logs-display.php (copied) (copied from jne-shipping-official/trunk/admin/partials/jne-woocommerce-admin-webhook-logs-display.php)
-
tags/1.2.2/assets (copied) (copied from jne-shipping-official/trunk/assets)
-
tags/1.2.2/composer.json (copied) (copied from jne-shipping-official/trunk/composer.json) (1 diff)
-
tags/1.2.2/composer.lock (copied) (copied from jne-shipping-official/trunk/composer.lock)
-
tags/1.2.2/includes (copied) (copied from jne-shipping-official/trunk/includes)
-
tags/1.2.2/includes/class-jne-woocommerce-api.php (copied) (copied from jne-shipping-official/trunk/includes/class-jne-woocommerce-api.php)
-
tags/1.2.2/includes/class-jne-woocommerce-webhook-logger.php (copied) (copied from jne-shipping-official/trunk/includes/class-jne-woocommerce-webhook-logger.php)
-
tags/1.2.2/includes/class-jne-woocommerce-webhook.php (copied) (copied from jne-shipping-official/trunk/includes/class-jne-woocommerce-webhook.php)
-
tags/1.2.2/includes/class-jne-woocommerce.php (copied) (copied from jne-shipping-official/trunk/includes/class-jne-woocommerce.php)
-
tags/1.2.2/index.php (copied) (copied from jne-shipping-official/trunk/index.php)
-
tags/1.2.2/jne-shipping-official.php (copied) (copied from jne-shipping-official/trunk/jne-shipping-official.php) (2 diffs)
-
tags/1.2.2/languages (copied) (copied from jne-shipping-official/trunk/languages)
-
tags/1.2.2/public (copied) (copied from jne-shipping-official/trunk/public)
-
tags/1.2.2/public/class-jne-woocommerce-public.php (copied) (copied from jne-shipping-official/trunk/public/class-jne-woocommerce-public.php)
-
tags/1.2.2/public/includes/jne-woocommerce-public-cod.php (copied) (copied from jne-shipping-official/trunk/public/includes/jne-woocommerce-public-cod.php)
-
tags/1.2.2/public/includes/jne-woocommerce-public-insurance.php (copied) (copied from jne-shipping-official/trunk/public/includes/jne-woocommerce-public-insurance.php)
-
tags/1.2.2/public/includes/jne-woocommerce-public-shipping-cost-adjustment.php (copied) (copied from jne-shipping-official/trunk/public/includes/jne-woocommerce-public-shipping-cost-adjustment.php) (2 diffs)
-
tags/1.2.2/readme.txt (copied) (copied from jne-shipping-official/trunk/readme.txt) (3 diffs)
-
tags/1.2.2/uninstall.php (copied) (copied from jne-shipping-official/trunk/uninstall.php)
-
tags/1.2.2/vendor (copied) (copied from jne-shipping-official/trunk/vendor)
-
trunk/admin/includes/class-jne-admin-dashboard.php (modified) (5 diffs)
-
trunk/admin/includes/class-jne-admin-generate-awb.php (modified) (1 diff)
-
trunk/admin/includes/class-jne-admin-generate-cnote.php (modified) (2 diffs)
-
trunk/admin/includes/class-jne-admin-shipping-cost-adjustment.php (modified) (2 diffs)
-
trunk/admin/includes/class-jne-admin-shipping-method.php (modified) (1 diff)
-
trunk/composer.json (modified) (1 diff)
-
trunk/jne-shipping-official.php (modified) (2 diffs)
-
trunk/public/includes/jne-woocommerce-public-shipping-cost-adjustment.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
jne-shipping-official/tags/1.2.2/admin/includes/class-jne-admin-dashboard.php
r3399074 r3415143 38 38 $payment_type = $filters['payment_type'] ?? ''; // 'cod' or 'non_cod' or '' 39 39 40 // Ensure date_to includes time (end of day) 41 $date_to_with_time = $date_to . ' 23:59:59'; 42 40 43 // Get all orders in date range with status completed 41 44 $args = [ 42 45 'limit' => -1, 43 'date_created' => $date_from . '...' . $date_to,46 'date_created' => strtotime($date_from) . '...' . strtotime($date_to_with_time), 44 47 'status' => 'completed', 45 48 'return' => 'ids' … … 57 60 // Filter orders that use JNE shipping 58 61 $jne_orders = []; 62 $jne_shipping_method_id = 'jneshof_shipping'; // Use direct string instead of constant 63 59 64 foreach ($order_ids as $order_id) { 60 65 $order = wc_get_order($order_id); … … 66 71 $is_jne = false; 67 72 foreach ($order->get_shipping_methods() as $shipping_method) { 68 if ($shipping_method->get_method_id() === Jneshof_Order_Helper::JNESHOF_SHIPPING_METHOD_ID) {73 if ($shipping_method->get_method_id() === $jne_shipping_method_id) { 69 74 $is_jne = true; 70 75 break; … … 195 200 $order_status = $order->get_status(); 196 201 197 // Completed orders 198 if ($order_status === 'completed') { 199 $stats['completed_orders']['count']++; 200 $stats['completed_orders']['total_cost'] += $shipping_cost; 201 } 202 // All orders passed to this function are already completed (filtered in get_jne_orders) 203 // So we count all as completed 204 $stats['completed_orders']['count']++; 205 $stats['completed_orders']['total_cost'] += $shipping_cost; 202 206 203 207 // Delivered shipping status … … 206 210 $stats['delivered']['total_cost'] += $shipping_cost; 207 211 } else { 208 // Not delivered 212 // Not delivered (includes MENUNGGU PICKUP, SHIPPED, etc.) 209 213 $stats['not_delivered']['count']++; 210 214 $stats['not_delivered']['total_cost'] += $shipping_cost; -
jne-shipping-official/tags/1.2.2/admin/includes/class-jne-admin-generate-awb.php
r3411298 r3415143 181 181 182 182 $products = []; 183 foreach ($order->getOrderProductItems() as $product) { 183 foreach ($order->getOrderProductItems() as $item) { 184 $product = $item->get_product(); 185 $sku = ''; 186 if ($product && method_exists($product, 'get_sku')) { 187 $sku = $product->get_sku(); 188 } 184 189 $products[] = [ 185 'name' => $product->get_name(), 186 'qty' => $product->get_quantity() 190 'name' => $item->get_name(), 191 'sku' => $sku ?: '', 192 'qty' => $item->get_quantity() 187 193 ]; 188 194 } -
jne-shipping-official/tags/1.2.2/admin/includes/class-jne-admin-generate-cnote.php
r3398965 r3415143 87 87 88 88 /** 89 * Truncate string to maximum length in bytes 90 * 91 * @param string $value 92 * @param int $max_length Maximum length in bytes 93 * @return string 94 */ 95 private function truncate_string($value, $max_length) 96 { 97 if (empty($value)) { 98 return ''; 99 } 100 101 $value = (string) $value; 102 103 // If string is already within limit, return as is 104 if (strlen($value) <= $max_length) { 105 return $value; 106 } 107 108 // Truncate by bytes using mb_strcut which handles multibyte characters correctly 109 return mb_strcut($value, 0, $max_length, 'UTF-8'); 110 } 111 112 /** 89 113 * Summary of generate_tracking_number 90 114 * @return string|null … … 122 146 123 147 $cnote_data = [ 124 'olshop_branch' => $this-> storeSettingHelper->getBranchCode(),148 'olshop_branch' => $this->truncate_string($this->storeSettingHelper->getBranchCode(), 10), 125 149 'olshop_cod_amount' => $olshop_cod_amount, 126 'olshop_cod_flag' => $ olshop_cod_flag,127 'olshop_cust' => $ olshop_cust,128 'olshop_orderid' => $this-> orderHelper->getOrderId(),129 'olshop_shipper_name' => $this-> storeSettingHelper->getStoreName(),130 'olshop_shipper_addr1' => $ shipper_address[0] ?? '',131 'olshop_shipper_addr2' => $ shipper_address[1] ?? $shipper_address[0],132 'olshop_shipper_addr3' => $ shipper_address[2] ?? '',133 'olshop_shipper_city' => $this-> storeSettingHelper->getStoreCity(),134 'olshop_shipper_region' => $this-> storeSettingHelper->getStoreRegion(),135 'olshop_shipper_zip' => $this-> storeSettingHelper->getStorePostcode(),136 'olshop_shipper_phone' => $this-> storeSettingHelper->getStorePhone(),137 'olshop_receiver_name' => $this-> orderHelper->getCustomerShippingName(),138 'olshop_receiver_addr1' => $ receiver_address[0] ?? '',139 'olshop_receiver_addr2' => $ receiver_address[1] ?? $receiver_address[0],140 'olshop_receiver_addr3' => $ receiver_address[2] ?? '',141 'olshop_receiver_city' => $this-> orderHelper->getCustomerShippingCity(),142 'olshop_receiver_region' => $this-> orderHelper->getCustomerShippingRegion(),143 'olshop_receiver_zip' => $this-> orderHelper->getCustomerShippingPostcode(),144 'olshop_receiver_phone' => $ receiver_phone ?? '',150 'olshop_cod_flag' => $this->truncate_string($olshop_cod_flag, 3), 151 'olshop_cust' => $this->truncate_string($olshop_cust, 10), 152 'olshop_orderid' => $this->truncate_string($this->orderHelper->getOrderId(), 20), 153 'olshop_shipper_name' => $this->truncate_string($this->storeSettingHelper->getStoreName(), 30), 154 'olshop_shipper_addr1' => $this->truncate_string($shipper_address[0] ?? '', 30), 155 'olshop_shipper_addr2' => $this->truncate_string($shipper_address[1] ?? $shipper_address[0] ?? '', 30), 156 'olshop_shipper_addr3' => $this->truncate_string($shipper_address[2] ?? '', 30), 157 'olshop_shipper_city' => $this->truncate_string($this->storeSettingHelper->getStoreCity(), 20), 158 'olshop_shipper_region' => $this->truncate_string($this->storeSettingHelper->getStoreRegion(), 20), 159 'olshop_shipper_zip' => $this->truncate_string($this->storeSettingHelper->getStorePostcode(), 5), 160 'olshop_shipper_phone' => $this->truncate_string($this->storeSettingHelper->getStorePhone(), 15), 161 'olshop_receiver_name' => $this->truncate_string($this->orderHelper->getCustomerShippingName(), 30), 162 'olshop_receiver_addr1' => $this->truncate_string($receiver_address[0] ?? '', 30), 163 'olshop_receiver_addr2' => $this->truncate_string($receiver_address[1] ?? $receiver_address[0] ?? '', 30), 164 'olshop_receiver_addr3' => $this->truncate_string($receiver_address[2] ?? '', 30), 165 'olshop_receiver_city' => $this->truncate_string($this->orderHelper->getCustomerShippingCity(), 20), 166 'olshop_receiver_region' => $this->truncate_string($this->orderHelper->getCustomerShippingRegion(), 20), 167 'olshop_receiver_zip' => $this->truncate_string($this->orderHelper->getCustomerShippingPostcode(), 5), 168 'olshop_receiver_phone' => $this->truncate_string($receiver_phone ?? '', 15), 145 169 'olshop_qty' => $this->orderHelper->getOrderTotalQty(), 146 170 'olshop_weight' => $this->orderHelper->getOrderTotalWeight(), 147 'olshop_goodsdesc' => substr($this->orderHelper->getOrderProductName(), 0, 60),171 'olshop_goodsdesc' => $this->truncate_string($this->orderHelper->getOrderProductName(), 60), 148 172 'olshop_goodsvalue' => $this->orderHelper->getOrderProductPrice(), 149 'olshop_goodstype' => '2',150 'olshop_inst' => 'Handle With Care',151 'olshop_ins_flag' => $this-> storeSettingHelper->getStoreInsuranceEnabled() ? 'Y' : 'N',152 'olshop_orig' => $this-> storeSettingHelper->getOriginCode(),153 'olshop_dest' => $this-> orderHelper->getDestinationCodeFilteredByZipcode(),154 'olshop_service' => $ jneshof_shipping_CODE,173 'olshop_goodstype' => $this->truncate_string('2', 1), 174 'olshop_inst' => $this->truncate_string('Handle With Care', 60), 175 'olshop_ins_flag' => $this->truncate_string($this->storeSettingHelper->getStoreInsuranceEnabled() ? 'Y' : 'N', 1), 176 'olshop_orig' => $this->truncate_string($this->storeSettingHelper->getOriginCode(), 10), 177 'olshop_dest' => $this->truncate_string($this->orderHelper->getDestinationCodeFilteredByZipcode(), 10), 178 'olshop_service' => $this->truncate_string($jneshof_shipping_CODE, 10), 155 179 'is_multikoli' => 'N', 156 180 'jlc_number' => '', -
jne-shipping-official/tags/1.2.2/admin/includes/class-jne-admin-shipping-cost-adjustment.php
r3411310 r3415143 254 254 255 255 case 'fixed_subtract': 256 $adjusted_cost -= $adjustment_value; 256 // Discount cannot exceed original cost 257 $discount_amount = min($adjustment_value, $original_cost); 258 $adjusted_cost -= $discount_amount; 257 259 break; 258 260 … … 262 264 263 265 case 'percentage_subtract': 264 $adjusted_cost -= ($original_cost * $adjustment_value / 100); 266 // Calculate percentage discount, but cap at original cost 267 $discount_amount = ($original_cost * $adjustment_value / 100); 268 $discount_amount = min($discount_amount, $original_cost); 269 $adjusted_cost -= $discount_amount; 265 270 break; 266 271 } -
jne-shipping-official/tags/1.2.2/admin/includes/class-jne-admin-shipping-method.php
r3411298 r3415143 189 189 case 'JTR250': 190 190 return 'JTR 250'; 191 case 'CTC': 192 return 'REG'; 193 case 'CTCYES': 194 return 'YES'; 195 case 'CTCSPS': 196 return 'SPS'; 191 197 default: 192 198 return $service['service_display']; -
jne-shipping-official/tags/1.2.2/composer.json
r3411298 r3415143 2 2 "name": "jne-shipping/jne-shipping-official", 3 3 "description": "WordPress plugin integrated with WooCommerce for JNE shipping services", 4 "version": "1.2. 1",4 "version": "1.2.2", 5 5 "type": "wordpress-plugin", 6 6 "license": "GPL-2.0+", -
jne-shipping-official/tags/1.2.2/jne-shipping-official.php
r3411298 r3415143 20 20 * Plugin Name: JNE Shipping Official 21 21 * Description: WordPress plugin integrated with WooCommerce for JNE shipping services 22 * Version: 1.2. 122 * Version: 1.2.2 23 23 * Author: PT. Tiki Jalur Nugraha Ekakurir 24 24 * Author URI: https://jne.co.id/ … … 48 48 * Rename this for your plugin and update it as you release new versions. 49 49 */ 50 define('JNESHOF_PLUGIN_VERSION', '1.2. 1');50 define('JNESHOF_PLUGIN_VERSION', '1.2.2'); 51 51 52 52 /** -
jne-shipping-official/tags/1.2.2/public/includes/jne-woocommerce-public-shipping-cost-adjustment.php
r3411310 r3415143 121 121 122 122 case 'fixed_subtract': 123 $fee_amount = -$adjustment_value; // Negative for discount 123 // Discount cannot exceed original shipping cost 124 $discount_amount = min($adjustment_value, $original_shipping_cost); 125 $fee_amount = -$discount_amount; // Negative for discount 124 126 $fee_label = __('Shipping Cost Discount', 'jne-shipping-official'); 125 127 break; … … 131 133 132 134 case 'percentage_subtract': 133 $fee_amount = -($original_shipping_cost * $adjustment_value / 100); // Negative for discount 135 // Calculate percentage discount, but cap at original shipping cost 136 $discount_amount = ($original_shipping_cost * $adjustment_value / 100); 137 $discount_amount = min($discount_amount, $original_shipping_cost); 138 $fee_amount = -$discount_amount; // Negative for discount 134 139 $fee_label = __('Shipping Cost Discount', 'jne-shipping-official'); 135 140 break; -
jne-shipping-official/tags/1.2.2/readme.txt
r3411298 r3415143 6 6 Tested up to: 6.8 7 7 Requires PHP: 7.4 8 Stable tag: 1.2. 18 Stable tag: 1.2.2 9 9 License: GPL-2.0+ 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.txt … … 90 90 91 91 == Changelog == 92 93 = 1.2.2 = 94 * Fixed: Changed CTC service label to REG for better clarity 95 * Fixed: Dashboard calculation issues - improved date range filtering and shipping method detection 96 * Fixed: SKU field now displays correctly in shipping labels (was showing N/A) 97 * Fixed: Added validation to check if order has tracking number before requesting pickup 98 * Improved: Dashboard query performance and accuracy for order filtering 92 99 93 100 = 1.2.1 = … … 181 188 == Upgrade Notice == 182 189 190 = 1.2.2 = 191 Bug fixes and improvements: Fixed CTC service labeling (now displays as REG), improved dashboard calculations, fixed SKU display in shipping labels, and added pickup request validation. Recommended for all users. 192 183 193 = 1.1.0 = 184 194 Major update: Added comprehensive JNE Shipping Dashboard with analytics including Shipping Status Statistics, Aging Shipment tracking, Shipping Cost Statistics, Top Destinations, and Top JNE Services. Includes date range and payment type filters. Dashboard provides valuable insights into your shipping operations. Recommended for all users. -
jne-shipping-official/trunk/admin/includes/class-jne-admin-dashboard.php
r3399074 r3415143 38 38 $payment_type = $filters['payment_type'] ?? ''; // 'cod' or 'non_cod' or '' 39 39 40 // Ensure date_to includes time (end of day) 41 $date_to_with_time = $date_to . ' 23:59:59'; 42 40 43 // Get all orders in date range with status completed 41 44 $args = [ 42 45 'limit' => -1, 43 'date_created' => $date_from . '...' . $date_to,46 'date_created' => strtotime($date_from) . '...' . strtotime($date_to_with_time), 44 47 'status' => 'completed', 45 48 'return' => 'ids' … … 57 60 // Filter orders that use JNE shipping 58 61 $jne_orders = []; 62 $jne_shipping_method_id = 'jneshof_shipping'; // Use direct string instead of constant 63 59 64 foreach ($order_ids as $order_id) { 60 65 $order = wc_get_order($order_id); … … 66 71 $is_jne = false; 67 72 foreach ($order->get_shipping_methods() as $shipping_method) { 68 if ($shipping_method->get_method_id() === Jneshof_Order_Helper::JNESHOF_SHIPPING_METHOD_ID) {73 if ($shipping_method->get_method_id() === $jne_shipping_method_id) { 69 74 $is_jne = true; 70 75 break; … … 195 200 $order_status = $order->get_status(); 196 201 197 // Completed orders 198 if ($order_status === 'completed') { 199 $stats['completed_orders']['count']++; 200 $stats['completed_orders']['total_cost'] += $shipping_cost; 201 } 202 // All orders passed to this function are already completed (filtered in get_jne_orders) 203 // So we count all as completed 204 $stats['completed_orders']['count']++; 205 $stats['completed_orders']['total_cost'] += $shipping_cost; 202 206 203 207 // Delivered shipping status … … 206 210 $stats['delivered']['total_cost'] += $shipping_cost; 207 211 } else { 208 // Not delivered 212 // Not delivered (includes MENUNGGU PICKUP, SHIPPED, etc.) 209 213 $stats['not_delivered']['count']++; 210 214 $stats['not_delivered']['total_cost'] += $shipping_cost; -
jne-shipping-official/trunk/admin/includes/class-jne-admin-generate-awb.php
r3411298 r3415143 181 181 182 182 $products = []; 183 foreach ($order->getOrderProductItems() as $product) { 183 foreach ($order->getOrderProductItems() as $item) { 184 $product = $item->get_product(); 185 $sku = ''; 186 if ($product && method_exists($product, 'get_sku')) { 187 $sku = $product->get_sku(); 188 } 184 189 $products[] = [ 185 'name' => $product->get_name(), 186 'qty' => $product->get_quantity() 190 'name' => $item->get_name(), 191 'sku' => $sku ?: '', 192 'qty' => $item->get_quantity() 187 193 ]; 188 194 } -
jne-shipping-official/trunk/admin/includes/class-jne-admin-generate-cnote.php
r3398965 r3415143 87 87 88 88 /** 89 * Truncate string to maximum length in bytes 90 * 91 * @param string $value 92 * @param int $max_length Maximum length in bytes 93 * @return string 94 */ 95 private function truncate_string($value, $max_length) 96 { 97 if (empty($value)) { 98 return ''; 99 } 100 101 $value = (string) $value; 102 103 // If string is already within limit, return as is 104 if (strlen($value) <= $max_length) { 105 return $value; 106 } 107 108 // Truncate by bytes using mb_strcut which handles multibyte characters correctly 109 return mb_strcut($value, 0, $max_length, 'UTF-8'); 110 } 111 112 /** 89 113 * Summary of generate_tracking_number 90 114 * @return string|null … … 122 146 123 147 $cnote_data = [ 124 'olshop_branch' => $this-> storeSettingHelper->getBranchCode(),148 'olshop_branch' => $this->truncate_string($this->storeSettingHelper->getBranchCode(), 10), 125 149 'olshop_cod_amount' => $olshop_cod_amount, 126 'olshop_cod_flag' => $ olshop_cod_flag,127 'olshop_cust' => $ olshop_cust,128 'olshop_orderid' => $this-> orderHelper->getOrderId(),129 'olshop_shipper_name' => $this-> storeSettingHelper->getStoreName(),130 'olshop_shipper_addr1' => $ shipper_address[0] ?? '',131 'olshop_shipper_addr2' => $ shipper_address[1] ?? $shipper_address[0],132 'olshop_shipper_addr3' => $ shipper_address[2] ?? '',133 'olshop_shipper_city' => $this-> storeSettingHelper->getStoreCity(),134 'olshop_shipper_region' => $this-> storeSettingHelper->getStoreRegion(),135 'olshop_shipper_zip' => $this-> storeSettingHelper->getStorePostcode(),136 'olshop_shipper_phone' => $this-> storeSettingHelper->getStorePhone(),137 'olshop_receiver_name' => $this-> orderHelper->getCustomerShippingName(),138 'olshop_receiver_addr1' => $ receiver_address[0] ?? '',139 'olshop_receiver_addr2' => $ receiver_address[1] ?? $receiver_address[0],140 'olshop_receiver_addr3' => $ receiver_address[2] ?? '',141 'olshop_receiver_city' => $this-> orderHelper->getCustomerShippingCity(),142 'olshop_receiver_region' => $this-> orderHelper->getCustomerShippingRegion(),143 'olshop_receiver_zip' => $this-> orderHelper->getCustomerShippingPostcode(),144 'olshop_receiver_phone' => $ receiver_phone ?? '',150 'olshop_cod_flag' => $this->truncate_string($olshop_cod_flag, 3), 151 'olshop_cust' => $this->truncate_string($olshop_cust, 10), 152 'olshop_orderid' => $this->truncate_string($this->orderHelper->getOrderId(), 20), 153 'olshop_shipper_name' => $this->truncate_string($this->storeSettingHelper->getStoreName(), 30), 154 'olshop_shipper_addr1' => $this->truncate_string($shipper_address[0] ?? '', 30), 155 'olshop_shipper_addr2' => $this->truncate_string($shipper_address[1] ?? $shipper_address[0] ?? '', 30), 156 'olshop_shipper_addr3' => $this->truncate_string($shipper_address[2] ?? '', 30), 157 'olshop_shipper_city' => $this->truncate_string($this->storeSettingHelper->getStoreCity(), 20), 158 'olshop_shipper_region' => $this->truncate_string($this->storeSettingHelper->getStoreRegion(), 20), 159 'olshop_shipper_zip' => $this->truncate_string($this->storeSettingHelper->getStorePostcode(), 5), 160 'olshop_shipper_phone' => $this->truncate_string($this->storeSettingHelper->getStorePhone(), 15), 161 'olshop_receiver_name' => $this->truncate_string($this->orderHelper->getCustomerShippingName(), 30), 162 'olshop_receiver_addr1' => $this->truncate_string($receiver_address[0] ?? '', 30), 163 'olshop_receiver_addr2' => $this->truncate_string($receiver_address[1] ?? $receiver_address[0] ?? '', 30), 164 'olshop_receiver_addr3' => $this->truncate_string($receiver_address[2] ?? '', 30), 165 'olshop_receiver_city' => $this->truncate_string($this->orderHelper->getCustomerShippingCity(), 20), 166 'olshop_receiver_region' => $this->truncate_string($this->orderHelper->getCustomerShippingRegion(), 20), 167 'olshop_receiver_zip' => $this->truncate_string($this->orderHelper->getCustomerShippingPostcode(), 5), 168 'olshop_receiver_phone' => $this->truncate_string($receiver_phone ?? '', 15), 145 169 'olshop_qty' => $this->orderHelper->getOrderTotalQty(), 146 170 'olshop_weight' => $this->orderHelper->getOrderTotalWeight(), 147 'olshop_goodsdesc' => substr($this->orderHelper->getOrderProductName(), 0, 60),171 'olshop_goodsdesc' => $this->truncate_string($this->orderHelper->getOrderProductName(), 60), 148 172 'olshop_goodsvalue' => $this->orderHelper->getOrderProductPrice(), 149 'olshop_goodstype' => '2',150 'olshop_inst' => 'Handle With Care',151 'olshop_ins_flag' => $this-> storeSettingHelper->getStoreInsuranceEnabled() ? 'Y' : 'N',152 'olshop_orig' => $this-> storeSettingHelper->getOriginCode(),153 'olshop_dest' => $this-> orderHelper->getDestinationCodeFilteredByZipcode(),154 'olshop_service' => $ jneshof_shipping_CODE,173 'olshop_goodstype' => $this->truncate_string('2', 1), 174 'olshop_inst' => $this->truncate_string('Handle With Care', 60), 175 'olshop_ins_flag' => $this->truncate_string($this->storeSettingHelper->getStoreInsuranceEnabled() ? 'Y' : 'N', 1), 176 'olshop_orig' => $this->truncate_string($this->storeSettingHelper->getOriginCode(), 10), 177 'olshop_dest' => $this->truncate_string($this->orderHelper->getDestinationCodeFilteredByZipcode(), 10), 178 'olshop_service' => $this->truncate_string($jneshof_shipping_CODE, 10), 155 179 'is_multikoli' => 'N', 156 180 'jlc_number' => '', -
jne-shipping-official/trunk/admin/includes/class-jne-admin-shipping-cost-adjustment.php
r3411310 r3415143 254 254 255 255 case 'fixed_subtract': 256 $adjusted_cost -= $adjustment_value; 256 // Discount cannot exceed original cost 257 $discount_amount = min($adjustment_value, $original_cost); 258 $adjusted_cost -= $discount_amount; 257 259 break; 258 260 … … 262 264 263 265 case 'percentage_subtract': 264 $adjusted_cost -= ($original_cost * $adjustment_value / 100); 266 // Calculate percentage discount, but cap at original cost 267 $discount_amount = ($original_cost * $adjustment_value / 100); 268 $discount_amount = min($discount_amount, $original_cost); 269 $adjusted_cost -= $discount_amount; 265 270 break; 266 271 } -
jne-shipping-official/trunk/admin/includes/class-jne-admin-shipping-method.php
r3411298 r3415143 189 189 case 'JTR250': 190 190 return 'JTR 250'; 191 case 'CTC': 192 return 'REG'; 193 case 'CTCYES': 194 return 'YES'; 195 case 'CTCSPS': 196 return 'SPS'; 191 197 default: 192 198 return $service['service_display']; -
jne-shipping-official/trunk/composer.json
r3411298 r3415143 2 2 "name": "jne-shipping/jne-shipping-official", 3 3 "description": "WordPress plugin integrated with WooCommerce for JNE shipping services", 4 "version": "1.2. 1",4 "version": "1.2.2", 5 5 "type": "wordpress-plugin", 6 6 "license": "GPL-2.0+", -
jne-shipping-official/trunk/jne-shipping-official.php
r3411298 r3415143 20 20 * Plugin Name: JNE Shipping Official 21 21 * Description: WordPress plugin integrated with WooCommerce for JNE shipping services 22 * Version: 1.2. 122 * Version: 1.2.2 23 23 * Author: PT. Tiki Jalur Nugraha Ekakurir 24 24 * Author URI: https://jne.co.id/ … … 48 48 * Rename this for your plugin and update it as you release new versions. 49 49 */ 50 define('JNESHOF_PLUGIN_VERSION', '1.2. 1');50 define('JNESHOF_PLUGIN_VERSION', '1.2.2'); 51 51 52 52 /** -
jne-shipping-official/trunk/public/includes/jne-woocommerce-public-shipping-cost-adjustment.php
r3411310 r3415143 121 121 122 122 case 'fixed_subtract': 123 $fee_amount = -$adjustment_value; // Negative for discount 123 // Discount cannot exceed original shipping cost 124 $discount_amount = min($adjustment_value, $original_shipping_cost); 125 $fee_amount = -$discount_amount; // Negative for discount 124 126 $fee_label = __('Shipping Cost Discount', 'jne-shipping-official'); 125 127 break; … … 131 133 132 134 case 'percentage_subtract': 133 $fee_amount = -($original_shipping_cost * $adjustment_value / 100); // Negative for discount 135 // Calculate percentage discount, but cap at original shipping cost 136 $discount_amount = ($original_shipping_cost * $adjustment_value / 100); 137 $discount_amount = min($discount_amount, $original_shipping_cost); 138 $fee_amount = -$discount_amount; // Negative for discount 134 139 $fee_label = __('Shipping Cost Discount', 'jne-shipping-official'); 135 140 break; -
jne-shipping-official/trunk/readme.txt
r3411298 r3415143 6 6 Tested up to: 6.8 7 7 Requires PHP: 7.4 8 Stable tag: 1.2. 18 Stable tag: 1.2.2 9 9 License: GPL-2.0+ 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.txt … … 90 90 91 91 == Changelog == 92 93 = 1.2.2 = 94 * Fixed: Changed CTC service label to REG for better clarity 95 * Fixed: Dashboard calculation issues - improved date range filtering and shipping method detection 96 * Fixed: SKU field now displays correctly in shipping labels (was showing N/A) 97 * Fixed: Added validation to check if order has tracking number before requesting pickup 98 * Improved: Dashboard query performance and accuracy for order filtering 92 99 93 100 = 1.2.1 = … … 181 188 == Upgrade Notice == 182 189 190 = 1.2.2 = 191 Bug fixes and improvements: Fixed CTC service labeling (now displays as REG), improved dashboard calculations, fixed SKU display in shipping labels, and added pickup request validation. Recommended for all users. 192 183 193 = 1.1.0 = 184 194 Major update: Added comprehensive JNE Shipping Dashboard with analytics including Shipping Status Statistics, Aging Shipment tracking, Shipping Cost Statistics, Top Destinations, and Top JNE Services. Includes date range and payment type filters. Dashboard provides valuable insights into your shipping operations. Recommended for all users.
Note: See TracChangeset
for help on using the changeset viewer.