Kişi bilgileri gizlidir. Logo çalışanları görebilir.

Object Dll ile Teklif Kayıt Ederken Başlığı Teklif Tablosuna Satırı Sipariş Satırı Tablosuna Atıyor

  Tiger/Logo Objects

Merhaba


Aşağıdaki kod ile yaptığımız kayıtta. 

Başlık bilgilerini LG_XXX_PURCHOFFER tablosuna

Satır bilgilerinide  LG_XXX_XX_ORFLINE tablosuna yazıyor


nerede hata yapıyor olabiliriz. 


Kolay gelsin.


object logoOrderTime = 0;
UnityApp.PackTime(DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second, ref logoOrderTime);

UnityApp.Login(company.ErpUserName, company.ErpPassword, Convert.ToInt16(company.ErpBranchCode), 0);
Data logoOffer = UnityApp.NewDataObject(DataObjectType.doSalesOffer);
logoOffer.New();

logoOffer.DataFields.FieldByName("ARP_CODE").Value = proposal.CustomerCode;
logoOffer.DataFields.FieldByName("FICHENO").Value = proposal.ProposalNo;
logoOffer.DataFields.FieldByName("DATE").Value = proposal.ProposalDate;
logoOffer.DataFields.FieldByName("TIME").Value = logoOrderTime;
logoOffer.DataFields.FieldByName("AUXIL_CODE").Value = proposal.Note2;
logoOffer.DataFields.FieldByName("AUTH_CODE").Value = proposal.BranchCode;
logoOffer.DataFields.FieldByName("SOURCEINDEX").Value = proposal.WarehouseCode;
logoOffer.DataFields.FieldByName("GENEXP1").Value = proposal.Note1;
logoOffer.DataFields.FieldByName("GENEXP3").Value = proposal.Note3;
logoOffer.DataFields.FieldByName("BRANCH").Value = proposal.BranchCode;
logoOffer.DataFields.FieldByName("DEPARTMENT").Value = 0;
logoOffer.DataFields.FieldByName("CAPIBLOCK_CREATEDBY").Value = 1;
logoOffer.DataFields.FieldByName("CAPIBLOCK_CREADEDDATE").Value = DateTime.Now;
if (!string.IsNullOrEmpty(proposal.SalesPersonCode))
logoOffer.DataFields.FieldByName("SALESMAN_CODE").Value = proposal.SalesPersonCode;
logoOffer.DataFields.FieldByName("DEDUCTION_PART1").Value = 2;
logoOffer.DataFields.FieldByName("DEDUCTION_PART2").Value = 3;

short index = 0;
foreach (SProposalProduct orderProduct in proposal.ProductList)
{
index = (short)(index + 1);
var transactions_lines = logoOffer.DataFields.FieldByName("TRANSACTIONS").Lines;

transactions_lines.AppendLine();
transactions_lines[transactions_lines.Count - 1].FieldByName("TYPE").Value = 0;
transactions_lines[transactions_lines.Count - 1].FieldByName("TRCODE").Value = 1;
transactions_lines[transactions_lines.Count - 1].FieldByName("MASTER_CODE").Value = orderProduct.ProductID;
transactions_lines[transactions_lines.Count - 1].FieldByName("QUANTITY").Value = orderProduct.Amount;
transactions_lines[transactions_lines.Count - 1].FieldByName("PRICE").Value = Convert.ToDouble(orderProduct.Price * (1 + (orderProduct.VatRate / 100)));
transactions_lines[transactions_lines.Count - 1].FieldByName("VAT").Value = Convert.ToDouble(orderProduct.VatRate);
transactions_lines[transactions_lines.Count - 1].FieldByName("UEDIT").Value = orderProduct.Unit;
transactions_lines[transactions_lines.Count - 1].FieldByName("VATINC").Value = 1;
transactions_lines[transactions_lines.Count - 1].FieldByName("DUEDATE").Value = proposal.DeliveryDate ?? proposal.ProposalDate;
transactions_lines[transactions_lines.Count - 1].FieldByName("PRCURR").Value = defaultCurrencyErpCode;
transactions_lines[transactions_lines.Count - 1].FieldByName("SOURCEINDEX").Value = proposal.WarehouseCode;
transactions_lines[transactions_lines.Count - 1].FieldByName("BRANCH").Value = proposal.BranchCode;
transactions_lines[transactions_lines.Count - 1].FieldByName("SALESMANCODE").Value = proposal.SalesPersonCode;
transactions_lines[transactions_lines.Count - 1].FieldByName("FCTYP").Value = 1;
transactions_lines[transactions_lines.Count - 1].FieldByName("PURCHOFFNR").Value = 1;
}

if (logoOffer.Post())
{
LoggerHelper.Instance.Info(String.Format("DataLayerHelper: SaveProposal - CustomerCode={0}, ProposalNo={1}, ErpType={2} Transaction Commit ", proposal.CustomerCode, proposal.ProposalNo, company.ErpTypeID));

result.IsSuccess = true;
result.ProposalNo = proposal.ProposalNo;

var orderUpdateResult = ActionProcedures.UpdateErpProposalAfterInsert(domainID, proposal.CustomerCode, proposal.ProposalNo) > 0;
}
else
{
if (logoOffer.ErrorCode != 0)
{
result.Message = "DataLayerHelper: SaveProposal - UnityObject DBError -" + logoOffer.ErrorCode.ToString() + " - " + logoOffer.ErrorDesc + logoOffer.DBErrorDesc;
}
else if (logoOffer.ValidateErrors.Count > 0)
{
result.Message = "DataLayerHelper: SaveProposal - UnityObject XMLError -";
for (int i = 0; i < logoOffer.ValidateErrors.Count; i++)
{
result.Message += logoOffer.ValidateErrors[i].ID.ToString() + " - " + logoOffer.ValidateErrors[i].Error + ", ";
}
}

LoggerHelper.Instance.Info(String.Format("DataLayerHelper: SaveProposal - CustomerCode={0}, ProposalNo={1}, ErpType={2} Transaction Rollback {3} ", proposal.CustomerCode, proposal.ProposalNo, company.ErpTypeID, result.Message));
}
}


object dll offer teklif logo

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