Feature #3777 » PFILOGENBOMMATCONVERT.sql
1 |
ALTER PROCEDURE PFILOGENBOMMATCONVERT |
---|---|
2 |
(
|
3 |
@MaterialID VARCHAR(10) |
4 |
,@Quantity DECIMAL(18,2) |
5 |
)
|
6 |
AS
|
7 |
|
8 |
--DECLARE @MaterialID VARCHAR(10) = '00000048'
|
9 |
--DECLARE @Quantity DECIMAL(18,2) = 2.5
|
10 |
|
11 |
SELECT '' AS [DocNo] |
12 |
,SeqID AS [DocItemID] |
13 |
,'' AS [DocItemRef] |
14 |
,MaterialItemID AS [MaterialID] |
15 |
,'' AS [ItemNumber] |
16 |
,'0' AS [ItemType] |
17 |
,'ISSU' AS [ItemFlow] |
18 |
,[Quantity] * @Quantity AS Quantity |
19 |
,mat1.[UnitMeasurement] |
20 |
,'' AS [CustSoRef] |
21 |
,'' AS [CustSoItemRef] |
22 |
,'' AS [PORef] |
23 |
,'' AS [POItemRef] |
24 |
,'' AS [DeliveryRef] |
25 |
,'' AS [DeliveryItemRef] |
26 |
,'' AS [QualityInspectionResult] |
27 |
,'' AS [QualityAssuranceResult] |
28 |
,'' AS [Storage] |
29 |
,'' AS [Bin] |
30 |
,'' AS [Startdate] |
31 |
,'' AS [EndDate] |
32 |
,'' AS [Valuation] |
33 |
,'' AS [RefDocTr] |
34 |
,'' AS [RefDocTy] |
35 |
,'' AS [RefDocID] |
36 |
,'' AS [CreateBy] |
37 |
,'' AS [CreateDate] |
38 |
,'' AS [ChangeBy] |
39 |
,'' AS [ChangeDate] |
40 |
,'' AS [Warehouse] |
41 |
,mat1.MaterialType AS [MaterialType] |
42 |
,mat1.[MAP] * @Quantity AS MAP |
43 |
,0 AS [NetPrice] |
44 |
,'' AS [NoLot] |
45 |
,'' AS [UnitConversion] |
46 |
,'' AS [QuantityDua] |
47 |
,mat1.Description AS [MaterialDesc] |
48 |
,0 AS[UnitPrice] |
49 |
,0 AS [QtyReal] |
50 |
,0 AS [QtyAdjust] |
51 |
,'' AS [StockStatus] |
52 |
,'' AS [Notes] |
53 |
,0 AS [DiscountDefect] |
54 |
,0 AS [PriceAmount] |
55 |
,0 AS [Discount] |
56 |
,0 AS [DiscountPercentage] |
57 |
,'' AS [Currency] |
58 |
,0 AS [TotAmount] |
59 |
,0 AS [Tax] |
60 |
,0 AS [NetTax] |
61 |
,0 AS [NetAmount] |
62 |
,0 AS [BiayaJasa] |
63 |
,0 AS [TaxPPh23] |
64 |
,mat1.ProductGroup AS [ProductGroup] |
65 |
FROM PMDMAT0006 AS mat6 |
66 |
LEFT JOIN PMDMAT0001 AS mat1 |
67 |
ON mat1.MaterialID = mat6.MaterialID |
68 |
WHERE mat6.MaterialID = @MaterialID |