This begins with enquiring about open to whom and, vitally, by whom?
This commit is contained in:
parent
caa40a9be6
commit
a7b602af8c
1 changed files with 1194 additions and 1165 deletions
|
@ -12,7 +12,7 @@ no warnings qw(experimental::smartmatch);
|
||||||
# #
|
# #
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
do "./f20-budget.config.pl";
|
do "./f20_budget_config.pl";
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# #
|
# #
|
||||||
|
@ -76,9 +76,12 @@ $new_url=$q->param("new_url");
|
||||||
$new_item = sanitise($q->param("new_item"));
|
$new_item = sanitise($q->param("new_item"));
|
||||||
$new_labour = sanitise($q->param("new_labour"));
|
$new_labour = sanitise($q->param("new_labour"));
|
||||||
$new_resource = sanitise($q->param("new_resource"));
|
$new_resource = sanitise($q->param("new_resource"));
|
||||||
|
$insert_labour = sanitise($q->param("insert_labour"));
|
||||||
|
$insert_resources = sanitise($q->param("insert_resources"));
|
||||||
$new_status = sanitise($q->param("new_status"));
|
$new_status = sanitise($q->param("new_status"));
|
||||||
$new_lstatus = sanitise($q->param("new_lstatus"));
|
$new_lstatus = sanitise($q->param("new_lstatus"));
|
||||||
$new_rstatus = sanitise($q->param("new_rstatus"));
|
$new_rstatus = sanitise($q->param("new_rstatus"));
|
||||||
|
$new_notes = sanitise($q->param("new_notes"));
|
||||||
$type = sanitise($q->param("type"));
|
$type = sanitise($q->param("type"));
|
||||||
|
|
||||||
for ( $i=0; $i<=50; $i+=1) {
|
for ( $i=0; $i<=50; $i+=1) {
|
||||||
|
@ -324,7 +327,7 @@ END
|
||||||
print(qq(>$cat</option>));
|
print(qq(>$cat</option>));
|
||||||
}
|
}
|
||||||
print(qq(</select></td>));
|
print(qq(</select></td>));
|
||||||
print(qq(<td colspan="3">item <input type="text" name="new_item$i" value="$record4->{item}" size="70" maxsize="100"></td></tr>));
|
print(qq(<td colspan="3">item <input type="text" name="new_item$i" value="$record4->{item}" size="70" maxsize="120"></td></tr>));
|
||||||
$i++
|
$i++
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -360,11 +363,12 @@ END
|
||||||
print(qq( size="3" maxsize="5"></td></tr>\n));
|
print(qq( size="3" maxsize="5"></td></tr>\n));
|
||||||
|
|
||||||
|
|
||||||
## resources section !!! read-in notworking !!!
|
## resources section
|
||||||
|
|
||||||
print(qq(<tr><td colspan="8" height="20"> </td></tr>\n));
|
print(qq(<tr><td colspan="8" height="20"> </td></tr>\n));
|
||||||
print(qq(<tr><td colspan="1" class="medbig"><b>input labour</b></td><td colspan="8">things you commit to doing, non-remunerated. (check the box if this labour has already been deployed) </td></tr>));
|
print(qq(<tr><td colspan="1" class="medbig"><b>input labour</b></td><td colspan="8">things you commit to doing, non-remunerated. (check the box if this labour has already been deployed) </td></tr>));
|
||||||
|
|
||||||
|
|
||||||
my $sql5 = qq( SELECT * from nonfinance where budget_id=$record->{id} AND agent_id =$record2->{id} AND kind='labour' );
|
my $sql5 = qq( SELECT * from nonfinance where budget_id=$record->{id} AND agent_id =$record2->{id} AND kind='labour' );
|
||||||
my $sth5 = $dbh->prepare($sql5);
|
my $sth5 = $dbh->prepare($sql5);
|
||||||
$sth5->execute;
|
$sth5->execute;
|
||||||
|
@ -378,19 +382,21 @@ END
|
||||||
|
|
||||||
for ($i=1;$i<=$t;$i++) {
|
for ($i=1;$i<=$t;$i++) {
|
||||||
while (my $record5 = $sth5->fetchrow_hashref) {
|
while (my $record5 = $sth5->fetchrow_hashref) {
|
||||||
print(qq(<tr><td colspan="1"><b>$i.</b></td>\n));
|
print "<tr><td colspan=\"1\"><b>$i.</b></td>\n";
|
||||||
print(qq(<td><input type="checkbox" NAME="new_lstatus$i" VALUE="delivered"));
|
print "<td><input type=\"checkbox\" NAME=\"new_lstatus$i\" VALUE=\"delivered\"";
|
||||||
if ($record5->{status} eq 'delivered') { print "CHECKED"};
|
if ($record5->{status} eq 'delivered') { print "CHECKED"};
|
||||||
print(qq(></td>\n));
|
print "></td>\n";
|
||||||
print(qq(<td colspan="3"><input type="text" name="new_labour$i" value="$record5->{item}" size="100" maxsize="200"></td></tr>\n));
|
print "<td colspan=\"3\"><input type=\"text\" name=\"new_labour$i\" value=\"$record5->{item}\" size=\"100\" maxsize=\"200\"></td></tr>\n";
|
||||||
$i++
|
$i++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print(qq(<tr><td colspan="4"><input type="text" name="insert_labour" size=1 maxsize=2 value="">));
|
print "<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 " enter a number to add budget lines </td></tr>\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print(qq(<tr><td colspan="8" height="20"> </td></tr>\n));
|
print(qq(<tr><td colspan="8" height="20"> </td></tr>\n));
|
||||||
print(qq(<tr><td colspan="1" class="medbig"><b>input resources</b></td><td colspan="8">materials, spaces, tools, previous work etc (check the box if your resource has already been deployed) </td></tr>));
|
print(qq(<tr><td colspan="1" class="medbig"><b>input resources</b></td><td colspan="8">materials, spaces, tools, previous work etc (check the box if your resource has already been deployed) </td></tr>));
|
||||||
|
|
||||||
|
@ -398,6 +404,7 @@ END
|
||||||
my $sth5 = $dbh->prepare($sql5);
|
my $sth5 = $dbh->prepare($sql5);
|
||||||
$sth5->execute;
|
$sth5->execute;
|
||||||
|
|
||||||
|
|
||||||
my $sqlCR = qq( SELECT count(id) AS count from nonfinance where budget_id=$record->{id} AND agent_id =$record2->{id} AND kind='resources' );
|
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);
|
my $sthCR = $dbh->prepare($sqlCR);
|
||||||
$sthCR->execute;
|
$sthCR->execute;
|
||||||
|
@ -407,27 +414,23 @@ END
|
||||||
|
|
||||||
for ($i=1;$i<=$t;$i++) {
|
for ($i=1;$i<=$t;$i++) {
|
||||||
while (my $record5 = $sth5->fetchrow_hashref) {
|
while (my $record5 = $sth5->fetchrow_hashref) {
|
||||||
print(qq(<tr><td colspan="1"><b>$i.</b></td>\n));
|
print "<tr><td colspan=\"1\"><b>$i.</b></td>\n";
|
||||||
print(qq(<td><input type="checkbox" NAME="new_rstatus$i" VALUE="delivered"));
|
print "<td><input type=\"checkbox\" NAME=\"new_rstatus$i\" VALUE=\"delivered\"";
|
||||||
if ($record5->{status} eq 'delivered') { print "CHECKED"};
|
if ($record5->{status} eq 'delivered') { print "CHECKED"};
|
||||||
print(qq(></td>\n));
|
print "></td>\n";
|
||||||
print(qq(<td colspan="3"><input type="text" name="new_resource$i" value="$record5->{item}" size="100" maxsize="200"></td></tr>\n));
|
print "<td colspan=\"3\"><input type=\"text\" name=\"new_resource$i\" value=\"$record5->{item}\" size=\"100\" maxsize=\"200\"></td></tr>\n";
|
||||||
$i++
|
$i++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print "<tr><td colspan=\"4\"><input type=\"text\" name=\"insert_resources\" size=1 maxsize=2 value=\"\">";
|
||||||
|
print " enter a number to add budget lines</td></tr>\n";
|
||||||
|
}
|
||||||
|
|
||||||
my $sql6 = qq( SELECT * from nonfinance where budget_id=$record->{id} AND agent_id =$record2->{id} AND kind='notes');
|
my $sql6 = qq( SELECT * from nonfinance where budget_id=$record->{id} AND agent_id =$record2->{id} AND kind='notes');
|
||||||
my $sth6 = $dbh->prepare($sql6);
|
my $sth6 = $dbh->prepare($sql6);
|
||||||
$sth6->execute;
|
$sth6->execute;
|
||||||
|
|
||||||
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(qq(<tr><td colspan="8" height="20"> </td></tr>\n));
|
print(qq(<tr><td colspan="8" height="20"> </td></tr>\n));
|
||||||
print(qq(<tr><td colspan="1" class="medbig"><b>notes</b></td><td colspan="8">for your own reference only, these notes will not show up in the shared budget</td></tr>\n));
|
print(qq(<tr><td colspan="1" class="medbig"><b>notes</b></td><td colspan="8">for your own reference only, these notes will not show up in the shared budget</td></tr>\n));
|
||||||
print(qq(<tr><td colspan=4 align="left"><TEXTAREA NAME="new_notes" ROWS="6" COLS="110" WRAP=SOFT>));
|
print(qq(<tr><td colspan=4 align="left"><TEXTAREA NAME="new_notes" ROWS="6" COLS="110" WRAP=SOFT>));
|
||||||
|
@ -465,7 +468,7 @@ sub input_budget {
|
||||||
&print_header;
|
&print_header;
|
||||||
print(qq(<center>\n));
|
print(qq(<center>\n));
|
||||||
print(qq(<table width="700" cellspacing="20" cellpadding="0" bgcolor="#ffffff">\n));
|
print(qq(<table width="700" cellspacing="20" cellpadding="0" bgcolor="#ffffff">\n));
|
||||||
print(qq(<tr><td><<table width="700" cellspacing="5" cellpadding="2" bgcolor="#ffffff" border="0">\n));
|
print(qq(<tr><td><table width="700" cellspacing="5" cellpadding="2" bgcolor="#ffffff" border="0">\n));
|
||||||
|
|
||||||
## delete expenditure line for agent + budget, if exists
|
## delete expenditure line for agent + budget, if exists
|
||||||
my $sqld = qq( DELETE from expenditure where budget_id="$budget_id" AND agent_id="$agent_id");
|
my $sqld = qq( DELETE from expenditure where budget_id="$budget_id" AND agent_id="$agent_id");
|
||||||
|
@ -506,6 +509,7 @@ sub input_budget {
|
||||||
my $sthi = $dbh->prepare($sqli);
|
my $sthi = $dbh->prepare($sqli);
|
||||||
$sthi->execute;
|
$sthi->execute;
|
||||||
|
|
||||||
|
## delete nonfinance line for agent + budget, if exists
|
||||||
my $sqld = qq( DELETE from nonfinance where budget_id="$budget_id" AND agent_id="$agent_id");
|
my $sqld = qq( DELETE from nonfinance where budget_id="$budget_id" AND agent_id="$agent_id");
|
||||||
my $sthd= $dbh->prepare($sqld);
|
my $sthd= $dbh->prepare($sqld);
|
||||||
$sthd->execute;
|
$sthd->execute;
|
||||||
|
@ -529,6 +533,35 @@ sub input_budget {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
## add new budget lines for resources or labour ***
|
||||||
|
|
||||||
|
if (param('insert_labour') ne '') {
|
||||||
|
#if ('$insert_labour' ne '') {
|
||||||
|
for ($i=1; $i<=$insert_labour; $i++) {
|
||||||
|
my $sqlIL = (qq{INSERT INTO nonfinance (budget_id, agent_id, item, kind, status) VALUES ('$budget_id','$agent_id','', 'labour', '')});
|
||||||
|
my $sthIL = $dbh->prepare($sqlIL);
|
||||||
|
$sthIL->execute;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (param('insert_resources') ne '') {
|
||||||
|
#if ('$insert_resources' ne '') {
|
||||||
|
for ($i=1; $i<=$insert_resources; $i++) {
|
||||||
|
my $sqlIR = (qq{INSERT INTO nonfinance (budget_id, agent_id, item, kind, status) VALUES ('$budget_id','$agent_id','', 'resources', '')});
|
||||||
|
my $sthIR = $dbh->prepare($sqlIR);
|
||||||
|
$sthIR->execute;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
## input notes nonfinance for agent
|
||||||
|
if ($new_notes ne '') {
|
||||||
|
my $sqln = (qq{INSERT INTO nonfinance (budget_id, agent_id, item, kind) VALUES ($budget_id, $agent_id, "$new_notes", "notes")});
|
||||||
|
my $sthn = $dbh->prepare($sqln);
|
||||||
|
$sthn->execute;
|
||||||
|
}
|
||||||
|
|
||||||
## read back in to get these values from the db, not from the cgi
|
## read back in to get these values from the db, not from the cgi
|
||||||
|
|
||||||
my $sqlv = (qq{SELECT DISTINCT item, cost, expenditure.currency, type, fullname from expenditure RIGHT JOIN agents on expenditure.agent_id=agents.id LEFT JOIN finance on expenditure.agent_id=finance.agent_id
|
my $sqlv = (qq{SELECT DISTINCT item, cost, expenditure.currency, type, fullname from expenditure RIGHT JOIN agents on expenditure.agent_id=agents.id LEFT JOIN finance on expenditure.agent_id=finance.agent_id
|
||||||
|
@ -816,7 +849,7 @@ sub compile_budget {
|
||||||
<div class="headline-2">
|
<div class="headline-2">
|
||||||
<b>$projectname</b> | |
|
<b>$projectname</b> | |
|
||||||
$recordb->{location} | |
|
$recordb->{location} | |
|
||||||
budget adjustments to $currentyear-$currentmonth-$currentdayofmonth
|
budget adjustments to $currentdayofmonth-$currentmonth-$currentyear
|
||||||
</div>
|
</div>
|
||||||
<div class="headline-3">
|
<div class="headline-3">
|
||||||
<img src="$feral_logo">
|
<img src="$feral_logo">
|
||||||
|
@ -824,7 +857,7 @@ END
|
||||||
if ($agent_id ne "") {
|
if ($agent_id ne "") {
|
||||||
while (my $recordfc = $sthfc->fetchrow_hashref) {
|
while (my $recordfc = $sthfc->fetchrow_hashref) {
|
||||||
print <<END;
|
print <<END;
|
||||||
Contributing agents <b>[$recordfc->{count}]</b>. This budget will remain open for editing until <b>$recordb->{end_date}</b>. Monetary items will be kept anonymous (although identifable to the budget r/administrators). Labour & resources will be tagged with the name of the contributor.
|
Contributing agents <b>[$recordfc->{count}]</b>. This multi-player budget will remain open for editing until <b>$recordb->{end_date}</b>. Monetary items will be kept anonymous (although identifable to the budget r/administrators). Labour & resources will be tagged with the name of the contributor.
|
||||||
END
|
END
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -909,7 +942,7 @@ END
|
||||||
$display_cost = sprintf "%.2f",$cost;
|
$display_cost = sprintf "%.2f",$cost;
|
||||||
$display_cost =~ s/(\d)(?=(\d{3})+(\D|$))/$1\,/g; ## add commma
|
$display_cost =~ s/(\d)(?=(\d{3})+(\D|$))/$1\,/g; ## add commma
|
||||||
|
|
||||||
print_item("$recordex->{item}", ">$recordex->{currency}$display_cost");
|
print_item("$recordex->{item}", "$recordex->{currency}$display_cost");
|
||||||
}
|
}
|
||||||
|
|
||||||
print_subtitle("INCOME: / donations, contributions, sums, funds");
|
print_subtitle("INCOME: / donations, contributions, sums, funds");
|
||||||
|
@ -1935,9 +1968,7 @@ END
|
||||||
sub print_subtotal {
|
sub print_subtotal {
|
||||||
my $string = shift;
|
my $string = shift;
|
||||||
my $amount = shift;
|
my $amount = shift;
|
||||||
if (not $amount) {
|
if (not $amount) {$amount = "";}
|
||||||
$amount = "";
|
|
||||||
}
|
|
||||||
print <<END;
|
print <<END;
|
||||||
<div class="budget-subtotal">
|
<div class="budget-subtotal">
|
||||||
<p class="subtotal-name">$string</p>
|
<p class="subtotal-name">$string</p>
|
||||||
|
@ -1951,9 +1982,7 @@ END
|
||||||
sub print_item {
|
sub print_item {
|
||||||
my $string = shift;
|
my $string = shift;
|
||||||
my $amount = shift;
|
my $amount = shift;
|
||||||
if (not $amount) {
|
if (not $amount) {$amount = "";}
|
||||||
$amount = "";
|
|
||||||
}
|
|
||||||
print <<END;
|
print <<END;
|
||||||
<div class="budget-item">
|
<div class="budget-item">
|
||||||
<p class="item-name">$string</p>
|
<p class="item-name">$string</p>
|
||||||
|
|
Loading…
Reference in a new issue