using
System;
using
System.Runtime.InteropServices;
using
NetOpenX50;
namespace
NetOpenXTest
{
public
static
class
FaturaOrnek
{
public
static
void
SatisFaturasiKaydet()
{
Kernel kernel =
new
Kernel();
Sirket sirket =
default
(Sirket);
Fatura fatura =
default
(Fatura);
FatUst fatUst =
default
(FatUst);
FatKalem fatKalem =
default
(FatKalem);
try
{
sirket = kernel.yeniSirket(TVTTipi.vtMSSQL,
"vt adi"
,
"vt kull adi"
,
"vt kull sifre"
,
"netsis kull adi"
,
"netsis sifre"
,
0);
fatura = kernel.yeniFatura(sirket, TFaturaTip.ftSFat);
fatUst = fatura.Ust();
fatUst.FATIRS_NO = fatura.YeniNumara(
"A"
);
fatUst.CariKod =
"00002"
;
fatUst.Tarih = DateTime.Now;
fatUst.ENTEGRE_TRH = DateTime.Now;
fatUst.FiiliTarih = DateTime.Now;
fatUst.TIPI = TFaturaTipi.ft_Acik;
fatUst.Proje_Kodu =
"1"
;
fatUst.KDV_DAHILMI =
true
;
fatKalem = fatura.kalemYeni(
"001"
);
fatKalem.DEPO_KODU = 2;
fatKalem.STra_GCMIK = 5;
fatKalem.STra_NF = 12;
fatKalem.STra_BF = 12;
fatura.kayitYeni();
}
finally
{
Marshal.ReleaseComObject(fatKalem);
Marshal.ReleaseComObject(fatUst);
Marshal.ReleaseComObject(fatura);
Marshal.ReleaseComObject(sirket);
kernel.FreeNetsisLibrary();
Marshal.ReleaseComObject(kernel);
}
}
}
}