package org.mxchange.jfinancials.enterprise.financial;
import java.text.MessageFormat;
+import java.util.Date;
import org.mxchange.jfinancials.enterprise.BaseFinancialsEnterpriseBean;
import org.mxchange.jfinancials.model.receipt.BillableReceipt;
import org.mxchange.jfinancials.model.receipt.Receipts;
// Merge receipt instance
final BillableReceipt managedReceipt = this.getEntityManager().merge(foundReceipt);
+ // Set updated timestamp
+ managedReceipt.setReceiptUpdated(new Date());
+
// Trace message
this.getLoggerBeanLocal().logTrace(MessageFormat.format("mergeReceipt: managedReceipt={0} - EXIT!", managedReceipt)); //NOI18N
throw new ReceiptNotFoundException(receipt);
}
- // Add created instance
- receipt.setReceiptCreated(new Date());
-
// Is user instance set?
if (receipt.getReceiptUser() instanceof User) {
// Then get managed instanced
receipt.setReceiptSellerEmployee(managedEmployee);
}
- // Set updated timestamp
- receipt.setReceiptUpdated(new Date());
-
// Merge data
- final BillableReceipt detachedReceipt = this.mergeReceipt(receipt);
+ final BillableReceipt managedReceipt = this.mergeReceipt(receipt);
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateReceipt(): detachedReceipt.receiptId={1} - EXIT!", this.getClass().getSimpleName(), detachedReceipt.getReceiptId())); //NOI18N
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateReceipt(): managedReceipt.receiptId={1} - EXIT!", this.getClass().getSimpleName(), managedReceipt.getReceiptId())); //NOI18N
// Return it
- return detachedReceipt;
+ return managedReceipt;
}
}