Obtain customer company code

@param Customer $customer

@return int
327911
public static function getCustomerCompany($customer)
    {
        return $customer->adresar->getDataValue('kod') ? \FlexiPeeHP\FlexiBeeRO::uncode($customer->adresar->getDataValue('kod'))
                : null;
    }
1262127
protected function tryLoginCustomer($customer = null)
    {
        $result = false;

        if ($customer !== null) {
            $checkUser = $this->accountService->loginUser($customer);
            if (empty($checkUser['sErrorMessages'])) {
                $result = true;
            }
        } else {
            /**
             * this could happen because we do not get all the data from the SSO Provider
             * and cannot create a valid user via RegisterService
             */
            $result = false;
        }

        return $result;
    }
401585
private function hydrateCustomerWithSubEntities(
        HalResource $customerResource,
        CustomerRequest $customerRequest
    ): Customer {
        $customerLoader = new CustomerLoader(
            $this->restClient,
            $customerResource,
            $customerRequest->getLinks()
        );
        $customerLoader->load();

        return $customerResource->getEntity();
    }
26021
public function deleteCustomer($customer_id)
    {
        $response = $this->client->delete('customers/' . $customer_id);
        return json_decode($response->getBody())->customer;
    }
458905
private function setSalesDataOnCustomer($salesData, $customer)
    {
        foreach ($salesData as $column => $value) {
            $customer->setData($column, $value);
        }
        return $customer;
    }
1280961
final protected function customerDob() {return dfc($this, function() {return
		!($s = $this->o()->getCustomerDob()) ? null : df_date_from_db($s)
	;});}
1094955
public function loginUser($customer)
    {
        $this->front->Request()->setPost('email', $customer->getEmail());
        $this->front->Request()->setPost('passwordMD5', $customer->getPassword());
        return $this->admin->sLogin(true);
    }
49052
public function checkCustomerHasGroup(Customer $customer, $groupCode)
    {
        $group = CustomerCustomerGroupQuery::create()
            ->filterByCustomer($customer)
            ->useCustomerGroupQuery()
            ->filterByCode($groupCode)
            ->endUse()
            ->findOne();

        return $group !== null;
    }
779228
public function getStripeId()
    {
        if ($this->stripe_id) {
            return $this->stripe_id;
        }

        $customer = $this->createAsStripeCustomer(null);

        return $customer->id;
    }
864128
private function parseCustomer($customer)
    {
        /** @var CustomerInterface $customerItem */
        $customerItem = $this->customerFactory->create()
            ->setId($customer->getId())
            ->setBillingAddress($this->getAddressFromCustomer($customer, 'billing'))
            ->setShippingAddress($this->getAddressFromCustomer($customer, 'shipping'));

        foreach ($customer->getData() as $key => $value) {
            $customerItem->setData($key, $value);
        }

        return $customerItem;
    }
363220
public function getCustomerDiscount(int $customerId) : array
    {
        Assert::that($customerId)->greaterThan(0, 'The $customerId has to be positive');

        return (array)$this->master->doRequest(
            'GET',
            sprintf(
                '/admin/WEBAPI/Endpoints/v1_0/CustomerService/{KEY}/GetCustomerDiscount/%d',
                $customerId
            )
        );
    }
273307
public function newCustomerAutomation($customer)
    {
        $email = $customer->getEmail();
        $websiteId = $customer->getWebsiteId();
        $customerId = $customer->getId();
        $store = $this->storeManager->getStore($customer->getStoreId());
        $storeName = $store->getName();
        try {
            //Api is enabled
            $apiEnabled = $this->helper->getWebsiteConfig(
                \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_API_ENABLED,
                $websiteId
            );

            //Automation enrolment
            $programId = $this->helper->getWebsiteConfig(
                \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_AUTOMATION_STUDIO_CUSTOMER,
                $websiteId
            );

            //new contact program mapped
            if ($programId && $apiEnabled) {
                //save automation type
                $this->setEmail($email)
                    ->setAutomationType(\Dotdigitalgroup\Email\Model\Sync\Automation::AUTOMATION_TYPE_NEW_CUSTOMER)
                    ->setEnrolmentStatus(\Dotdigitalgroup\Email\Model\Sync\Automation::AUTOMATION_STATUS_PENDING)
                    ->setTypeId($customerId)
                    ->setWebsiteId($websiteId)
                    ->setStoreName($storeName)
                    ->setProgramId($programId);

                $this->automationResource->save($this);
            }
        } catch (\Exception $e) {
            $this->helper->debug((string)$e, []);
        }
    }
133332
static public function getMediotecasForCustomer(CNabuCustomer $nb_customer)
    {
        $nb_customer_id = nb_getMixedValue($nb_customer, NABU_CUSTOMER_FIELD_ID);
        if (is_numeric($nb_customer_id)) {
            $retval = CNabuMedioteca::buildObjectListFromSQL(
                NABU_MEDIOTECA_FIELD_ID,
                'select * '
                . 'from ' . NABU_MEDIOTECA_TABLE . ' '
                . 'where nb_customer_id=%cust_id$d',
                array(
                    'cust_id' => $nb_customer_id
                ),
                $nb_customer
            );
        } else {
            $retval = new CNabuMediotecaList($nb_customer);
        }

        return $retval;
    }
605694
public function update(Customer $customer, UpdateCustomer $request)
    {
        try {
            $customer->update($request->all());

            flash()->success(__(':name has been updated', ['name' => $customer->getName()]));
        } catch (\Exception $e) {
            flash()->error(__('Error: :msg', ['msg' => $e->getMessage()]));

            return redirect()->back()->withInput();
        }

        return redirect(route('appshell.customer.show', $customer));
    }
154554
public function delete(Customer $customer)
    {
        $endpoint = '/admin/customers/'.$customer->id.'.json';
        $response = $this->request($endpoint, 'DELETE');
        return;
    }
272594
protected function udapteCustomerAttributes($customer)
    {
        try {
            $this->validator->validate($customer);

            $this->modelManager->persist($customer->getAttribute());
            $this->modelManager->flush($customer->getAttribute());
            $this->modelManager->refresh($customer->getAttribute());

            return $customer;
        } catch (Exception $ex) {
            return false;
        }
    }
369098
def get_customer(code):
    
    Party = client.model('party.party')
    results = Party.find([('code', '=', code)])
    if results:
        return results[0]['id']