[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[6557] trunk



Revision: 6557
          http://sourceforge.net/p/ledger-smb/code/6557
Author:   einhverfr
Date:     2014-01-20 07:55:57 +0000 (Mon, 20 Jan 2014)
Log Message:
-----------
weekly timecard entry now works

Modified Paths:
--------------
    trunk/LedgerSMB/Scripts/timecard.pm
    trunk/UI/timecards/timecard-week.html

Modified: trunk/LedgerSMB/Scripts/timecard.pm
===================================================================
--- trunk/LedgerSMB/Scripts/timecard.pm	2014-01-20 07:24:18 UTC (rev 6556)
+++ trunk/LedgerSMB/Scripts/timecard.pm	2014-01-20 07:55:57 UTC (rev 6557)
@@ -105,6 +105,11 @@
         $request->{transdate} = $request->{date_from};
         return display($request);
     } else {
+         @{$request->{b_units}} = LedgerSMB::Business_Unit->list(
+              $request->{bu_class_id}, undef, 0, $request->{transdate}
+         );
+         my $curr = LedgerSMB::Setting->get('curr');
+         @{$request->{currencies}} = split /:/, $curr;
          my $startdate = LedgerSMB::PGDate->from_input($request->{date_from});
          
          my @dates = ();
@@ -157,11 +162,12 @@
         for my $dow (0 .. 6){
             my $date = $request->{"transdate_$dow"};
             my $hash = { transdate => LedgerSMB::PGDate->from_input($date) };
-            $date =~ s|[.-/]|_|g;
+            $date =~ s#\D#_#g;
             next unless $request->{"partnumber_${date}_${row}"};
             $hash->{$_} = $request->{"${_}_${date}_${row}"} 
-                 for (qw(business_unit_id partnumber description qty
-                                 non_chargeable));
+                 for (qw(business_unit_id partnumber description qty curr
+                                 non_billable));
+            $hash->{non_billable} ||= 0;
             $hash->{parts_id} =  LedgerSMB::Timecard->get_part_id(
                      $hash->{partnumber}
             );

Modified: trunk/UI/timecards/timecard-week.html
===================================================================
--- trunk/UI/timecards/timecard-week.html	2014-01-20 07:24:18 UTC (rev 6556)
+++ trunk/UI/timecards/timecard-week.html	2014-01-20 07:55:57 UTC (rev 6557)
@@ -74,6 +74,18 @@
                  value_attr = 'id'
      } ?>
     </div>
+    <div id='curr-lbl'><?lsmb text('Currency') ?></div>
+    <div id='curr-input'><?lsmb 
+        currencies2 = [];  
+        FOREACH curr IN currencies;
+           currencies2.push({text = curr, value = curr });
+        END;
+
+               PROCESS select element_data = {
+                   name = "curr_$suffix"
+                options = currencies2
+         default_values = [${"curr_$suffix"}]
+       }; ?>
   <div><?lsmb  text('Partnumber') ?></div>
     <div><?lsmb PROCESS input element_data = {
                name = "partnumber_$suffix"
@@ -83,15 +95,6 @@
               class = 'control-code'
          } ?>
     </div>
-  <div><?lsmb text('Description') ?></div>
-    <div><?lsmb PROCESS input element_data = {
-               name = "description_$suffix"
-              value = ${"description_$suffix"}
-               type = 'text'
-               size = '15'
-              class = 'description'
-         } ?>
-    </div>
   <div><?lsmb text('Qty') ?></div>
     <div><?lsmb PROCESS input element_data = {
        name = "qty_$suffix"
@@ -101,11 +104,20 @@
        size = 5 } ?></div>
   <div><?lsmb text('Extra Used') ?></div>
     <div><?lsmb PROCESS input element_data = {
-       name = "non_chargeable_$suffix"
-      value = ${"non_chargeable_$suffix"}
+       name = "non_billable_$suffix"
+      value = ${"non_billable_$suffix"}
        type = text
       class = 'qty'
        size = 5 } ?></div>
+  <div><?lsmb text('Description') ?></div>
+    <div><?lsmb PROCESS textarea element_data = {
+               name = "description_$suffix"
+              value = ${"description_$suffix"}
+               type = 'text'
+               cols = '15'
+              class = 'description'
+         } ?>
+    </div>
 </td>
 <?lsmb END ?>
 </tr>

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits