feat: implement POS order management system
- Added CreateOrderDto and CreateOrderItemDto for order creation. - Developed PosOrdersController to handle order-related endpoints. - Created PosOrdersService for business logic related to orders. - Implemented PosOrdersWorkflow for order processing workflows. - Established Prisma integration for database operations in orders. - Introduced SalesInvoicesModule and related DTOs for sales invoice management. - Enhanced SalesInvoicesService and SalesInvoicesWorkflow for invoice processing.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
CREATE OR REPLACE VIEW Stock_Available_View AS
|
||||
SELECT
|
||||
sb.productId,
|
||||
sb.inventoryId,
|
||||
sb.quantity AS physicalQuantity,
|
||||
COALESCE(SUM(sr.quantity), 0) AS reservedQuantity,
|
||||
(
|
||||
sb.quantity - COALESCE(SUM(sr.quantity), 0)
|
||||
) AS availableQuantity
|
||||
FROM
|
||||
Stock_Balance sb
|
||||
LEFT JOIN Stock_Reservations sr ON sr.productId = sb.productId
|
||||
AND sr.inventoryId = sb.inventoryId
|
||||
GROUP BY
|
||||
sb.productId,
|
||||
sb.inventoryId,
|
||||
sb.quantity;
|
||||
Reference in New Issue
Block a user