mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
fix small bugs
This commit is contained in:
+3
-3
@@ -4,7 +4,7 @@ namespace App\Classes\General\Eloquent\Filters;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class DoesNotHaveGroupTransactions implements Filter
|
||||
class DoesNotHaveGroups implements Filter
|
||||
{
|
||||
/**
|
||||
* @param Builder $builder
|
||||
@@ -13,6 +13,6 @@ class DoesNotHaveGroupTransactions implements Filter
|
||||
*/
|
||||
public static function apply(Builder $builder, $value)
|
||||
{
|
||||
return $builder->whereDoesntHave('groupTransactions');
|
||||
return $builder->whereDoesntHave('groups');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -61,18 +61,18 @@ class GroupObject implements DataTransferObject
|
||||
* @param int $paymentMethod
|
||||
*/
|
||||
public function __construct(
|
||||
int $issuer,
|
||||
int $receiver,
|
||||
float $amount,
|
||||
float $originalAmount,
|
||||
int $issuer,
|
||||
int $receiver,
|
||||
float $amount,
|
||||
float $originalAmount,
|
||||
int $currencyId,
|
||||
int $originalCurrencyId,
|
||||
int $originalCurrencyId,
|
||||
float $currencyRate,
|
||||
float $tax,
|
||||
float $serviceCharge,
|
||||
int $paymentMethod,
|
||||
?string $reference,
|
||||
?int $status = ApprovalStatus::PENDING_SUBMISSION,
|
||||
float $tax,
|
||||
float $serviceCharge,
|
||||
int $paymentMethod,
|
||||
?string $reference,
|
||||
?int $status = ApprovalStatus::PENDING_SUBMISSION
|
||||
)
|
||||
{
|
||||
$this->issuer = $issuer;
|
||||
@@ -184,4 +184,4 @@ class GroupObject implements DataTransferObject
|
||||
{
|
||||
return $this->paymentMethod;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class UpdateConstantPostcodeLogic extends AbstractControllerLogic
|
||||
* @param UpdatePostcodeSegmentProcessor $updatePostcodeSegmentProcessor
|
||||
*/
|
||||
public function __construct(
|
||||
UpdatePostcodeSegmentProcessor $updatePostcodeSegmentProcessor,
|
||||
UpdatePostcodeSegmentProcessor $updatePostcodeSegmentProcessor
|
||||
)
|
||||
{
|
||||
$this->updatePostcodeSegmentProcessor = $updatePostcodeSegmentProcessor;
|
||||
@@ -48,4 +48,4 @@ class UpdateConstantPostcodeLogic extends AbstractControllerLogic
|
||||
return $this->resourceResponse(new ConstantResource($constant));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ use App\Classes\ValueObjects\Constants\TransactionType;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphMany;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
@@ -76,6 +77,14 @@ class Transaction extends AbstractModel implements Documentable, Transactionable
|
||||
return $this->HasMany(TransactionDetail::class, 'transaction_id', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BelongsToMany
|
||||
*/
|
||||
public function groups(): BelongsToMany
|
||||
{
|
||||
return $this->BelongsToMany(Group::class, GroupTransaction::class, 'transaction_id');
|
||||
}
|
||||
|
||||
public function convert_original_amount()
|
||||
{
|
||||
if($this->booking()->first()->fix_currency_id !== 1) {
|
||||
|
||||
Reference in New Issue
Block a user