Merging version 2.1 RC to main trunk.
[fa-stable.git] / purchasing / allocations / supplier_allocate.php
index 995b2735da945fc3e30bc1645cb38ebd0663bad2..6a0e83e3247f65692914e0f381ad0f073928d7ce 100644 (file)
@@ -1,5 +1,14 @@
 <?php
-
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU General Public License, GPL, 
+       as published by the Free Software Foundation, either version 3 
+       of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
+***********************************************************************/
 $path_to_root="../..";
 $page_security = 3;
 
@@ -74,7 +83,7 @@ function handle_process()
        begin_transaction();
 
        // clear all the allocations for this payment/credit
-       clear_supp_alloctions($_SESSION['alloc']->type, $_SESSION['alloc']->trans_no);
+       clear_supp_alloctions($_SESSION['alloc']->type, $_SESSION['alloc']->trans_no, $_SESSION['alloc']->date_);
 
        // now add the new allocations
        $total_allocated = 0;
@@ -88,6 +97,14 @@ function handle_process()
 
                        update_supp_trans_allocation($alloc_item->type, $alloc_item->type_no,
                                $alloc_item->current_allocated);
+
+                       // Exchange Variations Joe Hunt 2008-09-20 ////////////////////////////////////////
+
+                       exchange_variation($_SESSION['alloc']->type, $_SESSION['alloc']->trans_no,
+                               $alloc_item->type, $alloc_item->type_no, $_SESSION['alloc']->date_,
+                               $alloc_item->current_allocated, payment_person_types::supplier());
+
+                       ///////////////////////////////////////////////////////////////////////////
                        $total_allocated += $alloc_item->current_allocated;
                }