23-01-2026
This commit is contained in:
parent
a939cd51ef
commit
a8b395e20d
248 changed files with 29342 additions and 4805 deletions
|
|
@ -136,10 +136,49 @@ class UserAccount extends Model
|
|||
{
|
||||
protected $table = 'user_accounts';
|
||||
protected $fillable = [
|
||||
'm_account', 'm_salutation', 'm_first_name', 'm_last_name', 'm_notes', 'company', 'salutation', 'first_name', 'last_name', 'address', 'address_2', 'zipcode', 'city', 'country_id', 'pre_phone_id', 'phone', 'pre_mobil_id', 'mobil',
|
||||
'tax_number', 'tax_identification_number', 'taxable_sales', 'same_as_billing',
|
||||
'shipping_salutation', 'shipping_company', 'shipping_firstname', 'shipping_lastname', 'shipping_address', 'shipping_address_2', 'shipping_zipcode', 'shipping_city', 'shipping_country_id', 'shipping_pre_phone_id', 'shipping_phone',
|
||||
'birthday', 'website', 'facebook', 'facebook_fanpage', 'instagram', 'bank_owner', 'bank_iban', 'bank_bic', 'notice'
|
||||
'm_account',
|
||||
'm_salutation',
|
||||
'm_first_name',
|
||||
'm_last_name',
|
||||
'm_notes',
|
||||
'company',
|
||||
'salutation',
|
||||
'first_name',
|
||||
'last_name',
|
||||
'address',
|
||||
'address_2',
|
||||
'zipcode',
|
||||
'city',
|
||||
'country_id',
|
||||
'pre_phone_id',
|
||||
'phone',
|
||||
'pre_mobil_id',
|
||||
'mobil',
|
||||
'tax_number',
|
||||
'tax_identification_number',
|
||||
'taxable_sales',
|
||||
'same_as_billing',
|
||||
'shipping_salutation',
|
||||
'shipping_company',
|
||||
'shipping_firstname',
|
||||
'shipping_lastname',
|
||||
'shipping_address',
|
||||
'shipping_address_2',
|
||||
'shipping_zipcode',
|
||||
'shipping_city',
|
||||
'shipping_country_id',
|
||||
'shipping_pre_phone_id',
|
||||
'shipping_phone',
|
||||
'shipping_postnumber',
|
||||
'birthday',
|
||||
'website',
|
||||
'facebook',
|
||||
'facebook_fanpage',
|
||||
'instagram',
|
||||
'bank_owner',
|
||||
'bank_iban',
|
||||
'bank_bic',
|
||||
'notice'
|
||||
];
|
||||
//'reverse_charge', 'reverse_charge_valid'
|
||||
|
||||
|
|
@ -185,85 +224,100 @@ class UserAccount extends Model
|
|||
|
||||
public function getBirthdayAttribute($value)
|
||||
{
|
||||
if(!$value){
|
||||
if (!$value) {
|
||||
return "";
|
||||
}
|
||||
return Carbon::parse($value)->format(\Util::formatDateDB());
|
||||
}
|
||||
|
||||
public function setBirthdayAttribute( $value ) {
|
||||
public function setBirthdayAttribute($value)
|
||||
{
|
||||
$this->attributes['birthday'] = isset($value) ? (new Carbon($value))->format('Y-m-d') : NULL;
|
||||
}
|
||||
|
||||
public function getDataProtectionFormat(){
|
||||
if(!$this->attributes['data_protection']){ return ""; }
|
||||
public function getDataProtectionFormat()
|
||||
{
|
||||
if (!$this->attributes['data_protection']) {
|
||||
return "";
|
||||
}
|
||||
return Carbon::parse($this->attributes['data_protection'])->format(\Util::formatDateTimeDB());
|
||||
}
|
||||
|
||||
public function getAcceptContractFormat(){
|
||||
if(!$this->attributes['accept_contract']){ return ""; }
|
||||
public function getAcceptContractFormat()
|
||||
{
|
||||
if (!$this->attributes['accept_contract']) {
|
||||
return "";
|
||||
}
|
||||
return Carbon::parse($this->attributes['accept_contract'])->format(\Util::formatDateTimeDB());
|
||||
}
|
||||
|
||||
public function getReverseChargeValidFormat(){
|
||||
if(!$this->attributes['reverse_charge_valid']){ return ""; }
|
||||
public function getReverseChargeValidFormat()
|
||||
{
|
||||
if (!$this->attributes['reverse_charge_valid']) {
|
||||
return "";
|
||||
}
|
||||
return Carbon::parse($this->attributes['reverse_charge_valid'])->format(\Util::formatDateTimeDB());
|
||||
}
|
||||
|
||||
public function getCountryAttrAs($attr, $as = false){
|
||||
if($this->country){
|
||||
public function getCountryAttrAs($attr, $as = false)
|
||||
{
|
||||
if ($this->country) {
|
||||
$val = $this->country->getAttrByKey($attr);
|
||||
|
||||
if($val){
|
||||
if($as){
|
||||
if ($val) {
|
||||
if ($as) {
|
||||
return $as;
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public function setNotice($key, $value){
|
||||
public function setNotice($key, $value)
|
||||
{
|
||||
$notice = $this->notice;
|
||||
$notice[$key] = $value;
|
||||
$this->notice = $notice;
|
||||
$this->save();
|
||||
}
|
||||
|
||||
public function getNotice($key){
|
||||
public function getNotice($key)
|
||||
{
|
||||
return isset($this->notice[$key]) ? $this->notice[$key] : false;
|
||||
}
|
||||
|
||||
public function getPhoneNumber(){
|
||||
if($this->mobil && $this->mobil !== ""){
|
||||
return ($this->pre_mobil ? $this->pre_mobil->phone : '')." ".$this->mobil;
|
||||
public function getPhoneNumber()
|
||||
{
|
||||
if ($this->mobil && $this->mobil !== "") {
|
||||
return ($this->pre_mobil ? $this->pre_mobil->phone : '') . " " . $this->mobil;
|
||||
}
|
||||
if($this->phone && $this->phone !== ""){
|
||||
return ($this->pre_phone ? $this->pre_phone->phone : '')." ".$this->phone;
|
||||
if ($this->phone && $this->phone !== "") {
|
||||
return ($this->pre_phone ? $this->pre_phone->phone : '') . " " . $this->phone;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function getPhoneFull(){
|
||||
if($this->phone && $this->phone !== ""){
|
||||
return ($this->pre_phone ? $this->pre_phone->phone : '')." ".$this->phone;
|
||||
public function getPhoneFull()
|
||||
{
|
||||
if ($this->phone && $this->phone !== "") {
|
||||
return ($this->pre_phone ? $this->pre_phone->phone : '') . " " . $this->phone;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public function getMobilFull(){
|
||||
if($this->mobil && $this->mobil !== ""){
|
||||
return ($this->pre_mobil ? $this->pre_mobil->phone : '')." ".$this->mobil;
|
||||
public function getMobilFull()
|
||||
{
|
||||
if ($this->mobil && $this->mobil !== "") {
|
||||
return ($this->pre_mobil ? $this->pre_mobil->phone : '') . " " . $this->mobil;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public function getShippingPhoneFull(){
|
||||
if($this->shipping_phone && $this->shipping_phone !== ""){
|
||||
return ($this->shipping_pre_phone ? $this->shipping_pre_phone->phone : '')." ".$this->shipping_phone;
|
||||
public function getShippingPhoneFull()
|
||||
{
|
||||
if ($this->shipping_phone && $this->shipping_phone !== "") {
|
||||
return ($this->shipping_pre_phone ? $this->shipping_pre_phone->phone : '') . " " . $this->shipping_phone;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue