ramazanonur

Sipariş masraf kalemi nasıl eklenir ?

  /

Merhaba,


Sipariş kalemleri içerisinde "masraf" türünde bir kalem nasıl eklenir ?



Not: Malzeme aktarır gibi yapıp TYPE:3 olarak gönderdim fakat siparişte göremiyorum. DETAIL_LEVEL:1 denedim. CALC_TYPE:2 denedim.


masraf kalemi entegrasyon


NaciO

En basit hali ile aşağıdaki şekilde yapılabilir. Örnekte 1 tane satıra 1 tane de genele masraf uyguladım. 

UnityObjects.Data order = Global.UnityApp.NewDataObject(UnityObjects.DataObjectType.doSalesOrderSlip);
order.New();
order.DataFields.FieldByName("NUMBER").Value = "~";
order.DataFields.FieldByName("DATE").Value = "08.05.2018";
order.DataFields.FieldByName("TIME").Value = 151914790;
order.DataFields.FieldByName("ARP_CODE").Value = "CARI.02";
order.DataFields.FieldByName("ORDER_STATUS").Value = 1;
order.DataFields.FieldByName("SALESMAN_CODE").Value = 1;
order.DataFields.FieldByName("CURRSEL_TOTAL").Value = 1;

UnityObjects.Lines transactions_lines = order.DataFields.FieldByName("TRANSACTIONS").Lines;
transactions_lines.AppendLine();
transactions_lines[transactions_lines.Count - 1].FieldByName("TYPE").Value = 0;
transactions_lines[transactions_lines.Count - 1].FieldByName("MASTER_CODE").Value = "MALZEME.02";
transactions_lines[transactions_lines.Count - 1].FieldByName("QUANTITY").Value = 1;
transactions_lines[transactions_lines.Count - 1].FieldByName("PRICE").Value = 2500;
transactions_lines[transactions_lines.Count - 1].FieldByName("VAT_RATE").Value = 18;
transactions_lines[transactions_lines.Count - 1].FieldByName("UNIT_CODE").Value = "ADET";
transactions_lines[transactions_lines.Count - 1].FieldByName("UNIT_CONV1").Value = 1;
transactions_lines[transactions_lines.Count - 1].FieldByName("UNIT_CONV2").Value = 1;
transactions_lines[transactions_lines.Count - 1].FieldByName("ORDER_RESERVE").Value = 1;
transactions_lines[transactions_lines.Count - 1].FieldByName("DUE_DATE").Value = "08.05.2018";
transactions_lines[transactions_lines.Count - 1].FieldByName("CURR_PRICE").Value = 160;

transactions_lines.AppendLine();
transactions_lines[transactions_lines.Count - 1].FieldByName("TYPE").Value = 3;
transactions_lines[transactions_lines.Count - 1].FieldByName("DISCOUNT_RATE").Value = 10;
transactions_lines[transactions_lines.Count - 1].FieldByName("VAT_RATE").Value = 18;

transactions_lines.AppendLine();
transactions_lines[transactions_lines.Count - 1].FieldByName("TYPE").Value = 3;
transactions_lines[transactions_lines.Count - 1].FieldByName("DETAIL_LEVEL").Value = 1;
transactions_lines[transactions_lines.Count - 1].FieldByName("DISCOUNT_RATE").Value = 20;
transactions_lines[transactions_lines.Count - 1].FieldByName("VAT_RATE").Value = 18;

if (order.Post() == true)
{
 MessageBox.Show("POST OK !");
}
else
{
 if (order.ErrorCode != 0)
 {
 MessageBox.Show("DBError(" + order.ErrorCode.ToString() + ")-" + order.ErrorDesc + order.DBErrorDesc);
 }
 else if (order.ValidateErrors.Count > 0)
 {
 string result = "XML ErrorList:";
 for (int i = 0; i < order.ValidateErrors.Count; i++)
 {
 result += "(" + order.ValidateErrors[i].ID.ToString() + ") - " + order.ValidateErrors[i].Error;
 }
 MessageBox.Show(result);
 }
}




08/05/18 09:20

Cevap vermek için giriş yapmanız gerekmektedir.