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

Task #160337 chore: Getting Fatal Error while using vendorList field #82

Open
wants to merge 8 commits into
base: release-1.4.4
Choose a base branch
from
3 changes: 2 additions & 1 deletion src/com_tjvendors/admin/models/fields/vendorslist.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\FormHelper;

jimport('joomla.form.helper');
\FormHelper::loadFieldClass('list');
FormHelper::loadFieldClass('list');

/**
* Supports an HTML select list of vendors
Expand Down
69 changes: 0 additions & 69 deletions src/com_tjvendors/site/helpers/fronthelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,75 +387,6 @@ public function checkGatewayDetails($userId, $client)
}
}

/**
* function for adding credit entry
*
* @param integer $order_data integer
*
* @return void
*
* @since 1.0
*/
public function addEntry($order_data)
{
$com_params = ComponentHelper::getParams($order_data['client']);
$vendorParams = ComponentHelper::getParams('com_tjvendors');
$payout_day_limit = $vendorParams->get('payout_limit_days', '0', 'INT');
$date = Factory::getDate();
$payout_date_limit = $date->modify("-" . $payout_day_limit . " day");
$currency = $com_params->get('currency');

$payoutTable = Table::getInstance('payout', 'TjvendorsTable', array());
$payoutTable->load(array('reference_order_id' => $order_data['order_id']));

if ($payoutTable->debit > 0)
{
$checkOrderPayout = $payoutTable->order_id;
}
else
{
$checkOrderPayout = false;
}

$entry_data['vendor_id'] = $order_data['vendor_id'];
$totalAmount = TjvendorsHelper::getTotalAmount($entry_data['vendor_id'], $currency, $order_data['client']);
$entry_data['reference_order_id'] = $order_data['order_id'];
$entry_data['transaction_id'] = $order_data['client_name'] . '-' . $currency . '-' . $entry_data['vendor_id'] . '-';
$entry_data['transaction_time'] = Factory::getDate()->toSql();

if ($order_data['status'] != "C")
{
if ($order_data['status'] == "RF")
{
$entry_status = "debit_refund";
}
elseif ($order_data['status'] == "P")
{
$entry_status = "debit_pending";
}

$entry_data['debit'] = $order_data['amount'] - $order_data['fee_amount'];
$entry_data['credit'] = '0.00';
$entry_data['total'] = $totalAmount['total'] - $entry_data['debit'];
}

elseif ($order_data['status'] == "C")
{
$entry_data['credit'] = $order_data['amount'] - $order_data['fee_amount'];
$entry_data['debit'] = 0;
$entry_data['total'] = $totalAmount['total'] + $entry_data['credit'];
$entry_status = "credit_for_ticket_buy";
}

$params = array("customer_note" => $order_data['customer_note'], "entry_status" => $entry_status);
$entry_data['params'] = json_encode($params);
$entry_data['currency'] = $currency;
$entry_data['client'] = $order_data['client'];
BaseDatabaseModel::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_tjvendors/models', 'payout');
$tjvendorsModelPayout = BaseDatabaseModel::getInstance('Payout', 'TjvendorsModel');
$vendorDetail = $tjvendorsModelPayout->addCreditEntry($entry_data);
}

/**
* Get paid amount
*
Expand Down
Loading