Jump to content

Blesta Addons

Alpha Developers
  • Posts

    4,868
  • Joined

  • Last visited

  • Days Won

    389

Reputation Activity

  1. Like
    Blesta Addons got a reaction from activa in I will pay for language in url   
    Multi-languages Plugin is your friend, unless you want something specific, you can explain more and we can make a plugin just for you but it will cost you money .
  2. Thanks
    Blesta Addons got a reaction from Paul in Last Attempt, changing initial currency   
    Welcome to Blesta
  3. Like
    Blesta Addons reacted to Michael in Translate Blesta - client view   
    Go to Settings > Company > General > Internationalization > install.
  4. Like
    Blesta Addons reacted to the247hosting in Email Logs Not Working   
    Nevermind. Fixed it. I had to change this in the config file to 25.
    // Number of results to display per page
    Configure::set('Blesta.results_per_page', 25);
  5. Like
    Blesta Addons got a reaction from qatifserv in Configurable option type "text" & user pick the price   
    you need to add the js files and code to the order form view (depend on the template you use) .
     
  6. Like
    Blesta Addons got a reaction from Paul in Translate Blesta - client view   
    Sorry , the correct url is https://translate.blesta.com/
  7. Like
    Blesta Addons reacted to CanadaCloudHost in Introducing CanadaCloudHost   
    We are happy to show to all the community our brand new canada based website.
    Here what i have so far.
     
     

  8. Like
    Blesta Addons got a reaction from activa in Proforma & Invoice   
    This can be a solution also, not sure how you will dot it cloning in the same table or creating new table only for previous proforma? how it will infect the income/total invoiced today and other stats? for me any solution that will give us a track of the old proforma is welcome.
  9. Like
    Blesta Addons got a reaction from activa in Overview: Outstanding Balance Question   
    this is how we do it
    /** * Returns the amount available as a credit for each client by currency */ public function getCredits() { $fields = [ 'transactions.currency', 'transactions.client_id', 'transactions.amount', 'REPLACE(clients.id_format, ?, clients.id_value)' => 'client_id_code', 'SUM(IFNULL(transaction_applied.amount,?))' => 'applied_amount', 'contacts.first_name' => 'first_name', 'contacts.last_name' => 'last_name', 'contacts.company' => 'client_company' ]; $this->Record->select($fields) ->appendValues( [ $this->replacement_keys['clients']['ID_VALUE_TAG'], 0 ] ) ->from('transactions') ->leftJoin('transaction_applied', 'transaction_applied.transaction_id', '=', 'transactions.id', false) ->leftJoin('contacts', 'contacts.client_id', '=', 'transactions.client_id', false) ->innerJoin('clients', 'clients.id', '=', 'transactions.client_id', false) ->innerJoin('client_groups', 'client_groups.id', '=', 'clients.client_group_id', false) ->where('transactions.status', '=', 'approved'); // Filter by company $this->Record->where('client_groups.company_id', '=', Configure::get('Blesta.company_id')); // return $transactions = $this->Record ->group(['transactions.id', 'transactions.client_id', 'transactions.currency']) ->having('applied_amount', '<', 'transactions.amount', false) ->fetchAll(); $total_credits = []; foreach ($transactions as $transaction) { $transaction->total_amount = round($transaction->amount - $transaction->applied_amount, 4); if (isset($total_credits[$transaction->client_id]) && $total_credits[$transaction->client_id]->currency == $transaction->currency ) { $total_credits[$transaction->client_id]->total_transactions++; $total_credits[$transaction->client_id]->total_amount += $transaction->total_amount; continue; } $total_credits[$transaction->client_id] = $transaction; $total_credits[$transaction->client_id]->total_transactions = 1; } usort( $total_credits, function($a, $b) { return $b->total_amount - $a->total_amount; } ); return $total_credits; } for amout due
     
    /** * Returns the amount due for each client by currency * */ public function getAmountDue() { $fields = [ 'invoices.total', 'invoices.currency', 'invoices.client_id', 'COUNT(invoices.id)' => 'total_invoices', 'REPLACE(clients.id_format, ?, clients.id_value)' => 'client_id_code', 'contacts.first_name' => 'first_name', 'contacts.last_name' => 'last_name', 'contacts.company' => 'client_company' ]; $this->Record->select($fields) ->select(['SUM(IFNULL(invoices.total,0))-SUM(IFNULL(invoices.paid,0))' => 'total_amount'], false) ->from('invoices') ->appendValues( [ $this->replacement_keys['clients']['ID_VALUE_TAG'] ] ) ->innerJoin('clients', 'clients.id', '=', 'invoices.client_id', false) ->innerJoin('client_groups', 'client_groups.id', '=', 'clients.client_group_id', false) ->on('contacts.contact_type', '=', 'primary') ->innerJoin('contacts', 'contacts.client_id', '=', 'clients.id', false) ->where('invoices.status', 'in', ['active', 'proforma']) ->where('invoices.date_closed', '=', null); // Filter by company $this->Record->where('client_groups.company_id', '=', Configure::get('Blesta.company_id')); return $this->Record ->group(['invoices.client_id', 'invoices.currency']) ->order(['total_amount' => 'DESC']) // ->having('total_amount', '>', 0, false) ->limit($this->getPerPage(), (max(1, 1) - 1) * $this->getPerPage()) ->fetchAll(); }  
  10. Thanks
    Blesta Addons got a reaction from activa in Invoice item Cost show tax included   
    thank it work .
    the taxman say if we show total with taxe we need to add tax value in the same line like
    Description Quantity Unit Price Taxe Cost  
  11. Like
    Blesta Addons got a reaction from activa in Invoice item Cost show tax included   
    in invoices with tax enabled, the item cost is displaying the product price with tax included, we can't figure how to show it without tax, we need the tax to be included only in the total price,
    Description Quantity Unit Price Cost -------------------------------------------------- Item Label 1 10 12 -------------------------------------------------- Item Label 1 20 24 -------------------------------------------------- Subtotal 30.00 ---------------------- TVA (20%) 6.00 ---------------------- Total $36.00 we need to show it as like Description Quantity Unit Price Cost -------------------------------------------------- Item Label 1 10 10 -------------------------------------------------- Item Label 1 20 20 -------------------------------------------------- Subtotal 30.00 ---------------------- TVA (20%) 6.00 ---------------------- Total $36.00  
  12. Like
    Blesta Addons got a reaction from activa in Translate Blesta - client view   
    Hello Sir
    you should translate the order form plugin, some languages already has partial translation in the languages.blesta.com
  13. Like
    Blesta Addons got a reaction from Beav in is time to talk about domains ?   
    all we know blesta is working or has attention to create a new domain manager. it will take time of course, not sur what is the ETA and what is the progress in this subject . but what i'm sure of it it time to talk about this, the silence that blesta staff has about this subject render it a bit Unclear and hazy .
    we need a word from staff about what they have as ideas or in what step they are now, leaving us like this for almost 3 years is something unacceptable.
  14. Like
    Blesta Addons got a reaction from activa in Last Attempt, changing initial currency   
    Welcome to Blesta
  15. Like
    Blesta Addons got a reaction from activa in Last Attempt, changing initial currency   
    a simple tip is to add the fallowing code in set setCurrency()
    protected function setCurrency() { if (!$this->client) { $this->SessionCart->setData('currency', 'VND'); } .... ....  
  16. Thanks
    Blesta Addons got a reaction from activa in Last Attempt, changing initial currency   
    /** * Sets the ISO 4217 currency code to use for the order form */ protected function setCurrency() { // Set custom currency for no logged in users if (!$this->client) { $this->SessionCart->setData('currency', 'VND'); } // If user attempts to change currency, verify it can be set // Currency can only be changed if cart is empty if (isset($this->get['currency']) && $this->SessionCart->isEmptyCart()) { foreach ($this->order_form->currencies as $currency) { if ($currency->currency == $this->get['currency']) { $this->SessionCart->setData('currency', $currency->currency); break; } } } elseif (!isset($this->get['currency']) && $this->SessionCart->isEmptyCart()) { // If a queued item for the cart exists, verify and set its pricing currency for the order form $cart = $this->SessionCart->get(); if ($this->SessionCart->isEmptyCart() && !$this->SessionCart->isEmptyQueue() && !$this->SessionCart->getData('currency') && ($queue_item = $this->SessionCart->checkQueue()) && count($cart['queue']) == 1) { $pricing_id = $queue_item['pricing_id']; // Fetch the package info for the selected pricing ID if (($package = $this->Packages->getByPricingId($pricing_id))) { // Find the matching pricing foreach ($package->pricing as $pricing) { // Set the queued pricing currency as the form currency if ($pricing->id == $pricing_id) { foreach ($this->order_form->currencies as $currency) { if ($currency->currency == $pricing->currency) { $this->SessionCart->setData('currency', $currency->currency); break; } } break; } } } } } // If no currency for this session, default to the company's default currency, // or the first available currency for the order form if ($this->SessionCart->getData('currency') == null) { $temp = $this->Companies->getSetting($this->company_id, 'default_currency'); if ($temp) { $company_currency = $temp->value; } foreach ($this->order_form->currencies as $currency) { if ($currency->currency == $company_currency) { $this->SessionCart->setData('currency', $currency->currency); break; } } if ($this->SessionCart->getData('currency') == null && isset($this->order_form->currencies[0]->currency)) { $this->SessionCart->setData('currency', $this->order_form->currencies[0]->currency); } } }  
  17. Like
    Blesta Addons got a reaction from bunny in is time to talk about domains ?   
    all we know blesta is working or has attention to create a new domain manager. it will take time of course, not sur what is the ETA and what is the progress in this subject . but what i'm sure of it it time to talk about this, the silence that blesta staff has about this subject render it a bit Unclear and hazy .
    we need a word from staff about what they have as ideas or in what step they are now, leaving us like this for almost 3 years is something unacceptable.
  18. Like
    Blesta Addons got a reaction from Michael in Last Attempt, changing initial currency   
    Welcome to Blesta
  19. Like
    Blesta Addons got a reaction from Michael in Last Attempt, changing initial currency   
    a simple tip is to add the fallowing code in set setCurrency()
    protected function setCurrency() { if (!$this->client) { $this->SessionCart->setData('currency', 'VND'); } .... ....  
  20. Like
    Blesta Addons reacted to Tiny in Last Attempt, changing initial currency   
    You are great, I got the thing done and it works !!!!!!!!!!! ????????????????
    Thank you
     
     
  21. Like
    Blesta Addons reacted to Tiny in Last Attempt, changing initial currency   
    Now, I can start selling at least a few bits, other issues remain, they must be worked on, step by step
  22. Like
    Blesta Addons reacted to mrrsm in validateHostname Should Accept Uppercase Characters   
    It looks like almost any module that accepts a hostname uses that check to validate it.
    PHP offers FILTER_VALIDATE_DOMAIN that you can use with filter_var to check a hostname (along with the flag FILTER_FLAG_HOSTNAME in php 7+) which which would provide a more robust checking mechanism.  This still would have issues with internationalized domain names but covers a large majority of cases.
    On the other hand if you fix this yourself, adding support for IDN's would be something nice as well as they seem to be gaining popularity.
  23. Like
    Blesta Addons reacted to Jonathan in validateHostname Should Accept Uppercase Characters   
    Currently the validateHostname() function in most modules looks something like this:
    /** * Validates that the given hostname is valid * * @param string $host_name The host name to validate * @param bool $require_fqdn True to require a FQDN (e.g. host.domain.com), * or false for a partial name (e.g. domain.com) (optional, default false) * @return bool True if the hostname is valid, false otherwise */ public function validateHostName($host_name, $require_fqdn = false) { if (strlen($host_name) > 255) { return false; } $octet = "([a-z0-9]|[a-z0-9][a-z0-9\-]{0,61}[a-z0-9])"; $nested_octet = "(\." . $octet . ')'; $hostname_regex = '/^' . $octet . $nested_octet . ($require_fqdn ? $nested_octet : '') . '+$/'; return $this->Input->matches($host_name, $hostname_regex); } While sure hostnames shouldn't contain uppercase characters (my opinion), it's perfectly valid RFC and we shouldn't cause undue burden on the customer with vague rejection messages that what they entered isn't a valid domain/hostname simply because it contains uppercase letters.
    A better solution would be to update the regex to accept A-z and then in the modules run it through strtolower().
  24. Like
    Blesta Addons reacted to Paul in Email notification for canceled service   
    The task can be found at https://dev.blesta.com/browse/CORE-1912 and it's related to https://dev.blesta.com/browse/CORE-1564 which would likely be implemented together. Thoughts?
  25. Thanks
    Blesta Addons got a reaction from Paul in Overview: Outstanding Balance Question   
    You need it for making a statement for clients? if yes, i think already a member has posted a plugin that do this .
    if you have subscription in our website, look at the stats plugin, it has some sort of this request, as i see you want a list of client's credit ?
    is this what you want? i can share with you the code if you don't have access to our addons

     
     
×
×
  • Create New...