Browse Source

Preparing GnuCash CSV interface, and fixed no shop bug with new logic.

devel
Jonathan Rosenbaum 9 years ago
parent
commit
e444cdb93c
  1. 2
      css/transactions.css
  2. 6
      sql/populate.sql
  3. 31
      transaction_log.php

2
css/transactions.css

@ -1,7 +1,7 @@
/* sensible UI defaults for transaction views */
/* right-align labels */
td > label:not(.payment_type):not(#open_shop) {
td > label:not(.payment_type):not(.open_shop) {
float: right;
padding-right: 5px;
}

6
sql/populate.sql

@ -128,12 +128,10 @@ INSERT INTO contacts (
-- Deposit (transaction_type_id) is a special transaction type that behaves differently in the log
-- for a good reason.
--
-- DONATIONS (or option to allow an anonymous transactions)
-- Anonymous (transaction_type_id) provides a checkbox if show_soldto_location is set to allow donations and other types
-- of desired transactions to be anonymous.
-- DONATIONS are best complimented with anonymous, see below.
--
-- "show_payment" shows cash, credit, and check payment types if selected.
-- "anonymous" allows anonymous transactions with a check box.
-- Assuming show_soldto_location is set, "anonymous" allows anonymous transactions with a check box.
ALTER TABLE transaction_types ADD show_payment tinyint(1) NOT NULL DEFAULT '1';
ALTER TABLE transaction_types ADD anonymous tinyint(1) NOT NULL DEFAULT '0';

31
transaction_log.php

@ -637,7 +637,7 @@ if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ChangeDate")) {
Show <input name="record_count" type="text" value="<?php echo $number_of_transactions; ?>" size="3">
transactions on or before:
<input name="trans_date" type="text" id="trans_date" value="<?php echo current_date(); ?>" size="10" maxlength="10" />
<select name="dayname">
<select class="yb_standard" name="dayname">
<option value="alldays" selected="selected">All Days</option>
<option value="Monday">Monday</option>
<option value="Tuesday">Tuesday</option>
@ -656,22 +656,31 @@ if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ChangeDate")) {
</form>
</td>
</tr>
<tr>
</tr>
<tr>
<td>
<?php
$shop_id = current_shop_by_ip();
$sql = "SELECT *, IF(date <> curdate() AND shop_type = 'Mechanic Operation Shop',0,1) as CanEdit
FROM shops WHERE shop_id = $shop_id;";
$query = mysql_query($sql, $YBDB) or die(mysql_error());
$result = mysql_fetch_assoc($query);
if(current_shop_by_ip()>=1) echo '<label id="open_shop" for="shop" style="font-weight:bold;">Current Shop:</label>';
else echo '<label id="open_shop" for="shop" style="font-weight:bold">No Shop</label>';
echo "<br \>" . $result['shop_location'] . " - " . $result['shop_type'] . " - " . $result['date'];
if ($shop_id) {
$sql = "SELECT *, IF(date <> curdate() AND shop_type = 'Mechanic Operation Shop',0,1) as CanEdit
FROM shops WHERE shop_id = $shop_id;";
$query = mysql_query($sql, $YBDB) or die(mysql_error());
$result = mysql_fetch_assoc($query);
}
if(current_shop_by_ip()>=1) echo '<label class="open_shop" for="shop" style="font-weight:bold;">Current Shop:</label>';
else echo '<label class="open_shop" for="shop" style="font-weight:bold">No Shop</label>';
if (current_shop_by_ip()>=1) echo "<br \>" . "(" . $result['shop_id'] . ") " .
$result['shop_location'] . " - " . $result['shop_type'] . " - " . $result['date'];
?>
</td>
</tr>
<tr>
<td>
<br \>
<label style="font-weight:bold;" class="open_shop" for="gnucash_csv">GnuCash CSV:</label>
</td>
</tr>
</table>
<p>&nbsp;</p>
<?php include("include_footer.html"); ?>

Loading…
Cancel
Save