/**
  * Delete an existing journal voucher (soft delete)
  *
  * @param int $input Voucher id
  *
  * @return JSON encoded string
  *  A string as follows:
  *	In case of success: {"success" : form.defaultSuccessDeleteMessage}
  */
 public function deleteJournalVoucher($input)
 {
     $this->DB->transaction(function () use($input) {
         $loggedUserId = $this->AuthenticationManager->getLoggedUserId();
         $organizationId = $this->AuthenticationManager->getCurrentUserOrganization('id');
         $JournalVoucher = $this->JournalVoucher->byId($input['id']);
         $Journal = $this->Journal->create(array('journalized_id' => $input['id'], 'journalized_type' => $this->JournalVoucher->getTable(), 'user_id' => $loggedUserId, 'organization_id' => $organizationId));
         $this->Journal->attachDetail($Journal->id, array('note' => $this->Lang->get('decima-accounting::journal-management.journalVoucherDeletedJournal', array('number' => $JournalVoucher->number)), $Journal));
         // $this->JournalVoucher->delete(array($input['id']));
         $this->JournalEntry->byJournalVoucherId($input['id'])->each(function ($JournalEntry) use($JournalVoucher, $Journal) {
             $this->updateJournalEntry(array('journal_voucher_id' => $JournalVoucher->id, 'journal_entry_id' => $JournalEntry->id, 'debit' => '0.00', 'credit' => '0.00', 'number' => $JournalVoucher->number), $Journal);
         });
         $this->updateJournalVoucherStatus($JournalVoucher->id, $Journal, $JournalVoucher, 'C');
     });
     return json_encode(array('success' => $this->Lang->get('decima-accounting::journal-management.successDeletedVoucherMessage')));
 }