From a3cb3a0cfb0bcb5e7d8093badd68abc64ccfbe82 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 15 Dec 2016 13:16:19 +0200 Subject: [PATCH] Working on discounts --- app/Ninja/Datatables/InvoiceDatatable.php | 1 + resources/views/accounts/management.blade.php | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/Ninja/Datatables/InvoiceDatatable.php b/app/Ninja/Datatables/InvoiceDatatable.php index 13372bc416ec..2bdb6e1c3b8d 100644 --- a/app/Ninja/Datatables/InvoiceDatatable.php +++ b/app/Ninja/Datatables/InvoiceDatatable.php @@ -205,6 +205,7 @@ class InvoiceDatatable extends EntityDatatable $actions = parent::bulkActions(); if ($this->entityType == ENTITY_INVOICE || $this->entityType == ENTITY_QUOTE) { + $actions[] = \DropdownButton::DIVIDER; $actions[] = [ 'label' => mtrans($this->entityType, 'mark_sent'), 'url' => 'javascript:submitForm_'.$this->entityType.'("markSent")', diff --git a/resources/views/accounts/management.blade.php b/resources/views/accounts/management.blade.php index 2f21b048a7fb..11735abf39ac 100644 --- a/resources/views/accounts/management.blade.php +++ b/resources/views/accounts/management.blade.php @@ -281,18 +281,18 @@ $('#plan_term').closest('.form-group').toggle(plan!='free'); if(plan=='{{PLAN_PRO}}'){ - $('#plan_term option[value=month]').text({!! json_encode(trans('texts.plan_price_monthly', ['price'=>$account->company->discountedPrice(PLAN_PRICE_PRO_MONTHLY)])) !!}); - $('#plan_term option[value=year]').text({!! json_encode(trans('texts.plan_price_yearly', ['price'=>$account->company->discountedPrice(PLAN_PRICE_PRO_MONTHLY) * 10])) !!}); + $('#plan_term option[value=month]').text({!! json_encode(trans('texts.plan_price_monthly', ['price'=>PLAN_PRICE_PRO_MONTHLY])) !!}); + $('#plan_term option[value=year]').text({!! json_encode(trans('texts.plan_price_yearly', ['price'=>PLAN_PRICE_PRO_MONTHLY * 10])) !!}); } else if(plan=='{{PLAN_ENTERPRISE}}') { if (numUsers == 2) { - $('#plan_term option[value=month]').text({!! json_encode(trans('texts.plan_price_monthly', ['price'=>$account->company->discountedPrice(PLAN_PRICE_ENTERPRISE_MONTHLY_2)])) !!}); - $('#plan_term option[value=year]').text({!! json_encode(trans('texts.plan_price_yearly', ['price'=>$account->company->discountedPrice(PLAN_PRICE_ENTERPRISE_MONTHLY_2) * 10])) !!}); + $('#plan_term option[value=month]').text({!! json_encode(trans('texts.plan_price_monthly', ['price'=>PLAN_PRICE_ENTERPRISE_MONTHLY_2])) !!}); + $('#plan_term option[value=year]').text({!! json_encode(trans('texts.plan_price_yearly', ['price'=>PLAN_PRICE_ENTERPRISE_MONTHLY_2 * 10])) !!}); } else if (numUsers == 5) { - $('#plan_term option[value=month]').text({!! json_encode(trans('texts.plan_price_monthly', ['price'=>$account->company->discountedPrice(PLAN_PRICE_ENTERPRISE_MONTHLY_5)])) !!}); - $('#plan_term option[value=year]').text({!! json_encode(trans('texts.plan_price_yearly', ['price'=>$account->company->discountedPrice(PLAN_PRICE_ENTERPRISE_MONTHLY_5) * 10])) !!}); + $('#plan_term option[value=month]').text({!! json_encode(trans('texts.plan_price_monthly', ['price'=>PLAN_PRICE_ENTERPRISE_MONTHLY_5])) !!}); + $('#plan_term option[value=year]').text({!! json_encode(trans('texts.plan_price_yearly', ['price'=>PLAN_PRICE_ENTERPRISE_MONTHLY_5 * 10])) !!}); } else { - $('#plan_term option[value=month]').text({!! json_encode(trans('texts.plan_price_monthly', ['price'=>$account->company->discountedPrice(PLAN_PRICE_ENTERPRISE_MONTHLY_10)])) !!}); - $('#plan_term option[value=year]').text({!! json_encode(trans('texts.plan_price_yearly', ['price'=>$account->company->discountedPrice(PLAN_PRICE_ENTERPRISE_MONTHLY_10) * 10])) !!}); + $('#plan_term option[value=month]').text({!! json_encode(trans('texts.plan_price_monthly', ['price'=>PLAN_PRICE_ENTERPRISE_MONTHLY_10])) !!}); + $('#plan_term option[value=year]').text({!! json_encode(trans('texts.plan_price_yearly', ['price'=>PLAN_PRICE_ENTERPRISE_MONTHLY_10 * 10])) !!}); } } }