diff --git a/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerGroupController.php b/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerGroupController.php index 68c9ac975..c1bff5291 100644 --- a/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerGroupController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerGroupController.php @@ -123,7 +123,7 @@ class CustomerGroupController extends Controller { $group = $this->customerGroup->findOneWhere(['id'=>$id]); - if($group->is_user_defined == 1) { + if(!$group->is_user_defined) { session()->flash('error', 'This Customer Group can not be deleted'); } else { $this->customerGroup->delete($id); diff --git a/packages/Webkul/Checkout/src/Http/Requests/CustomerAddressForm.php b/packages/Webkul/Checkout/src/Http/Requests/CustomerAddressForm.php index 0988a254b..a77e10d66 100644 --- a/packages/Webkul/Checkout/src/Http/Requests/CustomerAddressForm.php +++ b/packages/Webkul/Checkout/src/Http/Requests/CustomerAddressForm.php @@ -38,7 +38,7 @@ class CustomerAddressForm extends FormRequest 'billing.country' => ['required'] ]; - if(!$this->get('billing')['use_for_shipping']) { + if(isset($this->get('billing')['use_for_shipping']) && !$this->get('billing')['use_for_shipping']) { $this->rules = array_merge($this->rules, [ 'shipping.first_name' => ['required'], 'shipping.last_name' => ['required'], diff --git a/packages/Webkul/Sales/src/Repositories/InvoiceRepository.php b/packages/Webkul/Sales/src/Repositories/InvoiceRepository.php index b7b023aa6..139a44c84 100644 --- a/packages/Webkul/Sales/src/Repositories/InvoiceRepository.php +++ b/packages/Webkul/Sales/src/Repositories/InvoiceRepository.php @@ -111,6 +111,7 @@ class InvoiceRepository extends Repository $invoiceItem = $this->invoiceItem->create([ 'invoice_id' => $invoice->id, 'order_item_id' => $orderItem->id, + 'state' => 'paid', 'name' => $orderItem->name, 'sku' => $orderItem->sku, 'qty' => $qty,