To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/76a10bfd-24df-45f1-8ebb-d60ef4207b3e%40googlegroups.com.--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/21137334-2885-4cd9-b85a-75ad7715a590%40googlegroups.com.
If possible please share the customization, which allow payment of different business partner.
Regards
Hans
public ArrayList<Fact> createFacts (MAcctSchema as) { ArrayList<Fact> facts = super.createFacts(as); // Normal posting
for (int i = 0; i < p_lines.length; i++) { DocLine_Allocation line = (DocLine_Allocation)p_lines[i]; if (line.getC_Invoice_ID() > 0 && line.getC_Payment_ID() > 0) { MInvoice_Tgi invoice = new MInvoice_Tgi(Env.getCtx(), line.getC_Invoice_ID(), null); MPayment payment = new MPayment(Env.getCtx(), line.getC_Payment_ID(), null);
if (invoice.getC_BPartner_ID() != payment.getC_BPartner_ID()) { Object[] arguments = new Object[3]; arguments[0] = invoice.getDocumentInfo(); arguments[1] = invoice.getC_BPartner().getName(); arguments[2] = payment.getC_BPartner().getName(); MessageFormat mf = new MessageFormat(Msg.getMsg(Env.getAD_Language(Env.getCtx()), "DocAllocInterBPartnerDescription"), Env.getLanguage(Env.getCtx()).getLocale()); String description = mf.format (arguments);
// Payment Fact fact = new Fact(this, as, Fact.POST_Actual); FactLine fl = fact.createLine (line, getAccount(Doc.ACCTTYPE_UnallocatedCash, as), getC_Currency_ID(), line.getAmtSource(), null); if (fl != null) { fl.setAD_Org_ID(payment.getAD_Org_ID()); fl.setC_BPartner_ID(payment.getC_BPartner_ID()); fl.setDescription(description); }
// Invoice fl = fact.createLine (line, getAccount(Doc.ACCTTYPE_UnallocatedCash, as), getC_Currency_ID(), null, line.getAmtSource()); if (fl != null) { fl.setAD_Org_ID(invoice.getAD_Org_ID()); fl.setC_BPartner_ID(invoice.getC_BPartner_ID()); fl.setDescription(description); } facts.add(fact); } } }
return facts; }
Thank you very much for sharing.
Regards
Hans