-
Posts
4,868 -
Joined
-
Last visited
-
Days Won
390
Everything posted by Blesta Addons
-
Welcome to Blesta
-
if you don't want to change the blesta files you can remove usd currency from order form setting and set only vnd, then all users/client will be forced to use vnd .
-
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.
-
Hello Sir you should translate the order form plugin, some languages already has partial translation in the languages.blesta.com
-
/** * 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); } } }
-
i have tested the code and is working for me .
-
can you check the blesta logs in blesta_log directory . you should add only if (!$this->client) { $this->SessionCart->setData('currency', 'VND'); }
-
a simple tip is to add the fallowing code in set setCurrency() protected function setCurrency() { if (!$this->client) { $this->SessionCart->setData('currency', 'VND'); } .... ....
-
this can be done by editing the order plugin . how many order form you have, as blesta dind't have universal carts, so every order form has it own cart. please look at order_form_controller.php , the fucntion setCurrency(), i believe this is the function responsible for setting the currency for users in order form.
-
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
-
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(); }
-
you issue is a known issue in blesta, i have talked about it 2016 and in this thread
-
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
-
Password protect the Admin folder / admin path with htaccess
Blesta Addons replied to Chris van der Westhuizen's question in Support
if you have admin tools installed, you can change the admin route from admin side without touching the blesta files. for htaccess not sure if the statement location will work for you . -
in fact, it can be done with a custom plugin, with the event Services.Cancel, don't have big free time to look into it, but i will try .
-
not impemented yet, and already requested
-
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.
-
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
-
Domain Manager - We need your feedback on domains
Blesta Addons replied to Paul's topic in The Lounge
always Negative sensations, in office and in internet !!!- 181 replies
-
is good news that blesta has more client every day, and getting more migrating to Blesta than away from it. but i'm still insist that blesta has not touched yet the big market (Hosting Market), if blesta can concentrate in this market, you will get more clients than what you imagine, we are working with the two billing system and we know exactly what are locked and missed in blesta, if you want @Paul any suggestion or ideas about how the hosting market work i'm ready . whimps has a big team (in term of persons) and a big company behind it, and of course a big base clients for it, and they are totally in the hosting market for so many years and they know well what the market need. why not blesta look at the other side a try to make a collaboration with Plesk, interworks and directadmin ... ect, and why not searching for investors, it a win win contract, because the time is money nowadays .
-
get transaction for wich invoice via Event
Blesta Addons replied to Blesta Addons's topic in Feature Requests
Thanks -
Hello all today we will open again the debate about EU invoicing system in Blesta, our taxman require the track info for proforma in invoices. so the actual behavior, when a proforma is paid totally it's converted to invoice, with new date creation. this lead the customer to ask as every time for wich this invoice and what is the related proforma. what blesta staff can do for this issue, we need the track info of proforma in invoices (Proforma Number, proforma Date).
-
Blank pages mean a php error, try enable the error_reporting. you might have missed a step in installation, you can open a ticket with us to install it for you .
- 45 replies
-
- multi languages
- languages
-
(and 1 more)
Tagged with:
-
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 .
-
the Transactions.Add event is not returning the invoice_id wish the transaction was for. the transaction info and applying payment is called after the Transactions.Add, So there are no way to know the transaction for wich invoice by the Transactions.Add . is possible to add another event that return the transaction info with amount applier to each invoice, this event should be trigger after Transactions->apply() function . we can get something with the Invoices.setClosed function, but we need this only in the transactions.Add() event .