Transaccion de inventarios
Attribute VB_Name = "Inventario"
Option Compare Database
Option Explicit
Public Enum InventoryTransactionTypeEnum
Purchase_TransactionType = 1Sold_TransactionType = 2
Hold_TransactionType = 3
End Enum
Type InventoryTransaction
ProductID As Long 'Producto para agregar o quitar del inventario
TransactionType AsInventoryTransactionTypeEnum '1=Compra; 2=Venta; 3=Retenido; 4=Sobrante;
Quantity As Long 'Cantidad especificada para compra, venta, retención, etc.
QuantityGranted As Long'Cantidad real concedida; puede ser inferior a la especificada
InventoryID As Long 'Id. de transacción de inventario devuelto al llamador
AllOrNothing As Boolean 'Todos o ningúnindicador para asignaciones de productos
Comments As String
End Type
Public Enum OrderItemStatusEnum
None_OrderItemStatus = 0
OnHold_OrderItemStatus = 1Invoiced_OrderItemStatus = 2
Shipped_OrderItemStatus = 3
OnOrder_OrderItemStatus = 4
NoStock_OrderItemStatus = 5
End Enum
Private Const m_cNew_InventoryID = -1
Public Property Get NewInventoryID() AsLong
NewInventoryID = m_cNew_InventoryID
End Property
Function AddPurchase(PurchaseOrderID As Long, ProductID As Long, Qty As Long, ByRef InventoryID As Long) As Boolean
Dim IT AsInventoryTransaction
IT.TransactionType = Purchase_TransactionType
IT.ProductID = ProductID
IT.Quantity = Qty
IT.InventoryID = m_cNew_InventoryID
IfEditTransaction(IT, , PurchaseOrderID) Then
AddPurchase = True
InventoryID = IT.InventoryID
End If
End Function
Function RemovePurchase(lInventoryID As Long)
MsgBoxOKOnlyCannotRemovePostedInventory
End Function
Function GetQtyAvailable(ProductID As Long) As Long
GetQtyAvailable = GetInventoryQuantity("[Ctd disponible]", ProductID)
End Function
Function...
Regístrate para leer el documento completo.