When adding New Journal, if seem to be not way to
delete or edit the wrongly added New Journal. And
Restart another another new Journal seem to be the only
way.
This is the Patch
RCS file: /cvsroot/arias/arias/gljouradd.php,v
retrieving revision 1.2
diff -r1.2 gljouradd.php
18a19,23
> } elseif ($delete) {
> $recordSet =
&$conn->SelectLimit("select id from
gltransvoucher".$userid." where
voucher=".sqlprep($voucher)." order by lastchangedate desc",1);
> if (!$recordSet||$recordSet->EOF)
die(texterror('Error retrieving voucher info.'));
> $voucherid=$recordSet->fields[0];
> if ($conn->Execute("delete from
gltransaction".$userid." where
glaccountid='".$glaccountid."' and
voucherid='".$voucherid."' and amount='".$amount."'") ===
false) echo texterror("Error deleting voucher detail.");
77,78c82,83
< $recordSet=&$conn->Execute('select
glaccount.name,glaccount.description,gltransaction'.$userid.'.amount
from gltransaction'.$userid.', glaccount where
gltransaction'.$userid.'.glaccountid=glaccount.id');
< if ($recordSet&&!$recordSet->EOF)
echo '<br><br><table
border="1"><tr><th>Account</th><th>Account
Description</th><th>Amount</th></tr>';
---
> $recordSet=&$conn->Execute('select
glaccount.name,glaccount.description,gltransaction'.$userid.'.amount,gltransaction'.$userid.'.voucherid,gltransaction'.$userid.'.glaccountid
from gltransaction'.$userid.', glaccount where
gltransaction'.$userid.'.glaccountid=glaccount.id');
> if ($recordSet&&!$recordSet->EOF)
echo '<br><br><table
border="1"><tr><th>Account</th><th>Account
Description</th><th>Amount</th><th>Options</Th</tr>';
80c85
< echo
'<tr><td>'.$recordSet->fields[0].'</td><td>'.$recordSet->fields[1].'</td><td>'.checkdec($recordSet->fields[2],PREFERRED_DECIMAL_PLACES).'</td></tr>';
---
> echo
'<tr><td>'.$recordSet->fields[0].'</td><td>'.$recordSet->fields[1].'</td><td>'.checkdec($recordSet->fields[2],PREFERRED_DECIMAL_PLACES).'</td><td><a
href="gljouradd.php?voucher='.$voucher.'&glaccountid='.$recordSet->fields[4].'&voucherid='.$recordSet->fields[3].'&amount='.checkdec($recordSet->fields[2],PREFERRED_DECIMAL_PLACES).'&delete=1">Delete</a></td></tr>';
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=402754
The Delete is done Edit will be did if require...
This is the Patch
RCS file: /cvsroot/arias/arias/gljouradd.php,v
retrieving revision 1.2
diff -r1.2 gljouradd.php
18a19,23
> } elseif ($delete) {
> $recordSet =
&$conn->SelectLimit("select id from
gltransvoucher".$userid." where
voucher=".sqlprep($voucher)." order by lastchangedate desc",1);
> if (!$recordSet||$recordSet->EOF)
die(texterror('Error retrieving voucher info.'));
> $voucherid=$recordSet->fields[0];
> if ($conn->Execute("delete from
gltransaction".$userid." where
glaccountid='".$glaccountid."' and
voucherid='".$voucherid."' and amount='".$amount."'") ===
false) echo texterror("Error deleting voucher detail.");
77,78c82,83
< $recordSet=&$conn->Execute('select
glaccount.name,glaccount.description,gltransaction'.$userid.'.amount
from gltransaction'.$userid.', glaccount where
gltransaction'.$userid.'.glaccountid=glaccount.id');
< if ($recordSet&&!$recordSet->EOF)
echo '<br><br><table
border="1"><tr><th>Account</th><th>Account
Description</th><th>Amount</th></tr>';
---
> $recordSet=&$conn->Execute('select
glaccount.name,glaccount.description,gltransaction'.$userid.'.amount,gltransaction'.$userid.'.voucherid,gltransaction'.$userid.'.glaccountid
from gltransaction'.$userid.', glaccount where
gltransaction'.$userid.'.glaccountid=glaccount.id');
> if ($recordSet&&!$recordSet->EOF)
echo '<br><br><table
border="1"><tr><th>Account</th><th>Account
Description</th><th>Amount</th><th>Options</Th</tr>';
80c85
< echo
'<tr><td>'.$recordSet->fields[0].'</td><td>'.$recordSet->fields[1].'</td><td>'.checkdec($recordSet->fields[2],PREFERRED_DECIMAL_PLACES).'</td></tr>';
---
> echo
'<tr><td>'.$recordSet->fields[0].'</td><td>'.$recordSet->fields[1].'</td><td>'.checkdec($recordSet->fields[2],PREFERRED_DECIMAL_PLACES).'</td><td><a
href="gljouradd.php?voucher='.$voucher.'&glaccountid='.$recordSet->fields[4].'&voucherid='.$recordSet->fields[3].'&amount='.checkdec($recordSet->fields[2],PREFERRED_DECIMAL_PLACES).'&delete=1">Delete</a></td></tr>';