diff --git a/.phpunit.result.cache b/.phpunit.result.cache index 7ad5aeb..d9a6496 100644 --- a/.phpunit.result.cache +++ b/.phpunit.result.cache @@ -1 +1 @@ -{"version":2,"defects":{"Tests\\Feature\\ProductPriceTest::test_product_list_returns_price_for_store_level":8,"Tests\\Feature\\ProductPriceTest::test_store_without_level_is_rejected":8,"Tests\\Feature\\ProductPriceTest::test_batch_price_updates_and_notifies_affected_stores":7,"Tests\\Feature\\ProductPriceTest::test_price_matrix_structure":8,"Tests\\Feature\\StoreOrderTest::test_place_order_snapshots_level_price_and_recalculates":8,"Tests\\Feature\\StoreOrderTest::test_client_supplied_amount_is_ignored":8,"Tests\\Feature\\StoreOrderTest::test_product_without_level_price_rejected":8,"Tests\\Feature\\StoreOrderTest::test_cancel_only_pending_orders":8,"Tests\\Feature\\StoreOrderTest::test_summarized_order_cannot_be_cancelled":8,"Tests\\Feature\\StoreOrderTest::test_order_data_isolated_between_stores":8,"Tests\\Feature\\PurchaseGenerateTest::test_generate_aggregates_orders_by_product":7,"Tests\\Feature\\PurchaseGenerateTest::test_generate_writes_back_order_status":7,"Tests\\Feature\\PurchaseGenerateTest::test_generate_without_pending_orders_fails":8,"Tests\\Feature\\PurchaseGenerateTest::test_generate_is_idempotent":7,"Tests\\Feature\\AllocationTest::test_allocation_conserves_amount_with_tail_correction":7,"Tests\\Feature\\AllocationTest::test_allocation_follows_order_ratio":7,"Tests\\Feature\\AllocationTest::test_allocation_is_idempotent":7,"Tests\\Feature\\AllocationTest::test_allocation_rejected_without_actual_amount":8,"Tests\\Feature\\MiniAuthTest::test_login_creates_user_and_issues_token":7,"Tests\\Feature\\MiniAuthTest::test_phone_binding_matches_store":8,"Tests\\Feature\\MiniAuthTest::test_phone_no_match_stays_pending":8,"Tests\\Feature\\ExportTest::test_export_xlsx_with_encoded_chinese_filename":7,"Tests\\Feature\\CartTest::test_list_with_prices_amounts_and_totals":7,"Tests\\Feature\\CartTest::test_list_marks_off_shelf_item_unbuyable":7,"Tests\\Feature\\DebugCartListTest::test_dump_cart_list_response":5,"Tests\\Feature\\ProductCostPriceTest::test_create_product_with_cost_and_percent_pricing":7,"Tests\\Feature\\ProductCostPriceTest::test_create_percent_row_without_percent_fails":7,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_cost_only_notifies_percent_level_stores":7,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_empty_row_rejected":7,"Tests\\Feature\\MiniAuthTest::test_disabled_user_cannot_login":8,"Tests\\Feature\\MiniAuthTest::test_mini_token_cannot_access_admin_api":8,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_percent_row_update":7,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_mixed_row_updates_cost_and_level":7,"Tests\\Feature\\ReconciliationTest::test_build_creates_reconciliation_items":8,"Tests\\Feature\\ReconciliationTest::test_build_filters_by_supplier":8,"Tests\\Feature\\ReconciliationTest::test_update_item_recalculates_diff_and_header":8,"Tests\\Feature\\ReconciliationTest::test_toggle_reconciled_flag":8,"Tests\\Feature\\ReconciliationTest::test_settle_creates_settlements_per_store":8,"Tests\\Feature\\ProductCostPriceTest::test_mini_list_returns_actual_price_without_cost_price":8,"Tests\\Feature\\ProductCostPriceTest::test_mini_order_uses_actual_price_for_percent_row":8,"Tests\\Feature\\ProductCostPriceTest::test_mini_cart_uses_actual_price_for_percent_row":8,"Tests\\Feature\\StoreOrderTest::test_container_update_recalculates_amounts":8,"Tests\\Feature\\StoreOrderTest::test_container_update_allowed_in_editable_statuses":8,"Tests\\Feature\\StoreOrderTest::test_container_update_rejected_in_other_statuses":8,"Tests\\Feature\\StoreOrderTest::test_container_update_heals_legacy_product_amount":8,"Tests\\Feature\\StoreOrderTest::test_container_update_validates_negative_numbers":8,"Tests\\Feature\\StoreOrderItemTest::test_sync_item_rejected_when_product_deleted":7,"Tests\\Feature\\StoreOrderItemTest::test_order_list_search_by_product_name":8,"Tests\\Feature\\PurchaseEditTest::test_detail_returns_store_matrix":7,"Tests\\Feature\\PurchaseEditTest::test_update_cell_syncs_order_item_and_totals":7,"Tests\\Feature\\PurchaseEditTest::test_update_row_cost_syncs_all_order_items":7,"Tests\\Feature\\PurchaseEditTest::test_update_row_weight_distributed_by_quantity":7,"Tests\\Feature\\PurchaseEditTest::test_update_row_syncs_product_attributes":7,"Tests\\Feature\\PurchaseGenerateTest::test_generate_aggregates_order_items_into_header":7,"Tests\\Feature\\ExportTest::test_export_category_filters_to_vegetables":7,"Tests\\Feature\\ExportTest::test_export_pdf":7,"Tests\\Feature\\PurchaseEditTest::test_update_row_does_not_touch_manual_weight":7,"Tests\\Feature\\PurchaseEditTest::test_update_row_syncs_to_product_catalog":7,"Tests\\Feature\\PurchaseEditTest::test_update_cell_weight_cascades_totals":7,"Tests\\Feature\\PurchaseEditTest::test_cell_sync_refreshes_snapshot_and_cascades":7,"Tests\\Feature\\PurchaseEditTest::test_edits_rejected_when_purchase_completed":7,"Tests\\Feature\\StoreOrderItemTest::test_update_item_recalculates_order_totals":7,"Tests\\Feature\\StoreOrderItemTest::test_update_item_validates_negative_price":7,"Tests\\Feature\\StoreOrderItemTest::test_sync_item_updates_snapshot_from_product":7,"Tests\\Feature\\StoreOrderItemTest::test_sync_item_recalculates_percent_price_with_latest_cost":7,"Tests\\Feature\\PurchaseEditTest::test_cell_detail_returns_items_with_order_info":8,"Tests\\Feature\\ProductCategoryTest::test_create_product_with_leaf_category_ok":7,"Tests\\Feature\\BillExportTest::test_export_filters_by_root_category":8,"Tests\\Feature\\BillExportTest::test_export_requires_export_permission":8,"Tests\\Feature\\DebugPermissionTest::test_debug_permission":8,"Tests\\Feature\\BillPaymentTest::test_order_status_progresses_via_business_chain":7,"Tests\\Feature\\BillPaymentTest::test_payment_audit_reject_does_not_accumulate":7,"Tests\\Feature\\BillPaymentTest::test_payment_detail_returns_voucher_urls":8,"Tests\\Feature\\ContainerReturnTest::test_press_containers_adds_amount_and_writes_record":7,"Tests\\Feature\\ContainerReturnTest::test_return_containers_deducts_amount":7,"Tests\\Feature\\ContainerReturnTest::test_mixed_sign_containers":7,"Tests\\Feature\\ContainerReturnTest::test_zero_containers_writes_no_record":7,"Tests\\Feature\\StoreOrderTest::test_order_list_outputs_status_name_and_item_preview":7,"Tests\\Feature\\DashboardTest::test_requires_dashboard_analysis_ability":7,"Tests\\Feature\\DashboardTest::test_recon_summary_and_receivable":8,"Tests\\Feature\\DashboardDebugTest::test_debug":8,"Tests\\Feature\\StoreOrderItemTest::test_place_order_snapshots_full_product_info":8,"Tests\\Feature\\StoreOrderItemTest::test_mini_detail_hides_cost_price":8,"Tests\\Feature\\StoreOrderItemTest::test_admin_detail_shows_cost_price_and_supplier":8,"Tests\\Feature\\StoreOrderItemTest::test_update_item_rejected_when_completed_or_cancelled":8,"Tests\\Feature\\StoreOrderItemTest::test_add_store_item_uses_level_percent_price":8,"Tests\\Feature\\ExportTest::test_export_suppliers_multi_sheet":7,"Tests\\Feature\\PurchaseEditTest::test_update_row_skips_catalog_sync_when_product_deleted":7,"Tests\\Feature\\ProductImportExportTest::test_export_filters_by_category":8,"Tests\\Feature\\ProductImportExportTest::test_import_creates_products_and_auto_supplier":7,"Tests\\Feature\\ProductImportExportTest::test_import_matches_existing_supplier":7,"Tests\\Feature\\ProductImportExportTest::test_import_errors_abort_all_rows":7,"Tests\\Feature\\ProductImportExportTest::test_import_category_path_resolution":7,"Tests\\Feature\\MiniReportTest::test_report_accumulates_same_product_across_orders":7,"Tests\\Feature\\ExportTest::test_export_suppliers_split_by_market":7,"Tests\\Feature\\MiniOnlinePaymentTest::test_query_syncs_gateway_status":7,"Tests\\Feature\\MiniSpecialTest::test_cart_quantity_attached_for_store":8,"Tests\\Feature\\MiniWechatPaymentTest::test_create_wechat_payment_success":7,"Tests\\Feature\\ExportTest::test_export_lists_all_catalog_products_with_totals_row":7,"Tests\\Feature\\MiniOnlinePaymentTest::test_create_online_payment_success":7,"Tests\\Feature\\MiniMpPaymentTest::test_mp_scene_wechat_channel":8,"Tests\\Feature\\MiniMpPaymentTest::test_default_scene_remains_mini":7,"Tests\\Feature\\MiniProductTest::test_product_list_ordered_by_category_tree":7,"Tests\\Feature\\PurchaseEditTest::test_list_includes_bill_product_amount":7,"Tests\\Feature\\StoreOrderTest::test_place_order_blocked_outside_order_time_window":7,"Tests\\Feature\\StoreOrderTest::test_place_order_cross_midnight_time_window":7,"Tests\\Feature\\StoreOrderTest::test_place_order_only_cutoff_time_and_invalid_config":7},"times":{"Tests\\Feature\\ExampleTest::test_the_application_returns_a_successful_response":0.005,"Tests\\Feature\\ProductPriceTest::test_product_list_returns_price_for_store_level":0.093,"Tests\\Feature\\ProductPriceTest::test_store_without_level_is_rejected":0.007,"Tests\\Feature\\ProductPriceTest::test_batch_price_updates_and_notifies_affected_stores":0.01,"Tests\\Feature\\ProductPriceTest::test_price_matrix_structure":0.01,"Tests\\Feature\\StoreOrderTest::test_place_order_snapshots_level_price_and_recalculates":0.052,"Tests\\Feature\\StoreOrderTest::test_client_supplied_amount_is_ignored":0.055,"Tests\\Feature\\StoreOrderTest::test_product_without_level_price_rejected":0.007,"Tests\\Feature\\StoreOrderTest::test_cancel_only_pending_orders":0.061,"Tests\\Feature\\StoreOrderTest::test_summarized_order_cannot_be_cancelled":0.056,"Tests\\Feature\\StoreOrderTest::test_order_data_isolated_between_stores":0.104,"Tests\\Feature\\PurchaseGenerateTest::test_generate_aggregates_orders_by_product":0.028,"Tests\\Feature\\PurchaseGenerateTest::test_generate_writes_back_order_status":0.121,"Tests\\Feature\\PurchaseGenerateTest::test_generate_without_pending_orders_fails":0.006,"Tests\\Feature\\PurchaseGenerateTest::test_generate_is_idempotent":0.119,"Tests\\Feature\\AllocationTest::test_allocation_conserves_amount_with_tail_correction":0.076,"Tests\\Feature\\AllocationTest::test_allocation_follows_order_ratio":0.022,"Tests\\Feature\\AllocationTest::test_allocation_is_idempotent":0.028,"Tests\\Feature\\AllocationTest::test_allocation_rejected_without_actual_amount":0.021,"Tests\\Feature\\DebugGenerateTest::test_debug_generate":0.047,"Tests\\Feature\\ReconciliationTest::test_build_creates_reconciliation_items":0.019,"Tests\\Feature\\ReconciliationTest::test_build_filters_by_supplier":0.022,"Tests\\Feature\\ReconciliationTest::test_update_item_recalculates_diff_and_header":0.019,"Tests\\Feature\\ReconciliationTest::test_toggle_reconciled_flag":0.02,"Tests\\Feature\\ReconciliationTest::test_settle_creates_settlements_per_store":0.036,"Tests\\Feature\\StatementTest::test_generate_snapshots_payment_cycle":0.011,"Tests\\Feature\\StatementTest::test_statement_isolated_between_stores":0.013,"Tests\\Feature\\StatementTest::test_generate_excludes_cancelled_and_used_items":0.016,"Tests\\Feature\\MiniAuthTest::test_login_creates_user_and_issues_token":0.056,"Tests\\Feature\\MiniAuthTest::test_disabled_user_cannot_login":0.003,"Tests\\Feature\\MiniAuthTest::test_phone_binding_matches_store":0.005,"Tests\\Feature\\MiniAuthTest::test_phone_no_match_stays_pending":0.001,"Tests\\Feature\\MiniAuthTest::test_sys_token_cannot_access_mini":0.005,"Tests\\Feature\\MiniAuthTest::test_mini_token_cannot_access_admin_api":0.056,"Tests\\Feature\\ExportTest::test_export_xlsx_with_encoded_chinese_filename":0.125,"Tests\\Feature\\ExportTest::test_export_category_filters_to_vegetables":0.017,"Tests\\Feature\\ExportTest::test_export_pdf":0.015,"Tests\\Feature\\ExportTest::test_export_invalid_format_rejected":0.016,"Tests\\Feature\\ExportTest::test_export_requires_export_permission":0.072,"Tests\\Unit\\ExampleTest::test_that_true_is_true":0.001,"Tests\\Feature\\MiniAuthTest::test_login_fails_when_wechat_rejects_code":0.003,"Tests\\Feature\\CartTest::test_add_to_cart_succeeds":0.046,"Tests\\Feature\\CartTest::test_duplicate_add_merges_quantity":0.048,"Tests\\Feature\\CartTest::test_off_shelf_product_rejected":0.053,"Tests\\Feature\\CartTest::test_soft_deleted_product_rejected":0.008,"Tests\\Feature\\CartTest::test_product_without_level_price_rejected":0.006,"Tests\\Feature\\CartTest::test_unbound_user_rejected":0.006,"Tests\\Feature\\CartTest::test_store_without_level_rejected":0.087,"Tests\\Feature\\CartTest::test_list_with_prices_amounts_and_totals":0.05,"Tests\\Feature\\CartTest::test_list_marks_off_shelf_item_unbuyable":0.049,"Tests\\Feature\\CartTest::test_empty_cart_returns_empty_items":0.046,"Tests\\Feature\\CartTest::test_update_quantity":0.046,"Tests\\Feature\\CartTest::test_update_other_users_item_rejected":0.009,"Tests\\Feature\\CartTest::test_update_missing_item_rejected":0.047,"Tests\\Feature\\CartTest::test_invalid_quantity_rejected":0.047,"Tests\\Feature\\CartTest::test_delete_item":0.047,"Tests\\Feature\\CartTest::test_delete_other_users_item_rejected":0.009,"Tests\\Feature\\CartTest::test_clear_only_own_cart":0.092,"Tests\\Feature\\CartTest::test_unauthenticated_returns_401":0.002,"Tests\\Feature\\CartTest::test_cart_isolated_between_users":0.011,"Tests\\Feature\\DebugCartListTest::test_dump_cart_list_response":0.057,"Tests\\Feature\\ProductCostPriceTest::test_calc_actual_price_fixed_and_percent":0.001,"Tests\\Feature\\ProductCostPriceTest::test_calc_actual_price_edge_cases":0.001,"Tests\\Feature\\ProductCostPriceTest::test_admin_list_contains_cost_price_and_actual_price":0.009,"Tests\\Feature\\ProductCostPriceTest::test_mini_list_returns_actual_price_without_cost_price":0.05,"Tests\\Feature\\ProductCostPriceTest::test_create_product_with_cost_and_percent_pricing":0.008,"Tests\\Feature\\ProductCostPriceTest::test_create_percent_row_without_percent_fails":0.007,"Tests\\Feature\\ProductCostPriceTest::test_update_switches_fixed_to_percent":0.01,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_cost_only_notifies_percent_level_stores":0.01,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_percent_row_update":0.009,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_mixed_row_updates_cost_and_level":0.008,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_empty_row_rejected":0.013,"Tests\\Feature\\ProductCostPriceTest::test_price_matrix_includes_cost_and_percent_columns":0.007,"Tests\\Feature\\ProductCostPriceTest::test_mini_order_uses_actual_price_for_percent_row":0.007,"Tests\\Feature\\ProductCostPriceTest::test_mini_cart_uses_actual_price_for_percent_row":0.01,"Tests\\Feature\\PurchaseGenerateTest::test_generate_uses_min_actual_price_across_types":0.014,"Tests\\Feature\\ProductPriceTest::test_store_without_level_sees_products_without_price":0.053,"Tests\\Feature\\ProductPriceTest::test_unbound_user_can_browse_products_without_price_but_cannot_cart":0.009,"Tests\\Feature\\MiniAuthTest::test_login_issues_token_for_registered_user":0.01,"Tests\\Feature\\MiniAuthTest::test_login_rejects_unregistered_openid":0.002,"Tests\\Feature\\MiniAuthTest::test_register_binds_store_and_issues_token":0.009,"Tests\\Feature\\MiniAuthTest::test_register_rejects_unknown_store":0.002,"Tests\\Feature\\MiniAuthTest::test_register_rejects_duplicate_openid":0.003,"Tests\\Feature\\MiniStoreTest::test_info_returns_bound_store":0.005,"Tests\\Feature\\MiniStoreTest::test_update_info":0.052,"Tests\\Feature\\MiniStoreTest::test_update_info_ignores_readonly_fields":0.048,"Tests\\Feature\\MiniStoreTest::test_requires_bound_store":0.007,"Tests\\Feature\\MiniStoreTest::test_update_info_validates_length":0.047,"Tests\\Feature\\StoreOrderTest::test_container_update_recalculates_amounts":0.012,"Tests\\Feature\\StoreOrderTest::test_container_update_allowed_in_editable_statuses":0.022,"Tests\\Feature\\StoreOrderTest::test_container_update_rejected_in_other_statuses":0.019,"Tests\\Feature\\StoreOrderTest::test_container_update_heals_legacy_product_amount":0.02,"Tests\\Feature\\StoreOrderTest::test_container_update_validates_negative_numbers":0.014,"Tests\\Feature\\PurchaseGenerateTest::test_generate_without_accepted_orders_fails":0.058,"Tests\\Feature\\PurchaseGenerateTest::test_generate_with_selected_order_ids":0.118,"Tests\\Feature\\StoreOrderItemTest::test_place_order_snapshots_full_product_info":0.062,"Tests\\Feature\\StoreOrderItemTest::test_mini_detail_hides_cost_price":0.058,"Tests\\Feature\\StoreOrderItemTest::test_admin_detail_shows_cost_price_and_supplier":0.063,"Tests\\Feature\\StoreOrderItemTest::test_update_item_recalculates_order_totals":0.011,"Tests\\Feature\\StoreOrderItemTest::test_update_item_rejected_when_completed_or_cancelled":0.011,"Tests\\Feature\\StoreOrderItemTest::test_update_item_validates_negative_price":0.012,"Tests\\Feature\\StoreOrderItemTest::test_sync_item_updates_snapshot_from_product":0.013,"Tests\\Feature\\StoreOrderItemTest::test_sync_item_recalculates_percent_price_with_latest_cost":0.01,"Tests\\Feature\\StoreOrderItemTest::test_sync_item_rejected_when_product_deleted":0.01,"Tests\\Feature\\StoreOrderItemTest::test_order_list_search_by_product_name":0.064,"Tests\\Feature\\StoreOrderTest::test_soft_delete_only_cancelled_orders":0.07,"Tests\\Feature\\StoreOrderTest::test_soft_delete_rejected_for_non_cancelled_orders":0.302,"Tests\\Feature\\StoreOrderTest::test_soft_delete_twice_rejected":0.066,"Tests\\Feature\\PurchaseEditTest::test_detail_returns_store_matrix":0.123,"Tests\\Feature\\PurchaseEditTest::test_update_cell_syncs_order_item_and_totals":0.127,"Tests\\Feature\\PurchaseEditTest::test_update_row_cost_syncs_all_order_items":0.113,"Tests\\Feature\\PurchaseEditTest::test_update_row_weight_distributed_by_quantity":0.032,"Tests\\Feature\\PurchaseEditTest::test_update_row_requires_at_least_one_field":0.108,"Tests\\Feature\\PurchaseEditTest::test_update_cell_rejects_negative_quantity":0.121,"Tests\\Feature\\PurchaseGenerateTest::test_generate_aggregates_order_items_into_header":0.114,"Tests\\Feature\\ReconciliationTest::test_build_excludes_unfinished_orders":0.016,"Tests\\Feature\\PurchaseEditTest::test_update_row_syncs_product_attributes":0.138,"Tests\\Feature\\PurchaseEditTest::test_update_row_syncs_to_product_catalog":0.019,"Tests\\Feature\\PurchaseEditTest::test_cell_detail_returns_items_with_order_info":0.118,"Tests\\Feature\\PurchaseEditTest::test_cell_detail_rejects_missing_params":0.124,"Tests\\Feature\\PurchaseEditTest::test_update_cell_weight_cascades_totals":0.117,"Tests\\Feature\\PurchaseEditTest::test_cell_sync_refreshes_snapshot_and_cascades":0.012,"Tests\\Feature\\PurchaseEditTest::test_edits_rejected_when_purchase_completed":0.126,"Tests\\Feature\\PurchaseEditTest::test_update_row_does_not_touch_manual_weight":0.114,"Tests\\Feature\\PurchaseEditTest::test_store_summary_returns_aggregated_items":0.13,"Tests\\Feature\\PurchaseEditTest::test_store_summary_aggregates_multiple_orders_with_weighted_price":0.061,"Tests\\Feature\\PurchaseEditTest::test_store_summary_rejects_missing_or_invalid_params":0.12,"Tests\\Feature\\ExportTest::test_export_invalid_type_rejected":0.016,"Tests\\Feature\\ExportTest::test_export_missing_purchase_rejected":0.012,"Tests\\Feature\\PurchaseEditTest::test_detail_returns_container_summary":0.022,"Tests\\Feature\\PurchaseEditTest::test_update_container_syncs_order_amounts":0.018,"Tests\\Feature\\PurchaseEditTest::test_update_container_rejected_when_purchase_completed":0.018,"Tests\\Feature\\PurchaseEditTest::test_update_container_rejects_incomplete_or_foreign_orders":0.026,"Tests\\Feature\\PurchaseEditTest::test_update_container_validates_negative_and_duplicate_orders":0.018,"Tests\\Feature\\ProductCategoryTest::test_create_child_category_under_top_level":0.006,"Tests\\Feature\\ProductCategoryTest::test_create_category_under_second_level_rejected":0.01,"Tests\\Feature\\ProductCategoryTest::test_update_second_level_move_to_another_top":0.01,"Tests\\Feature\\ProductCategoryTest::test_update_parent_with_children_cannot_move_under_category":0.01,"Tests\\Feature\\ProductCategoryTest::test_update_with_missing_parent_rejected":0.007,"Tests\\Feature\\ProductCategoryTest::test_create_product_with_parent_category_rejected":0.013,"Tests\\Feature\\ProductCategoryTest::test_create_product_with_leaf_category_ok":0.015,"Tests\\Feature\\ProductCategoryTest::test_mini_categories_returns_all_enabled_categories":0.062,"Tests\\Feature\\MiniBillTest::test_bill_list_derives_pay_state_and_settlement_date":0.048,"Tests\\Feature\\MiniBillTest::test_bill_list_summary_aggregates_unpaid":0.051,"Tests\\Feature\\MiniBillTest::test_bill_list_payable_filter":0.048,"Tests\\Feature\\MiniBillTest::test_bill_list_filters_by_bill_date_range":0.06,"Tests\\Feature\\MiniBillTest::test_bill_data_isolated_between_stores":0.095,"Tests\\Feature\\MiniBillTest::test_bill_detail_outputs_bill_items_and_orders":0.061,"Tests\\Feature\\StoreOrderTest::test_order_list_outputs_status_name_and_item_preview":0.056,"Tests\\Feature\\StoreOrderTest::test_order_list_filters_by_order_date_range":0.063,"Tests\\Feature\\StoreOrderTest::test_order_list_rejects_invalid_filters":0.051,"Tests\\Feature\\BillExportTest::test_export_merges_items_across_bills":0.097,"Tests\\Feature\\BillExportTest::test_export_filters_by_root_category":0.05,"Tests\\Feature\\BillExportTest::test_export_empty_category_rejected":0.067,"Tests\\Feature\\BillExportTest::test_export_requires_export_permission":0.047,"Tests\\Feature\\BillExportTest::test_export_invalid_ids_rejected":0.009,"Tests\\Feature\\DebugPermissionTest::test_debug_permission":0.098,"Tests\\Feature\\BillExportTest::test_mini_export_scoped_to_bound_store":0.014,"Tests\\Feature\\BillExportTest::test_mini_export_requires_store_binding":0.005,"Tests\\Feature\\MiniNoticeTest::test_notice_list_includes_personal_and_broadcast":0.062,"Tests\\Feature\\MiniNoticeTest::test_broadcast_read_creates_personal_copy":0.06,"Tests\\Feature\\MiniNoticeTest::test_personal_notice_read_marks_directly":0.045,"Tests\\Feature\\MiniNoticeTest::test_other_users_notice_not_found":0.007,"Tests\\Feature\\StoreOrderTest::test_manual_status_flow_only_accept_and_cancel":0.113,"Tests\\Feature\\StoreOrderTest::test_manual_status_flow_rejects_delivery_and_completion":0.18,"Tests\\Feature\\StoreOrderTest::test_batch_status_only_accept_and_cancel":0.104,"Tests\\Feature\\BillPaymentTest::test_order_status_progresses_via_business_chain":0.057,"Tests\\Feature\\BillPaymentTest::test_manual_pay_accumulates_store_total_purchase_amount":0.066,"Tests\\Feature\\BillPaymentTest::test_payment_audit_pass_accumulates_store_total_purchase_amount":0.05,"Tests\\Feature\\BillPaymentTest::test_payment_audit_reject_does_not_accumulate":0.047,"Tests\\Feature\\MiniProductTest::test_product_detail_guest_sees_null_price":0.052,"Tests\\Feature\\MiniProductTest::test_product_detail_store_user_sees_level_price":0.006,"Tests\\Feature\\MiniProductTest::test_product_detail_percent_price_calculated_from_cost":0.051,"Tests\\Feature\\MiniProductTest::test_product_detail_off_shelf_or_missing_rejected":0.046,"Tests\\Feature\\MiniProductTest::test_product_list_store_user_sees_level_price":0.005,"Tests\\Feature\\MiniProductTest::test_product_list_guest_sees_null_price":0.044,"Tests\\Feature\\BillPaymentTest::test_admin_order_list_and_detail_show_bill_info":0.07,"Tests\\Feature\\BillPaymentTest::test_payment_detail_returns_voucher_urls":0.051,"Tests\\Feature\\StoreOrderTest::test_order_list_preview_includes_image_spec_and_unit":0.057,"Tests\\Feature\\ContainerReturnTest::test_press_containers_adds_amount_and_writes_record":0.075,"Tests\\Feature\\ContainerReturnTest::test_return_containers_deducts_amount":0.072,"Tests\\Feature\\ContainerReturnTest::test_mixed_sign_containers":0.075,"Tests\\Feature\\ContainerReturnTest::test_zero_containers_writes_no_record":0.089,"Tests\\Feature\\ContainerReturnTest::test_non_integer_containers_rejected":0.078,"Tests\\Feature\\ContainerReturnTest::test_manual_create_and_delete_routes_removed":0.009,"Tests\\Feature\\ContainerReturnTest::test_export_matrix_merges_same_day_and_zero_fills":0.105,"Tests\\Feature\\ContainerReturnTest::test_export_filters_by_selected_stores":0.139,"Tests\\Feature\\ContainerReturnTest::test_export_invalid_params_rejected":0.02,"Tests\\Feature\\ContainerReturnTest::test_export_empty_range_rejected":0.006,"Tests\\Feature\\ContainerReturnTest::test_export_requires_export_permission":0.012,"Tests\\Feature\\DashboardTest::test_guest_cannot_access_dashboard":0.004,"Tests\\Feature\\DashboardTest::test_requires_dashboard_analysis_ability":0.006,"Tests\\Feature\\DashboardTest::test_empty_database_returns_zero_structure":0.01,"Tests\\Feature\\DashboardTest::test_overview_excludes_cancelled_orders":0.05,"Tests\\Feature\\DashboardTest::test_week_growth_rate":0.056,"Tests\\Feature\\DashboardTest::test_trend_covers_30_days_with_zero_filling":0.053,"Tests\\Feature\\DashboardTest::test_category_sales_grouped_by_category":0.063,"Tests\\Feature\\DashboardTest::test_top_products_aggregated_across_orders":0.067,"Tests\\Feature\\DashboardTest::test_top_stores_ranked_by_amount":0.1,"Tests\\Feature\\DashboardTest::test_purchase_amount_prefers_actual_over_estimate":0.009,"Tests\\Feature\\DashboardTest::test_recon_summary_and_receivable":0.057,"Tests\\Feature\\DashboardTest::test_latest_orders_limited_and_ordered":0.068,"Tests\\Feature\\DashboardTest::test_archives_count_active_records_only":0.148,"Tests\\Feature\\DashboardDebugTest::test_debug_ability_check":0.044,"Tests\\Feature\\DashboardDebugTest::test_debug":0.045,"Tests\\Feature\\ProductPriceTest::test_batch_price_updates_cost_and_notifies_all_stores":0.094,"Tests\\Feature\\ProductPriceTest::test_level_percent_update_notifies_level_stores":0.135,"Tests\\Feature\\ProductPriceTest::test_level_update_without_percent_change_sends_no_notice":0.047,"Tests\\Feature\\ProductPriceTest::test_level_percent_validation":0.008,"Tests\\Feature\\ProductCostPriceTest::test_calc_level_price":0.001,"Tests\\Feature\\ProductCostPriceTest::test_calc_level_price_edge_cases":0.001,"Tests\\Feature\\ProductCostPriceTest::test_admin_list_contains_cost_price_and_level_prices":0.007,"Tests\\Feature\\ProductCostPriceTest::test_create_product_with_cost_price":0.007,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_cost_row_update":0.076,"Tests\\Feature\\ProductCostPriceTest::test_price_matrix_includes_cost_and_level_price_columns":0.01,"Tests\\Feature\\ProductCostPriceTest::test_mini_order_uses_level_price":0.049,"Tests\\Feature\\ProductCostPriceTest::test_mini_cart_uses_level_price":0.057,"Tests\\Feature\\CartTest::test_store_level_missing_rejected":0.006,"Tests\\Feature\\StoreOrderTest::test_store_level_missing_rejected":0.046,"Tests\\Feature\\PurchaseEditTest::test_update_row_skips_catalog_sync_when_product_deleted":0.116,"Tests\\Feature\\PurchaseEditTest::test_store_item_add_creates_item_and_recalculates":0.125,"Tests\\Feature\\PurchaseEditTest::test_store_item_update_merges_multi_order_rows":0.059,"Tests\\Feature\\PurchaseEditTest::test_store_item_remove_deletes_and_recalculates":0.105,"Tests\\Feature\\StoreOrderItemTest::test_update_store_item_recalculates_totals":0.063,"Tests\\Feature\\StoreOrderItemTest::test_store_item_edits_rejected_when_purchase_completed":0.077,"Tests\\Feature\\StoreOrderItemTest::test_update_store_item_validates_negative_values":0.06,"Tests\\Feature\\StoreOrderItemTest::test_add_store_item_uses_level_percent_price":0.081,"Tests\\Feature\\StoreOrderItemTest::test_add_store_item_rejected_when_product_deleted":0.071,"Tests\\Feature\\ExportTest::test_export_lists_all_catalog_products_with_totals_row":0.144,"Tests\\Feature\\ExportTest::test_export_supplier_filter":0.137,"Tests\\Feature\\ExportTest::test_export_stores_multi_sheet":0.135,"Tests\\Feature\\ExportTest::test_export_stores_single_store":0.106,"Tests\\Feature\\ExportTest::test_export_stores_without_items_rejected":0.177,"Tests\\Feature\\ExportTest::test_export_suppliers_multi_sheet":0.164,"Tests\\Feature\\ExportTest::test_export_suppliers_single":0.127,"Tests\\Feature\\ExportTest::test_export_suppliers_without_items_rejected":0.124,"Tests\\Feature\\PurchaseEditTest::test_update_row_cost_change_reprices_items_by_store_level":0.109,"Tests\\Feature\\PurchaseEditTest::test_update_row_without_cost_change_keeps_item_price":0.123,"Tests\\Feature\\CartTest::test_update_other_stores_item_rejected":0.091,"Tests\\Feature\\CartTest::test_delete_other_stores_item_rejected":0.089,"Tests\\Feature\\CartTest::test_cart_isolated_between_stores":0.121,"Tests\\Feature\\MiniAuthTest::test_login_issues_token_for_valid_credentials":0.147,"Tests\\Feature\\MiniAuthTest::test_login_rejects_wrong_password":0.154,"Tests\\Feature\\MiniAuthTest::test_login_rejects_unknown_username":0.005,"Tests\\Feature\\MiniAuthTest::test_disabled_store_cannot_login":0.151,"Tests\\Feature\\MiniAuthTest::test_login_validates_required_params":0.003,"Tests\\Feature\\MiniAuthTest::test_login_token_accesses_protected_routes":0.138,"Tests\\Feature\\MiniAuthTest::test_set_password_succeeds":0.234,"Tests\\Feature\\MiniAuthTest::test_set_password_rejects_wrong_old_password":0.144,"Tests\\Feature\\MiniAuthTest::test_set_password_validates_confirmation":0.052,"Tests\\Feature\\BillExportTest::test_mini_export_scoped_to_own_store":0.088,"Tests\\Feature\\MiniNoticeTest::test_other_stores_notice_not_found":0.094,"Tests\\Feature\\MiniProductTest::test_product_detail_store_sees_level_price":0.056,"Tests\\Feature\\MiniProductTest::test_product_list_store_sees_level_price":0.054,"Tests\\Feature\\MiniStoreTest::test_info_returns_current_store":0.069,"Tests\\Feature\\MiniStoreTest::test_disabled_store_rejected":0.049,"Tests\\Feature\\ProductImportExportTest::test_export_downloads_all_products":0.009,"Tests\\Feature\\ProductImportExportTest::test_export_filters_by_category":0.008,"Tests\\Feature\\ProductImportExportTest::test_export_template_mode":0.005,"Tests\\Feature\\ProductImportExportTest::test_export_requires_permission":0.011,"Tests\\Feature\\ProductImportExportTest::test_import_creates_products_and_auto_supplier":0.038,"Tests\\Feature\\ProductImportExportTest::test_import_matches_existing_supplier":0.016,"Tests\\Feature\\ProductImportExportTest::test_import_errors_abort_all_rows":0.016,"Tests\\Feature\\ProductImportExportTest::test_import_category_path_resolution":0.031,"Tests\\Feature\\ProductImportExportTest::test_import_rejects_invalid_header":0.015,"Tests\\Feature\\ProductImportExportTest::test_import_requires_permission":0.013,"Tests\\Feature\\ProductImportExportTest::test_list_filters_by_market":0.008,"Tests\\Feature\\MiniReportTest::test_report_aggregates_total_and_item_percent":0.049,"Tests\\Feature\\MiniReportTest::test_report_accumulates_same_product_across_orders":0.062,"Tests\\Feature\\MiniReportTest::test_report_filters_by_custom_date_range":0.056,"Tests\\Feature\\MiniReportTest::test_report_excludes_cancelled_and_deleted_orders":0.057,"Tests\\Feature\\MiniReportTest::test_report_preset_month_and_last_month":0.059,"Tests\\Feature\\MiniReportTest::test_report_preset_week_and_last_week":0.057,"Tests\\Feature\\MiniReportTest::test_report_defaults_to_current_month":0.046,"Tests\\Feature\\MiniReportTest::test_report_data_isolated_between_stores":0.106,"Tests\\Feature\\MiniReportTest::test_report_empty_period_returns_zero":0.046,"Tests\\Feature\\MiniReportTest::test_report_validates_params":0.061,"Tests\\Feature\\ProductBatchDeleteTest::test_batch_delete_soft_deletes_selected_products":0.007,"Tests\\Feature\\ProductBatchDeleteTest::test_batch_delete_requires_non_empty_ids":0.006,"Tests\\Feature\\ProductBatchDeleteTest::test_batch_delete_forbidden_without_permission":0.006,"Tests\\Feature\\CartTest::test_place_order_clears_ordered_items_from_cart":0.057,"Tests\\Feature\\StoreOrderItemTest::test_admin_order_list_filters_by_order_date_range":0.103,"Tests\\Feature\\StoreOrderItemTest::test_admin_order_list_search_by_purchase_no":0.065,"Tests\\Feature\\ExportTest::test_export_suppliers_split_by_market":0.071,"Tests\\Feature\\BillPaymentTest::test_generate_bill_saves_after_sale_and_remark":0.114,"Tests\\Feature\\ProductCostPriceTest::test_product_price_unit_default_and_editable":0.013,"Tests\\Feature\\StoreOrderTest::test_place_order_blocked_by_overdue_unpaid_bill":0.061,"Tests\\Feature\\StoreOrderTest::test_place_order_allowed_within_payment_cycle":0.065,"Tests\\Feature\\CartTest::test_cart_summary_endpoint":0.051,"Tests\\Feature\\CartTest::test_cart_summary_requires_login":0.002,"Tests\\Feature\\MiniProductTest::test_product_list_appends_cart_quantity_and_summary":0.055,"Tests\\Feature\\MiniProductTest::test_product_list_guest_sees_zero_cart_fields":0.062,"Tests\\Feature\\MiniProductTest::test_product_detail_appends_cart_quantity":0.066,"Tests\\Feature\\MiniProductTest::test_home_appends_cart_summary":0.06,"Tests\\Feature\\MiniOnlinePaymentTest::test_sign_matches_document_example":0.002,"Tests\\Feature\\MiniOnlinePaymentTest::test_create_online_payment_success":0.072,"Tests\\Feature\\MiniOnlinePaymentTest::test_create_online_payment_validation":0.112,"Tests\\Feature\\MiniOnlinePaymentTest::test_create_fails_when_code2session_fails":0.055,"Tests\\Feature\\MiniOnlinePaymentTest::test_create_gateway_failure_releases_bills":0.054,"Tests\\Feature\\MiniOnlinePaymentTest::test_notify_settles_payment":0.064,"Tests\\Feature\\MiniOnlinePaymentTest::test_notify_rejects_invalid_messages":0.054,"Tests\\Feature\\MiniOnlinePaymentTest::test_query_syncs_gateway_status":0.06,"Tests\\Feature\\MiniOnlinePaymentTest::test_query_rejects_other_store_payment":0.087,"Tests\\Feature\\MiniOnlinePaymentTest::test_offline_payment_flow_unaffected":0.072,"Tests\\Feature\\BillPaymentTest::test_generate_bill_positive_after_sale_added_to_total":0.111,"Tests\\Feature\\BillPaymentTest::test_generate_bill_rejects_non_numeric_after_sale":0.047,"Tests\\Feature\\ClientSpecialTest::test_batch_add_creates_specials":0.011,"Tests\\Feature\\ClientSpecialTest::test_batch_add_skips_existing_products":0.006,"Tests\\Feature\\ClientSpecialTest::test_batch_add_requires_non_empty_product_ids":0.006,"Tests\\Feature\\ClientSpecialTest::test_batch_add_forbidden_without_permission":0.007,"Tests\\Feature\\ClientSpecialTest::test_query_filters_by_product_name_keyword":0.008,"Tests\\Feature\\ClientSpecialTest::test_update_changes_sort_and_status":0.006,"Tests\\Feature\\ClientSpecialTest::test_delete_and_batch_delete":0.008,"Tests\\Feature\\ClientSpecialTest::test_batch_delete_requires_non_empty_ids":0.007,"Tests\\Feature\\MiniSpecialTest::test_guest_sees_specials_with_null_price":0.051,"Tests\\Feature\\MiniSpecialTest::test_store_sees_level_price":0.06,"Tests\\Feature\\MiniSpecialTest::test_disabled_special_and_off_shelf_product_excluded":0.047,"Tests\\Feature\\MiniSpecialTest::test_specials_sorted_by_sort_asc":0.115,"Tests\\Feature\\MiniSpecialTest::test_cart_quantity_attached_for_store":0.045,"Tests\\Feature\\MiniOnlinePaymentTest::test_aes_encryption_matches_demo_golden":0.001,"Tests\\Feature\\MiniOnlinePaymentTest::test_notify_envelope_round_trip":0.004,"Tests\\Feature\\MiniOnlinePaymentTest::test_swapped_key_config_fails_with_clear_message":0.004,"Tests\\Feature\\MiniWechatPaymentTest::test_create_wechat_payment_success":0.069,"Tests\\Feature\\MiniWechatPaymentTest::test_create_wechat_payment_gateway_failure_releases_bills":0.056,"Tests\\Feature\\MiniWechatPaymentTest::test_wechat_notify_settles_payment":0.055,"Tests\\Feature\\MiniWechatPaymentTest::test_wechat_notify_rejects_invalid_messages":0.098,"Tests\\Feature\\MiniWechatPaymentTest::test_wechat_notify_with_platform_cert_validates_signature":0.06,"Tests\\Feature\\MiniWechatPaymentTest::test_wechat_query_syncs_status":0.063,"Tests\\Feature\\MiniWechatPaymentTest::test_wangpu_channel_remains_default":0.058,"Tests\\Feature\\BillPaymentTest::test_payment_config_returns_pay_methods":0.048,"Tests\\Feature\\MiniMpPaymentTest::test_mp_scene_wechat_channel":0.094,"Tests\\Feature\\MiniMpPaymentTest::test_mp_scene_wangpu_channel":0.074,"Tests\\Feature\\MiniMpPaymentTest::test_mp_scene_oauth_failure":0.076,"Tests\\Feature\\MiniMpPaymentTest::test_mp_scene_requires_mp_config":0.046,"Tests\\Feature\\MiniMpPaymentTest::test_default_scene_remains_mini":0.058,"Tests\\Feature\\MiniProductTest::test_product_list_ordered_by_category_tree":0.005,"Tests\\Feature\\MiniOnlinePaymentTest::test_notify_sign_matches_doc_golden":0.001,"Tests\\Feature\\MiniOnlinePaymentTest::test_notify_verify_rejects_bad_sign":0.002,"Tests\\Feature\\ExportTest::test_export_hides_detail_columns_by_default":0.111,"Tests\\Feature\\ExportTest::test_export_scope_includes_off_shelf_but_not_deleted":0.115,"Tests\\Unit\\WeightEstimatorTest::test_weight_unit_quantity_is_weight":0.001,"Tests\\Unit\\WeightEstimatorTest::test_spec_per_unit_weight":0,"Tests\\Unit\\WeightEstimatorTest::test_unparsable_spec_fallback":0,"Tests\\Feature\\StoreOrderTest::test_place_order_prefills_reference_weight":0.055,"Tests\\Feature\\PurchaseGenerateTest::test_generate_sums_reference_weight":0.072,"Tests\\Feature\\PurchaseEditTest::test_store_item_add_defaults_reference_weight":0.1,"Tests\\Feature\\StoreOrderTest::test_place_order_blocked_outside_order_time_window":0.059,"Tests\\Feature\\StoreOrderTest::test_place_order_cross_midnight_time_window":0.06,"Tests\\Feature\\StoreOrderTest::test_place_order_only_cutoff_time_and_invalid_config":0.076,"Tests\\Feature\\PurchaseEditTest::test_item_check_toggle_persists_and_echoes_in_detail":0.12,"Tests\\Feature\\PurchaseEditTest::test_item_check_allowed_when_purchase_completed":0.132,"Tests\\Feature\\PurchaseEditTest::test_item_check_toggle_validates_purchase_and_product":0.131,"Tests\\Feature\\PurchaseEditTest::test_item_check_batch_marks_and_clears":0.131,"Tests\\Feature\\PurchaseEditTest::test_item_check_batch_validates_and_ignores_unknown_products":0.131,"Tests\\Feature\\PurchaseEditTest::test_list_includes_bill_product_amount":0.127,"Tests\\Feature\\BillPaymentTest::test_generate_bill_after_sale_marked_up_by_level":0.102,"Tests\\Feature\\BillExportTest::test_export_merges_items_within_bill":0.091,"Tests\\Feature\\BillExportTest::test_export_bill_not_found_rejected":0.007}} \ No newline at end of file +{"version":2,"defects":{"Tests\\Feature\\ProductPriceTest::test_product_list_returns_price_for_store_level":8,"Tests\\Feature\\ProductPriceTest::test_store_without_level_is_rejected":8,"Tests\\Feature\\ProductPriceTest::test_batch_price_updates_and_notifies_affected_stores":7,"Tests\\Feature\\ProductPriceTest::test_price_matrix_structure":8,"Tests\\Feature\\StoreOrderTest::test_place_order_snapshots_level_price_and_recalculates":8,"Tests\\Feature\\StoreOrderTest::test_client_supplied_amount_is_ignored":8,"Tests\\Feature\\StoreOrderTest::test_product_without_level_price_rejected":8,"Tests\\Feature\\StoreOrderTest::test_cancel_only_pending_orders":8,"Tests\\Feature\\StoreOrderTest::test_summarized_order_cannot_be_cancelled":8,"Tests\\Feature\\StoreOrderTest::test_order_data_isolated_between_stores":8,"Tests\\Feature\\PurchaseGenerateTest::test_generate_aggregates_orders_by_product":7,"Tests\\Feature\\PurchaseGenerateTest::test_generate_writes_back_order_status":7,"Tests\\Feature\\PurchaseGenerateTest::test_generate_without_pending_orders_fails":8,"Tests\\Feature\\PurchaseGenerateTest::test_generate_is_idempotent":7,"Tests\\Feature\\AllocationTest::test_allocation_conserves_amount_with_tail_correction":7,"Tests\\Feature\\AllocationTest::test_allocation_follows_order_ratio":7,"Tests\\Feature\\AllocationTest::test_allocation_is_idempotent":7,"Tests\\Feature\\AllocationTest::test_allocation_rejected_without_actual_amount":8,"Tests\\Feature\\MiniAuthTest::test_login_creates_user_and_issues_token":7,"Tests\\Feature\\MiniAuthTest::test_phone_binding_matches_store":8,"Tests\\Feature\\MiniAuthTest::test_phone_no_match_stays_pending":8,"Tests\\Feature\\ExportTest::test_export_xlsx_with_encoded_chinese_filename":7,"Tests\\Feature\\CartTest::test_list_with_prices_amounts_and_totals":7,"Tests\\Feature\\CartTest::test_list_marks_off_shelf_item_unbuyable":7,"Tests\\Feature\\DebugCartListTest::test_dump_cart_list_response":5,"Tests\\Feature\\ProductCostPriceTest::test_create_product_with_cost_and_percent_pricing":7,"Tests\\Feature\\ProductCostPriceTest::test_create_percent_row_without_percent_fails":7,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_cost_only_notifies_percent_level_stores":7,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_empty_row_rejected":7,"Tests\\Feature\\MiniAuthTest::test_disabled_user_cannot_login":8,"Tests\\Feature\\MiniAuthTest::test_mini_token_cannot_access_admin_api":8,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_percent_row_update":7,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_mixed_row_updates_cost_and_level":7,"Tests\\Feature\\ReconciliationTest::test_build_creates_reconciliation_items":8,"Tests\\Feature\\ReconciliationTest::test_build_filters_by_supplier":8,"Tests\\Feature\\ReconciliationTest::test_update_item_recalculates_diff_and_header":8,"Tests\\Feature\\ReconciliationTest::test_toggle_reconciled_flag":8,"Tests\\Feature\\ReconciliationTest::test_settle_creates_settlements_per_store":8,"Tests\\Feature\\ProductCostPriceTest::test_mini_list_returns_actual_price_without_cost_price":8,"Tests\\Feature\\ProductCostPriceTest::test_mini_order_uses_actual_price_for_percent_row":8,"Tests\\Feature\\ProductCostPriceTest::test_mini_cart_uses_actual_price_for_percent_row":8,"Tests\\Feature\\StoreOrderTest::test_container_update_recalculates_amounts":8,"Tests\\Feature\\StoreOrderTest::test_container_update_allowed_in_editable_statuses":8,"Tests\\Feature\\StoreOrderTest::test_container_update_rejected_in_other_statuses":8,"Tests\\Feature\\StoreOrderTest::test_container_update_heals_legacy_product_amount":8,"Tests\\Feature\\StoreOrderTest::test_container_update_validates_negative_numbers":8,"Tests\\Feature\\StoreOrderItemTest::test_sync_item_rejected_when_product_deleted":7,"Tests\\Feature\\StoreOrderItemTest::test_order_list_search_by_product_name":8,"Tests\\Feature\\PurchaseEditTest::test_detail_returns_store_matrix":7,"Tests\\Feature\\PurchaseEditTest::test_update_cell_syncs_order_item_and_totals":7,"Tests\\Feature\\PurchaseEditTest::test_update_row_cost_syncs_all_order_items":7,"Tests\\Feature\\PurchaseEditTest::test_update_row_weight_distributed_by_quantity":7,"Tests\\Feature\\PurchaseEditTest::test_update_row_syncs_product_attributes":7,"Tests\\Feature\\PurchaseGenerateTest::test_generate_aggregates_order_items_into_header":7,"Tests\\Feature\\ExportTest::test_export_category_filters_to_vegetables":7,"Tests\\Feature\\ExportTest::test_export_pdf":7,"Tests\\Feature\\PurchaseEditTest::test_update_row_does_not_touch_manual_weight":7,"Tests\\Feature\\PurchaseEditTest::test_update_row_syncs_to_product_catalog":7,"Tests\\Feature\\PurchaseEditTest::test_update_cell_weight_cascades_totals":7,"Tests\\Feature\\PurchaseEditTest::test_cell_sync_refreshes_snapshot_and_cascades":7,"Tests\\Feature\\PurchaseEditTest::test_edits_rejected_when_purchase_completed":7,"Tests\\Feature\\StoreOrderItemTest::test_update_item_recalculates_order_totals":7,"Tests\\Feature\\StoreOrderItemTest::test_update_item_validates_negative_price":7,"Tests\\Feature\\StoreOrderItemTest::test_sync_item_updates_snapshot_from_product":7,"Tests\\Feature\\StoreOrderItemTest::test_sync_item_recalculates_percent_price_with_latest_cost":7,"Tests\\Feature\\PurchaseEditTest::test_cell_detail_returns_items_with_order_info":8,"Tests\\Feature\\ProductCategoryTest::test_create_product_with_leaf_category_ok":7,"Tests\\Feature\\BillExportTest::test_export_filters_by_root_category":8,"Tests\\Feature\\BillExportTest::test_export_requires_export_permission":8,"Tests\\Feature\\DebugPermissionTest::test_debug_permission":8,"Tests\\Feature\\BillPaymentTest::test_order_status_progresses_via_business_chain":7,"Tests\\Feature\\BillPaymentTest::test_payment_audit_reject_does_not_accumulate":7,"Tests\\Feature\\BillPaymentTest::test_payment_detail_returns_voucher_urls":8,"Tests\\Feature\\ContainerReturnTest::test_press_containers_adds_amount_and_writes_record":7,"Tests\\Feature\\ContainerReturnTest::test_return_containers_deducts_amount":7,"Tests\\Feature\\ContainerReturnTest::test_mixed_sign_containers":7,"Tests\\Feature\\ContainerReturnTest::test_zero_containers_writes_no_record":7,"Tests\\Feature\\StoreOrderTest::test_order_list_outputs_status_name_and_item_preview":7,"Tests\\Feature\\DashboardTest::test_requires_dashboard_analysis_ability":7,"Tests\\Feature\\DashboardTest::test_recon_summary_and_receivable":8,"Tests\\Feature\\DashboardDebugTest::test_debug":8,"Tests\\Feature\\StoreOrderItemTest::test_place_order_snapshots_full_product_info":8,"Tests\\Feature\\StoreOrderItemTest::test_mini_detail_hides_cost_price":8,"Tests\\Feature\\StoreOrderItemTest::test_admin_detail_shows_cost_price_and_supplier":8,"Tests\\Feature\\StoreOrderItemTest::test_update_item_rejected_when_completed_or_cancelled":8,"Tests\\Feature\\StoreOrderItemTest::test_add_store_item_uses_level_percent_price":8,"Tests\\Feature\\ExportTest::test_export_suppliers_multi_sheet":7,"Tests\\Feature\\PurchaseEditTest::test_update_row_skips_catalog_sync_when_product_deleted":7,"Tests\\Feature\\ProductImportExportTest::test_export_filters_by_category":8,"Tests\\Feature\\ProductImportExportTest::test_import_creates_products_and_auto_supplier":7,"Tests\\Feature\\ProductImportExportTest::test_import_matches_existing_supplier":7,"Tests\\Feature\\ProductImportExportTest::test_import_errors_abort_all_rows":7,"Tests\\Feature\\ProductImportExportTest::test_import_category_path_resolution":7,"Tests\\Feature\\MiniReportTest::test_report_accumulates_same_product_across_orders":7,"Tests\\Feature\\ExportTest::test_export_suppliers_split_by_market":7,"Tests\\Feature\\MiniOnlinePaymentTest::test_query_syncs_gateway_status":7,"Tests\\Feature\\MiniSpecialTest::test_cart_quantity_attached_for_store":8,"Tests\\Feature\\MiniWechatPaymentTest::test_create_wechat_payment_success":7,"Tests\\Feature\\ExportTest::test_export_lists_all_catalog_products_with_totals_row":7,"Tests\\Feature\\MiniOnlinePaymentTest::test_create_online_payment_success":7,"Tests\\Feature\\MiniMpPaymentTest::test_mp_scene_wechat_channel":8,"Tests\\Feature\\MiniMpPaymentTest::test_default_scene_remains_mini":7,"Tests\\Feature\\MiniProductTest::test_product_list_ordered_by_category_tree":7,"Tests\\Feature\\PurchaseEditTest::test_list_includes_bill_product_amount":7,"Tests\\Feature\\StoreOrderTest::test_place_order_blocked_outside_order_time_window":7,"Tests\\Feature\\StoreOrderTest::test_place_order_cross_midnight_time_window":7,"Tests\\Feature\\StoreOrderTest::test_place_order_only_cutoff_time_and_invalid_config":7},"times":{"Tests\\Feature\\ExampleTest::test_the_application_returns_a_successful_response":0.006,"Tests\\Feature\\ProductPriceTest::test_product_list_returns_price_for_store_level":0.093,"Tests\\Feature\\ProductPriceTest::test_store_without_level_is_rejected":0.007,"Tests\\Feature\\ProductPriceTest::test_batch_price_updates_and_notifies_affected_stores":0.01,"Tests\\Feature\\ProductPriceTest::test_price_matrix_structure":0.008,"Tests\\Feature\\StoreOrderTest::test_place_order_snapshots_level_price_and_recalculates":0.051,"Tests\\Feature\\StoreOrderTest::test_client_supplied_amount_is_ignored":0.051,"Tests\\Feature\\StoreOrderTest::test_product_without_level_price_rejected":0.007,"Tests\\Feature\\StoreOrderTest::test_cancel_only_pending_orders":0.055,"Tests\\Feature\\StoreOrderTest::test_summarized_order_cannot_be_cancelled":0.054,"Tests\\Feature\\StoreOrderTest::test_order_data_isolated_between_stores":0.095,"Tests\\Feature\\PurchaseGenerateTest::test_generate_aggregates_orders_by_product":0.028,"Tests\\Feature\\PurchaseGenerateTest::test_generate_writes_back_order_status":0.107,"Tests\\Feature\\PurchaseGenerateTest::test_generate_without_pending_orders_fails":0.006,"Tests\\Feature\\PurchaseGenerateTest::test_generate_is_idempotent":0.105,"Tests\\Feature\\AllocationTest::test_allocation_conserves_amount_with_tail_correction":0.076,"Tests\\Feature\\AllocationTest::test_allocation_follows_order_ratio":0.022,"Tests\\Feature\\AllocationTest::test_allocation_is_idempotent":0.028,"Tests\\Feature\\AllocationTest::test_allocation_rejected_without_actual_amount":0.021,"Tests\\Feature\\DebugGenerateTest::test_debug_generate":0.047,"Tests\\Feature\\ReconciliationTest::test_build_creates_reconciliation_items":0.019,"Tests\\Feature\\ReconciliationTest::test_build_filters_by_supplier":0.022,"Tests\\Feature\\ReconciliationTest::test_update_item_recalculates_diff_and_header":0.019,"Tests\\Feature\\ReconciliationTest::test_toggle_reconciled_flag":0.02,"Tests\\Feature\\ReconciliationTest::test_settle_creates_settlements_per_store":0.036,"Tests\\Feature\\StatementTest::test_generate_snapshots_payment_cycle":0.011,"Tests\\Feature\\StatementTest::test_statement_isolated_between_stores":0.013,"Tests\\Feature\\StatementTest::test_generate_excludes_cancelled_and_used_items":0.016,"Tests\\Feature\\MiniAuthTest::test_login_creates_user_and_issues_token":0.056,"Tests\\Feature\\MiniAuthTest::test_disabled_user_cannot_login":0.003,"Tests\\Feature\\MiniAuthTest::test_phone_binding_matches_store":0.005,"Tests\\Feature\\MiniAuthTest::test_phone_no_match_stays_pending":0.001,"Tests\\Feature\\MiniAuthTest::test_sys_token_cannot_access_mini":0.006,"Tests\\Feature\\MiniAuthTest::test_mini_token_cannot_access_admin_api":0.049,"Tests\\Feature\\ExportTest::test_export_xlsx_with_encoded_chinese_filename":0.104,"Tests\\Feature\\ExportTest::test_export_category_filters_to_vegetables":0.017,"Tests\\Feature\\ExportTest::test_export_pdf":0.015,"Tests\\Feature\\ExportTest::test_export_invalid_format_rejected":0.016,"Tests\\Feature\\ExportTest::test_export_requires_export_permission":0.077,"Tests\\Unit\\ExampleTest::test_that_true_is_true":0.001,"Tests\\Feature\\MiniAuthTest::test_login_fails_when_wechat_rejects_code":0.003,"Tests\\Feature\\CartTest::test_add_to_cart_succeeds":0.048,"Tests\\Feature\\CartTest::test_duplicate_add_merges_quantity":0.051,"Tests\\Feature\\CartTest::test_off_shelf_product_rejected":0.05,"Tests\\Feature\\CartTest::test_soft_deleted_product_rejected":0.008,"Tests\\Feature\\CartTest::test_product_without_level_price_rejected":0.006,"Tests\\Feature\\CartTest::test_unbound_user_rejected":0.006,"Tests\\Feature\\CartTest::test_store_without_level_rejected":0.09,"Tests\\Feature\\CartTest::test_list_with_prices_amounts_and_totals":0.051,"Tests\\Feature\\CartTest::test_list_marks_off_shelf_item_unbuyable":0.051,"Tests\\Feature\\CartTest::test_empty_cart_returns_empty_items":0.046,"Tests\\Feature\\CartTest::test_update_quantity":0.05,"Tests\\Feature\\CartTest::test_update_other_users_item_rejected":0.009,"Tests\\Feature\\CartTest::test_update_missing_item_rejected":0.05,"Tests\\Feature\\CartTest::test_invalid_quantity_rejected":0.05,"Tests\\Feature\\CartTest::test_delete_item":0.049,"Tests\\Feature\\CartTest::test_delete_other_users_item_rejected":0.009,"Tests\\Feature\\CartTest::test_clear_only_own_cart":0.096,"Tests\\Feature\\CartTest::test_unauthenticated_returns_401":0.002,"Tests\\Feature\\CartTest::test_cart_isolated_between_users":0.011,"Tests\\Feature\\DebugCartListTest::test_dump_cart_list_response":0.057,"Tests\\Feature\\ProductCostPriceTest::test_calc_actual_price_fixed_and_percent":0.001,"Tests\\Feature\\ProductCostPriceTest::test_calc_actual_price_edge_cases":0.001,"Tests\\Feature\\ProductCostPriceTest::test_admin_list_contains_cost_price_and_actual_price":0.009,"Tests\\Feature\\ProductCostPriceTest::test_mini_list_returns_actual_price_without_cost_price":0.046,"Tests\\Feature\\ProductCostPriceTest::test_create_product_with_cost_and_percent_pricing":0.008,"Tests\\Feature\\ProductCostPriceTest::test_create_percent_row_without_percent_fails":0.007,"Tests\\Feature\\ProductCostPriceTest::test_update_switches_fixed_to_percent":0.01,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_cost_only_notifies_percent_level_stores":0.01,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_percent_row_update":0.009,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_mixed_row_updates_cost_and_level":0.008,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_empty_row_rejected":0.008,"Tests\\Feature\\ProductCostPriceTest::test_price_matrix_includes_cost_and_percent_columns":0.007,"Tests\\Feature\\ProductCostPriceTest::test_mini_order_uses_actual_price_for_percent_row":0.007,"Tests\\Feature\\ProductCostPriceTest::test_mini_cart_uses_actual_price_for_percent_row":0.01,"Tests\\Feature\\PurchaseGenerateTest::test_generate_uses_min_actual_price_across_types":0.014,"Tests\\Feature\\ProductPriceTest::test_store_without_level_sees_products_without_price":0.048,"Tests\\Feature\\ProductPriceTest::test_unbound_user_can_browse_products_without_price_but_cannot_cart":0.009,"Tests\\Feature\\MiniAuthTest::test_login_issues_token_for_registered_user":0.01,"Tests\\Feature\\MiniAuthTest::test_login_rejects_unregistered_openid":0.002,"Tests\\Feature\\MiniAuthTest::test_register_binds_store_and_issues_token":0.009,"Tests\\Feature\\MiniAuthTest::test_register_rejects_unknown_store":0.002,"Tests\\Feature\\MiniAuthTest::test_register_rejects_duplicate_openid":0.003,"Tests\\Feature\\MiniStoreTest::test_info_returns_bound_store":0.005,"Tests\\Feature\\MiniStoreTest::test_update_info":0.046,"Tests\\Feature\\MiniStoreTest::test_update_info_ignores_readonly_fields":0.046,"Tests\\Feature\\MiniStoreTest::test_requires_bound_store":0.007,"Tests\\Feature\\MiniStoreTest::test_update_info_validates_length":0.046,"Tests\\Feature\\StoreOrderTest::test_container_update_recalculates_amounts":0.012,"Tests\\Feature\\StoreOrderTest::test_container_update_allowed_in_editable_statuses":0.022,"Tests\\Feature\\StoreOrderTest::test_container_update_rejected_in_other_statuses":0.019,"Tests\\Feature\\StoreOrderTest::test_container_update_heals_legacy_product_amount":0.02,"Tests\\Feature\\StoreOrderTest::test_container_update_validates_negative_numbers":0.014,"Tests\\Feature\\PurchaseGenerateTest::test_generate_without_accepted_orders_fails":0.056,"Tests\\Feature\\PurchaseGenerateTest::test_generate_with_selected_order_ids":0.106,"Tests\\Feature\\StoreOrderItemTest::test_place_order_snapshots_full_product_info":0.05,"Tests\\Feature\\StoreOrderItemTest::test_mini_detail_hides_cost_price":0.053,"Tests\\Feature\\StoreOrderItemTest::test_admin_detail_shows_cost_price_and_supplier":0.055,"Tests\\Feature\\StoreOrderItemTest::test_update_item_recalculates_order_totals":0.011,"Tests\\Feature\\StoreOrderItemTest::test_update_item_rejected_when_completed_or_cancelled":0.011,"Tests\\Feature\\StoreOrderItemTest::test_update_item_validates_negative_price":0.012,"Tests\\Feature\\StoreOrderItemTest::test_sync_item_updates_snapshot_from_product":0.013,"Tests\\Feature\\StoreOrderItemTest::test_sync_item_recalculates_percent_price_with_latest_cost":0.01,"Tests\\Feature\\StoreOrderItemTest::test_sync_item_rejected_when_product_deleted":0.01,"Tests\\Feature\\StoreOrderItemTest::test_order_list_search_by_product_name":0.06,"Tests\\Feature\\StoreOrderTest::test_soft_delete_only_cancelled_orders":0.065,"Tests\\Feature\\StoreOrderTest::test_soft_delete_rejected_for_non_cancelled_orders":0.257,"Tests\\Feature\\StoreOrderTest::test_soft_delete_twice_rejected":0.055,"Tests\\Feature\\PurchaseEditTest::test_detail_returns_store_matrix":0.109,"Tests\\Feature\\PurchaseEditTest::test_update_cell_syncs_order_item_and_totals":0.116,"Tests\\Feature\\PurchaseEditTest::test_update_row_cost_syncs_all_order_items":0.188,"Tests\\Feature\\PurchaseEditTest::test_update_row_weight_distributed_by_quantity":0.032,"Tests\\Feature\\PurchaseEditTest::test_update_row_requires_at_least_one_field":0.107,"Tests\\Feature\\PurchaseEditTest::test_update_cell_rejects_negative_quantity":0.109,"Tests\\Feature\\PurchaseGenerateTest::test_generate_aggregates_order_items_into_header":0.104,"Tests\\Feature\\ReconciliationTest::test_build_excludes_unfinished_orders":0.016,"Tests\\Feature\\PurchaseEditTest::test_update_row_syncs_product_attributes":0.117,"Tests\\Feature\\PurchaseEditTest::test_update_row_syncs_to_product_catalog":0.019,"Tests\\Feature\\PurchaseEditTest::test_cell_detail_returns_items_with_order_info":0.108,"Tests\\Feature\\PurchaseEditTest::test_cell_detail_rejects_missing_params":0.102,"Tests\\Feature\\PurchaseEditTest::test_update_cell_weight_cascades_totals":0.105,"Tests\\Feature\\PurchaseEditTest::test_cell_sync_refreshes_snapshot_and_cascades":0.012,"Tests\\Feature\\PurchaseEditTest::test_edits_rejected_when_purchase_completed":0.113,"Tests\\Feature\\PurchaseEditTest::test_update_row_does_not_touch_manual_weight":0.127,"Tests\\Feature\\PurchaseEditTest::test_store_summary_returns_aggregated_items":0.109,"Tests\\Feature\\PurchaseEditTest::test_store_summary_aggregates_multiple_orders_with_weighted_price":0.065,"Tests\\Feature\\PurchaseEditTest::test_store_summary_rejects_missing_or_invalid_params":0.105,"Tests\\Feature\\ExportTest::test_export_invalid_type_rejected":0.016,"Tests\\Feature\\ExportTest::test_export_missing_purchase_rejected":0.008,"Tests\\Feature\\PurchaseEditTest::test_detail_returns_container_summary":0.022,"Tests\\Feature\\PurchaseEditTest::test_update_container_syncs_order_amounts":0.018,"Tests\\Feature\\PurchaseEditTest::test_update_container_rejected_when_purchase_completed":0.018,"Tests\\Feature\\PurchaseEditTest::test_update_container_rejects_incomplete_or_foreign_orders":0.026,"Tests\\Feature\\PurchaseEditTest::test_update_container_validates_negative_and_duplicate_orders":0.018,"Tests\\Feature\\ProductCategoryTest::test_create_child_category_under_top_level":0.007,"Tests\\Feature\\ProductCategoryTest::test_create_category_under_second_level_rejected":0.008,"Tests\\Feature\\ProductCategoryTest::test_update_second_level_move_to_another_top":0.01,"Tests\\Feature\\ProductCategoryTest::test_update_parent_with_children_cannot_move_under_category":0.008,"Tests\\Feature\\ProductCategoryTest::test_update_with_missing_parent_rejected":0.007,"Tests\\Feature\\ProductCategoryTest::test_create_product_with_parent_category_rejected":0.008,"Tests\\Feature\\ProductCategoryTest::test_create_product_with_leaf_category_ok":0.008,"Tests\\Feature\\ProductCategoryTest::test_mini_categories_returns_all_enabled_categories":0.045,"Tests\\Feature\\MiniBillTest::test_bill_list_derives_pay_state_and_settlement_date":0.048,"Tests\\Feature\\MiniBillTest::test_bill_list_summary_aggregates_unpaid":0.048,"Tests\\Feature\\MiniBillTest::test_bill_list_payable_filter":0.048,"Tests\\Feature\\MiniBillTest::test_bill_list_filters_by_bill_date_range":0.053,"Tests\\Feature\\MiniBillTest::test_bill_data_isolated_between_stores":0.09,"Tests\\Feature\\MiniBillTest::test_bill_detail_outputs_bill_items_and_orders":0.049,"Tests\\Feature\\StoreOrderTest::test_order_list_outputs_status_name_and_item_preview":0.055,"Tests\\Feature\\StoreOrderTest::test_order_list_filters_by_order_date_range":0.062,"Tests\\Feature\\StoreOrderTest::test_order_list_rejects_invalid_filters":0.05,"Tests\\Feature\\BillExportTest::test_export_merges_items_across_bills":0.097,"Tests\\Feature\\BillExportTest::test_export_filters_by_root_category":0.054,"Tests\\Feature\\BillExportTest::test_export_empty_category_rejected":0.073,"Tests\\Feature\\BillExportTest::test_export_requires_export_permission":0.05,"Tests\\Feature\\BillExportTest::test_export_invalid_ids_rejected":0.009,"Tests\\Feature\\DebugPermissionTest::test_debug_permission":0.098,"Tests\\Feature\\BillExportTest::test_mini_export_scoped_to_bound_store":0.014,"Tests\\Feature\\BillExportTest::test_mini_export_requires_store_binding":0.005,"Tests\\Feature\\MiniNoticeTest::test_notice_list_includes_personal_and_broadcast":0.047,"Tests\\Feature\\MiniNoticeTest::test_broadcast_read_creates_personal_copy":0.049,"Tests\\Feature\\MiniNoticeTest::test_personal_notice_read_marks_directly":0.047,"Tests\\Feature\\MiniNoticeTest::test_other_users_notice_not_found":0.007,"Tests\\Feature\\StoreOrderTest::test_manual_status_flow_only_accept_and_cancel":0.105,"Tests\\Feature\\StoreOrderTest::test_manual_status_flow_rejects_delivery_and_completion":0.159,"Tests\\Feature\\StoreOrderTest::test_batch_status_only_accept_and_cancel":0.106,"Tests\\Feature\\BillPaymentTest::test_order_status_progresses_via_business_chain":0.061,"Tests\\Feature\\BillPaymentTest::test_manual_pay_accumulates_store_total_purchase_amount":0.072,"Tests\\Feature\\BillPaymentTest::test_payment_audit_pass_accumulates_store_total_purchase_amount":0.054,"Tests\\Feature\\BillPaymentTest::test_payment_audit_reject_does_not_accumulate":0.051,"Tests\\Feature\\MiniProductTest::test_product_detail_guest_sees_null_price":0.048,"Tests\\Feature\\MiniProductTest::test_product_detail_store_user_sees_level_price":0.006,"Tests\\Feature\\MiniProductTest::test_product_detail_percent_price_calculated_from_cost":0.046,"Tests\\Feature\\MiniProductTest::test_product_detail_off_shelf_or_missing_rejected":0.048,"Tests\\Feature\\MiniProductTest::test_product_list_store_user_sees_level_price":0.005,"Tests\\Feature\\MiniProductTest::test_product_list_guest_sees_null_price":0.046,"Tests\\Feature\\BillPaymentTest::test_admin_order_list_and_detail_show_bill_info":0.078,"Tests\\Feature\\BillPaymentTest::test_payment_detail_returns_voucher_urls":0.055,"Tests\\Feature\\StoreOrderTest::test_order_list_preview_includes_image_spec_and_unit":0.052,"Tests\\Feature\\ContainerReturnTest::test_press_containers_adds_amount_and_writes_record":0.063,"Tests\\Feature\\ContainerReturnTest::test_return_containers_deducts_amount":0.064,"Tests\\Feature\\ContainerReturnTest::test_mixed_sign_containers":0.067,"Tests\\Feature\\ContainerReturnTest::test_zero_containers_writes_no_record":0.065,"Tests\\Feature\\ContainerReturnTest::test_non_integer_containers_rejected":0.053,"Tests\\Feature\\ContainerReturnTest::test_manual_create_and_delete_routes_removed":0.008,"Tests\\Feature\\ContainerReturnTest::test_export_matrix_merges_same_day_and_zero_fills":0.092,"Tests\\Feature\\ContainerReturnTest::test_export_filters_by_selected_stores":0.131,"Tests\\Feature\\ContainerReturnTest::test_export_invalid_params_rejected":0.011,"Tests\\Feature\\ContainerReturnTest::test_export_empty_range_rejected":0.007,"Tests\\Feature\\ContainerReturnTest::test_export_requires_export_permission":0.01,"Tests\\Feature\\DashboardTest::test_guest_cannot_access_dashboard":0.003,"Tests\\Feature\\DashboardTest::test_requires_dashboard_analysis_ability":0.008,"Tests\\Feature\\DashboardTest::test_empty_database_returns_zero_structure":0.011,"Tests\\Feature\\DashboardTest::test_overview_excludes_cancelled_orders":0.052,"Tests\\Feature\\DashboardTest::test_week_growth_rate":0.055,"Tests\\Feature\\DashboardTest::test_trend_covers_30_days_with_zero_filling":0.054,"Tests\\Feature\\DashboardTest::test_category_sales_grouped_by_category":0.054,"Tests\\Feature\\DashboardTest::test_top_products_aggregated_across_orders":0.055,"Tests\\Feature\\DashboardTest::test_top_stores_ranked_by_amount":0.096,"Tests\\Feature\\DashboardTest::test_purchase_amount_prefers_actual_over_estimate":0.011,"Tests\\Feature\\DashboardTest::test_recon_summary_and_receivable":0.053,"Tests\\Feature\\DashboardTest::test_latest_orders_limited_and_ordered":0.054,"Tests\\Feature\\DashboardTest::test_archives_count_active_records_only":0.136,"Tests\\Feature\\DashboardDebugTest::test_debug_ability_check":0.044,"Tests\\Feature\\DashboardDebugTest::test_debug":0.045,"Tests\\Feature\\ProductPriceTest::test_batch_price_updates_cost_and_notifies_all_stores":0.091,"Tests\\Feature\\ProductPriceTest::test_level_percent_update_notifies_level_stores":0.091,"Tests\\Feature\\ProductPriceTest::test_level_update_without_percent_change_sends_no_notice":0.051,"Tests\\Feature\\ProductPriceTest::test_level_percent_validation":0.01,"Tests\\Feature\\ProductCostPriceTest::test_calc_level_price":0.001,"Tests\\Feature\\ProductCostPriceTest::test_calc_level_price_edge_cases":0.001,"Tests\\Feature\\ProductCostPriceTest::test_admin_list_contains_cost_price_and_level_prices":0.008,"Tests\\Feature\\ProductCostPriceTest::test_create_product_with_cost_price":0.008,"Tests\\Feature\\ProductCostPriceTest::test_batch_price_cost_row_update":0.052,"Tests\\Feature\\ProductCostPriceTest::test_price_matrix_includes_cost_and_level_price_columns":0.015,"Tests\\Feature\\ProductCostPriceTest::test_mini_order_uses_level_price":0.052,"Tests\\Feature\\ProductCostPriceTest::test_mini_cart_uses_level_price":0.049,"Tests\\Feature\\CartTest::test_store_level_missing_rejected":0.006,"Tests\\Feature\\StoreOrderTest::test_store_level_missing_rejected":0.049,"Tests\\Feature\\PurchaseEditTest::test_update_row_skips_catalog_sync_when_product_deleted":0.109,"Tests\\Feature\\PurchaseEditTest::test_store_item_add_creates_item_and_recalculates":0.109,"Tests\\Feature\\PurchaseEditTest::test_store_item_update_merges_multi_order_rows":0.062,"Tests\\Feature\\PurchaseEditTest::test_store_item_remove_deletes_and_recalculates":0.104,"Tests\\Feature\\StoreOrderItemTest::test_update_store_item_recalculates_totals":0.062,"Tests\\Feature\\StoreOrderItemTest::test_store_item_edits_rejected_when_purchase_completed":0.064,"Tests\\Feature\\StoreOrderItemTest::test_update_store_item_validates_negative_values":0.064,"Tests\\Feature\\StoreOrderItemTest::test_add_store_item_uses_level_percent_price":0.062,"Tests\\Feature\\StoreOrderItemTest::test_add_store_item_rejected_when_product_deleted":0.06,"Tests\\Feature\\ExportTest::test_export_lists_all_catalog_products_with_totals_row":0.113,"Tests\\Feature\\ExportTest::test_export_supplier_filter":0.106,"Tests\\Feature\\ExportTest::test_export_stores_multi_sheet":0.111,"Tests\\Feature\\ExportTest::test_export_stores_single_store":0.105,"Tests\\Feature\\ExportTest::test_export_stores_without_items_rejected":0.149,"Tests\\Feature\\ExportTest::test_export_suppliers_multi_sheet":0.111,"Tests\\Feature\\ExportTest::test_export_suppliers_single":0.105,"Tests\\Feature\\ExportTest::test_export_suppliers_without_items_rejected":0.117,"Tests\\Feature\\PurchaseEditTest::test_update_row_cost_change_reprices_items_by_store_level":0.107,"Tests\\Feature\\PurchaseEditTest::test_update_row_without_cost_change_keeps_item_price":0.109,"Tests\\Feature\\CartTest::test_update_other_stores_item_rejected":0.093,"Tests\\Feature\\CartTest::test_delete_other_stores_item_rejected":0.092,"Tests\\Feature\\CartTest::test_cart_isolated_between_stores":0.091,"Tests\\Feature\\MiniAuthTest::test_login_issues_token_for_valid_credentials":0.131,"Tests\\Feature\\MiniAuthTest::test_login_rejects_wrong_password":0.124,"Tests\\Feature\\MiniAuthTest::test_login_rejects_unknown_username":0.007,"Tests\\Feature\\MiniAuthTest::test_disabled_store_cannot_login":0.155,"Tests\\Feature\\MiniAuthTest::test_login_validates_required_params":0.005,"Tests\\Feature\\MiniAuthTest::test_login_token_accesses_protected_routes":0.177,"Tests\\Feature\\MiniAuthTest::test_set_password_succeeds":0.212,"Tests\\Feature\\MiniAuthTest::test_set_password_rejects_wrong_old_password":0.128,"Tests\\Feature\\MiniAuthTest::test_set_password_validates_confirmation":0.046,"Tests\\Feature\\BillExportTest::test_mini_export_scoped_to_own_store":0.093,"Tests\\Feature\\MiniNoticeTest::test_other_stores_notice_not_found":0.088,"Tests\\Feature\\MiniProductTest::test_product_detail_store_sees_level_price":0.047,"Tests\\Feature\\MiniProductTest::test_product_list_store_sees_level_price":0.047,"Tests\\Feature\\MiniStoreTest::test_info_returns_current_store":0.045,"Tests\\Feature\\MiniStoreTest::test_disabled_store_rejected":0.051,"Tests\\Feature\\ProductImportExportTest::test_export_downloads_all_products":0.01,"Tests\\Feature\\ProductImportExportTest::test_export_filters_by_category":0.009,"Tests\\Feature\\ProductImportExportTest::test_export_template_mode":0.006,"Tests\\Feature\\ProductImportExportTest::test_export_requires_permission":0.007,"Tests\\Feature\\ProductImportExportTest::test_import_creates_products_and_auto_supplier":0.035,"Tests\\Feature\\ProductImportExportTest::test_import_matches_existing_supplier":0.022,"Tests\\Feature\\ProductImportExportTest::test_import_errors_abort_all_rows":0.022,"Tests\\Feature\\ProductImportExportTest::test_import_category_path_resolution":0.047,"Tests\\Feature\\ProductImportExportTest::test_import_rejects_invalid_header":0.018,"Tests\\Feature\\ProductImportExportTest::test_import_requires_permission":0.012,"Tests\\Feature\\ProductImportExportTest::test_list_filters_by_market":0.008,"Tests\\Feature\\MiniReportTest::test_report_aggregates_total_and_item_percent":0.048,"Tests\\Feature\\MiniReportTest::test_report_accumulates_same_product_across_orders":0.048,"Tests\\Feature\\MiniReportTest::test_report_filters_by_custom_date_range":0.048,"Tests\\Feature\\MiniReportTest::test_report_excludes_cancelled_and_deleted_orders":0.05,"Tests\\Feature\\MiniReportTest::test_report_preset_month_and_last_month":0.05,"Tests\\Feature\\MiniReportTest::test_report_preset_week_and_last_week":0.051,"Tests\\Feature\\MiniReportTest::test_report_defaults_to_current_month":0.048,"Tests\\Feature\\MiniReportTest::test_report_data_isolated_between_stores":0.087,"Tests\\Feature\\MiniReportTest::test_report_empty_period_returns_zero":0.046,"Tests\\Feature\\MiniReportTest::test_report_validates_params":0.05,"Tests\\Feature\\ProductBatchDeleteTest::test_batch_delete_soft_deletes_selected_products":0.008,"Tests\\Feature\\ProductBatchDeleteTest::test_batch_delete_requires_non_empty_ids":0.008,"Tests\\Feature\\ProductBatchDeleteTest::test_batch_delete_forbidden_without_permission":0.008,"Tests\\Feature\\CartTest::test_place_order_clears_ordered_items_from_cart":0.062,"Tests\\Feature\\StoreOrderItemTest::test_admin_order_list_filters_by_order_date_range":0.067,"Tests\\Feature\\StoreOrderItemTest::test_admin_order_list_search_by_purchase_no":0.067,"Tests\\Feature\\ExportTest::test_export_suppliers_split_by_market":0.06,"Tests\\Feature\\BillPaymentTest::test_generate_bill_saves_after_sale_and_remark":0.123,"Tests\\Feature\\ProductCostPriceTest::test_product_price_unit_default_and_editable":0.017,"Tests\\Feature\\StoreOrderTest::test_place_order_blocked_by_overdue_unpaid_bill":0.058,"Tests\\Feature\\StoreOrderTest::test_place_order_allowed_within_payment_cycle":0.065,"Tests\\Feature\\CartTest::test_cart_summary_endpoint":0.055,"Tests\\Feature\\CartTest::test_cart_summary_requires_login":0.002,"Tests\\Feature\\MiniProductTest::test_product_list_appends_cart_quantity_and_summary":0.055,"Tests\\Feature\\MiniProductTest::test_product_list_guest_sees_zero_cart_fields":0.047,"Tests\\Feature\\MiniProductTest::test_product_detail_appends_cart_quantity":0.049,"Tests\\Feature\\MiniProductTest::test_home_appends_cart_summary":0.051,"Tests\\Feature\\MiniOnlinePaymentTest::test_sign_matches_document_example":0.002,"Tests\\Feature\\MiniOnlinePaymentTest::test_create_online_payment_success":0.058,"Tests\\Feature\\MiniOnlinePaymentTest::test_create_online_payment_validation":0.1,"Tests\\Feature\\MiniOnlinePaymentTest::test_create_fails_when_code2session_fails":0.051,"Tests\\Feature\\MiniOnlinePaymentTest::test_create_gateway_failure_releases_bills":0.054,"Tests\\Feature\\MiniOnlinePaymentTest::test_notify_settles_payment":0.051,"Tests\\Feature\\MiniOnlinePaymentTest::test_notify_rejects_invalid_messages":0.052,"Tests\\Feature\\MiniOnlinePaymentTest::test_query_syncs_gateway_status":0.063,"Tests\\Feature\\MiniOnlinePaymentTest::test_query_rejects_other_store_payment":0.088,"Tests\\Feature\\MiniOnlinePaymentTest::test_offline_payment_flow_unaffected":0.047,"Tests\\Feature\\BillPaymentTest::test_generate_bill_positive_after_sale_added_to_total":0.122,"Tests\\Feature\\BillPaymentTest::test_generate_bill_rejects_non_numeric_after_sale":0.051,"Tests\\Feature\\ClientSpecialTest::test_batch_add_creates_specials":0.009,"Tests\\Feature\\ClientSpecialTest::test_batch_add_skips_existing_products":0.008,"Tests\\Feature\\ClientSpecialTest::test_batch_add_requires_non_empty_product_ids":0.007,"Tests\\Feature\\ClientSpecialTest::test_batch_add_forbidden_without_permission":0.008,"Tests\\Feature\\ClientSpecialTest::test_query_filters_by_product_name_keyword":0.009,"Tests\\Feature\\ClientSpecialTest::test_update_changes_sort_and_status":0.008,"Tests\\Feature\\ClientSpecialTest::test_delete_and_batch_delete":0.01,"Tests\\Feature\\ClientSpecialTest::test_batch_delete_requires_non_empty_ids":0.008,"Tests\\Feature\\MiniSpecialTest::test_guest_sees_specials_with_null_price":0.045,"Tests\\Feature\\MiniSpecialTest::test_store_sees_level_price":0.047,"Tests\\Feature\\MiniSpecialTest::test_disabled_special_and_off_shelf_product_excluded":0.046,"Tests\\Feature\\MiniSpecialTest::test_specials_sorted_by_sort_asc":0.087,"Tests\\Feature\\MiniSpecialTest::test_cart_quantity_attached_for_store":0.047,"Tests\\Feature\\MiniOnlinePaymentTest::test_aes_encryption_matches_demo_golden":0.001,"Tests\\Feature\\MiniOnlinePaymentTest::test_notify_envelope_round_trip":0.004,"Tests\\Feature\\MiniOnlinePaymentTest::test_swapped_key_config_fails_with_clear_message":0.004,"Tests\\Feature\\MiniWechatPaymentTest::test_create_wechat_payment_success":0.055,"Tests\\Feature\\MiniWechatPaymentTest::test_create_wechat_payment_gateway_failure_releases_bills":0.055,"Tests\\Feature\\MiniWechatPaymentTest::test_wechat_notify_settles_payment":0.061,"Tests\\Feature\\MiniWechatPaymentTest::test_wechat_notify_rejects_invalid_messages":0.055,"Tests\\Feature\\MiniWechatPaymentTest::test_wechat_notify_with_platform_cert_validates_signature":0.053,"Tests\\Feature\\MiniWechatPaymentTest::test_wechat_query_syncs_status":0.061,"Tests\\Feature\\MiniWechatPaymentTest::test_wangpu_channel_remains_default":0.051,"Tests\\Feature\\BillPaymentTest::test_payment_config_returns_pay_methods":0.049,"Tests\\Feature\\MiniMpPaymentTest::test_mp_scene_wechat_channel":0.082,"Tests\\Feature\\MiniMpPaymentTest::test_mp_scene_wangpu_channel":0.063,"Tests\\Feature\\MiniMpPaymentTest::test_mp_scene_oauth_failure":0.049,"Tests\\Feature\\MiniMpPaymentTest::test_mp_scene_requires_mp_config":0.048,"Tests\\Feature\\MiniMpPaymentTest::test_default_scene_remains_mini":0.055,"Tests\\Feature\\MiniProductTest::test_product_list_ordered_by_category_tree":0.006,"Tests\\Feature\\MiniOnlinePaymentTest::test_notify_sign_matches_doc_golden":0.002,"Tests\\Feature\\MiniOnlinePaymentTest::test_notify_verify_rejects_bad_sign":0.002,"Tests\\Feature\\ExportTest::test_export_hides_detail_columns_by_default":0.171,"Tests\\Feature\\ExportTest::test_export_scope_includes_off_shelf_but_not_deleted":0.102,"Tests\\Unit\\WeightEstimatorTest::test_weight_unit_quantity_is_weight":0.001,"Tests\\Unit\\WeightEstimatorTest::test_spec_per_unit_weight":0.001,"Tests\\Unit\\WeightEstimatorTest::test_unparsable_spec_fallback":0.001,"Tests\\Feature\\StoreOrderTest::test_place_order_prefills_reference_weight":0.052,"Tests\\Feature\\PurchaseGenerateTest::test_generate_sums_reference_weight":0.06,"Tests\\Feature\\PurchaseEditTest::test_store_item_add_defaults_reference_weight":0.108,"Tests\\Feature\\StoreOrderTest::test_place_order_blocked_outside_order_time_window":0.11,"Tests\\Feature\\StoreOrderTest::test_place_order_cross_midnight_time_window":0.055,"Tests\\Feature\\StoreOrderTest::test_place_order_only_cutoff_time_and_invalid_config":0.054,"Tests\\Feature\\PurchaseEditTest::test_item_check_toggle_persists_and_echoes_in_detail":0.116,"Tests\\Feature\\PurchaseEditTest::test_item_check_allowed_when_purchase_completed":0.103,"Tests\\Feature\\PurchaseEditTest::test_item_check_toggle_validates_purchase_and_product":0.105,"Tests\\Feature\\PurchaseEditTest::test_item_check_batch_marks_and_clears":0.116,"Tests\\Feature\\PurchaseEditTest::test_item_check_batch_validates_and_ignores_unknown_products":0.106,"Tests\\Feature\\PurchaseEditTest::test_list_includes_bill_product_amount":0.116,"Tests\\Feature\\BillPaymentTest::test_generate_bill_after_sale_marked_up_by_level":0.107,"Tests\\Feature\\BillExportTest::test_export_merges_items_within_bill":0.111,"Tests\\Feature\\BillExportTest::test_export_bill_not_found_rejected":0.007}} \ No newline at end of file diff --git a/app/Exports/BillExport.php b/app/Exports/BillExport.php index f0f43ad..c467be9 100644 --- a/app/Exports/BillExport.php +++ b/app/Exports/BillExport.php @@ -17,7 +17,7 @@ use PhpOffice\PhpSpreadsheet\Style\Fill; use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet; /** - * 门店账单单独导出:账单内明细按商品合并(可按一级分类过滤), + * 门店账单单独导出:账单内明细按商品合并(可按一级分类过滤),明细行展示商品一级分类, * 表尾汇总商品金额/配送费/附加金额/售后金额/总金额 */ class BillExport implements FromCollection, WithStyles @@ -36,10 +36,10 @@ class BillExport implements FromCollection, WithStyles /** @var array 特殊行索引(1 起)=> 类型(title/scope/header/summary/grand) */ private array $specialRows = []; - /** @var array 标签需左合并 A:F 的合计行索引 */ + /** @var array 标签需左合并 A:G 的合计行索引 */ private array $mergeRows = []; - /** @var array 条件填色单元格(E=数量浅黄,G=金额浅红,非 0 填色) */ + /** @var array 条件填色单元格(F=数量浅黄,H=金额浅红,非 0 填色) */ private array $fillCells = []; /** 列头所在行索引 */ @@ -69,9 +69,12 @@ class BillExport implements FromCollection, WithStyles $items = app(BillDetailService::class)->mergedItems($this->bill); + // 商品 => 一级分类解析(明细行「一级分类」列与分类过滤共用同一份结果) + [$categories, $rootIds] = $this->resolveRootCategories($items); + $categoryName = '全部'; if ($this->categoryId > 0) { - [$items, $categoryName] = $this->filterByRootCategory($items); + [$items, $categoryName] = $this->filterByRootCategory($items, $categories, $rootIds); } $bill = $this->bill; @@ -96,8 +99,8 @@ class BillExport implements FromCollection, WithStyles $rows[] = ['']; $rowIndex++; - // 列头(包规=包规+单位合并;单价=每件零售价+单价单位) - $rows[] = ['序号', '品名', '包规', '单价', '数量', '重量(斤)', '金额']; + // 列头(包规=包规+单位合并;单价=每件零售价+单价单位;一级分类=商品根分类名) + $rows[] = ['序号', '品名', '一级分类', '包规', '单价', '数量', '重量(斤)', '金额']; $this->specialRows[++$rowIndex] = 'header'; $this->headerRow = $rowIndex; @@ -109,6 +112,7 @@ class BillExport implements FromCollection, WithStyles $rows[] = [ $sort + 1, $item['product_name'], + $categories->get($rootIds[$item['product_id']] ?? 0)?->name ?? '', $item['product_spec'] . $item['unit'], self::retailPriceLabel($item), (int) $item['quantity'], @@ -116,18 +120,18 @@ class BillExport implements FromCollection, WithStyles (float) $item['amount'], ]; $rowIndex++; - $this->fillCells[] = ['row' => $rowIndex, 'column' => 'E', 'value' => (float) $item['quantity']]; - $this->fillCells[] = ['row' => $rowIndex, 'column' => 'G', 'value' => (float) $item['amount']]; + $this->fillCells[] = ['row' => $rowIndex, 'column' => 'F', 'value' => (float) $item['quantity']]; + $this->fillCells[] = ['row' => $rowIndex, 'column' => 'H', 'value' => (float) $item['amount']]; $totalQuantity += (int) $item['quantity']; $totalWeight = bcadd($totalWeight, $item['weight'], 3); $totalAmount = bcadd($totalAmount, $item['amount'], 2); } // 商品合计行 - $rows[] = ['', '合计', '', '', $totalQuantity, (float) $totalWeight, (float) $totalAmount]; + $rows[] = ['', '合计', '', '', '', $totalQuantity, (float) $totalWeight, (float) $totalAmount]; $this->specialRows[++$rowIndex] = 'summary'; - $this->fillCells[] = ['row' => $rowIndex, 'column' => 'E', 'value' => (float) $totalQuantity]; - $this->fillCells[] = ['row' => $rowIndex, 'column' => 'G', 'value' => (float) $totalAmount]; + $this->fillCells[] = ['row' => $rowIndex, 'column' => 'F', 'value' => (float) $totalQuantity]; + $this->fillCells[] = ['row' => $rowIndex, 'column' => 'H', 'value' => (float) $totalAmount]; // 配送费/附加金额/售后金额/总金额(账单级费用全额计入,不受分类过滤影响) $deliveryTotal = (string) $bill->delivery_fee; @@ -135,32 +139,32 @@ class BillExport implements FromCollection, WithStyles $afterSaleTotal = (string) $bill->after_sale; $grandTotal = bcadd(bcadd(bcadd($totalAmount, $deliveryTotal, 2), $addedTotal, 2), $afterSaleTotal, 2); - $rows[] = ['配送费', '', '', '', '', '', (float) $deliveryTotal]; + $rows[] = ['配送费', '', '', '', '', '', '', (float) $deliveryTotal]; $this->specialRows[++$rowIndex] = 'summary'; $this->mergeRows[] = $rowIndex; - $this->fillCells[] = ['row' => $rowIndex, 'column' => 'G', 'value' => (float) $deliveryTotal]; + $this->fillCells[] = ['row' => $rowIndex, 'column' => 'H', 'value' => (float) $deliveryTotal]; - $rows[] = ['附加金额(周转筐 ' . (int) $bill->box_num . ' 个 / 周转托盘 ' . (int) $bill->tray_num . ' 个)', '', '', '', '', '', (float) $addedTotal]; + $rows[] = ['附加金额(周转筐 ' . (int) $bill->box_num . ' 个 / 周转托盘 ' . (int) $bill->tray_num . ' 个)', '', '', '', '', '', '', (float) $addedTotal]; $this->specialRows[++$rowIndex] = 'summary'; $this->mergeRows[] = $rowIndex; - $this->fillCells[] = ['row' => $rowIndex, 'column' => 'G', 'value' => (float) $addedTotal]; + $this->fillCells[] = ['row' => $rowIndex, 'column' => 'H', 'value' => (float) $addedTotal]; - $rows[] = ['售后金额(可正负)', '', '', '', '', '', (float) $afterSaleTotal]; + $rows[] = ['售后金额(可正负)', '', '', '', '', '', '', (float) $afterSaleTotal]; $this->specialRows[++$rowIndex] = 'summary'; $this->mergeRows[] = $rowIndex; - $this->fillCells[] = ['row' => $rowIndex, 'column' => 'G', 'value' => (float) $afterSaleTotal]; + $this->fillCells[] = ['row' => $rowIndex, 'column' => 'H', 'value' => (float) $afterSaleTotal]; - $rows[] = ['总金额(商品金额+配送费+附加金额+售后金额)', '', '', '', '', '', (float) $grandTotal]; + $rows[] = ['总金额(商品金额+配送费+附加金额+售后金额)', '', '', '', '', '', '', (float) $grandTotal]; $this->specialRows[++$rowIndex] = 'grand'; $this->mergeRows[] = $rowIndex; - $this->fillCells[] = ['row' => $rowIndex, 'column' => 'G', 'value' => (float) $grandTotal]; + $this->fillCells[] = ['row' => $rowIndex, 'column' => 'H', 'value' => (float) $grandTotal]; $this->lastRow = $rowIndex; return $this->rows = collect($rows); } /** - * 标题/列头/合计行加粗,合计行标签左合并 A:F;全表居中 + 全边框;金额列货币格式; + * 标题/列头/合计行加粗,合计行标签左合并 A:G;全表居中 + 全边框;金额列货币格式; * 数量(浅黄)/金额(浅红)非 0 条件填色(0 不填、列头固定填色),冻结列头 */ public function styles(Worksheet $sheet): array @@ -170,18 +174,19 @@ class BillExport implements FromCollection, WithStyles $sheet->freezePane('A' . ($this->headerRow + 1)); $sheet->getColumnDimension('A')->setWidth(6); $sheet->getColumnDimension('B')->setWidth(24); - $sheet->getColumnDimension('C')->setWidth(14); - $sheet->getColumnDimension('D')->setWidth(12); - $sheet->getColumnDimension('E')->setWidth(10); - $sheet->getColumnDimension('F')->setWidth(12); + $sheet->getColumnDimension('C')->setWidth(12); + $sheet->getColumnDimension('D')->setWidth(14); + $sheet->getColumnDimension('E')->setWidth(12); + $sheet->getColumnDimension('F')->setWidth(10); $sheet->getColumnDimension('G')->setWidth(12); + $sheet->getColumnDimension('H')->setWidth(12); foreach ($this->mergeRows as $row) { - $sheet->mergeCells('A' . $row . ':F' . $row); + $sheet->mergeCells('A' . $row . ':G' . $row); } // 全部单元格水平/垂直居中(合计行标签保持左对齐) - $sheet->getStyle('A1:G' . $this->lastRow) + $sheet->getStyle('A1:H' . $this->lastRow) ->getAlignment() ->setHorizontal(Alignment::HORIZONTAL_CENTER) ->setVertical(Alignment::VERTICAL_CENTER); @@ -190,19 +195,19 @@ class BillExport implements FromCollection, WithStyles } // 表格区域(列头 → 末行)添加所有边框 - $sheet->getStyle('A' . $this->headerRow . ':G' . $this->lastRow) + $sheet->getStyle('A' . $this->headerRow . ':H' . $this->lastRow) ->getBorders() ->getAllBorders() ->setBorderStyle(Border::BORDER_THIN); // 金额列货币格式:¥ + 两位小数(单价列为文本,不设格式) - $sheet->getStyle('G' . ($this->headerRow + 1) . ':G' . $this->lastRow) + $sheet->getStyle('H' . ($this->headerRow + 1) . ':H' . $this->lastRow) ->getNumberFormat() ->setFormatCode(self::CURRENCY_FORMAT); - // 列头固定填色:数量列(E)浅黄、金额列(G)浅红 - $this->fillCell($sheet, 'E' . $this->headerRow, self::QUANTITY_FILL); - $this->fillCell($sheet, 'G' . $this->headerRow, self::AMOUNT_FILL); + // 列头固定填色:数量列(F)浅黄、金额列(H)浅红 + $this->fillCell($sheet, 'F' . $this->headerRow, self::QUANTITY_FILL); + $this->fillCell($sheet, 'H' . $this->headerRow, self::AMOUNT_FILL); // 数据区条件填色:非 0 填色,0 无背景(金额含负值) foreach ($this->fillCells as $cell) { @@ -210,7 +215,7 @@ class BillExport implements FromCollection, WithStyles $this->fillCell( $sheet, $cell['column'] . $cell['row'], - $cell['column'] === 'E' ? self::QUANTITY_FILL : self::AMOUNT_FILL + $cell['column'] === 'F' ? self::QUANTITY_FILL : self::AMOUNT_FILL ); } } @@ -260,16 +265,39 @@ class BillExport implements FromCollection, WithStyles } /** - * 按一级分类过滤明细:沿 parent_id 上溯取根分类(商品含软删除,保证历史账单可导出), - * 仅保留根分类为所选分类的行 + * 按一级分类过滤明细:仅保留根分类为所选分类的行 * * @param array $items 合并后的商品明细 + * @param Collection $categories 全部分类(id => 分类) + * @param array $rootIds 商品ID => 一级分类ID * @return array{0: array, 1: string} [过滤后明细, 一级分类名] */ - private function filterByRootCategory(array $items): array + private function filterByRootCategory(array $items, Collection $categories, array $rootIds): array + { + $categoryName = $categories->get($this->categoryId)?->name ?? ('分类#' . $this->categoryId); + + $categoryId = $this->categoryId; + $filtered = array_values(array_filter( + $items, + static fn (array $row): bool => ($rootIds[$row['product_id']] ?? 0) === $categoryId + )); + + if ($filtered === []) { + throw new RepositoryException('该账单在「' . $categoryName . '」分类下无商品明细'); + } + + return [$filtered, $categoryName]; + } + + /** + * 解析明细商品的一级分类:沿 parent_id 上溯取根分类(商品含软删除,保证历史账单可导出) + * + * @param array $items 合并后的商品明细 + * @return array{0: Collection, 1: array} [全部分类(id=>分类), 商品ID=>一级分类ID] + */ + private function resolveRootCategories(array $items): array { $categories = ProductCategoryModel::all()->keyBy('id'); - $categoryName = $categories->get($this->categoryId)->name ?? ('分类#' . $this->categoryId); $productCategoryIds = ProductModel::withTrashed() ->whereIn('id', array_column($items, 'product_id')) @@ -292,16 +320,6 @@ class BillExport implements FromCollection, WithStyles $rootIds[(int) $productId] = $rootId; } - $categoryId = $this->categoryId; - $filtered = array_values(array_filter( - $items, - static fn (array $row): bool => ($rootIds[$row['product_id']] ?? 0) === $categoryId - )); - - if ($filtered === []) { - throw new RepositoryException('该账单在「' . $categoryName . '」分类下无商品明细'); - } - - return [$filtered, $categoryName]; + return [$categories, $rootIds]; } } diff --git a/tests/Feature/BillExportTest.php b/tests/Feature/BillExportTest.php index 3616219..302e1a0 100644 --- a/tests/Feature/BillExportTest.php +++ b/tests/Feature/BillExportTest.php @@ -98,38 +98,42 @@ class BillExportTest extends ProcurementTestCase if ($rowA === null || $rowB === null) { return false; } + // 一级分类列=商品根分类名 + if ($rowA[2] !== '蔬菜' || $rowB[2] !== '蔬菜') { + return false; + } // 包规列=包规+单位合并;单价列=每件价÷每件斤数+单价单位(A:2.37÷10=0.23元/斤) - if ($rowA[2] !== '10斤/箱' || $rowA[3] !== '0.23元/斤') { + if ($rowA[3] !== '10斤/箱' || $rowA[4] !== '0.23元/斤') { return false; } // 散装无法折算 → 单价按每件原价显示(B:5.00元/斤) - if ($rowB[2] !== '散装筐' || $rowB[3] !== '5.00元/斤') { + if ($rowB[3] !== '散装筐' || $rowB[4] !== '5.00元/斤') { return false; } // 账单内同商品合并:数量 16、金额 38.00 - if ((int) $rowA[4] !== 16 || (float) $rowA[6] !== 38.0) { + if ((int) $rowA[5] !== 16 || (float) $rowA[7] !== 38.0) { return false; } - if ((int) $rowB[4] !== 4 || (float) $rowB[6] !== 20.0) { + if ((int) $rowB[5] !== 4 || (float) $rowB[7] !== 20.0) { return false; } $summary = $rows->slice(6)->values(); // 合计:数量 20、商品金额 58.00;配送费 10.00;附加 30.00(筐 2 / 托盘 1);售后 -8.00;总金额 90.00 - if ((int) $summary[0][4] !== 20 || (float) $summary[0][6] !== 58.0) { + if ((int) $summary[0][5] !== 20 || (float) $summary[0][7] !== 58.0) { return false; } - if ($summary[1][0] !== '配送费' || (float) $summary[1][6] !== 10.0) { + if ($summary[1][0] !== '配送费' || (float) $summary[1][7] !== 10.0) { return false; } - if (! str_contains((string) $summary[2][0], '筐 2 个 / 周转托盘 1 个') || (float) $summary[2][6] !== 30.0) { + if (! str_contains((string) $summary[2][0], '筐 2 个 / 周转托盘 1 个') || (float) $summary[2][7] !== 30.0) { return false; } - if (! str_contains((string) $summary[3][0], '售后金额') || (float) $summary[3][6] !== -8.0) { + if (! str_contains((string) $summary[3][0], '售后金额') || (float) $summary[3][7] !== -8.0) { return false; } - return (float) $summary[4][6] === 90.0; + return (float) $summary[4][7] === 90.0; } ); } @@ -161,22 +165,22 @@ class BillExportTest extends ProcurementTestCase if (! str_contains((string) $rows[1][0], '分类:蔬菜')) { return false; } - // 明细仅剩蔬菜(子分类归入根分类),肉禽被忽略 + // 明细仅剩蔬菜(子分类归入根分类),肉禽被忽略;一级分类列显示根分类名 $detail = $rows->slice(4, 1)->values()->first(); - if ($detail === null || $detail[1] !== $veg->name) { + if ($detail === null || $detail[1] !== $veg->name || $detail[2] !== '蔬菜') { return false; } $summary = $rows->slice(5)->values(); // 商品金额合计 20.00(仅蔬菜);配送费 10.00 / 附加 30.00 / 售后 0.00 全额;总金额 60.00 - if ((float) $summary[0][6] !== 20.0) { + if ((float) $summary[0][7] !== 20.0) { return false; } - if ((float) $summary[1][6] !== 10.0 || (float) $summary[2][6] !== 30.0 || (float) $summary[3][6] !== 0.0) { + if ((float) $summary[1][7] !== 10.0 || (float) $summary[2][7] !== 30.0 || (float) $summary[3][7] !== 0.0) { return false; } - return (float) $summary[4][6] === 60.0; + return (float) $summary[4][7] === 60.0; } ); }