RMA Validator
This commit is contained in:
parent
08458e7f15
commit
72a59a4901
|
|
@ -92,13 +92,11 @@ public class MID_RMAValidator {
|
||||||
iLine.setQtyInvoiced(line.getQty());
|
iLine.setQtyInvoiced(line.getQty());
|
||||||
iLine.saveEx();
|
iLine.saveEx();
|
||||||
}
|
}
|
||||||
|
|
||||||
invoice.processIt(DocAction.ACTION_Complete);
|
invoice.processIt(DocAction.ACTION_Complete);
|
||||||
invoice.saveEx();
|
invoice.saveEx();
|
||||||
MInvoice invoiceUsed = new MInvoice(RMA.getCtx (), order.getC_Invoice_ID(), RMA.get_TrxName());
|
MInvoice invoiceUsed = new MInvoice(RMA.getCtx (), order.getC_Invoice_ID(), RMA.get_TrxName());
|
||||||
if(invoiceUsed.getC_Payment_ID()>0 && (invoice.getC_Order().getC_DocType_ID()==1000135 || invoice.getC_Order().getC_DocType_ID()==135)) {
|
if(invoiceUsed.getC_Payment_ID()>0 && (invoiceUsed.getC_Order().getC_DocTypeTarget_ID()==135 || invoiceUsed.getC_Order().getC_DocTypeTarget_ID()==1000135 || invoiceUsed.getC_Order().getC_DocType_ID()==1000135 || invoiceUsed.getC_Order().getC_DocType_ID()==135)) {
|
||||||
MPayment payment = new MPayment(RMA.getCtx(), 0, RMA.get_TrxName());
|
MPayment payment = new MPayment(RMA.getCtx(), 0, RMA.get_TrxName());
|
||||||
|
|
||||||
payment.setC_Invoice_ID(invoice.get_ID());
|
payment.setC_Invoice_ID(invoice.get_ID());
|
||||||
// payment.setC_Order_ID(invoice.getC_Order_ID());
|
// payment.setC_Order_ID(invoice.getC_Order_ID());
|
||||||
payment.setIsReceipt(invoice.isSOTrx());
|
payment.setIsReceipt(invoice.isSOTrx());
|
||||||
|
|
@ -107,8 +105,8 @@ public class MID_RMAValidator {
|
||||||
payment.setC_BPartner_ID(invoice.getC_BPartner_ID());
|
payment.setC_BPartner_ID(invoice.getC_BPartner_ID());
|
||||||
payment.setAmount(invoice.getC_Currency_ID(), invoice.getGrandTotal().negate());
|
payment.setAmount(invoice.getC_Currency_ID(), invoice.getGrandTotal().negate());
|
||||||
payment.setC_BankAccount_ID(invoiceUsed.getC_Payment().getC_BankAccount_ID());
|
payment.setC_BankAccount_ID(invoiceUsed.getC_Payment().getC_BankAccount_ID());
|
||||||
|
payment.setDescription("Return Material and Payment for POS Invoice No : "+invoiceUsed.getDocumentNo()+" and Payment ID : "+invoiceUsed.getC_Payment_ID());
|
||||||
payment.saveEx();
|
payment.saveEx();
|
||||||
|
|
||||||
payment.processIt(DocAction.ACTION_Complete);
|
payment.processIt(DocAction.ACTION_Complete);
|
||||||
payment.saveEx();
|
payment.saveEx();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue