public static MCashLine createCashLine(Properties ctx,int cashId,int invoiceId,BigDecimal amount,BigDecimal writeOffAmout,BigDecimal discountAmt,String trxName) throws OperationException {
  MInvoice invoice=new MInvoice(ctx,invoiceId,trxName);
  if (invoice.get_ID() == 0) {
    throw new OperationException("Could not load invoice!!!");
  }
  MCashLine cashLine=new MCashLine(ctx,0,trxName);
  cashLine.setC_Cash_ID(cashId);
  cashLine.setInvoice(invoice);
  cashLine.setAmount(amount);
  cashLine.setWriteOffAmt(writeOffAmout);
  cashLine.setDiscountAmt(discountAmt);
  PoManager.save(cashLine);
  return cashLine;
}

public static MCashLine createCashLine ( Properties ctx , int cashId , int invoiceId , BigDecimal amount , BigDecimal writeOffAmout , BigDecimal discountAmt , String trxName ) throws OperationException { MInvoice invoice = new MInvoice ( ctx , invoiceId , trxName ) ; if ( invoice . get_ID ( ) == 0 ) { throw new OperationException ( "Could not load invoice!!!" ) ; } MCashLine cashLine = new MCashLine ( ctx , 0 , trxName ) ; cashLine . setC_Cash_ID ( cashId ) ; cashLine . setInvoice ( invoice ) ; cashLine . setAmount ( amount ) ; cashLine . setWriteOffAmt ( writeOffAmout ) ; cashLine . setDiscountAmt ( discountAmt ) ; PoManager . save ( cashLine ) ; return cashLine ; }
creates a new cash journal entry with the amount specified for the invoice
