Jump to content

Client Area vie Statement Date Range or Datepicker


wilburlikesmith

Recommended Posts

Hi,

 

I've googled myself crazy. I've also found no results searching for "datepicker" or "client statement" in this forum.

 

I have found this code in the clientstatement.tpl page:

<link type="text/css" href="includes/jscript/css/ui.all.css" rel="stylesheet" />
<script type="text/javascript" src="includes/jscript/jquery.js"></script>
<script>jQuery.noConflict();</script>
<script type="text/javascript" src="includes/jscript/jqueryui.js"></script>
<!--
<script type="text/javascript" src="includes/jscript/jquerydp.js"></script>
-->
<script type="text/javascript">
//Create the date pickers and attach the onChange
jQuery(document).ready(function(){
 jQuery(".adate").datepicker({ dateFormat: '{/literal}{$dateformat}{literal}' });
 jQuery(".adate").change(function(){document.location = "clientstatement.php?fromdate="+jQuery("#fromDate").val()+"&todate="+jQuery("#toDate").val();});
 jQuery("#pdfStatement").css({cursor:'pointer'}).click(function(){document.location = "https://www.snowball.co.za/portal/clientstatement.php?output=PDF&fromdate="+jQuery("#fromDate").val()+"&todate="+jQuery("#toDate").val();});

});
</script>
<style>
.statementinvoiceunpaid {
	font-style:italic;
	color:red;
}
</style>

And the HTML:

<p style="text-align:right">
<b>From Date: </b><input type="textbox" class="adate" id="fromDate" value="{$fromdate}" size=8/>
<b>To Date: </b><input type="textbox" class="adate" id="toDate" value="{$todate}" size=8/>
</p> 

It however doesn't work. I noticed the jquerydp.js file being commented out, it's also not in the /includes/jscript/ folder. I can also not find the Client Area Statement section in the client demo site http://demo.whmcs.com otherwise I could have done some more troubleshooting...

 

Could someone please help or direct me on how to fix this or what the alternative method is for a logged in client to view a date ranged statement. The download PDF at the bottom doesn't appear to be a link either, but I suspect it's because the date ranged statement hasn't been generated.

 

Any help soonest would be much appreciated!

Link to comment
Share on other sites

Then at least, how would I then not show the datepicker fields or the download PDF for the clients?

you can edit the code within any of the reports - so you could remove the date pickers that way.

 

what are you trying to do? add a client statement page in the client area and allow clients to generate their own statements ? if so, it's going to need a bit more than some javascript to do it. :)

 

there's been a feature request for the option to send pdf statements to clients for two years - perhaps it will be added to v6.

 

https://requests.whmcs.com/responses/monthly-emailed-pdf-statement

Edited by brian!
Link to comment
Share on other sites

Can this be something to take a look on?

 

http://forum.whmcs.com/showthread.php?46322-Download-Statement-as-PDF-Script&highlight=client+statement

 

The problem is that I do not get it to work on 5.3.11

 

I get the following error:

 

No User ID submitted.

 

I have changed the path in statementpdf.php to the following:

 

# Include the TCPDF library

require(ROOTDIR . "/includes/classes/TCPDF/tcpdf.php");

Link to comment
Share on other sites

interesting find web2008 - it needs some polishing, but it still works with v5.3.11 ! :idea:

 

did you download the first zip? that contains a readme file with installation instructions - those instructions are a little out of date now... they'll work, but they contain bad habits (e.g modifying language files instead of using overrides, editing an existing report instead of renaming and then modifying - to avoid it getting overwritten with a whmcs update etc).

 

I downloaded the first zip, followed the instructions, then overwrote the php with the one in the second zip - modified the path to the tcpdf class as you suggested above.

 

what I think you may be doing is just pressing the "Download as PDF" link - if I do that, I get the same error you mention... what you need to do is enter a user ID and then press the "Generate Report" button... once the report is generated, you can then click the "Download as PDF" link and that should work.

Link to comment
Share on other sites

When I click on the "Generate Report" button the "Download as PDF" disappears.

 

Any idea what this can be?

 

Otherwise, the PDF download from the client area existed and I bought this module a few years ago, but it seems that Shaun is not in business anymore.

 

Silly that code can not be entrusted to someone else, so that the module will be further developed, for now it does not work anymore!

 

http://forum.whmcs.com/showthread.php?18569-Client-Area-Statement-With-PDF-Download&highlight=client+statement+pdf

Link to comment
Share on other sites

I have changed the report name to "client_statement_PDF"

 

When I click on the report I get the following:

/reports.php?report=client_statement_PDF

 

When I click on "Generate Report" I get the following:

/reports.php?report=client_statement

 

I have changed line 39 in statementpdf.php

require(ROOTDIR . "/modules/reports/client_statement_PDF.php");

 

What am I doing wrong?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated