Post Reply 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Allocate Receipts Modifications
09-03-2016, 12:47 AM
Post: #1
Allocate Receipts Modifications
I have modified CustomerAllocations.php around line 133 and added a column to the table debtrotrans named transallocdate and added the line transallocdate = '" . date('Y-m-d') . "', to the code below
// Update the receipt or credit note
$SQL = "UPDATE debtortrans
SET alloc = '" . -$AllAllocations . "',
diffonexch = '" . -$TotalDiffOnExch . "',
transallocdate = '" . date('Y-m-d') . "',
settled='" . $Settled . "'
WHERE id = '" . $_POST['AllocTrans']."'";

if( !$Result = DB_query($SQL) ) {
$Error = _('Could not update receipt or credit note');

What I would like to do is have it only update when the trans is allocated the first time, what happens now if there is any amount left to be allocated and you do the allocation again it updates the date that is already there.
For example I have a Sales Invoice that was 128.35 that was previously allocated in full and there was a balance left of 2.90 if I apply this as a parcial amount to another invoice when I process the allocation it post the new date to the transallocdate in the debtortrans table even though it has been already setteled.
I assume that I would need to add a if statement that if settled do not update transallocdate.
Any ideas how I can do this?
Any ideas would be greatly appreciated.
Find all posts by this user
Quote this message in a reply
Post Reply 

Forum Jump:

User(s) browsing this thread: 1 Guest(s)