Jump to content

Profit and Loss - Reporting


kgerm7513

Recommended Posts

I hate to dig up old threads, but has anyone updated these scripts (http://forum.whmcs.com/showthread.php?39092-Profit-and-Loss-Report/page1) for the new DB structure in 6.3.1?

 

I'm just getting a spew of code when I try and execute it:

 

> # -------------------------------------------------------------------------------------- $dateselector=""; $dateselector.=""; $dateselector.=""; $dateselector.=""; $dateselector.="

"; if($year-1 >= $minyear) $dateselector.=""; $dateselector.= "<< ".($year-1); if($year-1 >= $minyear) $dateselector.=""; $dateselector.=" "; $dateselector.="Jan "; $dateselector.="Feb "; $dateselector.="Mar "; $dateselector.="Apr "; $dateselector.="May "; $dateselector.="Jun "; $dateselector.="Jul "; $dateselector.="Aug "; $dateselector.="Sep "; $dateselector.="Oct "; $dateselector.="Nov "; $dateselector.="Dec "; $dateselector.="[ All ]"; $dateselector.=" "; if($year+1 <= $maxyear) $dateselector.=""; $dateselector.= ($year+1)." >>"; if($year+1 <= $maxyear) $dateselector.=""; $dateselector.="

"; # table for selecting previous and next years in sequence excluding month options $dateselectoryear=""; $dateselectoryear.=""; $dateselectoryear.=""; $dateselectoryear.=""; $dateselectoryear.="

"; $dateselectoryear.="<< ".($year-1).""; $dateselectoryear.=" "; $dateselectoryear.=" "; $dateselectoryear.="".($year+1)." >>"; $dateselectoryear.="

"; # ##################################################################### # # safe calculation of days in month # # ##################################################################### function daysinmonth($month, $year) { if(checkdate($month, 31, $year)) return 31; if(checkdate($month, 30, $year)) return 30; if(checkdate($month, 29, $year)) return 29; if(checkdate($month, 28, $year)) return 28; return 0; // error } # ##################################################################### # detailLine(array(">Test", ">This", ">Out"); function detailLine($columns, $hoverrow = 0) { # each report line is a new table row # this table row has the option of adding hover state $tr = "": $align = "text-align: right;"; $column = substr($column, 1); break; default: $align = ""; break; } // font weight $font = substr($column, 0, 3); switch($font) { case "(b)": $font = "font-weight: bold;"; $column = substr($column, 3); break; default: $font = ""; break; } // font color $color = substr($column, 0, 3); switch($color) { case "©": $color = "color: #0000FF !important;"; $column = substr($column, 3); break; default: $color = ""; break; } // column spanning $colspan = substr($column, 0, 1); if($colspan==".") { $colspan = 1; $column = substr($column, 1); while(substr($column, 0, 1)==".") { $column = substr($column, 1); $colspan++; } } else $colspan = 1; // border of cell $border = substr($column, 0, 4); switch($border) { case "(BT)": $border = "border-top: 1px solid #B6B6B6;"; $column = substr($column, 4); break; case "(BB)": $border = "border-bottom: 1px solid #B6B6B6;"; $column = substr($column, 4); break; case "(BL)": $border = "border-left: 1px solid #B6B6B6;"; $column = substr($column, 4); break; case "(BR)": $border = "border-right: 1px solid #B6B6B6;"; $column = substr($column, 4); break; case "(BA)": $border = "border: 1px solid #B6B6B6;"; $column = substr($column, 4); break; default: $border = ""; break; } // padding of cell $padding = substr($column, 0, 4); switch($padding) { case "(PT)": $padding = "padding-top: 10px;"; $column = substr($column, 4); break; case "(PB)": $padding = "padding-bottom: 10px;"; $column = substr($column, 4); break; default: $padding = ""; break; } // add all styles together $style = "style=\"$highlight$align$font$color$border$padding\""; // null columns are still to be shown if($column == "") $column = " "; $tr .= "$column\n"; } $tr .= "\n"; return $tr; } ?>

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