feat: add vendor order detail page with invoice integration

- Add new route /vendor/{code}/orders/{order_id} for order details
- Create order-detail.html template with:
  - Order summary with status and totals
  - Order items with per-item shipment status and ship buttons
  - Customer and shipping address display
  - Invoice section (create invoice or view existing)
  - Quick actions (confirm, ship all, mark delivered, cancel)
  - Status update modal with tracking info fields
  - Ship all modal for bulk shipment with tracking
- Create order-detail.js with full functionality:
  - Load order details, shipment status, and linked invoice
  - Individual item shipping with partial shipment support
  - Ship all remaining items with tracking info
  - Create invoice from order
  - Download invoice PDF
  - Status management with automatic shipment handling
- Update orders list to navigate to detail page instead of modal
- Add partially_shipped status (orange) to orders list

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-01 18:34:13 +01:00
parent 5a3f2bce57
commit 8fd8168ff4
5 changed files with 862 additions and 14 deletions

View File

@@ -38,6 +38,7 @@ function vendorOrders() {
statuses: [
{ value: 'pending', label: 'Pending', color: 'yellow' },
{ value: 'processing', label: 'Processing', color: 'blue' },
{ value: 'partially_shipped', label: 'Partially Shipped', color: 'orange' },
{ value: 'shipped', label: 'Shipped', color: 'indigo' },
{ value: 'delivered', label: 'Delivered', color: 'green' },
{ value: 'completed', label: 'Completed', color: 'green' },
@@ -243,21 +244,10 @@ function vendorOrders() {
},
/**
* View order details
* View order details - navigates to detail page
*/
async viewOrder(order) {
this.loading = true;
try {
const response = await apiClient.get(`/vendor/${this.vendorCode}/orders/${order.id}`);
this.selectedOrder = response;
this.showDetailModal = true;
vendorOrdersLog.info('Loaded order details:', order.id);
} catch (error) {
vendorOrdersLog.error('Failed to load order details:', error);
Utils.showToast(error.message || 'Failed to load order details', 'error');
} finally {
this.loading = false;
}
viewOrder(order) {
window.location.href = `/vendor/${this.vendorCode}/orders/${order.id}`;
},
/**