Leaderboard
Popular Content
Showing content with the highest reputation on 08/19/2018 in all areas
-
is time to talk about domains ?
Beav reacted to Blesta Addons for a topic
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.1 point -
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().1 point
-
Invoice item Cost show tax included
activa reacted to Blesta Addons for a question
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.001 point -
Introducing CanadaCloudHost
activa reacted to CanadaCloudHost for a topic
1 point -
Introducing CanadaCloudHost
activa reacted to CanadaCloudHost for a topic
Thanks Joseph H we're adding material effect on top aswell to give it that final canadian sexyness once this theme out the way i will be porting bootstrap 4.1 to blesta for you guys to enjoy free.1 point -
Translate Blesta - client view
activa reacted to Blesta Addons for a question
Hello Sir you should translate the order form plugin, some languages already has partial translation in the languages.blesta.com1 point -
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.1 point
-
Created on: 25/Nov/15 1:36 PM When its going to be released then?1 point
-
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?1 point
-
Invoice item Cost show tax included
activa reacted to Blesta Addons for a question
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 Cost1 point -
Overview: Outstanding Balance Question
activa reacted to Blesta Addons for a 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(); }1 point -
Proforma & Invoice
activa reacted to Blesta Addons for a topic
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.1 point -
Invoice item Cost show tax included
Blesta Addons reacted to Paul for a question
Is this a legal issue in your area? If so, I wonder if we should make this a setting.1 point -
This is on the PDF invoice, correct? If so, I believe you want to change the invoice line item total to the invoice line item subtotal, i.e. (from /components/invoice_templates/default_invoice_pdf.php): Find and change: $this->invoice->line_items[$i]->total to: $this->invoice->line_items[$i]->subtotal1 point