return new ModificationInfo(persistAudit(auditDoc));
}
@Override
public ModificationInfo copy() throws ClipsServerException {
Contract contract = getExistentEntity();
if (contract.getType() == Contract.TYPE_OMI) {
checkCommandAccessibility(COMMAND_MODIFY_OMI);
} else {
checkCommandAccessibility(COMMAND_MODIFY_CLINIC);
}
try {
ArrayList<AuditDoc> auditDocList = new ArrayList<AuditDoc>();
AuditDoc<Contract> auditDoc = new AuditDoc<Contract>(null, getCollaborator());
auditDocList.add(auditDoc);
Contract newContract = (Contract) contract.clone();
newContract.setBegin(null);
newContract.setIndex(newContract.getIndex() + "(копия)");
int id = saveEntity(newContract);
auditDoc.check(newContract);
copyServices(contract, newContract, auditDocList);
copyPackets(contract, newContract, auditDocList);