By Manfred on Thursday, 19 April 2018
Posted in General
Likes 0
Views 427
Votes 0
Hi Folks

We have quite a big problem with payplans related to invoice numbering.

We are using [[year]].MF.[[number]] in the invoice serial counter configuration which is working well except

1) How do you RESET the counter from 1 again? We are up to over 200 now due to rigorous testing, and the client wants invoices to start from 1 for launch.
2) We are recreating a lot of user accounts, and giving them a partial subscription for free. This is automatically generating an invoice.. even though it is only for 0 Euro, this is (again) incrementing the invoice counter and giving the appearance of gaps. We do not want zero invoices.. only those with a figure

Is it possible to ONLY generate an invoice serial if the amount is greater than 0, where is the code that injects the invoice serial so I can potentially put an IF statement in there and skip invoice serial generation.. leaving that field blank AND not incrementing the numner

Thanks in advance for a swift reply
Hello Manfred,

1) How do you RESET the counter from 1 again? We are up to over 200 now due to rigorous testing, and the client wants invoices to start from 1 for launch.
# currently in payplans there is no functionality to reset counter. You can do this by custom script to re-assign serial number. If you want us to do that then you can send your request at at support@stackideas.com OR https://crm.stackideas.com and select "Customizations".

2) We are recreating a lot of user accounts, and giving them a partial subscription for free. This is automatically generating an invoice.. even though it is only for 0 Euro, this is (again) incrementing the invoice counter and giving the appearance of gaps. We do not want zero invoices.. only those with a figure
# You can do it by customization in core , find the code in root/component/com_payplans/libraries/event/order.php.
See attached screen shot.

Update me if you have any query.
·
Friday, 20 April 2018 12:03
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks, got it working

This is the code to skip invoice number if its zero


//change the invoice serial here
if (isset($prev)
&& in_array($prev->getStatus(), array(PayplansStatus::INVOICE_CONFIRMED,PayplansStatus::NONE))
&& $new->getStatus() == PayplansStatus::INVOICE_PAID )
{
if($new->getTotal() > 0) {
$newSerial = PayplansHelperInvoice::getNewSerial($new);
} else {
$newSerial = 'NA';
}
$new->set('serial', $newSerial);
}


and I found the counter in the #__payplans_config table so was able to reset
·
Friday, 20 April 2018 19:41
·
0 Likes
·
0 Votes
·
0 Comments
·
It sounds good that your issue is resolved

Just for your information, I have locked and marked this thread as resolved to avoid confusions in the future. Please start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiries.
·
Friday, 20 April 2018 20:41
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post