Thursday, 10 January 2019

Complete Call center sales orders using x++ code


MCRCustPaymTable        mcrCustPaymTable;
RetailMCRChannelTable   retailMCRChannelTable;
boolean                 mcrCallCenterOrder;

//Returns whether the sales order is associated with a call center or not.
mcrCallCenterOrder = salesTable.mcrIsCallCenter();
           
if (mcrCallCenterOrder == true)
{
       select firstonly retailMCRChannelTable
                    where retailMCRChannelTable.RecId   == salesTable.RetailChannelTable;

       mcrCustPaymTable.CustAccount    = salesTable.CustAccount;
       mcrCustPaymTable.CurrencyCode   = salesTable.CurrencyCode;
       mcrCustPaymTable.Channel        = salesTable.RetailChannelTable;
       mcrCustPaymTable.LineNum        = 1;
       mcrCustPaymTable.OnAccountAuthorized = NoYes::Yes;
       mcrCustPaymTable.PercentAmount  = 100;
       mcrCustPaymTable.TenderTypeId   = retailMCRChannelTable.DOMServiceEventPaymMethod;
       mcrCustPaymTable.CustPaymType   = MCRCustPaymTable::getMCRTypeFromTender(mcrCustPaymTable.TenderTypeId,
                                                                                         mcrCustPaymTable.Channel,
                                                                                         mcrCustPaymTable.CardTypeId);
       mcrCustPaymTable.RefTableId     = salesTable.TableId;
       mcrCustPaymTable.RefRecId       = salesTable.RecId;
       mcrCustPaymTable.insert();

       MCRSalesOrderTotals mcrSalesOrderTotals = new MCRSalesOrderTotals(salesTable, true);

       //complete
       MCREndOrder::endOrder(salesTable.SalesId, true, mcrSalesOrderTotals, false);
}

1 comment:

  1. Excellent Blog! I would Thanks for sharing this wonderful content.its very useful to us.I gained many unknown information, the way you have clearly explained is really fantastic.
    oracle training in chennai

    oracle training institute in chennai

    oracle training in bangalore

    oracle training in hyderabad

    oracle training

    hadoop training in chennai

    hadoop training in bangalore


    ReplyDelete