Skip to content

Conversation

@SteveIreland
Copy link
Collaborator

No description provided.

$invoice_format = $this->config->item('sales_invoice_format');

// generate final invoice number (if using the invoice in sales by receipt mode then the invoice number can be manually entered or altered in some way
// generate final invoice numbr (if using the invoice in sales by receipt mode then the invoice number can be manually entered or altered in some way
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for this change to munbr in the comment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling obsessive compulsive disorder

if ($temp_invoice_number == NULL || $temp_invoice_number == '')
{
$invoice_number = $this->config->item('sales_invoice_format');
$temp_invoice_number = $this->token_lib->render($invoice_format, array(), FALSE);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if I understand well the number will be rendered if nothing is set before, so it will be rendered once and stay until the sale is completed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit more complex than that. The temporary invoice number is returned so that it can be displayed to the user. However, if the sale is then suspended then the next sale will be assigned that same invoice number (if it is completed). When the suspended sale is unsuspended then the next invoice number to be used is displayed on the register (not the one that was previously displayed since it was assigned to an earlier completed sale.

@SteveIreland SteveIreland merged commit 96c5924 into master Jan 28, 2022
@objecttothis objecttothis deleted the preview-invoice-number branch September 29, 2023 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants