LOGO Tiger'a irsaliye kaydetmek istediğinizde aşağıdaki örneği kullanabilirsiniz.
Entegrasyonda sorun yaşıyorsunuz lütfen iletişime geçiniz : 0535 508 91 34
UnityApplication giris = new UnityApplication();
if (giris.Connect())
{
if (giris.UserLogin("LOGO", "1453")) //Logo yetkili kullanıcı adı ve parolası
{
if (giris.CompanyLogin(24)) //Logo şirket numarası
{
Data slip = giris.NewDataObject(DataObjectType.doSalesDispatch); //Satış İrsaliyesi tipi
slip.New();
slip.DataFields.FieldByName("TYPE").Value = 8;
slip.DataFields.FieldByName("ARP_CODE").Value = "CARİKODU";
slip.DataFields.FieldByName("NUMBER").Value = "BELGENUMARASI";
slip.DataFields.FieldByName("DATE").Value = Convert.ToDateTime(DateTime.Now);
object MyTime = null;
UnityApplication UnityApp = new UnityApplication();
UnityApp.PackTime(
Convert.ToDateTime(DateTime.Now).Hour,
Convert.ToDateTime(DateTime.Now).Minute,
Convert.ToDateTime(DateTime.Now).Second,
ref MyTime);
slip.DataFields.FieldByName("TIME").Value = (int)MyTime;
slip.DataFields.FieldByName("SOURCE_WH").Value = 66;
slip.DataFields.FieldByName("SOURCE_COST_GRP").Value = 66;
slip.DataFields.FieldByName("DIVISION").Value = 62;
slip.DataFields.FieldByName("ORDER_STATUS").Value = 1; //Sipariş Durumu
slip.DataFields.FieldByName("WITH_PAYMENT").Value = 0; //Ödeme Durumu
slip.DataFields.FieldByName("PAYMENT_CODE").Value = Convert.ToString("ÖDEME GRUBU");
slip.DataFields.FieldByName("TRADING_GRP").Value = "Ticari işlem grubu";
slip.DataFields.FieldByName("AUXIL_CODE").Value = "B";
slip.DataFields.FieldByName("AUTH_CODE").Value = "YETKİ KODU";
slip.DataFields.FieldByName("SALESMAN_CODE").Value = sConvert.ToString("SATIŞ PERSONELİ KODU");
slip.DataFields.FieldByName("NOTES1").Value = Convert.ToString("GENEL AÇIKLAMA");
UnityObjects.Lines transactionstransaction = slip.DataFields.FieldByName("TRANSACTIONS").Lines; //Satırlar
foreach (DataRow satir in dt.Rows)
{
transactionstransaction.AppendLine();
transactionstransaction[(transactionstransaction.Count - 1)].FieldByName("TYPE").Value = 0;
transactionstransaction[(transactionstransaction.Count - 1)].FieldByName("MASTER_CODE").Value = "STOK KODU";
transactionstransaction[(transactionstransaction.Count - 1)].FieldByName("QUANTITY").Value = 1; //Miktar
transactionstransaction[(transactionstransaction.Count - 1)].FieldByName("UNIT_CODE").Value = "ADET"; //Birim
transactionstransaction[(transactionstransaction.Count - 1)].FieldByName("VAT_RATE").Value = "KDV ORANI";
transactionstransaction[(transactionstransaction.Count - 1)].FieldByName("SOURCEWH").Value = 66;
transactionstransaction[(transactionstransaction.Count - 1)].FieldByName("SOURCECOSTGRP").Value = 66;
double price;
transactionstransaction.GetStockLinePrice(8, out price); // 8 : tanımlı satış fiyatı IDsi
transactionstransaction[transactionstransaction.Count - 1].FieldByName("PRICE").Value = price;
transactionstransaction[(transactionstransaction.Count - 1)].FieldByName("ORDER_REFERENCE").Value = "VarsaSiparisReferansID";
}
slip.ApplyCampaign();
slip.DataFields.FieldByName("EDESPATCH").Value = 1; //E-İrsaliye için
slip.DataFields.FieldByName("EINVOICE").Value = 1;
if (slip.Post() == true)
{
// Başarılı bir şekilde kaydedilmiştir.
}
else
{
if (slip.ErrorCode != 0)
{
MessageBox.Show("DBError(" + slip.ErrorCode.ToString() + ")-" + slip.ErrorDesc + slip.DBErrorDesc);
}
else if (slip.ValidateErrors.Count > 0)
{
string result = "XML ErrorList:";
for (int i = 0; i < slip.ValidateErrors.Count; i++)
{
result += "(" + slip.ValidateErrors[i].ID.ToString() + ") - " + slip.ValidateErrors[i].Error;
}
MessageBox.Show(result);
}
}
}
}
}
Commentaires