Günü Sözü

"Hiçbir şey bilmeyen cahildir, ama bilip de susan ahlaksızdır. " Bertolt Brecht.
"İyilik yapabildiğim zaman mutlu olurum; ama en büyük mutluluk yapılan bir haksızlığı düzeltmektir." Tolstoy

1 Aralık 2014 Pazartesi

Asset Table, Asset Book, Asset Trans insert,update,import


static void _assetbookCreate(Args _args)
{
    AssetBook _assetBook;
    AssetTrans _assetTrans;
 
    try
    {
    ttsbegin;
        _assetBook.clear();
        _assetBook = AssetBook::find('assetid','assetbokid',true);
         if(!_assetBook)
            {
                info('asset id yok');
               // continue;
            }
        else
        {
        _assetBook.AssetId = 'asset id';
        _assetBook.AcquisitionDate =26\06\2014;
        _assetBook.VendAccount ='';
        _assetBook.AssetGroup ='254-1';
        _assetBook.VendInvoiceId ='';
        _assetBook.AcquisitionPrice =0.00;
     //   _assetBook.DefaultDimension = ''; //22565574414;
        _assetBook.DepreciationStartDate =26\06\2014;
        _assetBook.LifeTime =5;
        _assetBook.UsedFromDate = 26\06\2015;
        _assetBook.LifeTime =60;
        _assetBook.LifeTimeRest =60;
        _assetBook.PostingProfile = 'NORMAL';
        _assetBook.BookId='NORMAL';
        _assetBook.Status = AssetStatus::NoAcquisition;
        //_assetBook.Depreciation = NoYes::Yes;
        _assetBook.insert();
        }
 
    ttscommit;
   info("işlem başarıyla tamamlandı. hadi hayırlı olsun.");
    }
 
    catch
    {
        info(strFmt(" : %1 ",_assetBook.AssetId));
        info("işlem sırsaında bir hata oluştu :(");
    }
 
   
    try
    {
    ttsbegin;
        _assetTrans.clear();
        _assetTrans.AssetId = 'asset id';
        _assetTrans.TransDate = 26\06\2014;
        _assetTrans.Voucher ='FIS no';
        _assetTrans.AssetGroup ='grup no';
        _assetTrans.TransType = 1;
        _assetTrans.Txt ='Alım';
        _assetTrans.CurrencyCode='TRY';
        _assetTrans.BookId='NORMAL';
        _assetTrans.AmountMST=4100;
        _assetTrans.AmountCur=4100;
        _assetTrans.DefaultDimension = 22565574414;
        _assetTrans.insert();
 
    ttscommit;
   info("işlem başarıyla tamamlandı. hadi hayırlı olsun.");
    }
 
    catch
    {
        info(strFmt(" : %1 ",_assetTrans.AssetId));
        info("işlem sırsaında bir hata oluştu :(");
    }
   
}
 

Hiç yorum yok:

Yorum Gönder