CREATE  TRIGGER [dbo].[TI_SumPrice] ON [dbo].[TmpHavaleh]
For Insert
As
  Update TmpHeadH
      Set Tot_Price_kharid  = Round(Isnull(Tot_Price_kharid,0) + i.K_Qty1*i.Price_Kharid,0),
            Tot_Price_Forosh = Round(Isnull(Tot_Price_Forosh,0) + i.K_Qty1*i.Price_Forosh,0),
            Tot_Price_Omdeh= Round(Isnull(Tot_Price_Omdeh,0) + i.K_Qty1*i.Price_Omdeh,0)
      From Inserted i Where TmpHeadH.Id_havaleh=i.Id_Havaleh

