{extends file="layout.html"} {block name=title}LMS: {$layout.pagetitle|striphtml}{/block} {block name=module_content} {$pin_tip = ConfigHelper::getConfig('phpui.pin_restriction_description')} {if !$pin_tip} {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} {/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)"}
{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[$customerinfo.status].alias}"}{else}{icon name="customer-status-connected"}{/if}
{icon name="division"}
{icon name="cg"}
{icon name="legal-personality"}
{hint content="Select legal personality type"}
{icon name="legal-personality"}
{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['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_state'] = ConfigHelper::getConfig('phpui.default_stateid')} {$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:"]"} {$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:"]"} {$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="user-id-number"}
{trans("Identity document")}
{trans("SSN")} {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"}
{trans("RBE Name:")}
{hint content="Enter National Court Register / Register of Business Entities Name (optional)"}
{trans("RBE")}
{button type="link" icon="division" class="gusapi-button" data_type=Utils::GUS_REGON_API_SEARCH_TYPE_RBE tip="Click here to autocomplete company data from GUS REGON database"} {hint content="Enter National Court Register / Register of Business Entities Number (optional)"}
{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")}
  {hint content="Select date of cutoff suspending (optional)"}
{icon name="consent"} {block name="customeradd-options"} {foreach $_CCONSENTS as $type => $consent} {/foreach} {/block}
{trans("Consents")}
{$consent.label}
{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}