Advertisement
Ranish666

old publish file but purchase edit is needed

Apr 30th, 2021
1,730
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 2.44 KB | None | 0 0
  1.  go
  2. Alter proc [dbo].[PurchaseEdit_Insert]                  
  3. @PurchaseMasterID int,                  
  4. @PurchaseDetailsID int ,                  
  5. @VendorBillNo nvarchar(MAX),                  
  6. @ReferenceNo nvarchar(MAX),                
  7. @AccountledgerID int ,                
  8. @mode nvarchar(MAX) ,                  
  9. @StoreDepartmentID int ,                  
  10. @Itemtype nvarchar(MAX) ,                  
  11. @ItemID int ,                  
  12. @BrandName nvarchar(MAX),                  
  13. @Batch nvarchar(MAX) ,                  
  14. @ExpireDate datetime ,                  
  15. @TotalQty decimal(18, 2),                  
  16. @rate decimal(18, 2) ,                  
  17. @CashDiscPer decimal(18, 2),                  
  18. @CashDisc decimal(18, 2),                  
  19. @Taxper decimal(18, 2) ,                  
  20. @TaxAmt decimal(18, 2) ,                  
  21. @MRP decimal(18, 2) ,                  
  22. @profitPer decimal(18, 2) ,                  
  23. @QtyBonus decimal(18, 2) ,                  
  24. @CCPer decimal(18, 2) ,                  
  25. @NetUnitCost decimal(18, 2),                  
  26. @DiscUnitCost decimal(18, 2),                  
  27. @TotalCost decimal(18, 2),                  
  28. @CurentSellPrice decimal(18, 2) ,                  
  29. @newSellproce decimal(18, 2),            
  30. @Action nvarchar(MAX),    
  31. @userid int  ,  
  32. @soldQTY decimal(18,2) =null,  
  33. @isSold int  =null
  34. as                  
  35. BEGIN                  
  36. IF not exists(select * from tblPurchaseEditEntry where PurchaseMasterID=@PurchaseMasterID and ItemID=@ItemID and Itemtype=@Itemtype          
  37. and Batch=@Batch  and StoreDepartmentID=@StoreDepartmentID)                  
  38. BEGIN                  
  39.  insert into tblPurchaseEditEntry(PurchaseMasterID,PurchaseDetailsID,VendorBillNo,ReferenceNo,AccountledgerID,mode,StoreDepartmentID,Itemtype,ItemID,BrandName,Batch,            
  40.  ExpireDate,TotalQty,rate,CashDiscPer,CashDisc,Taxper,TaxAmt,MRP,profitPer,QtyBonus,CCPer,NetUnitCost,DiscUnitCost,TotalCost,CurentSellPrice,newSellproce,[Action],userid,createdate,  
  41.  soldQTY, isSold)                  
  42.  values (@PurchaseMasterID,@PurchaseDetailsID,@VendorBillNo,@ReferenceNo,@AccountledgerID,@mode,@StoreDepartmentID,@Itemtype,@ItemID,@BrandName,@Batch,@ExpireDate,            
  43.  @TotalQty,@rate,@CashDiscPer,@CashDisc,@Taxper,@TaxAmt,@MRP,@profitPer,@QtyBonus,@CCPer,@NetUnitCost,@DiscUnitCost,@TotalCost,@CurentSellPrice,@newSellproce,@Action,@userid,GETDATE(),  
  44.  @soldQTY, @isSold)                  
  45. END                  
  46. END    
  47. go
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement