YUNUS DEMİRBAŞ

Üretim Emrine Bağlı Planlanan Fiş Girişi

  Tiger/Logo Objects

Merhabalar üretim emrine bağlı planlanan sarf ve üretimden giriş fişi atmak istediğimizde seri takipli malzemeler için , malzeme seri takipli diye uyarı alıyoruz , planlanan fişlerde seri istememesi lazım normalde. üremi emirlerinde DOPLNRESERVE ve DOSLPLNRESERVE değerleri 0 olarak set edildi.


atılan işlem kodları aşağıdadır ;


Sarf fişi 

UnityObjects.Data items = UnityApp.NewDataObject(UnityObjects.DataObjectType.doMaterialSlip);
items.New();
items.DataFields.FieldByName("GROUP").Value = 3;
items.DataFields.FieldByName("TYPE").Value = 12;
items.DataFields.FieldByName("NUMBER").Value = "~";
items.DataFields.FieldByName("DATE").Value = DateTime.Now.ToString("dd.MM.yyyy");
items.DataFields.FieldByName("TIME").Value = ((DateTime.Now.Hour * 16777216) + (DateTime.Now.Minute * 65536) + (DateTime.Now.Second * 256));
items.DataFields.FieldByName("AUTH_CODE").Value = 0;
items.DataFields.FieldByName("PORDER_TYPE").Value = 1;
items.DataFields.FieldByName("SOURCE_WH").Value = Convert.ToInt32(operasyon["SOURCE_WH"]);
items.DataFields.FieldByName("SOURCE_WSCODE").Value = operasyon["SOURCE_WSCODE"].ToString();
items.DataFields.FieldByName("SPO_DETAIL_CODE").Value = operasyon["SPO_DETAIL_CODE"].ToString();
items.DataFields.FieldByName("SRCPOLN_REFERENCE").Value = Convert.ToInt32(operasyon["SRCPOLN_REFERENCE"]);
items.DataFields.FieldByName("SOURCE_COST_GRP").Value = 12;
items.DataFields.FieldByName("SOURCE_DIVISION_NR").Value = 1;
items.DataFields.FieldByName("DEST_DIVISION_NR").Value = 1;
items.DataFields.FieldByName("PORDER_STATUS").Value = Convert.ToInt32(operasyon["PORDER_STATUS"]);
items.DataFields.FieldByName("CURRSEL_TOTALS").Value = 1;
DataRow[] rw = isemirleri.Select("SOURCE_WH=" + Convert.ToInt32(operasyon["SOURCE_WH"]) + " and SOURCE_WSCODE='" + operasyon["SOURCE_WSCODE"] + "' and SPO_DETAIL_CODE='" + operasyon["SPO_DETAIL_CODE"] + "' and SRCPOLN_REFERENCE=" + Convert.ToInt32(operasyon["SRCPOLN_REFERENCE"]) + "");
if (rw.Length > 0)
{
int LINE_NUMBER = 1;
UnityObjects.Lines transactions_lines = items.DataFields.FieldByName("TRANSACTIONS").Lines;
foreach (DataRow item in rw.CopyToDataTable().Rows)
{
transactions_lines.AppendLine();
transactions_lines[transactions_lines.Count - 1].FieldByName("ITEM_CODE").Value = item["ITEM_CODE"].ToString();
transactions_lines[transactions_lines.Count - 1].FieldByName("LINE_TYPE").Value = Convert.ToInt32(item["LINE_TYPE"]);
transactions_lines[transactions_lines.Count - 1].FieldByName("PRORD_REFERENCE").Value = Convert.ToInt32(item["PRORD_REFERENCE"]);
transactions_lines[transactions_lines.Count - 1].FieldByName("PRORD_TYPE").Value = 1;
transactions_lines[transactions_lines.Count - 1].FieldByName("SOURCEINDEX").Value = Convert.ToInt32(operasyon["SOURCE_WH"]);
transactions_lines[transactions_lines.Count - 1].FieldByName("SOURCECOSTGRP").Value = 12;
transactions_lines[transactions_lines.Count - 1].FieldByName("LINE_NUMBER").Value = LINE_NUMBER;
transactions_lines[transactions_lines.Count - 1].FieldByName("QUANTITY").Value = Convert.ToDouble(item["QUANTITY"]);
transactions_lines[transactions_lines.Count - 1].FieldByName("UNIT_CODE").Value = item["UNIT_CODE"].ToString();
transactions_lines[transactions_lines.Count - 1].FieldByName("UNIT_CONV1").Value = 0;
transactions_lines[transactions_lines.Count - 1].FieldByName("UNIT_CONV2").Value = 0;
transactions_lines[transactions_lines.Count - 1].FieldByName("EDT_CURR").Value = 1;
transactions_lines[transactions_lines.Count - 1].FieldByName("PORD_CLS_PLN_AMNT").Value = Convert.ToDouble(item["QUANTITY"]);

LINE_NUMBER++;
}
}


Giriş fişi ;


UnityObjects.Data items = UnityApp.NewDataObject(UnityObjects.DataObjectType.doMaterialSlip);
items.New();
items.DataFields.FieldByName("GROUP").Value = 3;
items.DataFields.FieldByName("TYPE").Value = 13;
items.DataFields.FieldByName("NUMBER").Value = "~";
items.DataFields.FieldByName("DATE").Value = DateTime.Now.ToString("dd.MM.yyyy");
items.DataFields.FieldByName("TIME").Value = ((DateTime.Now.Hour * 16777216) + (DateTime.Now.Minute * 65536) + (DateTime.Now.Second * 256));
items.DataFields.FieldByName("AUTH_CODE").Value = 0;
items.DataFields.FieldByName("PORDER_TYPE").Value = 1;
items.DataFields.FieldByName("SOURCE_WH").Value = Convert.ToInt32(operasyon["SOURCE_WH"]);
items.DataFields.FieldByName("SOURCE_WSCODE").Value = operasyon["SOURCE_WSCODE"].ToString();
items.DataFields.FieldByName("SPO_DETAIL_CODE").Value = operasyon["SPO_DETAIL_CODE"].ToString();
items.DataFields.FieldByName("SRCPOLN_REFERENCE").Value = Convert.ToInt32(operasyon["SRCPOLN_REFERENCE"]);
items.DataFields.FieldByName("SOURCE_COST_GRP").Value = 12;
items.DataFields.FieldByName("SOURCE_DIVISION_NR").Value = 1;
items.DataFields.FieldByName("DEST_DIVISION_NR").Value = 1;
items.DataFields.FieldByName("PORDER_STATUS").Value = Convert.ToInt32(operasyon["PORDER_STATUS"]);
items.DataFields.FieldByName("CURRSEL_TOTALS").Value = 1;
DataRow[] rw = isemirleri.Select("SOURCE_WH=" + Convert.ToInt32(operasyon["SOURCE_WH"]) + " and SOURCE_WSCODE='" + operasyon["SOURCE_WSCODE"] + "' and SPO_DETAIL_CODE='" + operasyon["SPO_DETAIL_CODE"] + "' and SRCPOLN_REFERENCE=" + Convert.ToInt32(operasyon["SRCPOLN_REFERENCE"]) + "");
if (rw.Length > 0)
{
int LINE_NUMBER = 1;
UnityObjects.Lines transactions_lines = items.DataFields.FieldByName("TRANSACTIONS").Lines;
foreach (DataRow item in rw.CopyToDataTable().Rows)
{
transactions_lines.AppendLine();
transactions_lines[transactions_lines.Count - 1].FieldByName("ITEM_CODE").Value = item["ITEM_CODE"].ToString();
transactions_lines[transactions_lines.Count - 1].FieldByName("LINE_TYPE").Value = Convert.ToInt32(item["LINE_TYPE"]);
transactions_lines[transactions_lines.Count - 1].FieldByName("PRORD_REFERENCE").Value = Convert.ToInt32(item["PRORD_REFERENCE"]);
transactions_lines[transactions_lines.Count - 1].FieldByName("PRORD_TYPE").Value = 1;
transactions_lines[transactions_lines.Count - 1].FieldByName("SOURCEINDEX").Value = Convert.ToInt32(operasyon["SOURCE_WH"]);
transactions_lines[transactions_lines.Count - 1].FieldByName("SOURCECOSTGRP").Value = 12;
transactions_lines[transactions_lines.Count - 1].FieldByName("LINE_NUMBER").Value = LINE_NUMBER;
transactions_lines[transactions_lines.Count - 1].FieldByName("QUANTITY").Value = Convert.ToDouble(item["QUANTITY"]);
transactions_lines[transactions_lines.Count - 1].FieldByName("UNIT_CODE").Value = item["UNIT_CODE"].ToString();
transactions_lines[transactions_lines.Count - 1].FieldByName("UNIT_CONV1").Value = 0;
transactions_lines[transactions_lines.Count - 1].FieldByName("UNIT_CONV2").Value = 0;
transactions_lines[transactions_lines.Count - 1].FieldByName("EDT_CURR").Value = 1;
transactions_lines[transactions_lines.Count - 1].FieldByName("PLN_AMOUNT").Value = Convert.ToDouble(item["QUANTITY"]);

LINE_NUMBER++;
}
}




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