Jump to content

sokalsondha

Member
  • Content Count

    52
  • Joined

  • Last visited

Community Reputation

0 Neutral

About sokalsondha

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. hello Brian thanks again for your kind help i have done the changes. but now i have this output i need to display Subtotal without the Credit balance of the customer. this customer has 10 euros credit. so i need to see the subtotal 110 euros then credit will be minus and total due is 100 euros any idea what can i do? thanks a billion
  2. hello everyone. hope all are doing fine. can some one help me with correct my tpl file for the pdf invoice. basically what i am looking for is.... my product price is 55 euros which is included TAX . my tax rate is 21% so my product real price is 45.45 euros and 9.55 is TAX at the moment its showing like this which is accurate i know. but i want to hide that line 21.00% VAT from this pdf all i want it too looks like i dont want to remove the functionality just i want to hide the TAX thing from the invoicepdf here is my code <?php # Logo $logoFilename = 'placeholder.png'; if (file_exists(ROOTDIR . '/assets/img/logo.png')) { $logoFilename = 'logo.png'; } elseif (file_exists(ROOTDIR . '/assets/img/logo.jpg')) { $logoFilename = 'logo.jpg'; } $pdf->Ln(5); $pdf->SetFont($pdfFont, 'B', 15); $pdf->SetFillColor(255); $pdf->SetFont($pdfFont, '', 16); $pdf->Cell(100, 6, "My Bill Summary", 0, 1, 'L', '1'); $pdf->Image(ROOTDIR . '/assets/img/' . $logoFilename, 120, 25, 75); # Company Details $pdf->SetXY(15, 70); $pdf->SetFont($pdfFont, '', 13); foreach ($companyaddress as $addressLine) { $pdf->Cell(180, 4, trim($addressLine), 0, 1, 'R'); $pdf->SetFont($pdfFont, '', 9); } if ($taxCode) { $pdf->Cell(180, 4, $taxIdLabel . ': ' . trim($taxCode), 0, 1, 'R'); } $pdf->Ln(5); # Clients Details $pdf->SetXY(15, 70); $pdf->SetFont($pdfFont, 'B', 10); $pdf->SetFont($pdfFont, 'B', 14); if ($clientsdetails["companyname"]) { $pdf->Cell(0, 4, $clientsdetails["companyname"], 0, 1, 'L'); $pdf->Cell(0, 4, Lang::trans('invoicesattn') . ': ' . $clientsdetails["firstname"] . ' ' . $clientsdetails["lastname"], 0, 1, 'L'); } else { $pdf->Cell(0, 4, $clientsdetails["firstname"] . " " . $clientsdetails["lastname"], 0, 1, 'L'); } $pdf->SetFont($pdfFont, '', 12); $pdf->Cell(0, 4, $clientsdetails["address1"], 0, 1, 'L'); if ($clientsdetails["address2"]) { $pdf->Cell(0, 4, $clientsdetails["address2"], 0, 1, 'L'); } $pdf->Cell(0, 4, $clientsdetails["city"] . ", " . $clientsdetails["postcode"], 0, 1, 'L'); $pdf->Cell(0, 4, $clientsdetails["country"], 0, 1, 'L'); if (array_key_exists('tax_id', $clientsdetails) && $clientsdetails['tax_id']) { $pdf->Cell(0, 4, $taxIdLabel . ': ' . $clientsdetails['tax_id'], 0, 1, 'L'); } $pdf->Ln(5); $pdf->Ln(5); $pdf->Ln(5); # Header Bar /** * Invoice header * * You can optionally define a header/footer in a way that is repeated across page breaks. * For more information, see http://docs.whmcs.com/PDF_Invoice#Header.2FFooter */ $pdf->SetFont($pdfFont, 'B', 15); $pdf->SetFillColor(239); $pdf->SetFont($pdfFont, '', 12); if ($customfields) { foreach ($customfields as $customfield) { $pdf->Cell(75, 6, $customfield['fieldname'] . ' ' . $customfield['value'], 0, 1, 'L', '1'); } } $pdf->Cell(75, 6, "Invoice Number " . ' ' . $invoiceid, 0, 1, 'L', '1'); $pdf->Cell(75, 6, "Bill Issue Date" . ' ' . $datecreated, 0, 1, 'L', '1'); $pdf->Cell(75, 6, "Payment Method" . ' ' . $paymentmethod, 0, 1, 'L', '1'); $pdf->Ln(10); $startpage = $pdf->GetPage(); # Invoice Items $tblhtml = '<table width="85%" bgcolor="#ccc" cellspacing="1" cellpadding="2" border="0"> <tr height="30" bgcolor="#efefef" style="font-weight:bold;text-align:center;"> <td width="80%">' . Lang::trans('invoicesdescription') . '</td> <td width="20%">' . Lang::trans('quotelinetotal') . '</td> </tr>'; foreach ($invoiceitems as $item) { $tblhtml .= ' <tr bgcolor="#fff"> <td align="left">' . nl2br($item['description']) . '<br /></td> <td align="center">' . $item['amount'] . '</td> </tr>'; } $tblhtml .= ' <tr height="30" bgcolor="#efefef" style="font-weight:bold;"> <td align="right">' . Lang::trans('invoicessubtotal') . '</td> <td align="center">' . $subtotal . '</td> </tr>'; if ($taxname) { $tblhtml .= ' <tr height="30" bgcolor="#efefef" style="font-weight:bold;"> <td align="right">' . $taxrate . '% ' . $taxname . '</td> <td align="center">' . $tax . '</td> </tr>'; } if ($taxname2) { $tblhtml .= ' <tr height="30" bgcolor="#efefef" style="font-weight:bold;"> <td align="right">' . $taxrate2 . '% ' . $taxname2 . '</td> <td align="center">' . $tax2 . '</td> </tr>'; } $tblhtml .= ' <tr height="30" bgcolor="#efefef" style="font-weight:bold;"> <td align="right">' . Lang::trans('invoicescredit') . '</td> <td align="center">' . $credit . '</td> </tr> <tr height="30" bgcolor="#efefef" style="font-weight:bold;font-size:16px;"> <td align="right">' . "Total Amount Due" . '</td> <td align="center">' . $total . '</td> </tr> </table>'; $pdf->writeHTML($tblhtml, true, false, false, false, ''); $pdf->Ln(5); $html = "<h2 style=\"color:red;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Please pay by ${duedate} </h2>"; $pdf->writeHTML($html, true, false, false, false, ''); $pdf->Ln(10); $pdf->SetFont($pdfFont, 'B', 15); $pdf->SetFillColor(239); $pdf->SetFont($pdfFont, '', 10); $pdf->Cell(125, 6, "Failure to pay your account in full may result in loss of service.", 0, 1, 'L', '1'); $pdf->Cell(125, 6, "Reactivation of your service could take up to 7 days and will incur a fee. ", 0, 1, 'L', '1'); $pdf->Ln(10); # Notes if ($notes) { $pdf->Ln(5); $pdf->SetFont($pdfFont, '', 8); $pdf->MultiCell(170, 5, Lang::trans('invoicesnotes') . ': ' . $notes); } /** * Invoice footer */ can someone please help me in this issue.. i really need to solve it Thanks a million in advnace
  3. hello members. happy new year. i came up today with a very important question. i am using whmcs for my ISP. currently only selling broadband to residential customer. so i put in automation >>billing settinggs ..14 days. which is working perfect no problem i am going to add a phone service with the broadband too. so the broadband and phone bill will be together in one invoice. so for example customer billing start at 8th of August. so as per current system its generate invoice on 26th of July which is 14 days but when i will be start the phone service i need to generate the invoice on the same day service expired because i need to add the phone usage bill from the previous month so plan is customer will get the invoice on 8th of the August even its his date expired. and he have 7 days to make payment of the bill. and if he dont pay within 7 days his service will be suspended on the 8th of the day so what value i should put instead of 14 days in the automation settings? 0 ? because i want he get the email invoice the day his line going to be expire i can't do any test as its on live sytem so please someone help me with guide thanks a million
  4. Hello everyone. greetings from me again. i need to print out monthly sales report to submit tax office and the way whmcs sales tax liability report print its not possible to submit. there is no company name showing and also we dont work with clients name so i dont need to show the client name in the report. also after print out the report it showing in the top the whole whmcs admin link and whmcs printer friendly report. is there any chance i can customize the pdf report? like the way we customize the pdf invoice Hope someone can help me on this issue Thanks again
  5. thanks brian for this help. i was thinking to delete the whole invoice... completely remove each data from the system so then i can generate new invoice for the client. but found its not possible with whmcs thanks again brian
  6. Hello everyone. how are you? i need some expert help for my whmcs. basically i have setup a product with billing cycle quarterly with price of 150 euros. the customer used that for almost 2 and half months. now system generate an invoice for 150 euros again for the next 3 months. and now customer rang me and said he would like to go for monthly payment which is 55 a month. problem is invoice is generated and if i cancel the invoice system will not be generating any more invoice for him. so what can i do now? i need to remove or cancel that 3 months invoice and generate him a monthly invoice can someone please help with some idea. i am sure lot of people face this issue before Thanks very much in advance for reading my post
  7. hello members, hope all are fine. i have just installed fresh whmcs latest version and i am missing the login to cpanel button from the action menu on client area. any idea why? can someone help with the issue? Kind Regards Mahim
  8. hello thanks for reading my text. i have whmcs latest version and what is the issue is i can see the cron not generating the monthly invoice. i have a customer who have an active product due at 08/08/2020 but i cant understand why the cron is not generating the invoice when its suppose to be generate 14 days earlier. but if i click on the customer dashboard generate due invoice i can see system create the invoice for that client. so can someone guide me what can be issue?? i can see in the logs but i can't find any issue at all 😞 dont know what to do just to let you know i have customized pdf invoice . is that giving any issue? thanks a million in advance. please stay safe
  9. Hello Everyone. hope all are fine. can someone help me to modify this code a little so i can achieved what i am looking for. basically i have hook file for a client custom field. what the hook does is when i create a new customer its create a random 8 digit number for the custom field Account Number. its fine until now but the problem is 1. This hook doesn't check the existing value in the database , so there is chance to create the duplicate account number and we cant allocate same account for two customer. 2. once the Account created and we have the account number then any admin or staff can modify the client details form and easily change the account number. and this is another dangerous point. we cant change the account number for any customer. once we create the customer we will have permanent account number for that customer. so what can i do in this case with this hook? i have given the code in here. thanks again in advance <?php use Carbon\Carbon; if (!defined("WHMCS")) die("This file cannot be accessed directly"); function AccountNumber($vars) { $userid = $vars['userid']; $command = 'UpdateClient'; $values = array( 'clientid' => $userid, 'customfields' => base64_encode(serialize(['Account Number'=>rand(11111111,99999999)])) ); $results = localAPI($command, $values); if ($results['result'] == 'success') { logActivity('Success : Customer ID set successfully to User # '.$userid); } else { logActivity('Error : Customer ID could not be set to User # '.$userid.'. Response : '.$results['result']); } } add_hook("ClientAdd",1,"AccountNumber");
  10. hello old post freshen up again. did someone found the way to work with this? i am having same issue with my .com.bd domain so may be someone have idea what to do? thanks
  11. Hello everyone Can you help me something on this please. In my invoice list I have changed the button name from Unpaid to Make-Payment. Because what I want is when my customer click on this make payment button it will be take them direct to payment page instead of viewinvoice page.. Because I have put a button to download the pdf invoice so my customer can download the pdf invoice if they want to see it. But I really need to skip the viewinvoice page. So if I have PayPal as a payment method for that invoice then when client click on that Make-Payment button it will be take them to PayPal directly. Can someone help me with the code in the template file. Thanks a million in advance Please see the current invoice list page
  12. yes brian you are very right as always.. from the database pulling will be the best idea. i will try to work it out thanks again for the kind help
  13. thanks brian for reply.. yes its good point. but i will be have only one product in the invoice. one customer = one product only can it possible to do?
  14. Hello everyone. i hope everyone is doing great. i need again some help from the community. hope someone correct my invoicepdf tpl file so it can complete my demand. i have done some modify but i can't understand how to fix some more. i want to make my invoice like this and this is my current code. its already modified mostly <?php # Logo $logoFilename = 'placeholder.png'; if (file_exists(ROOTDIR . '/assets/img/logo.png')) { $logoFilename = 'logo.png'; } elseif (file_exists(ROOTDIR . '/assets/img/logo.jpg')) { $logoFilename = 'logo.jpg'; } $pdf->Ln(5); $pdf->SetFont($pdfFont, 'B', 15); $pdf->SetFillColor(255); $pdf->SetFont($pdfFont, '', 16); $pdf->Cell(100, 6, "My Bill Summary", 0, 1, 'L', '1'); $pdf->Image(ROOTDIR . '/assets/img/' . $logoFilename, 120, 25, 75); # Company Details $pdf->SetXY(15, 70); $pdf->SetFont($pdfFont, '', 13); foreach ($companyaddress as $addressLine) { $pdf->Cell(180, 4, trim($addressLine), 0, 1, 'R'); $pdf->SetFont($pdfFont, '', 9); } if ($taxCode) { $pdf->Cell(180, 4, $taxIdLabel . ': ' . trim($taxCode), 0, 1, 'R'); } $pdf->Ln(5); # Clients Details $pdf->SetXY(15, 70); $pdf->SetFont($pdfFont, 'B', 10); $pdf->SetFont($pdfFont, '', 9); if ($clientsdetails["companyname"]) { $pdf->Cell(0, 4, $clientsdetails["companyname"], 0, 1, 'L'); $pdf->Cell(0, 4, Lang::trans('invoicesattn') . ': ' . $clientsdetails["firstname"] . ' ' . $clientsdetails["lastname"], 0, 1, 'L'); } else { $pdf->Cell(0, 4, $clientsdetails["firstname"] . " " . $clientsdetails["lastname"], 0, 1, 'L'); } $pdf->Cell(0, 4, $clientsdetails["address1"], 0, 1, 'L'); if ($clientsdetails["address2"]) { $pdf->Cell(0, 4, $clientsdetails["address2"], 0, 1, 'L'); } $pdf->Cell(0, 4, $clientsdetails["city"] . ", " . $clientsdetails["postcode"], 0, 1, 'L'); $pdf->Cell(0, 4, $clientsdetails["country"], 0, 1, 'L'); if (array_key_exists('tax_id', $clientsdetails) && $clientsdetails['tax_id']) { $pdf->Cell(0, 4, $taxIdLabel . ': ' . $clientsdetails['tax_id'], 0, 1, 'L'); } $pdf->Ln(10); $pdf->Ln(10); $pdf->Ln(10); # Header Bar /** * Invoice header * * You can optionally define a header/footer in a way that is repeated across page breaks. * For more information, see http://docs.whmcs.com/PDF_Invoice#Header.2FFooter */ $pdf->SetFont($pdfFont, 'B', 15); $pdf->SetFillColor(239); $pdf->SetFont($pdfFont, '', 12); if ($customfields) { foreach ($customfields as $customfield) { $pdf->Cell(125, 6, $customfield['fieldname'] . ': ' . $customfield['value'], 0, 1, 'L', '1'); } } $pdf->Cell(125, 6, "Invoice Number " . ': ' . $invoiceid, 0, 1, 'L', '1'); $pdf->Cell(125, 6, "Bill Issue Date" . ': ' . $datecreated, 0, 1, 'L', '1'); $pdf->Cell(125, 6, "Billing Period" . ': ' . $datecreated, 0, 1, 'L', '1'); $pdf->Ln(10); $startpage = $pdf->GetPage(); # Invoice Items $tblhtml = '<table width="70%" bgcolor="#ccc" cellspacing="1" cellpadding="2" border="0"> <tr height="30" bgcolor="#efefef" style="font-weight:bold;text-align:center;"> <td width="80%">' . Lang::trans('invoicesdescription') . '</td> <td width="20%">' . Lang::trans('quotelinetotal') . '</td> </tr>'; foreach ($invoiceitems as $item) { $tblhtml .= ' <tr bgcolor="#fff"> <td align="left">' . nl2br($item['description']) . '<br /></td> <td align="center">' . $item['amount'] . '</td> </tr>'; } $tblhtml .= ' <tr height="30" bgcolor="#efefef" style="font-weight:bold;"> <td align="right">' . Lang::trans('invoicessubtotal') . '</td> <td align="center">' . $subtotal . '</td> </tr>'; if ($taxname) { $tblhtml .= ' <tr height="30" bgcolor="#efefef" style="font-weight:bold;"> <td align="right">' . $taxrate . '% ' . $taxname . '</td> <td align="center">' . $tax . '</td> </tr>'; } if ($taxname2) { $tblhtml .= ' <tr height="30" bgcolor="#efefef" style="font-weight:bold;"> <td align="right">' . $taxrate2 . '% ' . $taxname2 . '</td> <td align="center">' . $tax2 . '</td> </tr>'; } $tblhtml .= ' <tr height="30" bgcolor="#efefef" style="font-weight:bold;"> <td align="right">' . Lang::trans('invoicescredit') . '</td> <td align="center">' . $credit . '</td> </tr> <tr height="30" bgcolor="#efefef" style="font-weight:bold;font-size:14px;"> <td align="right">' . "Total Amount Due" . '</td> <td align="center">' . $total . '</td> </tr> </table>'; $pdf->writeHTML($tblhtml, true, false, false, false, ''); $pdf->Ln(5); if ($status == 'Unpaid'){ $html = "<h2 style=\"color:red;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Please pay by ${duedate} </h2>"; $pdf->writeHTML($html, true, false, false, false, ''); $pdf->Ln(10); $pdf->SetFont($pdfFont, 'B', 15); $pdf->SetFillColor(239); $pdf->SetFont($pdfFont, '', 10); $pdf->Cell(125, 6, "Failure to pay your account in full may result in loss of service.", 0, 1, 'L', '1'); $pdf->Cell(125, 6, "Reactivation of your service could take up to 7 days and will incur a fee. ", 0, 1, 'L', '1'); $pdf->Ln(10); } # Notes if ($notes) { $pdf->Ln(5); $pdf->SetFont($pdfFont, '', 8); $pdf->MultiCell(170, 5, Lang::trans('invoicesnotes') . ': ' . $notes); } /** * Invoice footer */ ============================ can someone please correct the code so my pdf invoice will be looks same like the image i provide thanks everyone and plesae stay safe
  15. hello brian your this line helped me again. but i applied this and works perfect. but my project is little different so i want the client can not take the tick out. by replace with your code i can see the TICK is coming automatically but is there any way can make this addon permanent with tick? basically i am settingup the product with SETUP FEES : ONE TIME MONTHLY FEES : RECURRING DEPOSIT : I WILL TAKE SOME AMOUNT AS DEPOSIT AND IT WILL BE REFUNDABLE ( Thats why i want to use the Addon as a deposit) Is there any way to do it? the configurable option works perfect. but there is no one time option for configurable . as all is monthly. thanks very much in advance Brian Please keep safe
×
×
  • 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