mirror of
https://github.com/Karaka-Management/oms-Billing.git
synced 2026-02-17 00:38:40 +00:00
bug fixes and subscription improvements
This commit is contained in:
parent
63cf7e8c3b
commit
2eacbaadc0
|
|
@ -674,7 +674,7 @@ final class ApiBillController extends Controller
|
||||||
->where('id', $billTypeId)
|
->where('id', $billTypeId)
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
$templateId = $billType->defaultTemplate->getId();
|
$templateId = $billType->defaultTemplate?->getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var \Modules\Media\Models\Collection $template */
|
/** @var \Modules\Media\Models\Collection $template */
|
||||||
|
|
@ -806,7 +806,7 @@ final class ApiBillController extends Controller
|
||||||
->where('id', $billTypeId)
|
->where('id', $billTypeId)
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
$templateId = $billType->defaultTemplate->getId();
|
$templateId = $billType->defaultTemplate?->getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var \Modules\Media\Models\Collection $template */
|
/** @var \Modules\Media\Models\Collection $template */
|
||||||
|
|
|
||||||
|
|
@ -274,12 +274,12 @@ class BillElement implements \JsonSerializable
|
||||||
if (!empty($element->bill)
|
if (!empty($element->bill)
|
||||||
&& $item->getAttribute('subscription')?->value->getValue() === 1
|
&& $item->getAttribute('subscription')?->value->getValue() === 1
|
||||||
) {
|
) {
|
||||||
$element->subscription = new Subscription();
|
$element->subscription = new Subscription();
|
||||||
$element->subscription->bill = $element->bill;
|
$element->subscription->bill = $element->bill;
|
||||||
$element->subscription->item = $element->item;
|
$element->subscription->item = $element->item;
|
||||||
$element->subscription->start = $element->quantity;
|
$element->subscription->start = $element->quantity;
|
||||||
$element->subscription->end = $element->quantity;
|
$element->subscription->end = $element->quantity;
|
||||||
$element->subscription->quantity = $element->quantity;
|
$element->subscription->quantity = $element->quantity;
|
||||||
$element->subscription->autoRenew = $item->getAttribute('subscription_renewal_type')->value->getValue() === 1;
|
$element->subscription->autoRenew = $item->getAttribute('subscription_renewal_type')->value->getValue() === 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user