Jump to content

custom report for showing unpaid invoices with description


Recommended Posts

<?php

use WHMCS\Database\Capsule;

        ?>
        <html>
                <head>
                <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
                </head>
        <body> 
                
        <table class="table">
  <thead>
    <tr>
      <th scope="col">Invoice ID</th>
      <th scope="col">User ID</th>
      <th scope="col">Invoice Date</th>
      <th scope="col">Due Date</th>
      <th scope="col">Description</th>
      <th scope="col">Amount</th>
    </tr>
  </thead>
  <tbody>
        <?php

        foreach (Capsule::table('tblinvoices')->where("status", "=", "Unpaid")->get() as $client) {
    // Fetch data from another_table based on $client->id
    $additional_data = Capsule::table('tblinvoiceitems')->where('invoiceid', $client->id)->first();

      
        <tr>
            <th scope="row"><?php echo $client->id  . PHP_EOL; ?></th>
            <td><?php echo $client->userid  . PHP_EOL; ?></td>
            <td><?php echo $client->date .  PHP_EOL; ?></td>
            <td><?php echo $client->duedate . PHP_EOL; ?></td>
            <td><?php echo $additional_data->description . PHP_EOL; ?></td>
            <td><?php echo $client->total  . PHP_EOL; ?></td>

        </tr>
        }
    <?php>
    </tbody>
</table>


</body>


Above mentioned code throwing the following error. so please help me to fix this issue.

 

Oops!

Something went wrong and we couldn't process your request.

Please go back to the previous page and try again.

For additional assistance, please reference the WHMCS TroubleShooting Guide »

ParseError: syntax error, unexpected '<' in /home/hotmaisl/public_html/billing/modules/reports/unpaid_Invoices_with_description.php:47
Stack trace:
#0 {main}

Edited by hmaddy
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