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

SF.net SVN: ledger-smb:[6070] branches/1.3



Revision: 6070
          http://sourceforge.net/p/ledger-smb/code/6070
Author:   pongracz
Date:     2013-09-20 16:43:19 +0000 (Fri, 20 Sep 2013)
Log Message:
-----------
Patch for using Invoice Creation Date (crdate) for AP/AR invoices and AP/AR transactions. In Sales Invoice form this field is the current date and readonly. Also includes readonly auto generated invoice number to guarantee gapless serial invoice number. Here is the video how does it work: http://youtu.be/uthH1m9swdg  

Modified Paths:
--------------
    branches/1.3/LedgerSMB/AA.pm
    branches/1.3/LedgerSMB/Form.pm
    branches/1.3/LedgerSMB/IR.pm
    branches/1.3/LedgerSMB/IS.pm
    branches/1.3/bin/aa.pl
    branches/1.3/bin/arapprn.pl
    branches/1.3/bin/is.pl

Property Changed:
----------------
    branches/1.3/LedgerSMB/AA.pm
    branches/1.3/LedgerSMB/Form.pm
    branches/1.3/LedgerSMB/IR.pm
    branches/1.3/LedgerSMB/IS.pm
    branches/1.3/bin/aa.pl
    branches/1.3/bin/arapprn.pl
    branches/1.3/bin/is.pl

Modified: branches/1.3/LedgerSMB/AA.pm
===================================================================
--- branches/1.3/LedgerSMB/AA.pm	2013-09-20 12:08:32 UTC (rev 6069)
+++ branches/1.3/LedgerSMB/AA.pm	2013-09-20 16:43:19 UTC (rev 6070)
@@ -383,6 +383,7 @@
 			intnotes = ?,
 			department_id = ?,
 			ponumber = ?,
+			crdate = ?,
                         reverse = ?
 		WHERE id = ?
 	|;
@@ -395,8 +396,8 @@
         $datepaid,              $invnetamount,
         $form->{currency},      $form->{notes},
         $form->{intnotes},      $form->{department_id},
-        $form->{ponumber},      $form->{reverse},
-        $form->{id}
+        $form->{ponumber},      $form->{crdate},
+	$form->{reverse},        $form->{id}
     );
 
     $dbh->prepare($query)->execute(@queryargs) || $form->dberror($query);
@@ -937,7 +938,7 @@
         } else {
             #HV typo error a.ponumber $acc_trans_fields -> a.ponumber $acc_trans_flds
             $query = qq|
-		   SELECT a.id, a.invnumber, a.ordnumber, a.transdate,
+		   SELECT a.id, a.invnumber, a.ordnumber, a.transdate, a.crdate,
 		          a.duedate, a.netamount, a.amount::numeric(20,$p), 
 		          a.amount::numeric(20,$p)
                              - (sum(acs.amount::numeric(20,$p)) 
@@ -975,7 +976,7 @@
        } 
     } else {
         $query = qq|
-		   SELECT a.id, a.invnumber, a.ordnumber, a.transdate,
+		   SELECT a.id, a.invnumber, a.ordnumber, a.transdate, a.crdate,
 		          a.duedate, a.netamount, a.amount, 
                           (a.amount - pd.due) AS paid,
 		          a.invoice, a.datepaid, a.terms, a.notes,
@@ -1015,7 +1016,7 @@
                 LEFT JOIN project ip ON (i.project_id = ip.id)
                 LEFT JOIN project p ON ac.project_id = p.id |;
         $group_by = qq| 
-                GROUP BY  a.id, a.invnumber, a.ordnumber, a.transdate,
+                GROUP BY  a.id, a.invnumber, a.ordnumber, a.transdate, 
                           a.duedate, a.netamount, a.amount,
                           a.invoice, a.datepaid, a.terms, a.notes,
                           a.shipvia, a.shippingpoint, ee.name , 
@@ -1030,7 +1031,8 @@
         invnumber     => 2,
         ordnumber     => 3,
         transdate     => 4,
-        duedate       => 5,
+        crdate        => 5,
+        duedate       => 6,
         datepaid      => 10,
         shipvia       => 13,
         shippingpoint => 14,


Property changes on: branches/1.3/LedgerSMB/AA.pm
___________________________________________________________________
Added: svn:text-time
## -0,0 +1 ##
+2013-09-20T13:22:45.000000Z
\ No newline at end of property
Added: svn:unix-mode
## -0,0 +1 ##
+0775
\ No newline at end of property
Added: svn:owner
## -0,0 +1 ##
+33 www-data
\ No newline at end of property
Added: svn:group
## -0,0 +1 ##
+33 www-data
\ No newline at end of property
Modified: branches/1.3/LedgerSMB/Form.pm
===================================================================
--- branches/1.3/LedgerSMB/Form.pm	2013-09-20 12:08:32 UTC (rev 6069)
+++ branches/1.3/LedgerSMB/Form.pm	2013-09-20 16:43:19 UTC (rev 6070)
@@ -2574,7 +2574,7 @@
 				a.person_id, e.name AS employee, 
 				c.language_code, a.ponumber, a.reverse,
                                 a.approved, ctf.default_reportable, 
-                                a.on_hold
+                                a.on_hold, a.crdate
 			FROM $arap a
 			JOIN entity_credit_account c 
 				ON (a.entity_credit_account = c.id)


Property changes on: branches/1.3/LedgerSMB/Form.pm
___________________________________________________________________
Added: svn:text-time
## -0,0 +1 ##
+2013-09-20T07:22:28.332822Z
\ No newline at end of property
Added: svn:unix-mode
## -0,0 +1 ##
+0600
\ No newline at end of property
Added: svn:owner
## -0,0 +1 ##
+0 root
\ No newline at end of property
Added: svn:group
## -0,0 +1 ##
+0 root
\ No newline at end of property
Modified: branches/1.3/LedgerSMB/IR.pm
===================================================================
--- branches/1.3/LedgerSMB/IR.pm	2013-09-20 12:08:32 UTC (rev 6069)
+++ branches/1.3/LedgerSMB/IR.pm	2013-09-20 16:43:19 UTC (rev 6070)
@@ -848,7 +848,8 @@
 		       curr = ?,
 		       department_id = ?,
 		       language_code = ?,
-		       ponumber = ?
+		       ponumber = ?,
+		       crdate = ?
 		 WHERE id = ?|;
 
     $sth = $dbh->prepare($query);
@@ -859,7 +860,8 @@
         $form->{duedate},       $form->{shippingpoint}, $form->{shipvia},
         $form->{taxincluded},   $form->{notes},         $form->{intnotes},
         $form->{currency},      $form->{department_id}, 
-        $form->{language_code}, $form->{ponumber},      $form->{id}
+        $form->{language_code}, $form->{ponumber},      
+	$form->{crdate},	$form->{id}
     ) || $form->dberror($query);
 
     # add shipto
@@ -1224,7 +1226,7 @@
 			SELECT a.invnumber, a.transdate, a.duedate,
 			       a.ordnumber, a.quonumber, a.paid, a.taxincluded,
 			       a.notes, a.intnotes, a.curr AS currency, 
-			       a.entity_credit_account as vendor_id, a.language_code, a.ponumber,
+			       a.entity_credit_account as vendor_id, a.language_code, a.ponumber, a.crdate,
 			       a.on_hold, a.reverse
 			  FROM ap a
 			 WHERE id = ?|;


Property changes on: branches/1.3/LedgerSMB/IR.pm
___________________________________________________________________
Modified: svn:text-time
## -1 +1 ##
-2013-08-30T10:44:38.000000Z
+2013-09-20T07:19:01.126433Z
\ No newline at end of property
Modified: branches/1.3/LedgerSMB/IS.pm
===================================================================
--- branches/1.3/LedgerSMB/IS.pm	2013-09-20 12:08:32 UTC (rev 6069)
+++ branches/1.3/LedgerSMB/IS.pm	2013-09-20 16:43:19 UTC (rev 6070)
@@ -1598,7 +1598,8 @@
 		       person_id = ?,
 		       till = ?,
 		       language_code = ?,
-		       ponumber = ?
+		       ponumber = ?,
+		       crdate = ?
 		 WHERE id = ?
              |;
     $sth = $dbh->prepare($query);
@@ -1614,7 +1615,7 @@
         $form->{currency},      $form->{department_id},
         $form->{employee_id},   $form->{till},
         $form->{language_code}, $form->{ponumber},
-        $form->{id}
+        $form->{crdate},	$form->{id}
     ) || $form->dberror($query);
 
     # add shipto
@@ -2092,7 +2093,7 @@
 			          a.duedate, a.taxincluded, a.curr AS currency,
 			          a.person_id, e.name AS employee, a.till, 
 			          a.reverse,
-			          a.language_code, a.ponumber,
+			          a.language_code, a.ponumber, a.crdate,
 			          a.on_hold
 			     FROM ar a
 			LEFT JOIN entity_employee em ON (em.entity_id = a.person_id)


Property changes on: branches/1.3/LedgerSMB/IS.pm
___________________________________________________________________
Modified: svn:text-time
## -1 +1 ##
-2013-08-30T10:45:04.000000Z
+2013-09-20T11:23:17.093428Z
\ No newline at end of property
Modified: branches/1.3/bin/aa.pl
===================================================================
--- branches/1.3/bin/aa.pl	2013-09-20 12:08:32 UTC (rev 6069)
+++ branches/1.3/bin/aa.pl	2013-09-20 16:43:19 UTC (rev 6070)
@@ -181,6 +181,7 @@
 			            && $form->{type} eq 'invoice');
 
     $duedate     = $form->{duedate};
+    $crdate	 = $form->{crdate};
     $taxincluded = $form->{taxincluded};
 
     $form->{formname} = "transaction";
@@ -208,6 +209,7 @@
 
     $form->{currency} =~ s/ //g;
     $form->{duedate}     = $duedate     if $duedate;
+    $form->{crdate}      = $crdate      if $crdate;
     $form->{taxincluded} = $taxincluded if $form->{id};
 
     $form->{notes} = $form->{intnotes} if !$form->{id};
@@ -1300,6 +1302,7 @@
     # check if there is an invoice number, invoice and due date
     $form->isblank( "transdate", $locale->text('Invoice Date missing!') );
     $form->isblank( "duedate",   $locale->text('Due Date missing!') );
+    $form->isblank( "crdate",    $locale->text('Invoice Created Date missing!') );
     $form->isblank( $form->{vc}, $label );
 
     $closedto  = $form->datetonum( \%myconfig, $form->{closedto} );
@@ -1696,6 +1699,8 @@
     push @a,
       qq|<input name="l_paid" class=checkbox type=checkbox value=Y checked> |
       . $locale->text('Paid');
+    push @a, qq|<input name="l_crdate" class=checkbox type=checkbox value=Y> |
+      . $locale->text('Invoice Created');
     push @a, qq|<input name="l_duedate" class=checkbox type=checkbox value=Y> |
       . $locale->text('Due Date');
     push @a, qq|<input name="l_due" class=checkbox type=checkbox value=Y> |
@@ -1975,7 +1980,7 @@
 
     @columns =
       $form->sort_columns(
-        qw(transdate id invnumber ordnumber ponumber name netamount tax amount paid due curr datepaid duedate notes till employee manager shippingpoint shipvia department)
+        qw(transdate id invnumber ordnumber ponumber name netamount tax amount paid due curr datepaid crdate duedate notes till employee manager shippingpoint shipvia department)
       );
     pop @columns if $form->{department};
     unshift @columns, "runningnumber";
@@ -2025,6 +2030,10 @@
         "<th><a class=listheading href=$href&sort=transdate>"
       . $locale->text('Date')
       . "</a></th>";
+    $column_header{crdate} =
+        "<th><a class=listheading href=$href&sort=crdate>"
+      . $locale->text('Invoice Created')
+      . "</a></th>";
     $column_header{duedate} =
         "<th><a class=listheading href=$href&sort=duedate>"
       . $locale->text('Due Date')
@@ -2290,7 +2299,7 @@
         }
         for (qw(notes description)) { $ref->{$_} =~ s/\r?\n/<br>/g }
         for (
-            qw(transdate datepaid duedate department ordnumber ponumber notes shippingpoint shipvia employee manager till source description projectnumber)
+            qw(transdate datepaid crdate duedate department ordnumber ponumber notes shippingpoint shipvia employee manager till source description projectnumber)
           )
         {
             $column_data{$_} = "<td>$ref->{$_}&nbsp;</td>";


Property changes on: branches/1.3/bin/aa.pl
___________________________________________________________________
Modified: svn:text-time
## -1 +1 ##
-2013-08-30T14:18:36.712925Z
+2013-09-20T12:43:54.000000Z
\ No newline at end of property
Modified: svn:owner
## -1 +1 ##
-0 root
+33 www-data
\ No newline at end of property
Modified: svn:group
## -1 +1 ##
-0 root
+33 www-data
\ No newline at end of property
Modified: branches/1.3/bin/arapprn.pl
===================================================================
--- branches/1.3/bin/arapprn.pl	2013-09-20 12:08:32 UTC (rev 6069)
+++ branches/1.3/bin/arapprn.pl	2013-09-20 16:43:19 UTC (rev 6070)
@@ -265,7 +265,7 @@
     ( $form->{employee} ) = split /--/, $form->{employee};
 
     if ( exists $form->{longformat} ) {
-        for (qw(duedate transdate)) {
+        for (qw(duedate transdate crdate)) {
             $form->{$_} =
               $locale->date( \%myconfig, $form->{$_}, $form->{longformat} );
         }
@@ -273,7 +273,7 @@
 
     $form->{notes} =~ s/^\s+//g;
 
-    @a = ( "invnumber", "transdate", "duedate", "notes" );
+    @a = ( "invnumber", "transdate", "duedate", "crdate", "notes" );
 
     push @a,
       qw(company address tel fax businessnumber text_amount text_decimal);


Property changes on: branches/1.3/bin/arapprn.pl
___________________________________________________________________
Added: svn:text-time
## -0,0 +1 ##
+2013-09-20T07:42:25.943976Z
\ No newline at end of property
Added: svn:unix-mode
## -0,0 +1 ##
+0775
\ No newline at end of property
Added: svn:owner
## -0,0 +1 ##
+0 root
\ No newline at end of property
Added: svn:group
## -0,0 +1 ##
+0 root
\ No newline at end of property
Modified: branches/1.3/bin/is.pl
===================================================================
--- branches/1.3/bin/is.pl	2013-09-20 12:08:32 UTC (rev 6069)
+++ branches/1.3/bin/is.pl	2013-09-20 16:43:19 UTC (rev 6070)
@@ -260,7 +260,7 @@
 
     $form->{AR} = $form->{AR_1} unless $form->{id};
     $form->{transdate} = $form->{current_date} if (!$form->{transdate});
-    $form->{crdate} = $form->{current_date};
+    $form->{crdate} = $form->{current_date} if (!$form->{crdate});
     $form->{locked} =
       ( $form->{revtrans} )
       ? '1'
@@ -568,7 +568,7 @@
 	      $employee
 	      <tr class="invnumber-row">
 		<th align=right nowrap>| . $locale->text('Invoice Number') . qq|</th>
-		<td><input name="invnumber" size="20" value="$form->{invnumber}"></td>
+		<td><input name="invnumber" size="20" value="$form->{invnumber}" readonly></td>
 	      </tr>
 	      <tr class="ordnumber-row">
 		<th align=right nowrap>| . $locale->text('Order Number') . qq|</th>


Property changes on: branches/1.3/bin/is.pl
___________________________________________________________________
Modified: svn:text-time
## -1 +1 ##
-2013-08-28T17:34:15.000000Z
+2013-09-20T14:40:14.000000Z
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits