Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function checkConversionRequirements($attribute,$params)
- {
- //ichecheck lang
- //conditions:
- //kelangan may value ung $customer_name IF Create new customer
- //kelangan naman nakaselect ung Dropdown kapag hindi nakacheck ung create new customer
- if(!$this->hasErrors())
- {
- if($this->isNewAccount)
- {
- if($this->customer_name == null || $this->customer_name == "")//kelangan may nilagay sya sa name ng customer kasi create new customer erh
- $this->addError('customer_name', 'Name is required if you are creating a new customer');
- }
- else
- {
- if($this->customer_id == 0)
- $this->addError('customer_id', 'You must select from the existing customers');
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement