diff --git a/app/Traits/Recurring.php b/app/Traits/Recurring.php index 73db91340..f67801685 100644 --- a/app/Traits/Recurring.php +++ b/app/Traits/Recurring.php @@ -23,6 +23,7 @@ trait Recurring $limit_by = !empty($request['recurring_limit']) ? $request['recurring_limit'] : 'count'; $limit_count = isset($request['recurring_limit_count']) ? (int) $request['recurring_limit_count'] : 0; $limit_date = !empty($request['recurring_limit_date']) ? $request['recurring_limit_date'] : null; + $auto_send = !empty($request['recurring_send_email']) ? $request['recurring_send_email'] : 0; $source = !empty($request['created_from']) ? $request['created_from'] : source_name(); $owner = !empty($request['created_by']) ? $request['created_by'] : user_id(); @@ -35,6 +36,7 @@ trait Recurring 'limit_by' => $limit_by, 'limit_count' => $limit_count, 'limit_date' => $limit_date, + 'auto_send' => $auto_send, 'created_from' => $source, 'created_by' => $owner, ]); @@ -54,6 +56,7 @@ trait Recurring $limit_by = !empty($request['recurring_limit']) ? $request['recurring_limit'] : 'count'; $limit_count = isset($request['recurring_limit_count']) ? (int) $request['recurring_limit_count'] : 0; $limit_date = !empty($request['recurring_limit_date']) ? $request['recurring_limit_date'] : null; + $auto_send = !empty($request['recurring_send_email']) ? $request['recurring_send_email'] : 0; $recurring = $this->recurring(); $model_exists = $recurring->count(); @@ -66,6 +69,7 @@ trait Recurring 'limit_by' => $limit_by, 'limit_count' => $limit_count, 'limit_date' => $limit_date, + 'auto_send' => $auto_send, ]; if (! empty($request['recurring_status'])) { diff --git a/app/View/Components/Form/Group/Recurring.php b/app/View/Components/Form/Group/Recurring.php index 6dcb043ce..68b5873cf 100644 --- a/app/View/Components/Form/Group/Recurring.php +++ b/app/View/Components/Form/Group/Recurring.php @@ -22,6 +22,9 @@ class Recurring extends Component public $limitCount = ''; public $limitDateValue = ''; + public $sendEmailShow; + public $sendEmail; + /** * Create a new component instance. * @@ -41,6 +44,9 @@ class Recurring extends Component $startedValue = '', $limitCount = '', $limitDateValue = '', + + $sendEmailShow = true, + $sendEmail = false ) { $this->type = $this->getType($type); $this->frequency = $this->getFrequency($frequency); @@ -55,6 +61,9 @@ class Recurring extends Component $this->startedValue = $this->getStartedValue($startedValue); $this->limitCount = $this->getLimitCount($limitCount); $this->limitDateValue = $this->getLimitDateValue($limitDateValue); + + $this->sendEmailShow = $this->getSendEmailShow($sendEmailShow); + $this->sendEmail = $this->getSendEmail($sendEmail); } /** @@ -171,4 +180,22 @@ class Recurring extends Component return Date::now()->toDateString(); } + + protected function getSendEmailShow($sendEmailShow) + { + if (! empty($sendEmailShow)) { + return $sendEmailShow; + } + + return false; + } + + protected function getSendEmail($sendEmail) + { + if (! empty($sendEmail)) { + return $sendEmail; + } + + return false; + } } diff --git a/resources/assets/js/components/AkauntingRecurring.vue b/resources/assets/js/components/AkauntingRecurring.vue index 19af1608b..d9ed1211c 100644 --- a/resources/assets/js/components/AkauntingRecurring.vue +++ b/resources/assets/js/components/AkauntingRecurring.vue @@ -126,6 +126,22 @@
+ +