Menu

Some errors on create Invoice Item

Daniel
2012-08-09
2012-09-14
  • Daniel

    Daniel - 2012-08-09

    Hello Alex,

    If I use Create Invoice Item/From Timesheet ** with the option Use Time
    Sheet Items**

    then ** numberToBasic ** is ignored as well as the ** Time Sheet Multipliers
    **

    in addtional

    If I use edit Item the values can not be modified

    After saving the modified Item The value come as Create Invoice Item/From
    Timesheet ** without the option
    Use Time Sheet Items**

    This is a realy nice new function

    Thanks for your help

    Daniel

     
  • Alex Lance

    Alex Lance - 2012-09-11

    Hi Daniel,

    Really sorry that I didn't see this post of yours. I have fixed the bug with
    regard to the Time Sheet Multiplier and the numberToBasic not being taken into
    account.

    You can wait till alloc version 1.8.7 or apply the fix yourself here ... the
    diff looks like this:

    --- old-alloc/invoice/lib/invoiceItem.inc.php   2012-09-11 15:34:05.000000000 +1000
    +++ new-alloc/invoice/lib/invoiceItem.inc.php   2012-09-11 15:34:05.000000000 +1000
    @@ -157,8 +157,13 @@
         $db = new db_alloc();
         $db->query(prepare("SELECT * FROM timeSheetItem WHERE timeSheetID = %d",$timeSheetID));
         while ($row = $db->row()) {
    
    -      $iiUnitPrice = $timeSheet->pay_info["customerBilledDollars"];
    -      imp($timeSheet->pay_info["customerBilledDollars"]) or $iiUnitPrice = $row["rate"];
    +
    +      if (imp($timeSheet->pay_info["customerBilledDollars"])) {
    +        $iiUnitPrice = $timeSheet->pay_info["customerBilledDollars"];
    +      } else {
    +        $iiUnitPrice = page::money($currency,$row["rate"],"%mo");
    +      }
    +
           unset($str);
           if ($row["comment"] && !$row["commentPrivate"]) {
             $str = $row["comment"];
    @@ -169,9 +174,9 @@
           $ii->set_value("timeSheetID",$timeSheet->get_id());
           $ii->set_value("timeSheetItemID",$row["timeSheetItemID"]);
           $ii->set_value("iiMemo","Time Sheet for ".person::get_fullname($timeSheet->get_value("personID")).", Project: ".$project->get_value("projectName").", ".$row["description"]."\n".$str);
    -      $ii->set_value("iiQuantity",$row["timeSheetItemDuration"]);
    +      $ii->set_value("iiQuantity",$row["timeSheetItemDuration"] * $row["multiplier"]);
           $ii->set_value("iiUnitPrice",$iiUnitPrice);
    -      $ii->set_value("iiAmount",$iiUnitPrice*$row["timeSheetItemDuration"]);
    +      $ii->set_value("iiAmount",$iiUnitPrice * $row["timeSheetItemDuration"]);
           $ii->set_value("iiDate",$row["dateTimeSheetItem"]);
           $ii->save();
         }
    
     
  • Alex Lance

    Alex Lance - 2012-09-11

    Sorry that last line should be:

    hunk ./invoice/lib/invoiceItem.inc.php 179
    
    -      $ii->set_value("iiAmount",$iiUnitPrice * $row["timeSheetItemDuration"]);
    +      $ii->set_value("iiAmount",$iiUnitPrice * $row["timeSheetItemDuration"] * $row["multiplier"]);
    
     

Anonymous
Anonymous

Add attachments
Cancel





Auth0 Logo