Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- go
- Alter proc [dbo].[PurchaseEdit_Insert]
- @PurchaseMasterID int,
- @PurchaseDetailsID int ,
- @VendorBillNo nvarchar(MAX),
- @ReferenceNo nvarchar(MAX),
- @AccountledgerID int ,
- @mode nvarchar(MAX) ,
- @StoreDepartmentID int ,
- @Itemtype nvarchar(MAX) ,
- @ItemID int ,
- @BrandName nvarchar(MAX),
- @Batch nvarchar(MAX) ,
- @ExpireDate datetime ,
- @TotalQty decimal(18, 2),
- @rate decimal(18, 2) ,
- @CashDiscPer decimal(18, 2),
- @CashDisc decimal(18, 2),
- @Taxper decimal(18, 2) ,
- @TaxAmt decimal(18, 2) ,
- @MRP decimal(18, 2) ,
- @profitPer decimal(18, 2) ,
- @QtyBonus decimal(18, 2) ,
- @CCPer decimal(18, 2) ,
- @NetUnitCost decimal(18, 2),
- @DiscUnitCost decimal(18, 2),
- @TotalCost decimal(18, 2),
- @CurentSellPrice decimal(18, 2) ,
- @newSellproce decimal(18, 2),
- @Action nvarchar(MAX),
- @userid int ,
- @soldQTY decimal(18,2) =null,
- @isSold int =null
- as
- BEGIN
- IF not exists(select * from tblPurchaseEditEntry where PurchaseMasterID=@PurchaseMasterID and ItemID=@ItemID and Itemtype=@Itemtype
- and Batch=@Batch and StoreDepartmentID=@StoreDepartmentID)
- BEGIN
- insert into tblPurchaseEditEntry(PurchaseMasterID,PurchaseDetailsID,VendorBillNo,ReferenceNo,AccountledgerID,mode,StoreDepartmentID,Itemtype,ItemID,BrandName,Batch,
- ExpireDate,TotalQty,rate,CashDiscPer,CashDisc,Taxper,TaxAmt,MRP,profitPer,QtyBonus,CCPer,NetUnitCost,DiscUnitCost,TotalCost,CurentSellPrice,newSellproce,[Action],userid,createdate,
- soldQTY, isSold)
- values (@PurchaseMasterID,@PurchaseDetailsID,@VendorBillNo,@ReferenceNo,@AccountledgerID,@mode,@StoreDepartmentID,@Itemtype,@ItemID,@BrandName,@Batch,@ExpireDate,
- @TotalQty,@rate,@CashDiscPer,@CashDisc,@Taxper,@TaxAmt,@MRP,@profitPer,@QtyBonus,@CCPer,@NetUnitCost,@DiscUnitCost,@TotalCost,@CurentSellPrice,@newSellproce,@Action,@userid,GETDATE(),
- @soldQTY, @isSold)
- END
- END
- go
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement