Buenos dias, estoy tratando de realizar una reconciliacion internar con el SDK, entre una factura (IN) y una asiento contable (JE). tengo el siguiente codigo pero el mensaje de respuesta es “no existen registros coincidentes”.
En los campos transId les asigno los que obtengo de la consulta en la Base de Datos
select TransId from oinv where docnum = ‘213138’
select TransId from OJDT where Number =‘660453’
y este es mi codigo.
public void reconciliacion()
{
SAPbobsCOM.Company oCompany = new SAPbobsCOM.Company();
try
{
// oCompany.CompanyDB = "SBO_FARMAVIC_PRODUCCION";
oCompany.CompanyDB = "PRUEBA_LOCALIZACION";
oCompany.Server = "192.168.74.3";
oCompany.LicenseServer = "192.168.74.3:40000";
oCompany.SLDServer = "192.168.74.3:40000";
oCompany.DbUserName = "SA";
oCompany.DbPassword = "naissant474.com.co";
oCompany.UserName = "manager";
oCompany.Password = "Farmavic18";
oCompany.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2014;
oCompany.language = SAPbobsCOM.BoSuppLangs.ln_Spanish_La;
int ret = oCompany.Connect();
string msgerr = oCompany.GetLastErrorDescription();
int errno = oCompany.GetLastErrorCode();
if (errno != 0)
{
MessageBox.Show(msgerr);
// resultado = false;
}
else
{
InternalReconciliationsService service = (InternalReconciliationsService)oCompany.GetCompanyService().GetBusinessService(ServiceTypes.InternalReconciliationsService);
InternalReconciliationOpenTransParams transParams = (InternalReconciliationOpenTransParams)service.GetDataInterface(InternalReconciliationsServiceDataInterfaces.irsInternalReconciliationOpenTransParams);
// Set date selection criteria
transParams.ReconDate = DateTime.Today;
transParams.DateType = ReconSelectDateTypeEnum.rsdtPostDate;
transParams.FromDate = new DateTime(2017, 10, 11);
transParams.ToDate = new DateTime(2017, 11, 11);
// Set account or card selection criterio
transParams.CardOrAccount = CardOrAccountEnum.coaCard;
transParams.InternalReconciliationBPs.Add();
transParams.InternalReconciliationBPs.Item(0).BPCode = "C1037605510";
try
{
InternalReconciliationOpenTrans openTrans = (InternalReconciliationOpenTrans)service.GetDataInterface(InternalReconciliationsServiceDataInterfaces.irsInternalReconciliationOpenTrans);
// Select transactions to reconcile and adjust amount
openTrans.ReconDate = DateTime.Now;
openTrans.InternalReconciliationOpenTransRows.Add();
openTrans.InternalReconciliationOpenTransRows.Item(0).Selected = SAPbobsCOM.BoYesNoEnum.tYES;
openTrans.InternalReconciliationOpenTransRows.Item(0).TransId = 531808;
openTrans.InternalReconciliationOpenTransRows.Item(0).ReconcileAmount = 15080;
openTrans.InternalReconciliationOpenTransRows.Add();
openTrans.InternalReconciliationOpenTransRows.Item(1).Selected = SAPbobsCOM.BoYesNoEnum.tYES;
openTrans.InternalReconciliationOpenTransRows.Item(1).TransId = 534880;
openTrans.InternalReconciliationOpenTransRows.Item(1).ReconcileAmount = -15080;
MessageBox.Show("se completó la jugada!");
// Add reconciliation
reconParams = service.Add(openTrans);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
catch
{
}
}
Agradecería me pudieran ayudar a resolver esta duda. se que solo me debe hacer falta algo sencillo.