Hi Sandip,
Reference to above conversation,I tried to create an payment details in the GP for the sales document(before posting) but when i check in GP, the Amount is 0.
Here I'm placing the code.
/*********************
SOPTransactionType[] transactionTypes = new SOPTransactionType[1];
taCreateSopPaymentInsertRecord_ItemsTaCreateSopPaymentInsertRecord[] sopPaymentRecords = new taCreateSopPaymentInsertRecord_ItemsTaCreateSopPaymentInsertRecord[1];
// Create the payment line item(s)
taCreateSopPaymentInsertRecord_ItemsTaCreateSopPaymentInsertRecord sopPaymentRecord = new taCreateSopPaymentInsertRecord_ItemsTaCreateSopPaymentInsertRecord();
sopPaymentRecord.Action = (Int16)sopPayment.ACTION;
sopPaymentRecord.ActionSpecified = (sopPayment.ACTION != null);
sopPaymentRecord.AUTHCODE = sopPayment.AUTHCODE;
sopPaymentRecord.CUSTNMBR = sopPayment.CUSTNMBR;
sopPaymentRecord.CUSTNAME = sopPayment.CUSTNAME;
sopPaymentRecord.CARDNAME = sopPayment.CARDNAME;
sopPaymentRecord.CHEKBKID = sopPayment.CHEKBKID;
sopPaymentRecord.CHEKNMBR = sopPayment.CHEKNMBR;
sopPaymentRecord.DOCAMNT = (decimal)((sopPayment.DOCAMNT == null) ? 0.00m : (decimal?)sopPayment.DOCAMNT);
sopPaymentRecord.DOCDATE = ((sopPayment.DOCDATE == null) ? sopPaymentRecord.DOCDATE : ((DateTime)sopPayment.DOCDATE).ToString("yyyy-MM-dd"));
sopPaymentRecord.DOCNUMBR = sopPayment.DOCNUMBR;
sopPaymentRecord.EXPNDATE = sopPayment.EXPNDATE;
sopPaymentRecord.MDFUSRID = sopPayment.MDFUSRID;
sopPaymentRecord.PYMTTYPE = (Int16)sopPayment.PYMTTYPE; // Allow to throw exception on null conversion when not supplied.
sopPaymentRecord.RCTNCCRD = sopPayment.RCTNCCRD;
sopPaymentRecord.SEQNUMBR = (Int16)((sopPayment.SEQNUMBR == null) ? 0 : (Int16?)sopPayment.SEQNUMBR);
sopPaymentRecord.SEQNUMBRSpecified = (sopPayment.SEQNUMBR != null);
sopPaymentRecord.SOPNUMBE = sopPayment.SOPNUMBE;
sopPaymentRecord.SOPTYPE = (Int16)sopPayment.SOPTYPE; // Allow to throw exception on null conversion when not supplied.
sopPaymentRecord.USRDEFND1 = sopPayment.USRDEFND1;
sopPaymentRecord.USRDEFND2 = sopPayment.USRDEFND2;
sopPaymentRecord.USRDEFND3 = sopPayment.USRDEFND3;
sopPaymentRecord.USRDEFND4 = sopPayment.USRDEFND4;
sopPaymentRecord.USRDEFND5 = sopPayment.USRDEFND5;
sopPaymentRecord.VOIDDATE = sopPayment.VOIDDATE;
// Create the header
GetNextDocNumbers numbers = new GetNextDocNumbers();
nextSOPNumber = numbers.GetNextSOPNumber(IncrementDecrement.Increment, string.Empty, SopType.SOPInvoice, connectionString);
taSopHdrIvcInsert invoiceHeader = new taSopHdrIvcInsert();
invoiceHeader.SOPNUMBE = nextSOPNumber;
invoiceHeader.BACHNUMB = sopPayment.BACHNUMB;
invoiceHeader.DOCID = sopPayment.DOCID;
invoiceHeader.SOPTYPE = sopPaymentRecord.SOPTYPE;
invoiceHeader.DOCDATE = sopPaymentRecord.DOCDATE;
invoiceHeader.CUSTNMBR = sopPaymentRecord.CUSTNMBR;
invoiceHeader.CUSTNAME = sopPaymentRecord.CUSTNAME;
invoiceHeader.SUBTOTAL = sopPaymentRecord.DOCAMNT;
invoiceHeader.DOCAMNT = 0.00m;
sopPaymentRecords[0] = sopPaymentRecord;
transactionTypes[0] = new SOPTransactionType();
transactionTypes[0].taSopHdrIvcInsert = invoiceHeader;
transactionTypes[0].taCreateSopPaymentInsertRecord_Items = sopPaymentRecords;
eConnectType eConnect = new eConnectType();
eConnect.SOPTransactionType = transactionTypes;
string documentXML = null;
using (StringWriter writer = new StringWriter())
{
XmlSerializer serializer = new XmlSerializer(typeof(eConnectType));
serializer.Serialize(writer, eConnect);
documentXML = writer.ToString();
}
string result = null;
using (eConnectMethods eConnectCall = new eConnectMethods())
{
result = eConnectCall.CreateTransactionEntity(connectionString, documentXML);
}
}
***************************/
Good if you provide with some examples.
Thanks in advance
Chandu