2024-07-10 12:43:19 +00:00
|
|
|
<div class="content-wrapper">
|
2024-08-08 06:31:46 +00:00
|
|
|
|
2024-07-10 12:43:19 +00:00
|
|
|
<div class="content">
|
|
|
|
<div class="container-fluid">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
|
|
|
<div class="card card-primary card-outline">
|
|
|
|
<div class="card-header">
|
|
|
|
<h5 class="m-0">Edit <?php echo $pageTitle; ?> <a href="<?php echo site_url("accounts/accountheads/list"); ?>" class="btn btn-sm btn-primary float-right">List <?php echo $pageTitle; ?></a></h5>
|
|
|
|
</div>
|
|
|
|
<div class="card-body">
|
|
|
|
<?php $TableData = $Account ?>
|
|
|
|
<form method=POST action="" enctype="multipart/form-data" name="tbl_accounts">
|
|
|
|
<div class="row">
|
|
|
|
<!--COL START-->
|
|
|
|
<div class="col-10">
|
|
|
|
<div class="form-group">
|
2024-08-08 06:31:46 +00:00
|
|
|
<label for="account_name">Account Name</label><input type="text" class="form-control" id="account_name" value="<?php echo $TableData->account_name; ?>" name="account_name">
|
2024-07-10 12:43:19 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-2">
|
2024-08-08 06:31:46 +00:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="exampleInputFile">Upload Image</label>
|
|
|
|
<div class="input-group">
|
|
|
|
<div class="custom-file">
|
|
|
|
<input type="file" class="custom-file-input" id="exampleInputFile" name="account_image" value="<?php echo $TableData->account_image; ?>" onchange="previewImage(event)">
|
|
|
|
<label class="custom-file-label" for="exampleInputFile">Choose file</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-07-16 12:07:18 +00:00
|
|
|
</div>
|
|
|
|
|
2024-07-10 12:43:19 +00:00
|
|
|
</div>
|
2024-08-08 06:31:46 +00:00
|
|
|
|
2024-07-10 12:43:19 +00:00
|
|
|
<div class="col-7">
|
|
|
|
<div class="form-group">
|
2024-08-08 06:31:46 +00:00
|
|
|
|
2024-08-14 15:54:12 +00:00
|
|
|
<?php fillComboWithValue("accategory_id", "Under", "accategory_id", "tbl_accategories", "accategory_name", "accategory_id", $TableData->accategory_id, "", false, "status=1", $required=true); ?>
|
2024-07-10 12:43:19 +00:00
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!--COL END-->
|
2024-08-08 06:31:46 +00:00
|
|
|
|
2024-07-10 12:43:19 +00:00
|
|
|
<!--COL START-->
|
|
|
|
<!-- <div class="col-2">
|
|
|
|
<div class="form-group">
|
2024-08-08 06:31:46 +00:00
|
|
|
<label for="account_code">Account Code</label><input type="text" readonly class="form-control" id="account_code" value="<?php //echo $TableData->account_code;
|
|
|
|
?>" name="account_code">
|
2024-07-10 12:43:19 +00:00
|
|
|
</div>
|
|
|
|
</div> -->
|
|
|
|
<!--COL END-->
|
2024-08-08 06:31:46 +00:00
|
|
|
|
2024-07-10 12:43:19 +00:00
|
|
|
<!--COL START-->
|
2024-08-08 06:31:46 +00:00
|
|
|
|
2024-07-10 12:43:19 +00:00
|
|
|
<div class="col-2">
|
2024-08-08 06:31:46 +00:00
|
|
|
|
|
|
|
<div class="form-group"> <label for="opening_balance">Opening Balance</label><input type="text" class="form-control" id="opening_balance" value="<?php echo ($TableData->OpeningEntry) ? ((($TableData->OpeningEntry->dr) > 0) ? $TableData->OpeningEntry->dr : $TableData->OpeningEntry->cr) : ""; ?>" name="opening_balance"> </div>
|
2024-07-10 12:43:19 +00:00
|
|
|
</div>
|
|
|
|
<div class="col-1">
|
|
|
|
<div class="form-group"> <label for="opening_balance_drcr">Dr/Cr</label>
|
2024-08-08 06:31:46 +00:00
|
|
|
<select class="form-control" id="opening_balance_drcr" name="opening_balance_drcr" required>
|
|
|
|
<option value="DR" <?php echo ($TableData->OpeningEntry) ? ((($TableData->OpeningEntry->dr) != 0) ? "SELECTED" : "") : ""; ?>>Dr</option>
|
|
|
|
<option value="CR" <?php echo ($TableData->OpeningEntry) ? ((($TableData->OpeningEntry->cr) != 0) ? "SELECTED" : "") : ""; ?>>Cr</option>
|
|
|
|
|
|
|
|
</select>
|
2024-07-10 12:43:19 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-07-16 12:07:18 +00:00
|
|
|
|
|
|
|
<!--image display-->
|
|
|
|
|
|
|
|
<div class="col-2">
|
2024-08-08 06:31:46 +00:00
|
|
|
<img id="imagePreview" class="profile-user-img img-fluid " src="<?php echo isset($TableData->account_image) && $TableData->account_image ? base_url('uploads/' . $TableData->account_image) : base_url('/dist/img/user4-128x128.jpg'); ?>" alt="Account Image">
|
2024-07-16 12:07:18 +00:00
|
|
|
</div>
|
|
|
|
<!--image display end-->
|
|
|
|
|
2024-07-10 12:43:19 +00:00
|
|
|
<!--COL END-->
|
|
|
|
</div>
|
|
|
|
|
2024-08-08 06:31:46 +00:00
|
|
|
<?php
|
|
|
|
// Get the account category name
|
|
|
|
$category_name = getFieldfromValue("tbl_accategories", "accategory_name", "accategory_id", $TableData->accategory_id);
|
|
|
|
?>
|
|
|
|
<div id="creditorFields" style="display: none;">
|
2024-08-12 10:36:46 +00:00
|
|
|
<!-- <?php //if ($category_name == "Sundry Creditors" || $category_name == "Sundry Debtors") :
|
|
|
|
?> -->
|
|
|
|
<hr>
|
|
|
|
<div class="row" style="padding-bottom: 4px;"><b>Mailing Details:</b></div>
|
2024-08-08 06:31:46 +00:00
|
|
|
<div class="row">
|
2024-08-12 10:36:46 +00:00
|
|
|
<!--COL START-->
|
|
|
|
<div class="col">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="account_partyname">Party Name</label><input type="text" class="form-control" id="account_partyname" value="<?php echo $TableData->account_partyname; ?>" name="account_partyname">
|
2024-08-08 06:31:46 +00:00
|
|
|
</div>
|
2024-08-12 10:36:46 +00:00
|
|
|
</div>
|
|
|
|
<!--COL END-->
|
2024-08-08 06:31:46 +00:00
|
|
|
|
2024-08-12 10:36:46 +00:00
|
|
|
<!--COL START-->
|
|
|
|
<div class="col">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="account_partyaddress">Party Address</label><input type="text" class="form-control" id="account_partyaddress" value="<?php echo $TableData->account_partyaddress; ?>" name="account_partyaddress">
|
2024-08-08 06:31:46 +00:00
|
|
|
</div>
|
2024-08-12 10:36:46 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<hr>
|
|
|
|
<div class="row" style="padding-bottom: 4px;"><b>Contact Details:</b></div>
|
|
|
|
<div class="row">
|
|
|
|
|
|
|
|
<!--COL END-->
|
|
|
|
<!--COL START-->
|
|
|
|
<div class="col">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="account_partyemail">Party Email</label><input type="email" class="form-control" id="account_partyemail" value="<?php echo $TableData->account_partyemail; ?>" name="account_partyemail">
|
2024-08-08 06:31:46 +00:00
|
|
|
</div>
|
2024-08-12 10:36:46 +00:00
|
|
|
|
|
|
|
</div>
|
|
|
|
<!--COL END-->
|
|
|
|
<!--COL START-->
|
|
|
|
<div class="col">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="account_partycontact">Party Contact</label><input type="text" class="form-control" id="account_partycontact" value="<?php echo $TableData->account_partycontact; ?>" name="account_partycontact">
|
2024-08-08 06:31:46 +00:00
|
|
|
</div>
|
|
|
|
|
2024-08-12 10:36:46 +00:00
|
|
|
</div>
|
|
|
|
<!--COL END-->
|
|
|
|
<!--COL START-->
|
|
|
|
<div class="col">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="account_partycontactperson">Contact Person</label><input type="text" class="form-control" id="account_partycontactperson" value="<?php echo $TableData->account_partycontactperson; ?>" name="account_partycontactperson">
|
2024-08-08 06:31:46 +00:00
|
|
|
</div>
|
|
|
|
|
2024-08-12 10:36:46 +00:00
|
|
|
</div>
|
|
|
|
<!--COL END-->
|
|
|
|
|
|
|
|
<!--COL START-->
|
|
|
|
<div class="col">
|
2024-08-08 06:31:46 +00:00
|
|
|
|
|
|
|
|
2024-08-12 10:36:46 +00:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="account_partycontactpersoncontact">Contact Person Phone</label><input type="text" class="form-control" id="account_partycontactpersoncontact" value="<?php echo $TableData->account_partycontactpersoncontact; ?>" name="account_partycontactpersoncontact">
|
2024-08-08 06:31:46 +00:00
|
|
|
</div>
|
|
|
|
|
2024-08-12 10:36:46 +00:00
|
|
|
</div>
|
|
|
|
<!--COL END-->
|
|
|
|
</div>
|
|
|
|
<hr>
|
|
|
|
<div class="row" style="padding-bottom: 4px;"><b>Tax Information:</b></div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-6 col-lg-2">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="account_partypan">PAN</label><input type="text" class="form-control" id="account_partypan" value="<?php echo $TableData->account_partypan; ?>" name="account_partypan">
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-08-08 06:31:46 +00:00
|
|
|
|
|
|
|
|
2024-08-12 10:36:46 +00:00
|
|
|
<!-- <?php //endif;
|
|
|
|
?> -->
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-08-08 06:31:46 +00:00
|
|
|
|
2024-08-12 10:36:46 +00:00
|
|
|
<div id="bankFields">
|
|
|
|
<!-- <?php //if ($category_name == "Bank Account") :
|
|
|
|
?> -->
|
|
|
|
<hr>
|
|
|
|
<div class="row" style="padding-bottom: 4px;"><b>Mailing Details:</b></div>
|
|
|
|
<div class="row">
|
|
|
|
<!--COL START-->
|
|
|
|
<div class="col">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="account_partyname">Party Name</label><input type="text" class="form-control" id="account_partyname" value="<?php echo $TableData->account_partyname; ?>" name="account_partyname">
|
2024-08-08 06:31:46 +00:00
|
|
|
</div>
|
2024-08-12 10:36:46 +00:00
|
|
|
</div>
|
|
|
|
<!--COL END-->
|
|
|
|
|
|
|
|
<!--COL START-->
|
|
|
|
<div class="col">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="account_partyaddress">Party Address</label><input type="text" class="form-control" id="account_partyaddress" value="<?php echo $TableData->account_partyaddress; ?>" name="account_partyaddress">
|
2024-08-08 06:31:46 +00:00
|
|
|
</div>
|
2024-08-12 10:36:46 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!--COL START-->
|
|
|
|
<hr>
|
|
|
|
<div class="row" style="padding-bottom: 4px;"><b>Contact Details:</b></div>
|
|
|
|
<div class="row">
|
2024-08-08 06:31:46 +00:00
|
|
|
|
2024-08-12 10:36:46 +00:00
|
|
|
<!--COL END-->
|
|
|
|
<!--COL START-->
|
|
|
|
<div class="col">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="account_partyemail">Party Email</label><input type="email" class="form-control" id="account_partyemail" value="<?php echo $TableData->account_partyemail; ?>" name="account_partyemail">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<!--COL END-->
|
|
|
|
<!--COL START-->
|
|
|
|
<div class="col">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="account_partycontact">Party Contact</label><input type="text" class="form-control" id="account_partycontact" value="<?php echo $TableData->account_partycontact; ?>" name="account_partycontact">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<!--COL END-->
|
2024-08-08 06:31:46 +00:00
|
|
|
<!--COL START-->
|
|
|
|
<div class="col">
|
2024-07-10 12:43:19 +00:00
|
|
|
|
|
|
|
|
2024-08-12 10:36:46 +00:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="account_partycontactperson">Contact Person</label><input type="text" class="form-control" id="account_partycontactperson" value="<?php echo $TableData->account_partycontactperson; ?>" name="account_partycontactperson">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<!--COL END-->
|
|
|
|
|
|
|
|
<!--COL START-->
|
|
|
|
<div class="col">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="account_partycontactpersoncontact">Contact Person Phone</label><input type="text" class="form-control" id="account_partycontactpersoncontact" value="<?php echo $TableData->account_partycontactpersoncontact; ?>" name="account_partycontactpersoncontact">
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<!--COL END-->
|
|
|
|
</div>
|
|
|
|
<hr>
|
|
|
|
<div class="row" style="padding-bottom: 4px;"><b>Account Details:</b></div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
|
|
|
|
|
|
|
|
2024-08-08 06:31:46 +00:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="account_bank">Account Bank</label><input type="text" class="form-control" id="account_bank" value="<?php echo $TableData->account_bank; ?>" name="account_bank">
|
|
|
|
</div>
|
2024-07-10 12:43:19 +00:00
|
|
|
|
|
|
|
</div>
|
2024-08-08 06:31:46 +00:00
|
|
|
<!--COL END-->
|
|
|
|
<!--COL START-->
|
|
|
|
<div class="col">
|
2024-07-10 12:43:19 +00:00
|
|
|
|
2024-07-16 12:58:54 +00:00
|
|
|
|
2024-08-08 06:31:46 +00:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="account_number">Account Number</label><input type="text" class="form-control" id="account_number" value="<?php echo $TableData->account_number; ?>" name="account_number">
|
|
|
|
</div>
|
2024-07-16 12:58:54 +00:00
|
|
|
|
|
|
|
</div>
|
2024-08-08 06:31:46 +00:00
|
|
|
<!--COL END-->
|
2024-07-16 12:58:54 +00:00
|
|
|
|
2024-08-08 06:31:46 +00:00
|
|
|
<!--COL START-->
|
|
|
|
<div class="col">
|
2024-07-16 12:58:54 +00:00
|
|
|
|
|
|
|
|
2024-08-08 06:31:46 +00:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="account_branch">Account Branch</label><input type="text" class="form-control" id="account_branch" value="<?php echo $TableData->account_branch; ?>" name="account_branch">
|
|
|
|
</div>
|
2024-07-16 12:58:54 +00:00
|
|
|
|
2024-08-08 06:31:46 +00:00
|
|
|
</div>
|
2024-07-16 12:58:54 +00:00
|
|
|
</div>
|
2024-08-12 10:36:46 +00:00
|
|
|
<!--COL END-->
|
|
|
|
<!-- <?php //endif;
|
|
|
|
?> -->
|
|
|
|
</div>
|
2024-07-16 12:58:54 +00:00
|
|
|
|
|
|
|
|
2024-08-12 10:36:46 +00:00
|
|
|
<hr>
|
2024-07-10 12:43:19 +00:00
|
|
|
<div class="row">
|
|
|
|
<!--COL START-->
|
|
|
|
<div class="col">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
|
|
|
<label for="remarks">Remarks</label>
|
|
|
|
<textarea class="form-control" id="remarks" name="remarks"><?php echo $TableData->remarks; ?></textarea>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<!--COL END-->
|
|
|
|
</div>
|
2024-08-05 07:28:06 +00:00
|
|
|
<p align="right">
|
2024-08-08 06:31:46 +00:00
|
|
|
<button style="padding: 6px 24px; border-radius: 2px; border: 1px solid DodgerBlue" class="btn btn-default btn-sm">Reset</button> <button style="padding: 6px 24px; border-radius: 2px;" class="btn btn-primary btn-sm" type="submit" name="submit">Save</button>
|
2024-08-05 07:28:06 +00:00
|
|
|
</p>
|
2024-07-10 12:43:19 +00:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-07-16 12:07:18 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
2024-08-08 06:31:46 +00:00
|
|
|
function previewImage(event) {
|
|
|
|
var reader = new FileReader();
|
|
|
|
reader.onload = function() {
|
|
|
|
var output = document.getElementById('imagePreview');
|
|
|
|
output.src = reader.result;
|
|
|
|
}
|
|
|
|
reader.readAsDataURL(event.target.files[0]);
|
2024-07-16 12:07:18 +00:00
|
|
|
}
|
2024-08-08 06:31:46 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<script>
|
2024-08-12 10:36:46 +00:00
|
|
|
$(document).ready(function() {
|
|
|
|
function updateFields() {
|
|
|
|
var category = $('#accategory_id').val(); // Assuming the category select field has this ID
|
|
|
|
|
|
|
|
if (category == 2) {
|
|
|
|
$('#bankFields').show();
|
|
|
|
$('#creditorFields').hide();
|
|
|
|
} else if (category == 4 || category == 30) {
|
|
|
|
$('#bankFields').hide();
|
|
|
|
$('#creditorFields').show();
|
|
|
|
} else {
|
|
|
|
$('#bankFields').hide();
|
|
|
|
$('#creditorFields').hide();
|
|
|
|
}
|
2024-08-08 06:31:46 +00:00
|
|
|
}
|
|
|
|
|
2024-08-12 10:36:46 +00:00
|
|
|
// On page load
|
2024-08-08 06:31:46 +00:00
|
|
|
updateFields();
|
2024-08-12 10:36:46 +00:00
|
|
|
|
|
|
|
// On category change
|
|
|
|
$('#accategory_id').change(function() {
|
|
|
|
updateFields();
|
|
|
|
});
|
2024-08-08 06:31:46 +00:00
|
|
|
});
|
2024-07-16 12:07:18 +00:00
|
|
|
</script>
|