{extends file="layout.html"} {block name=title}LMS: {$layout.pagetitle|striphtml}{/block} {block name=module_content} {$restrictive_sensitive_data_access = ConfigHelper::checkConfig('customers.restrictive_sensitive_data_access')} {$pin_tip = ConfigHelper::getConfig('customers.pin_restriction_description', ConfigHelper::getConfig('phpui.pin_restriction_description'))} {if !empty($unsecure_pin_validity)} {$pin_tip = ConfigHelper::getConfig('customers.unsecure_pin_restriction_description', $pin_tip)} {/if} {if !$pin_tip} {if empty($unsecure_pin_validity)} {if $pin_min_size == $pin_max_size} {$pin_tip = trans("Enter \$a characters PIN code", $pin_min_size)} {else} {$pin_tip = trans("Enter \$a to \$b characters PIN code", $pin_min_size, $pin_max_size)} {/if} {else} {if $unsecure_pin_min_size == $unsecure_pin_max_size} {$pin_tip = trans("Enter \$a characters PIN code", $unsecure_pin_min_size)} {else} {$pin_tip = trans("Enter \$a to \$b characters PIN code", $unsecure_pin_min_size, $unsecure_pin_max_size)} {/if} {/if} {/if}

{$layout.pagetitle}

{include file="customer/customercompanyselectiondialog.html"}

{hint content="Enter customer last name or company name"}
{hint content="Enter customer name"}
{hint content="Enter customer identifier in external system (optional)"}
{hint content="Customer Alternative name (brand, shortname, casual name)"}
{block name="customeradd-leftcolumn"} {if $divisions} {/if} {if $groups} {/if} {$addr_counter = 0} {foreach $customeradd.addresses as $v} {if $v.location_address_type != $smarty.const.BILLING_ADDRESS && $v.location_address_type != $smarty.const.POSTAL_ADDRESS } {/if} {/foreach} {include file="customer/customercontacts.html" customerinfo=$customeradd formelemprefix="customeradd"} {/block}
{if $customeradd.status}{icon name="customer-status-{$_CSTATUSES[$customeradd.status].alias}"}{else}{icon name="customer-status-connected"}{/if}
{icon name="origin" class="fa-fw"}
{icon name="tag"}
{icon name="division"}
{icon name="cg"}
{icon name="legal-personality"}
{hint content="Select legal personality type"}
{icon name="user-id-number"}
{if !ConfigHelper::checkPrivilege('hide_customer_sensitive_data', !$restrictive_sensitive_data_access)} {/if}
{trans("Identity document")}
{trans("SSN")} {if ConfigHelper::checkPrivilege('customer_sensitive_data_view', !$restrictive_sensitive_data_access)} {$ssn = $customeradd.ssn} {$disabled = false} {else} {$ssn = preg_replace('/[^\s]/', '*', $customeradd.ssn)} {$disabled = true} {/if} {if $customeradd.ssnwarning} {/if} {if $customeradd.ssnexistencewarning} {/if}
{trans("TEN")} {if $customeradd.tenwarning} {/if} {if $customeradd.tenexistencewarning} {/if} {button type="link" icon="division" class="gusapi-button" data_type=Utils::GUS_REGON_API_SEARCH_TYPE_TEN tip="Click here to autocomplete company data from GUS REGON database"}
{trans("REGON")} {button type="link" icon="division" class="gusapi-button" data_type=Utils::GUS_REGON_API_SEARCH_TYPE_REGON tip="Click here to autocomplete company data from GUS REGON database"}
{icon name="user-id-number"}
{trans("Business register")}
{icon name="home" tip="billing address"} {$addr_found = 0} {foreach $customeradd.addresses as $v} {if $v.location_address_type == $smarty.const.BILLING_ADDRESS} {$v.prefix = "customeradd[addresses]["|cat:$addr_counter|cat:"]"} {$addr_counter = $addr_counter + 1} {$addr_found = 1} {$v.hide_name=true} {location_box_expandable data=$v} {/if} {/foreach} {* if billing address is not set *} {if $addr_found == 0} {$tmp.location_address_type = $smarty.const.BILLING_ADDRESS} {$tmp.location_state_name = $default_states[$smarty.const.BILLING_ADDRESS]} {$tmp.prefix = "customeradd[addresses]["|cat:$addr_counter|cat:"]"} {$tmp.location_street_name = ConfigHelper::getConfig('phpui.default_address')} {$tmp.location_zip = ConfigHelper::getConfig('phpui.default_zip')} {$tmp.location_city_name = ConfigHelper::getConfig('phpui.default_city')} {$tmp.location_country_id = ConfigHelper::getConfig('phpui.default_countryid')} {$tmp.show = true} {$addr_counter = $addr_counter + 1} {$tmp.hide_name=true} {location_box_expandable data=$tmp} {$tmp = array()} {/if}
{icon name="message" tip="postal address"} {$addr_found = 0} {foreach $customeradd.addresses as $v} {if $v.location_address_type == $smarty.const.POSTAL_ADDRESS} {$v.prefix = "customeradd[addresses]["|cat:$addr_counter|cat:"]"} {$addr_counter = $addr_counter + 1} {$addr_found = 1} {location_box_expandable data=$v} {/if} {/foreach} {* if postal address is not set*} {if $addr_found == 0} {$tmp.location_address_type = $smarty.const.POSTAL_ADDRESS} {$tmp.prefix = "customeradd[addresses]["|cat:$addr_counter|cat:"]"} {$tmp.location_state_name = $default_states[$smarty.const.POSTAL_ADDRESS]} {$addr_counter = $addr_counter + 1} {location_box_expandable data=$tmp} {/if}
{if $v.location_address_type == $smarty.const.DEFAULT_LOCATION_ADDRESS} {icon name="default-customer-location" class="location-box-image" tip="default location address"} {else} {icon name="customer-location" class="location-box-image" tip="location/recipient address"} {/if} {$v.prefix = "customeradd[addresses]["|cat:$addr_counter|cat:"]"} {$v.location_state_name = $default_states[$smarty.const.LOCATION_ADDRESS]} {$address_idx = $addr_counter} {$v.default_type = 1} {$v.delete_button = 1} {$v.billing_address_button = 1} {$v.post_address_button = 1} {$addr_counter = $addr_counter + 1} {location_box_expandable data=$v}
{button class="lms-ui-location-add-button" icon="add" label="Add address" data_prefix="customeradd"}
{icon name="customer-pin-code"}
{button type="link" icon="next" id="randomize" tip="Generate random PIN"} {hint text=$pin_tip}
{icon name="paytype"}
{trans("Deadline")}
{hint content="Select default deadline in days"}
{trans("Payment type")}
{paytypes elemname="customeradd[paytype]" selected=$customeradd.paytype tip="Select default invoices payment type" trigger="paytype"} {hint content="Select default invoices payment type"}
{trans("Cutoff suspending")}
{day_selection elem="#cutoffstop" days="3,7,10,14"}
{hint content="Select date of cutoff suspending (optional)"}
{icon name="consent"} {include file="customer/customerconsents.html" variable_prefix="customeradd" variables=$customeradd}
{block name="customeradd-rightcolumn"} {/block}
{icon name="optional-info"}
{hint content="Enter additional information (optional)"}
{icon name="warning"}
{hint content="Enter notice contents (optional)"}
{icon name="notes"}
{hint content="Enter notes (optional)"}
{icon name="memo"}
{hint content="Enter document memo (optional)"}
{button type="submit" id="save-button" icon="save" label="Submit"} {button id="cancel-button" icon="cancel" label="Cancel" onclick="location.href = '?m=customerlist';"}
{/block}