mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 19:04:52 +00:00
Added select2 libs, started transactions, added additiona fields to vendor, new DB dump removed balance on invoices list
This commit is contained in:
@@ -41,8 +41,19 @@
|
||||
while($row = mysqli_fetch_array($sql2)){
|
||||
$account_id2 = $row['account_id'];
|
||||
$account_name = $row['account_name'];
|
||||
$opening_balance = $row['opening_balance'];
|
||||
|
||||
$sql_payments = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS total_payments FROM payments WHERE account_id = $account_id2");
|
||||
$row = mysqli_fetch_array($sql_payments);
|
||||
$total_payments = $row['total_payments'];
|
||||
|
||||
$sql_expenses = mysqli_query($mysqli,"SELECT SUM(expense_amount) AS total_expenses FROM expenses WHERE account_id = $account_id2");
|
||||
$row = mysqli_fetch_array($sql_expenses);
|
||||
$total_expenses = $row['total_expenses'];
|
||||
|
||||
$balance = $opening_balance + $total_payments - $total_expenses;
|
||||
?>
|
||||
<option <?php if($account_id == $account_id2){ ?> selected <?php } ?> value="<?php echo $account_id2; ?>"><?php echo $account_name; ?></option>
|
||||
<option <?php if($account_id == $account_id2){ ?> selected <?php } ?> value="<?php echo $account_id2; ?>"><?php echo $account_name; ?> [$<?php echo number_format($balance,2); ?>]</option>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -101,9 +112,9 @@
|
||||
<label>Description</label>
|
||||
<textarea class="form-control" rows="4" name="description" required><?php echo $expense_description; ?></textarea>
|
||||
</div>
|
||||
<div class="custom-file">
|
||||
<input type="file" class="custom-file-input" name="attachment">
|
||||
<label class="custom-file-label">Attach Reciept...</label>
|
||||
<div class="form-group">
|
||||
<label>Receipt</label>
|
||||
<input type="file" class="form-control-file" name="file">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
Reference in New Issue
Block a user