$1 PROCEDURE [dbo].[FastSell_v2_STOK_SERI_NO_TANIM_EKLE]
@stokKod varchar(25),
@seriNo varchar(25),
@evrakSeri varchar(12),
@evrakSira int,
@cariKod varchar(25)
AS
IF EXISTS (SELECT * FROM STOK_SERINO_TANIMLARI WHERE chz_stok_kodu =@stokKod and chz_serino=@seriNo)
BEGIN
	UPDATE STOK_SERINO_TANIMLARI
		SET chz_lastup_date=GETDATE(),
			chz_al_evr_seri=@evrakSeri,
			chz_al_evr_sira=@evrakSira
		WHERE  chz_serino=@seriNo and chz_stok_kodu=@stokKod
END
ELSE
BEGIN
INSERT INTO STOK_SERINO_TANIMLARI
                         (chz_Guid, chz_DBCno, chz_Spec_Rec_no, chz_iptal, chz_fileid, chz_hidden, chz_kilitli, chz_degisti, chz_checksum, chz_create_user, chz_create_date, chz_lastup_user, chz_lastup_date, chz_special1, chz_special2, 
                         chz_special3, chz_serino, chz_stok_kodu, chz_grup_kodu, chz_Tuktckodu, chz_GrnBasTarihi, chz_GrnBitTarihi, chz_aciklama1, chz_aciklama2, chz_aciklama3, chz_al_tarih, chz_al_evr_seri, chz_al_evr_sira, 
                         chz_al_cari_kodu, chz_al_wd_tarih, chz_al_wd_evr_seri, chz_al_wd_evr_sira, chz_st_tarih, chz_st_evr_seri, chz_st_evr_sira, chz_st_cari_kodu, chz_st_wd_tarih, chz_st_wd_evr_seri, chz_st_wd_evr_sira, chz_brut_fiati, 
                         chz_al_fiati_ana, chz_al_fiati_alt, chz_al_fiati_orj, chz_st_fiati_ana, chz_st_fiati_alt, chz_st_fiati_orj, chz_parca_garantisi, chz_parca_serino, chz_parca_garanti_baslangic, chz_parca_garanti_bitis, chz_makina_tipi, 
                         chz_model_yili, chz_kiraya_acilma_tarihi, chz_musteri_garanti_baslangic, chz_musteri_garanti_bitis, chz_demirbas_kodu, chz_tescil_tarihi, chz_bakim_tipi, chz_bakim_tarihi, chz_ara_bakim_sayisi, chz_bakim_peryodu, 
                         chz_sayac_tipi, chz_son_sayac_degeri, chz_motor_seri_no, chz_sase_no, chz_HGS_fl, chz_HGS_no, chz_OGS_fl, chz_OGS_no, chz_ruhsat_no, chz_ruhsat_sahibi, chz_rehin_fl, chz_rehin_nedeni, 
                         chz_sifirlama_oncesi_sayac, chz_devir_servis_sayac, chz_devir_servis_peryodu)
VALUES        (NEWID(), 0, 0, 0, 94, 0, 0, 0, 0, 1, GETDATE(), 1, GETDATE(), N'', N'', N'',@seriNo,@stokKod, N'', N'', '18991231', '18991231', N'', N'', N'', '20211013',@evrakSeri,@evrakSira,@cariKod, '18991230', N'', 0, '18991230', N'', 0, N'', 
                         '18991230', N'', 0, 0, 0, 0, 0, 0, 0, 0, 0, N'', '18991231', '18991231', 0, N'', '18991230', '18991230', '18991230', N'', '18991230', 0, '18991230', 0, 0, 0, 0, N'', N'', 0, N'', 0, N'', N'', N'', 0, N'', 0, 0, 0)
END