Lieferland UST CH, Reverse Charge

This commit is contained in:
Kevin Adametz 2021-08-03 16:00:01 +02:00
parent 351a8f763c
commit d46824a4ac
19 changed files with 455 additions and 41 deletions

View file

@ -64,6 +64,8 @@ class Country extends Model
protected $casts = [
'switch' => 'bool',
'supply_country' => 'bool',
'eu_country' => 'bool',
'own_eur' => 'bool',
'currency' => 'bool',
'currency_calc' => 'bool',
@ -73,7 +75,7 @@ class Country extends Model
protected $fillable = [
'code', 'phone', 'en', 'de', 'es', 'fr', 'it', 'ru',
'switch', 'own_eur', 'currency', 'currency_unit', 'currency_calc', 'currency_faktor',
'supply_country', 'eu_country', 'switch', 'own_eur', 'currency', 'currency_unit', 'currency_calc', 'currency_faktor',
'active', 'trans_name', 'attr',
];

View file

@ -129,10 +129,12 @@ class UserAccount extends Model
'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', 'notice'
];
//'reverse_charge', 'reverse_charge_valid'
protected $casts = [
'payment_data' => 'array',
'notice' => 'array',
//'reverse_charge' => 'bool'
];
use SoftDeletes;
@ -191,6 +193,10 @@ class UserAccount extends Model
return Carbon::parse($this->attributes['accept_contract'])->format(\Util::formatDateTimeDB());
}
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){