Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug#157642 fix:Showing 'Vendor fee successfully saved' message on after payouts flow completion #87

Open
wants to merge 3 commits into
base: release-1.4.4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions src/com_tjvendors/admin/controllers/payout.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,32 @@ public function changePayoutStatus()
echo json_encode($results);
jexit();
}

/**
* Method to save a record.
*
* @param string $key The name of the primary key of the URL variable.
* @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions).
*
* @return boolean True if successful, false otherwise.
*
* @since __DEPLOY_VERSION__
*/
public function save($key = NULL, $urlVar = NULL)
{
$app = Factory::getApplication();
$vendor_id =$app->input->get('vendor_id', '', 'INTEGER');
$client = $app->input->get('client', '', 'STRING');
$data = $app->input->get('jform', array(), 'array');
$model = $this->getModel('payout', 'TjvendorsModel');
$return = $model->save($data);
$this->setRedirect(Route::_('index.php?option=com_tjvendors&view=payouts&vendor_id' . $vendor_id . '&client=' . $client, false));

if($return != 1)
{
return $app->enqueueMessage(Text::_('COM_TJVENDORS_PAYOUT_UNSUCCESSFULL_MESSAGE'));;
}

return $app->enqueueMessage(Text::_('COM_TJVENDORS_PAYOUT_SUCCESSFULL_MESSAGE'));;
}
}
7 changes: 1 addition & 6 deletions src/com_tjvendors/admin/models/payout.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,6 @@ public function save($data)
// Update their details in the users table using id as the primary key.
Factory::getDbo()->updateObject('#__tjvendors_passbook', $payout_update, 'id');
}

$message = Text::_('COM_TJVENDORS_PAYOUT_SUCCESSFULL_MESSAGE');
Factory::getApplication()->enqueueMessage($message);
}

return true;
Expand Down Expand Up @@ -228,10 +225,8 @@ public function save($data)
$payout_update->transaction_id = $data['transaction_id'] . $payout_update->id;

// Update their details in the users table using id as the primary key.
$result = Factory::getDbo()->updateObject('#__tjvendors_passbook', $payout_update, 'id');

$message = Text::_('COM_TJVENDORS_PAYOUT_SUCCESSFULL_MESSAGE');
Factory::getApplication()->enqueueMessage($message);
JFactory::getDbo()->updateObject('#__tjvendors_passbook', $payout_update, 'id');

return true;
}
Expand Down