AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
DAX
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 30.03.2019, 00:33   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
d365technext: Customer Cancel Payment Transaction
Источник: http://d365technext.blogspot.com/201...ansaction.html
==============




Customer Cancel Payment Transaction



Using following code you can cancel the customer Invoice payment


class TMV_CustomerPaymentCancel
{



public static void main(Args _args)
{
LedgerJournalTrans _ledgerJournalTrans;
TMV_CustomerPaymentCancel objCancelPayment=new TMV_CustomerPaymentCancel();
objCancelPayment.cancelpaymentExecution('R00007404',_ledgerJournalTrans);
}

public void cancelpaymentExecution(InvoiceId _invoiceid,LedgerJournalTrans _ledgerJournalTrans)
{

CustTrans custTransOffset;

ReasonTable reasonTable;
ReasonCode reasonCode;
ReasonRefRecID reasonRefRecID;

Args args;

;


custTransOffset= this.findPaymentReference(_invoiceid);


if(custTransOffset.RecId>0)
{
this.CancelPayment(custTransOffset, _ledgerJournalTrans);
}

}

public CustTrans findPaymentReference(InvoiceId _invoiceid)
{
CustTrans custTrans,custTransOffset;

custTrans = CustTrans::findFromInvoice(_invoiceid);
select custTransOffset
where custTransOffset.OffsetRecid==custTrans.RecId
&& custTransOffset.TransType==LedgerTransType::Payment;
return custTransOffset;
}

public void CancelPayment(CustTrans custTransOffset,LedgerJournalTrans _ledgerJournalTrans)
{
CustVendPDCManager custVendPDCManager;
BankPaymCancel bankPaymCancel;
Args localArgs;
if(custTransOffset.RecId)
{

infolog.clear();
try
{
localArgs = new Args();

bankPaymCancel = BankPaymCancel::newBankPaymCancel(custTransOffset);

// bankPaymCancel.parmReason(reasonTable.Reason);
// bankPaymCancel.parmReasonComment(reasonTable.Description);
bankPaymCancel.parmTransDate(systemDateGet());

localArgs.caller(bankPaymCancel);
localArgs.record(custTransOffset);
BankPaymCancel::serverRun(localArgs);

}
catch
{



}

}
}



public str getErrorStr()
{
SysInfologEnumerator enumerator;
SysInfologMessageStruct msgStruct;
Exception exception;
str error;
enumerator = SysInfologEnumerator::newData(infolog.cut());
while (enumerator.moveNext())
{
msgStruct = new SysInfologMessageStruct(enumerator.currentMessage());
exception = enumerator.currentException();
error = strfmt("%1 %2", error, msgStruct.message());
}
return error;
}

}

Источник: http://d365technext.blogspot.com/201...ansaction.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
dynamicsaxse: November 2018 Release – Dynamics AX2012 R3 update Blog bot DAX Blogs 0 15.11.2018 09:11
emeadaxsupport: How to Void/Cancel/Reverse an Accounts Payable Payment that does not a have check number such as ACH, Wire or Electronic Payments in Microsoft Dynamics AX 2012. Blog bot DAX Blogs 0 23.08.2013 22:12
dynamicsaxtraining: Paying a Vendor Blog bot DAX Blogs 0 22.03.2012 22:11
wiki.dynamicsbook: Changes Made in Navision Attain 3.60 Blog bot Dynamics CRM: Blogs 0 02.09.2008 13:23
Inside Dynamics AX 4.0: Transaction Semantics Blog bot DAX Blogs 0 31.10.2007 23:40
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 08:50.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.