Below method can be used to mark the Invoice amounts for settlement in very easy way.
In your code to loop through ledgerjournaltrans(assuming you already created payment lines for respective Customer/vendor, if not, then create payment record either by X++ or direct entry through payment screens).
Just for reference, i am creating payment via x++ and marked the invoices for settlement.
I am posting full process (create & Post SO, Create Payment entry, Mark invoice for settlement, post payment entry)
form class Declaration.
Below method can be used for SO creation and Payment entry.
Below method can be used for settlement of required amount
yes, I am done here. Thanks!!!
In your code to loop through ledgerjournaltrans(assuming you already created payment lines for respective Customer/vendor, if not, then create payment record either by X++ or direct entry through payment screens).
Just for reference, i am creating payment via x++ and marked the invoices for settlement.
I am posting full process (create & Post SO, Create Payment entry, Mark invoice for settlement, post payment entry)
form class Declaration.
public class FormRun extends ObjectRun { CustTable custtable_g; CustInvoiceJour bitcustInvoiceJour; }
Below method can be used for SO creation and Payment entry.
public void TestReceipt() { SalesTable salesTable; NumberSeq NumberSeq; SalesLine salesLine; SalesFormLetter formLetterObj; InventTable inventTable; Ledgerjournalname ledgerjournalname; LedgerjournalTable LedgerjournalTable; LedgerjournalTrans LedgerjournalTrans; LedgerJournalCheckPost ledgerJournalCheckPost; ; try { ttsBegin; //Create sales header NumberSeq = NumberSeq::newGetNumFromId(SalesParameters::numRefSalesId().NumberSequenceId); salesTable.SalesId = NumberSeq.num(); salesTable.initValue(); salesTable.CustAccount = custtable_g.AccountNum; //custtable_g is already initialized salesTable.initFromCustTable(); salesTable.insert(); //Create Sales lines salesLine.clear(); salesLine.SalesId = salesTable.SalesId; salesLine.ItemId = ItemId.valueStr(); inventTable = InventTable::find(ItemId.valueStr()); salesLine.initFromInventTable(inventTable); salesLine.SalesQty = Quantity.value(); salesLine.createLine(NoYes::Yes, // Validate NoYes::Yes, // initFromSalesTable NoYes::Yes, // initFromInventTable NoYes::Yes, // calcInventQty NoYes::Yes, // searchMarkup NoYes::Yes); // searchPrice //confirmation //formLetterObj = SalesFormLetter::construct(DocumentStatus::Confirmation); //formLetterObj.update(salesTable,Selldate.dateValue()); //Packing Slip formLetterObj = SalesFormLetter::construct(DocumentStatus::PackingSlip); formLetterObj.update(salesTable,Selldate.dateValue()); //Post Invoice formLetterObj = SalesFormLetter::construct(DocumentStatus::Invoice); formLetterObj.update(salesTable,Selldate.dateValue()); ttsCommit; // ttsBegin; bitcustInvoiceJour = formLetterObj.parmJournalRecord(); //Generate and post receipt select ledgerjournalname where ledgerjournalname.JournalName == "PayJ"; //use correct payment journal name //ttsBegin; LedgerjournalTable.JournalName = ledgerjournalname.JournalName; LedgerjournalTable.initFromLedgerJournalName(); LedgerjournalTable.JournalNum = JournalTableData::newTable(LedgerjournalTable).nextJournalId(); LedgerjournalTable.insert(); numberSeq = NumberSeq::newGetVoucherFromId((ledgerjournalname.NumberSequenceTable)); LedgerjournalTrans.Voucher = numberSeq.voucher(); LedgerjournalTrans.JournalNum = LedgerjournalTable.JournalNum; LedgerjournalTrans.AccountType = LedgerJournalACType::Cust; LedgerjournalTrans.Company = curext(); LedgerjournalTrans.parmAccount(custtable_g.AccountNum,LedgerjournalTrans.AccountType); LedgerjournalTrans.initFromCustTable(custtable_g); LedgerjournalTrans.TransDate = Selldate.dateValue(); LedgerjournalTrans.ExchRate = Currency::exchRate(LedgerjournalTrans.CurrencyCode); LedgerjournalTrans.Txt = strFmt('Payment for item sale for sales id : %1',salestable.SalesId); LedgerjournalTrans.DefaultDimension = custtable_g.DefaultDimension; LedgerjournalTrans.OffsetDefaultDimension = custtable_g.DefaultDimension; LedgerjournalTrans.TransactionType = LedgerTransType::Payment; LedgerjournalTrans.AmountCurCredit = bitcustInvoiceJour.InvoiceAmount; LedgerjournalTrans.PaymMode = CustPaymMode.valueStr(); LedgerjournalTrans.SettleVoucher = SettlementType::SelectedTransact; LedgerjournalTrans.modifiedField(fieldNum(LedgerjournalTrans,PaymMode)); LedgerjournalTrans.insert(); element.settlement(LedgerjournalTrans,LedgerjournalTrans.AmountCurCredit); //look for method //Post Journal ledgerJournalCheckPost = LedgerJournalCheckPost::newLedgerJournalTable(LedgerjournalTable,NoYes::Yes); ledgerJournalCheckPost.run(); ttsCommit; info(strFmt("Journal %1 created for item sales Id %2 to Student id %3",LedgerjournalTable.JournalNum,salestable.SalesId,custtable_g.AccountNum)); } catch { error("error in generating receipt for sale."); } }
Below method can be used for settlement of required amount
void settlement(ledgerJournalTrans _ledgerJournalTrans,real _amounttoSettle) { SpecTrans insertSpecTrans; ; insertSpecTrans.SpecCompany = _ledgerJournalTrans.Company; insertSpecTrans.SpecTableId = TableNum(ledgerJournalTrans); insertSpecTrans.SpecRecId = _ledgerJournalTrans.RecId; insertSpecTrans.RefCompany = _ledgerJournalTrans.Company; insertSpecTrans.RefTableId = TableNum(custTransOPen); insertSpecTrans.RefRecId = custTransOPen::findRefId(bitcustInvoiceJour.custTrans().RecId).RecId; insertSpecTrans.Balance01 = _amounttoSettle; insertSpecTrans.Code = _ledgerJournalTrans.CurrencyCode; insertSpecTrans.Payment = NoYes::No; insertSpecTrans.LineNum = 1; insertSpecTrans.insert(); }
yes, I am done here. Thanks!!!
Halo,I'm Helena Julio from Ecuador,I want to talk good about Le_Meridian Funding Service on this topic.Le_Meridian Funding Service gives me financial support when all bank in my city turned down my request to grant me a loan of 500,000.00 USD, I tried all i could to get a loan from my banks here in Ecuador but they all turned me down because my credit was low but with god grace I came to know about Le_Meridian so I decided to give a try to apply for the loan. with God willing they grant me loan of 500,000.00 USD the loan request that my banks here in Ecuador has turned me down for, it was really awesome doing business with them and my business is going well now. Here is Le_Meridian Funding Investment Email/WhatsApp Contact if you wish to apply loan from them.Email:lfdsloans@lemeridianfds.com / lfdsloans@outlook.comWhatsApp Contact:+1-989-394-3740.
ReplyDeleteValuable post useful for everyone.Keep on sharing.
ReplyDeleteD365 Finance and Operations Training
D365 Finance and Operations Online Training
D365 Finance Training
D365 Operations Training
very useful post..
ReplyDeleteMicrosoft dynamics 365 for finance and operations
Dynamics 365 finance and operations
D365 finance and operations
Dynamics 365 training
Microsoft dynamics 365 training
New Safety Razor - Merit Casino
ReplyDeleteBuy 카지노 사이트 주소 a new 카지노사이트luckclub safety razor at the Merit Casino. Merit's proprietary Merit razors feature 메리트 카지노 쿠폰 a 메리트 카지노 조작 longer lasting blade that provides the grip and $99.99 온 카지노 가입쿠폰 · In stock
Such an informative post Thanks for sharing. We are providing the best services click on below links to visit our website.
ReplyDeleteD365 Finance and Operations - Training
D365 Finance and Operations Online - Training
D365 Finance Online - Training
D365 Operations - Training
D365 Functional Training - Hyderabad
Dynamics 365 Finance and Operations - Training
D365 Functional Training - Ameerpet
Excellent Thanks for sharing this post
ReplyDeleteSupply Chain Management Online Training Course
Dynamics 365 Supply Chain Management Training
D365 Supply Chain Management Functional(T&L)
Dynamics 365 Trade and Logistics Functional Training
Dynamics 365 Supply Chain in Hyderabad
MS Dynamics Trade Logistics Training Hyderabad
Dynamics AX Trade and Logistics Online Training
Microsoft Dynamics Course in Hyderabad
MS Dynamics trade and logistics training
Supply Chain Management Course Online
Good Article Thanks for sharing this post
ReplyDeleteSupply Chain Management Online Training Course
Dynamics 365 Supply Chain Management Training
D365 Supply Chain Management Functional(T&L)
Dynamics 365 Trade and Logistics Functional Training
Dynamics 365 Supply Chain in Hyderabad
MS Dynamics Trade Logistics Training Hyderabad
Dynamics AX Trade and Logistics Online Training
Microsoft Dynamics Course in Hyderabad
MS Dynamics trade and logistics training
Supply Chain Management Course Online