I can set Invoice Format on page /admin/settings/company/billing/customization/ (in my case it is: {year}Company{num}). I would like to pad invoice IDs with zeros. I guess that for this purpose there is inv_pad_size setting (http://docs.blesta.com/display/dev/Company+Settings). However, I was not able to make it work - id_code of invoice is 2013Company1 instead of 2013Company0001.
Is it a bug? Or what is the purpose of the inv_pad_size setting?
/app/models/invoices.php (This may be the place where inv_pad_size is not taken into account)
/** * Partially constructs the query required by Invoices::get() and others
*
* @param int $invoice_id The ID of the invoice to fetch
* @return Record The partially constructed query Record object
*/privatefunction getInvoice($invoice_id){
$fields = array("invoices.*","REPLACE(invoices.id_format, ?, invoices.id_value)"=>"id_code","invoice_delivery.date_sent"=>"delivery_date_sent");// Fetch the invoices along with total due and total paid, calculate total remaining on the fly
$this->Record->select($fields)->select(array("invoices.total-IFNULL(invoices.paid,0)"=>"due"),false)->
appendValues(array($this->replacement_keys['invoices']['ID_VALUE_TAG']))->from("invoices")->
on("invoice_delivery.date_sent","!=",null)->leftJoin("invoice_delivery","invoice_delivery.invoice_id","=","invoices.id",false)->where("invoices.id","=", $invoice_id)->group("invoices.id");return $this->Record;}
Question
MartyIX
Hello,
I can set Invoice Format on page /admin/settings/company/billing/customization/ (in my case it is: {year}Company{num}). I would like to pad invoice IDs with zeros. I guess that for this purpose there is inv_pad_size setting (http://docs.blesta.com/display/dev/Company+Settings). However, I was not able to make it work - id_code of invoice is 2013Company1 instead of 2013Company0001.
Is it a bug? Or what is the purpose of the inv_pad_size setting?
/app/models/invoices.php (This may be the place where inv_pad_size is not taken into account)
Thank you!
1 answer to this question
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now