private void cmd_saveChange(){
  MCashBook cashBook=new MCashBook(p_ctx,p_pos.getC_CashBook_ID(),null);
  Timestamp today=TimeUtil.getDay(System.currentTimeMillis());
  MCash cash=MCash.get(p_ctx,p_pos.getC_CashBook_ID(),today,null);
  BigDecimal initialChange=(BigDecimal)v_change.getValue();
  if (cash != null && cash.get_ID() != 0 && initialChange.compareTo(cash.getEndingBalance()) != 0) {
    MCashLine cl=new MCashLine(cash);
    cl.setCashType(MCashLine.CASHTYPE_Difference);
    cl.setAmount(initialChange.subtract(cash.getEndingBalance()));
    cl.setDescription("Initial Change Before: " + cash.getEndingBalance() + " Now: "+ initialChange);
    cl.saveEx();
  }
  v_PreviousChange.setValue(initialChange);
}

private void cmd_saveChange ( ) { MCashBook cashBook = new MCashBook ( p_ctx , p_pos . getC_CashBook_ID ( ) , null ) ; Timestamp today = TimeUtil . getDay ( System . currentTimeMillis ( ) ) ; MCash cash = MCash . get ( p_ctx , p_pos . getC_CashBook_ID ( ) , today , null ) ; BigDecimal initialChange = ( BigDecimal ) v_change . getValue ( ) ; if ( cash != null && cash . get_ID ( ) != 0 && initialChange . compareTo ( cash . getEndingBalance ( ) ) != 0 ) { MCashLine cl = new MCashLine ( cash ) ; cl . setCashType ( MCashLine . CASHTYPE_Difference ) ; cl . setAmount ( initialChange . subtract ( cash . getEndingBalance ( ) ) ) ; cl . setDescription ( "Initial Change Before: " + cash . getEndingBalance ( ) + " Now: " + initialChange ) ; cl . saveEx ( ) ; } v_PreviousChange . setValue ( initialChange ) ; }
save the initial change of the cash
