Can we increase the probability of success through the numerology of creative accounting?

kate’s changes to prepare_budget to add item lines and notes
This commit is contained in:
nik gaffney 2021-09-07 09:33:06 +02:00
parent 831352fc98
commit e6463c54e9

View file

@ -369,7 +369,15 @@ END
my $sth5 = $dbh->prepare($sql5);
$sth5->execute;
for ($i=1;$i<=8;$i++) {
my $sqlCL = qq( SELECT count(id) AS count from nonfinance where budget_id=$record->{id} AND agent_id =$record2->{id} AND kind='labour' );
my $sthCL = $dbh->prepare($sqlCL);
$sthCL->execute;
while (my $recordCL = $sthCL->fetchrow_hashref) {
my $t = $recordCL->{count};
for ($i=1;$i<=$t;$i++) {
while (my $record5 = $sth5->fetchrow_hashref) {
print(qq(<tr><td colspan="1"><b>$i.</b></td>\n));
print(qq(<td><input type="checkbox" NAME="new_lstatus$i" VALUE="delivered"));
@ -381,16 +389,10 @@ END
print(qq(<td colspan="3"><input type="text" name="new_labour$i" value="$record5->{item}" size="100" maxsize="200"></td></tr>\n));
$i++
}
if ($i<=5) {
print(qq(<tr><td colspan="1"><b>$i.</b></td>\n));
print(qq(<td><input type="checkbox" NAME="new_lstatus$i" VALUE="delivered"));
if ($record5->{status} eq 'delivered') {
print(qq(CHECKED));
}
;
print(qq(></td>\n));
print(qq(<td colspan="3"><input type="text" name="new_labour$i" size="100" maxsize="200"></td></tr>\n));
}
print(qq(<tr><td colspan="4"><input type="text" name="insert_labour" size=1 maxsize=2 value="">));
print(qq(enter a number to add budget lines </td></tr>));
}
print(qq(<tr><td colspan="8" height="20">&nbsp;</td></tr>\n));
@ -400,7 +402,14 @@ END
my $sth5 = $dbh->prepare($sql5);
$sth5->execute;
for ($i=1;$i<=8;$i++) {
my $sqlCR = qq( SELECT count(id) AS count from nonfinance where budget_id=$record->{id} AND agent_id =$record2->{id} AND kind='resources' );
my $sthCR = $dbh->prepare($sqlCR);
$sthCR->execute;
while (my $recordCR = $sthCR->fetchrow_hashref) {
my $t = $recordCR->{count};
for ($i=1;$i<=$t;$i++) {
while (my $record5 = $sth5->fetchrow_hashref) {
print(qq(<tr><td colspan="1"><b>$i.</b></td>\n));
print(qq(<td><input type="checkbox" NAME="new_rstatus$i" VALUE="delivered"));
@ -412,23 +421,46 @@ END
print(qq(<td colspan="3"><input type="text" name="new_resource$i" value="$record5->{item}" size="100" maxsize="200"></td></tr>\n));
$i++
}
if ($i<=5) {
print(qq(<tr><td colspan="1"><b>$i.</b></td>\n));
print(qq(<td><input type="checkbox" NAME="new_rstatus$i" VALUE="delivered"));
if ($record5->{status} eq 'delivered') {
print(qq(CHECKED));
}
print(qq(></td>\n));
print(qq(<td colspan="3"><input type="text" name="new_resource$i" size="100" maxsize="200"></td></tr>\n));
}
}
print(qq(<tr><td colspan="1"></td><td colspan="1"></td><td colspan="1"><INPUT TYPE="submit" VALUE="SUBMIT"></td></tr>\n));
print(qq(</td></tr>\n));
print(qq(</FORM>\n));
print(qq(<tr><td height="10"></td></tr>\n));
print(qq(<tr><td colspan="5"></td><td colspan="3" class="serif_sm">Notes:</td></tr>\n));
print(qq(</td></tr></table></table>\n));
print <<END;
<tr><td colspan="4">
<input type="text" name="insert_resources" size=1 maxsize=2 value="">
enter a number to add budget lines</td>
</tr>
END
}
print <<END;
<tr><td height="10"></td></tr>
<tr>
<td colspan="1"></td><td colspan="1"></td>
<td colspan="1"><INPUT TYPE="submit" VALUE="SUBMIT"></td>
</tr>
</td></tr>
</FORM>
<tr><td height="10"></td></tr>
END
# print "<tr><td colspan=\"1\" class=\"medbig\"><b>OR add budget lines</b></td><td colspan=\"8\">for labour &amp;/or resources </td></tr>";
# $sthCL->execute;
# while (my $recordCL = $sthCL->fetchrow_hashref) {
# print "<tr><td colspan=\"4\"><input type=\"text\" name=\"insert_labour\" size=2 maxsize=3 value=\"\">";
# print " add this many budget lines for labour [after $recordCL->{count}]\n";
# }
# $sthCR->execute;
# whle (my $recordCR = $sthCR->fetchrow_hashref) {
# print "<tr><td colspan=\"4\"><input type=\"text\" name=\"insert_labour\" size=2 maxsize=3 value=\"\">";
# print " add this many budget lines for resources [after $recordCR->{count}]\n";
# }
print <<END;
<tr><td colspan="5"></td><td colspan="3" class="serif_sm">Notes:</td></tr>
</td></tr>
</table>
</table>
END
} else {
& print_header;
@ -1910,47 +1942,51 @@ sub print_title {
END
}
## print a subtitle
## print a subtitle
sub print_subtitle {
sub print_subtitle {
my $string = shift;
print <<END;
<div class="subtitle">$string</div>
END
}
}
## print a budget subtotal line with a description and optional amount
## print a budget subtotal line with a description and optional amount
sub print_subtotal {
sub print_subtotal {
my $string = shift;
my $amount = shift;
if (not $amount) {$amount = "";}
if (not $amount) {
$amount = "";
}
print <<END;
<div class="budget-subtotal">
<p class="subtotal-name">$string</p>
<p class="subtotal-amount">$amount</p>
</div>
END
}
}
## print standard budget item with a description and optional amount
## print standard budget item with a description and optional amount
sub print_item {
sub print_item {
my $string = shift;
my $amount = shift;
if (not $amount) {$amount = "";}
if (not $amount) {
$amount = "";
}
print <<END;
<div class="budget-item">
<p class="item-name">$string</p>
<p class="item-amount">$amount</p>
</div>
END
}
}
## print the page header
## print the page header
sub print_header {
sub print_header {
print <<END;
Content-type: text/html
@ -1965,22 +2001,22 @@ Content-type: text/html
</head>
<body>
END
}
}
## print a standard footer
## print a standard footer
sub print_footer {
sub print_footer {
print <<END;
</body>
</html>
END
}
}
## print the admin footer
## print the admin footer
sub adminfooter {
sub adminfooter {
print(qq(<tr><td bgcolor="ffffff" colspan="4"><br><a href="$script_name?action\=display_budgets">all budgets: edit</a></td></tr>\n));
print(qq(<tr><td bgcolor="ffffff" colspan="4"><br><a href="$script_name?action\=list_budgets">all budgets: list</a></td></tr>\n));
@ -1991,4 +2027,4 @@ sub adminfooter {
print(qq(</body>\n));
print(qq(</html>\n));
}
}