ss
This commit is contained in:
parent
1b89482e5b
commit
c7ae64c6aa
@ -124,14 +124,22 @@ class Invoice extends BaseController
|
||||
$bmodel = new BooksModel();
|
||||
$setting_model = new SettingsModel();
|
||||
$where = ['business_id' => (int)get_business_id()];
|
||||
$receipt = $model->getData('receipt', $where);
|
||||
$count_receipt_no = (count($receipt) > 0) ? count($receipt) + 1 : 1;
|
||||
$rec_where = ['business_id' => (int)get_business_id(), 'YEAR(created_on)' => date('Y')];
|
||||
$receipt = $model->getData('receipt', $rec_where);
|
||||
|
||||
// receipt number
|
||||
$settingData = $setting_model->select('*')->where($where)->findAll();
|
||||
$count_receipt_no = (count($receipt) > 0) ? count($receipt) + $settingData[0]['start_no'] + 1 : $settingData[0]['start_no'] + 1;
|
||||
$pad = '';
|
||||
for ($i=0; $i < $settingData[0]['left_pad']; $i++) {
|
||||
$pad .= '0';
|
||||
}
|
||||
$data['count_receipt_no'] = $settingData[0]['prefix_format'].'/'.$pad.''.$count_receipt_no;
|
||||
// Get customer names for the dropdown, events details, and books details
|
||||
$data['currency'] = $setting_model->select('currency')->where($where)->findAll();
|
||||
$data['customers'] = $model->getData('donor', $where);
|
||||
// $data['causes'] = $model->getData('causes', $where);
|
||||
$data['causes'] = $bmodel->select('*')->where('business_id', (int)get_business_id() )->get()->getResult();
|
||||
$data['count_receipt_no'] = $count_receipt_no;
|
||||
$data['campaign'] = $model->getData('campaign', $where);
|
||||
$data['invoice_number_formatting'] = $model->getData('settings', $where);
|
||||
|
||||
@ -294,6 +302,7 @@ class Invoice extends BaseController
|
||||
'payment_mode' => $this->request->getPost('payment_mode'),
|
||||
'payment_ref_no' => $this->request->getPost('payment_ref_no'),
|
||||
'causes_id' => (int)$this->request->getPost('causes_id'),
|
||||
'currency' => $this->request->getPost('currency'),
|
||||
'business_id' => (int)get_business_id(),
|
||||
'isactive' => 1
|
||||
];
|
||||
@ -637,8 +646,10 @@ class Invoice extends BaseController
|
||||
$model = new InvoiceModel();
|
||||
$usermodel = new UsersModel();
|
||||
$setting_model = new SettingsModel();
|
||||
$business_model = new BusinessModel();
|
||||
$where = ['business_id' => (int)get_business_id()];
|
||||
$currency_data = $setting_model->select('currency')->where($where)->findAll();
|
||||
$terms_data = $business_model->select('terms,signature')->where($where)->findAll();
|
||||
$data = $model->getInvoiceData($id);
|
||||
// Check if data is empty
|
||||
if (!$data || !$currency_data) {
|
||||
@ -648,15 +659,34 @@ class Invoice extends BaseController
|
||||
$options = new Options();
|
||||
$options->set('isHtml5ParserEnabled', true);
|
||||
$options->set('isPhpEnabled', true);
|
||||
// $options->set('isRemoteEnabled', true);
|
||||
$options->set('isRemoteEnabled', true);
|
||||
$options->set('font_subsetting', true);
|
||||
$options->set('tempDir', sys_get_temp_dir());
|
||||
$options->set('defaultFont', 'Arial');
|
||||
$options->set('chroot', base_url()."public/uploads");
|
||||
|
||||
$dompdf = new Dompdf($options);
|
||||
|
||||
define("DOMPDF_UNICODE_ENABLED", true);
|
||||
$user = $usermodel->select('first_name')->where('user_id',$data[0]->created_by)->findAll();
|
||||
$baseurl = base_url()."public/uploads/".$data[0]->business_logo;
|
||||
$html = view('invoice_pdf_template', ['data' => $data[0],'currency' => $currency_data[0]['currency'], 'currency_in_words' => $this->convertNumberToWords($data[0]->amount) ,'baseurl' => $baseurl, 'staff_name' => $user[0]['first_name'] ]);
|
||||
$logoPath = base_url()."public/uploads/".$data[0]->business_logo;
|
||||
|
||||
if ($data[0]->business_logo && file_exists($logoPath)) {
|
||||
$baseurl = $logoPath;
|
||||
} else {
|
||||
// Logo does not exist, handle this case accordingly
|
||||
$baseurl = base_url()."public/uploads/default.png";
|
||||
}
|
||||
|
||||
$html = view('invoice_pdf_template', [
|
||||
'data' => $data[0],
|
||||
'currency' => $data[0]->currency,
|
||||
'currency_in_words' => $this->convertNumberToWords($data[0]->amount) ,
|
||||
'baseurl' => $baseurl,
|
||||
'signature' => $terms_data[0]['signature'],
|
||||
'staff_name' => $user[0]['first_name'],
|
||||
'Notes' => $terms_data[0]['terms']
|
||||
]);
|
||||
// echo $html;die;
|
||||
|
||||
$dompdf->loadHtml($html);
|
||||
|
||||
@ -8,7 +8,7 @@ class InvoiceModel extends Model
|
||||
protected $table = 'receipt';
|
||||
protected $primaryKey = 'receipt_id';
|
||||
// protected $allowedFields = ['invoice_id','invoice_number','donor_id','invoice_date','event_id','business_id','created_on','business_id'];
|
||||
protected $allowedFields = ['receipt_id', 'receipt_number', 'donor_id','notes','amount', 'payment_mode', 'business_id', 'created_on', 'created_by', 'updated_on', 'updated_by','isactive', 'payment_ref_no', 'receipt_date','causes_id','campaign_id','receipt_header','reason'];
|
||||
protected $allowedFields = ['receipt_id', 'receipt_number', 'donor_id','notes','amount', 'payment_mode', 'business_id', 'created_on', 'created_by', 'updated_on', 'updated_by','isactive', 'payment_ref_no', 'receipt_date','causes_id','campaign_id','receipt_header','reason','currency'];
|
||||
|
||||
public function saveInvoiceItemDetails($data){
|
||||
$i = 0;
|
||||
|
||||
@ -17,6 +17,10 @@
|
||||
margin-top: 10px;
|
||||
/* Add a top margin for spacing */
|
||||
}
|
||||
.toggle-icon {
|
||||
cursor: pointer;
|
||||
margin-left: 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@ -28,7 +32,14 @@
|
||||
<p class="sub-header"> </p>
|
||||
|
||||
<form class="needs-validation" novalidate method="POST" enctype="multipart/form-data" action="<?= base_url() . "insert_org"; ?>" id="myForm">
|
||||
<div class="form-group">
|
||||
<hr />
|
||||
<h4 class="header-title" id="org-settings-title">
|
||||
Organization Settings
|
||||
<span class="toggle-icon" onclick="toggleSettings('org-settings')">▼</span>
|
||||
</h4>
|
||||
<br>
|
||||
<div>
|
||||
<div class="form-group" id="org-settings">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="bname" class="col-form-label">Organization Name<span class="text-danger">*</span></label>
|
||||
@ -44,7 +55,7 @@
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="bmobile" class="col-form-label">Organization PAN Number<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="pan_no" value="<?= isset($businesses['pan_no']) ? $businesses['pan_no'] : '' ?>" placeholder="PAN Number" required data-parsley-type="number" />
|
||||
<input type="text" class="form-control" name="pan_no" value="<?= isset($businesses['pan_no']) ? $businesses['pan_no'] : '' ?>" placeholder="PAN Number" required pattern="[A-Z]{5}[0-9]{4}[A-Z]{1}" title="Enter a valid PAN number" />
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
@ -56,7 +67,7 @@
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="bmobile" class="col-form-label">Organization Mobile Number<span class="text-danger">*</span></label>
|
||||
<input type="tel" class="form-control" name="bmobile" value="<?= isset($businesses['mobile_no']) ? $businesses['mobile_no'] : '' ?>" placeholder="Mobile Number (Enter only numbers)" required data-parsley-type="number" oninput="this.value = this.value.replace(/[^0-9]/g, '')" maxlength="10" />
|
||||
<input type="tel" class="form-control" name="bmobile" value="<?= isset($businesses['mobile_no']) ? $businesses['mobile_no'] : '' ?>" placeholder="Mobile Number (Enter only numbers)" required pattern="\d{10}" title="Please enter a 10-digit mobile number" oninput="this.value = this.value.replace(/[^0-9]/g, '')" maxlength="10" />
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
@ -75,37 +86,32 @@
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="bcity" class="col-form-label">City<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="bcity" value="<?= isset($businesses['city']) ? $businesses['city'] : '' ?>" placeholder="City" required />
|
||||
<input type="text" class="form-control" name="bcity" value="<?= isset($businesses['city']) ? $businesses['city'] : '' ?>" placeholder="City" required pattern="[A-Za-z\s]+" title="Please enter alphabets only" />
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="bstate" class="col-form-label">State<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="bstate" value="<?= isset($businesses['state']) ? $businesses['state'] : '' ?>" placeholder="State" required />
|
||||
<input type="text" class="form-control" name="bstate" value="<?= isset($businesses['state']) ? $businesses['state'] : '' ?>" placeholder="State" required pattern="[A-Za-z\s]+" title="Please enter alphabets only" />
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="bzip" class="col-form-label">Postal Code<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="bzip" value="<?= isset($businesses['postal_code']) ? $businesses['postal_code'] : '' ?>" placeholder="Postal Code (Eg: Pincode)" required />
|
||||
<input type="text" class="form-control" name="bzip" value="<?= isset($businesses['postal_code']) ? $businesses['postal_code'] : '' ?>" placeholder="Postal Code (Eg: Pincode)" oninput="this.value = this.value.replace(/[^0-9]/g, '')" required />
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
|
||||
<?php if (isset($businesses['loged_user'])) { ?>
|
||||
<div class="form-group col-md-12">
|
||||
<label for="bterms" class="col-form-label">Receipt Note</label>
|
||||
<textarea class="form-control" id="terms" name="bterms" rows="5" cols="50"><?= isset($businesses['terms']) ? $businesses['terms'] : '' ?></textarea>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Existing form fields above this section -->
|
||||
<!-- ################################################################################################# -->
|
||||
<hr />
|
||||
<h4 class="header-title">Site Settings</h4>
|
||||
<br>
|
||||
<div class="form-group">
|
||||
|
||||
<hr />
|
||||
<h4 class="header-title" id="site-settings-title">
|
||||
Site Settings
|
||||
<span class="toggle-icon" onclick="toggleSettings('site-settings')">▼</span>
|
||||
</h4>
|
||||
<br>
|
||||
<div class="form-group" id="site-settings" style="display: none;">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<div class="form-group col-md-12" style="display:none;">
|
||||
<label for="postal_code" class="col-form-label">Organization</label>
|
||||
<select id="business_id" name="business_id" class="form-control">
|
||||
<option value="null"><?php if(!isset($details['business_id'])){ echo 'Choose Organization'; } ?></option>
|
||||
@ -143,7 +149,7 @@
|
||||
<label for="mobile" class="col-form-label">Mobile Number</label>
|
||||
<input type="text" class="form-control" id="mobile" name="mobile"
|
||||
placeholder="Mobile Number (Enter only numbers)" data-parsley-type="number"
|
||||
value="<?= isset($details['mobile']) ? $details['mobile'] : '' ?>" maxlength="10" />
|
||||
value="<?= isset($details['mobile']) ? $details['mobile'] : '' ?>" pattern="\d{10}" title="Please enter a 10-digit mobile number" maxlength="10" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
@ -175,57 +181,16 @@
|
||||
value="<?= isset($details['country']) ? $details['country'] : '' ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="mail_protocol" class="col-form-label">Mail Protocol</label>
|
||||
<input type="text" class="form-control" id="mail_protocol" name="mail_protocol"
|
||||
placeholder="Mail Protocol (eg : zoho,gmail)"
|
||||
value="<?= isset($details['mail_protocol']) ? $details['mail_protocol'] : '' ?>" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="mail_title" class="col-form-label">Mail Title</label>
|
||||
<input type="text" class="form-control" id="mail_title" name="mail_title"
|
||||
placeholder="Mail Title"
|
||||
value="<?= isset($details['mail_title']) ? $details['mail_title'] : '' ?>" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="mail_host" class="col-form-label">Mail Host</label>
|
||||
<input type="text" class="form-control" id="mail_host" name="mail_host"
|
||||
placeholder="Mail Host"
|
||||
value="<?= isset($details['mail_host']) ? $details['mail_host'] : '' ?>" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="mail_port" class="col-form-label">Mail Port</label>
|
||||
<input type="text" class="form-control" id="mail_port" name="mail_port"
|
||||
placeholder="Mail Port"
|
||||
value="<?= isset($details['mail_port']) ? $details['mail_port'] : '' ?>" />
|
||||
</div>
|
||||
<!-- <div class="form-group col-md-3">
|
||||
<label for="mail_encryption" class="col-form-label">Mail Encryption</label>
|
||||
<input type="text" class="form-control" id="mail_encryption" name="mail_encryption"
|
||||
placeholder="Mail Encryption"
|
||||
value="<?= isset($details['mail_encryption']) ? $details['mail_encryption'] : '' ?>" />
|
||||
</div> -->
|
||||
<div class="form-group col-md-4">
|
||||
<label for="mail_username" class="col-form-label">Mail Username</label>
|
||||
<input type="text" class="form-control" id="mail_username" name="mail_username"
|
||||
placeholder="Mail Username"
|
||||
value="<?= isset($details['mail_username']) ? $details['mail_username'] : '' ?>" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="mail_password" class="col-form-label">Mail Password</label>
|
||||
<input type="text" class="form-control" id="mail_password" name="mail_password"
|
||||
placeholder="Mail Password"
|
||||
value="<?= isset($details['mail_password']) ? $details['mail_password'] : '' ?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
</div>
|
||||
|
||||
<!-- ################################################################################################# -->
|
||||
<div class="after-shipping-addr-add-more">
|
||||
<hr />
|
||||
<hr />
|
||||
<h4 class="header-title" id="branch-settings-title">
|
||||
Branch Settings
|
||||
<span class="toggle-icon" onclick="toggleSettings('branch-settings')">▼</span>
|
||||
</h4>
|
||||
<br>
|
||||
<div class="after-shipping-addr-add-more" id="branch-settings" style="display: none;">
|
||||
<?php if (empty($branches)) : ?>
|
||||
|
||||
<!-- Display at least one set of branch fields when the array is empty -->
|
||||
@ -289,6 +254,7 @@
|
||||
<!-- Add hidden input for branch id -->
|
||||
<input type="hidden" name="id[]" value="<?= isset($branch['id']) ? $branch['id'] : '' ?>" />
|
||||
</div>
|
||||
<hr />
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<!-- Add more branches when clicking the "Add More Branches" button -->
|
||||
@ -306,9 +272,18 @@
|
||||
<a class="btn btn-danger waves-effect waves-light mr-1 remove-brnach-details">- Remove </a>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<!-- ############################################################################################### -->
|
||||
|
||||
</div>
|
||||
<div class="form-row">
|
||||
|
||||
<hr />
|
||||
<h4 class="header-title" id="logo-settings-title">
|
||||
Logo Settings
|
||||
<span class="toggle-icon" onclick="toggleSettings('logo-settings')">▼</span>
|
||||
</h4>
|
||||
<br>
|
||||
<div class="form-group" id="logo-settings" style="display: none;">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="logo" class="col-form-label">Maximise Logo</label>
|
||||
<input type="file" class="form-control" style="border: 0px !important; " id="logo"
|
||||
@ -373,11 +348,15 @@
|
||||
</div>
|
||||
<br>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
<div class="after-add-more">
|
||||
<hr />
|
||||
<h4 class="header-title">Receipt Format</h4>
|
||||
<div class="form-group">
|
||||
<hr />
|
||||
<h4 class="header-title" id="receipt-settings-title">
|
||||
Receipt Settings
|
||||
<span class="toggle-icon" onclick="toggleSettings('receipt-settings')">▼</span>
|
||||
</h4>
|
||||
<br>
|
||||
<div class="form-group" id="receipt-settings" style="display: none;">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<div>
|
||||
@ -393,6 +372,10 @@
|
||||
<label for="bcity" class="col-form-label">Start Number</label>
|
||||
<input type="text" class="form-control" id="bcity" name="start_no" value="<?= isset($details['start_no']) ? $details['start_no'] : '1' ?>" placeholder="Start Number" />
|
||||
</div>
|
||||
<div class="form-group col-md-12">
|
||||
<label for="bterms" class="col-form-label">Receipt Note</label>
|
||||
<textarea class="form-control" id="terms" name="bterms" rows="5" cols="50"><?= isset($businesses['terms']) ? $businesses['terms'] : '' ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -492,6 +475,19 @@ function validateImage(input) {
|
||||
});
|
||||
});
|
||||
|
||||
function toggleSettings(id) {
|
||||
var settingsDiv = document.getElementById(id);
|
||||
var titleIcon = document.querySelector("#"+id+"-title .toggle-icon");
|
||||
if (settingsDiv.style.display === "none") {
|
||||
settingsDiv.style.display = "block";
|
||||
titleIcon.textContent = "▲"; // Change icon to up arrow
|
||||
} else {
|
||||
settingsDiv.style.display = "none";
|
||||
titleIcon.textContent = "▼"; // Change icon to down arrow
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@ -71,7 +71,7 @@
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="invoiceNumber" class="col-form-label">Receipt Number</label>
|
||||
<input type="text" class="form-control" id="invoiceNumber" name="receipt_number" value="<?= isset($receipt_details['receipt_number']) ? $receipt_details['receipt_number'] : '' ?>">
|
||||
<input type="text" class="form-control" id="invoiceNumber" name="receipt_number" value="<?= isset($receipt_details['receipt_number']) ? $receipt_details['receipt_number'] : $count_receipt_no ?>" readonly>
|
||||
<input type="hidden" id="hiddenNextId" name="next_id" placeholder="hidden for next id" />
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
@ -81,11 +81,23 @@
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="csname" class="col-form-label">Amount in (<?= $currency[0]['currency'] ?>)<span class="text-danger"> *</span></label>
|
||||
<input type="text" class="form-control" id="org_name_field" name="amount" value="<?= isset($receipt_details['amount']) ? $receipt_details['amount'] : '' ?>" placeholder="Amount"/ required>
|
||||
<div class="form-group col-md-1">
|
||||
<label for="csname" class="col-form-label">Currency<span class="text-danger"> *</span></label>
|
||||
<select class="form-control" id="currency" name="currency" data-toggle="select2" required>
|
||||
<option value="">Select</option>
|
||||
<?php
|
||||
$currencies = explode(",", $currency[0]['currency']);
|
||||
foreach ($currencies as $currency) { ?>
|
||||
<option value="<?= $currency ?>" <?php if (isset($receipt_details['currency']) && ($receipt_details['currency'] === $currency)) echo "selected"; ?>><?= $currency ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<!-- <input type="text" class="form-control" id="org_name_field" name="amount" value="<?= isset($receipt_details['amount']) ? $receipt_details['amount'] : '' ?>" placeholder="Amount"/ required> -->
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<div class="form-group col-md-5">
|
||||
<label for="csname" class="col-form-label">Amount<span class="text-danger"> *</span></label>
|
||||
<input type="text" class="form-control" id="org_name_field" name="amount" value="<?= isset($receipt_details['amount']) ? $receipt_details['amount'] : '' ?>" placeholder="Amount" oninput="this.value = this.value.replace(/[^0-9]/g, '')" required />
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="invoiceDate" class="col-form-label">Payment Mode<span class="text-danger"> *</span></label>
|
||||
<select class="form-control" id="paymentMode" name="payment_mode" required>
|
||||
<option value="<?= isset($receipt_details['payment_mode']) ? $receipt_details['payment_mode'] : null ;?>"><?= isset($receipt_details['payment_mode']) ? $receipt_details['payment_mode'] : 'Select Payment Mode' ; ?></option>
|
||||
@ -96,7 +108,7 @@
|
||||
<option value="banktransfer">Bank Transfer</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="invoiceDate" class="col-form-label">Payment Reference No</label>
|
||||
<input type="text" class="form-control" id="invoiceDate" name="payment_ref_no" value="<?= isset($receipt_details['payment_ref_no']) ? $receipt_details['payment_ref_no'] : '' ?>" placeholder="Payment Reference No">
|
||||
</div>
|
||||
@ -220,21 +232,21 @@ $(function() {
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
var invoiceNo = $("#invoiceNumber").val()
|
||||
if (invoiceNo != '') {
|
||||
$("#invoiceNumber").val(invoiceNo).prop("readonly", true);
|
||||
}else{
|
||||
var final_sno = "<?php
|
||||
$lastYear = date('Y') - 1;
|
||||
$currentYear = date('y');
|
||||
echo $lastYear.'-'.$currentYear.'/'.$count_receipt_no;
|
||||
?>";
|
||||
// $(document).ready(function(){
|
||||
// var invoiceNo = $("#invoiceNumber").val()
|
||||
// if (invoiceNo != '') {
|
||||
// $("#invoiceNumber").val(invoiceNo).prop("readonly", true);
|
||||
// }else{
|
||||
// var final_sno = "<?php
|
||||
// $lastYear = date('Y') - 1;
|
||||
// $currentYear = date('y');
|
||||
// echo $lastYear.'-'.$currentYear.'/'.$count_receipt_no;
|
||||
// ?>";
|
||||
|
||||
// console.log(final_sno);
|
||||
$("#invoiceNumber").val(final_sno).prop("readonly", true);
|
||||
}
|
||||
});
|
||||
// // console.log(final_sno);
|
||||
// $("#invoiceNumber").val(final_sno).prop("readonly", true);
|
||||
// }
|
||||
// });
|
||||
|
||||
function restriction(event) {
|
||||
var charCode = event.which || event.keyCode;
|
||||
|
||||
@ -9,8 +9,9 @@
|
||||
<div class="card-body">
|
||||
<div class="float-right">
|
||||
<div id="checkAll" style="display:none;">
|
||||
<button type="button" class="btn btn-secondary" id="multi_success">Save All</button>
|
||||
<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#delete-all-modal">Delete All</button>
|
||||
<span id="totalAmt" style="margin-right:30px;"></span>
|
||||
<button type="button" class="btn btn-secondary" id="multi_success">Accept</button>
|
||||
<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#delete-all-modal">Reject</button>
|
||||
</div>
|
||||
<div id="addDonorBtn">
|
||||
<?php if(get_user_role() != 'accounts') { ?>
|
||||
@ -59,7 +60,11 @@
|
||||
<?php foreach ($receipt as $row) : ?>
|
||||
<tr>
|
||||
<td hidden><?= $row['receipt_id']; ?></td>
|
||||
<td <?php if (get_user_role() != 'accounts') { echo 'hidden'; } ?>><input type="checkbox" class="select-checkbox" value="<?= $row['receipt_id'] ?>"></td>
|
||||
<td <?php if (get_user_role() != 'accounts') { echo 'hidden'; } ?>>
|
||||
<?php if($row['receipt_header'] != 'Receipt') { ?>
|
||||
<input type="checkbox" class="select-checkbox" value="<?= $row['receipt_id'] ?>" >
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td><?= $row['receipt_number']; ?></td>
|
||||
<td><?= date("d-m-Y", strtotime($row['receipt_date'])); ?> </td>
|
||||
<td><?= $row['created_name']; ?></td>
|
||||
@ -68,7 +73,7 @@
|
||||
<?= $row['donor_id'] === $DonorData->donor_id ? $DonorData->first_name . $DonorData->last_name : ''; ?>
|
||||
<?php endforeach; ?>
|
||||
</td>
|
||||
<td><?= $row['amount']; ?></td>
|
||||
<td id="<?= $row['receipt_id'] ?>"><?= $row['amount']; ?></td>
|
||||
<td><?= $row['payment_mode']; ?></td>
|
||||
<td><?= $row['receipt_header']; ?></td>
|
||||
<td><?php echo ($row['reason'] == null) ? '-' : $row['reason']; ?></td>
|
||||
@ -163,7 +168,7 @@ $(function() {
|
||||
});
|
||||
});
|
||||
|
||||
// add id delete form
|
||||
// add id in delete form
|
||||
$(function() {
|
||||
$('.append_id').on('click', function(){
|
||||
id = $(this).attr('id');
|
||||
@ -183,9 +188,21 @@ $(function() {
|
||||
$('#addDonorBtn').show();
|
||||
$('#checkAll').hide();
|
||||
}
|
||||
totalAmt();
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
function totalAmt() {
|
||||
sum = 0;
|
||||
for (const checkbox of $('.select-checkbox:checked')) {
|
||||
const id = $(checkbox).val();
|
||||
sum = parseInt($('#'+id).html()) + sum;
|
||||
}
|
||||
$('#totalAmt').html('Total selected amount: <b>'+sum+'</b>');
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
var table = $('#datatable-buttons').DataTable({
|
||||
"order": [
|
||||
@ -264,6 +281,8 @@ $(document).ready(function() {
|
||||
$('#addDonorBtn').show();
|
||||
$('#checkAll').hide();
|
||||
}
|
||||
|
||||
totalAmt()
|
||||
});
|
||||
});
|
||||
|
||||
@ -298,6 +317,7 @@ $(document).ready(function() {
|
||||
<div id="delete-all-modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content">
|
||||
<div class="closeBtn float-right" style="padding: 10px;"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button></div>
|
||||
<div class="modal-body p-4">
|
||||
<div class="text-center">
|
||||
<form class="needs-validation" novalidate enctype="multipart/form-data" id="myForm2" name="myForm">
|
||||
|
||||
@ -79,7 +79,7 @@
|
||||
<table style=" width: 100%; height: 115px;border: none;">
|
||||
<tbody>
|
||||
<tr style="height: 25px;">
|
||||
<td style="width: 20%; height: 25px; text-align: center;border: none;"> <img src="<?= $baseurl ?>" alt="Your Organization Logo" style="width: 50%;"></td>
|
||||
<td style="width: 20%; height: 25px; text-align: center;border: none;"> <img src="<?= $baseurl ?>" alt="Your Organization Logo" style="width: 100%;"></td>
|
||||
<td style="width: 80%; height: 20px;border: none;">
|
||||
<h3 style="text-align: right;text-decoration: underline"><strong><?= $data->title ?></strong></h3>
|
||||
<p class="sub-add" style="padding-left: 80px; text-align: right;"><?= $data->org_address ?>, <?= $data->org_city ?>,<?= $data->org_state ?> ,<?= $data->org_zip ?>.<br>
|
||||
@ -88,7 +88,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="height: 18px;">
|
||||
<td style="width: 100%; height: 18px;border: none;" colspan="2">
|
||||
<td style="width: 100%; height: 18px;border: none;border-top: 1px solid #ccc;" colspan="2">
|
||||
<h4 style="text-align: center;"><strong><?=$data->receipt_header?></strong></h4>
|
||||
</td>
|
||||
</tr>
|
||||
@ -97,66 +97,18 @@
|
||||
<td style="width: 69.4882%; height: 18px; text-align: right;border: none;"><strong>Date:</strong> <?=date("d-m-Y", strtotime($data->receipt_date));?></td>
|
||||
</tr>
|
||||
<tr style="height: 18px;">
|
||||
<td style="width: 100%; height: 18px; text-align: center;border: none;" colspan="2"><p>Received with thanks from <b><?= $data->customer_name ?></b> <?php if($data->cust_pan_no) { echo ', PAN <b>'.$data->cust_pan_no.'</b>'; } ?>, a sum of <b><?= $currency ?> <?= $currency_in_words ?></b> (<?= $currency ?>.<?= $data->amount ?>), towards <b><?= $data->cause_name ?></b>.</td>
|
||||
<td style="width: 100%; height: 18px; text-align: justify;border: none;padding:30px;" colspan="2"><p>Received with thanks from <b><?= $data->customer_name ?></b> <?php if($data->cust_pan_no) { echo ', PAN <b>'.$data->cust_pan_no.'</b>'; } ?>, a sum of <b><?= $currency ?> <?= $currency_in_words ?></b> (<?= $currency ?>.<?= $data->amount ?>), towards <b><?= $data->cause_name ?></b>.</td>
|
||||
</tr>
|
||||
<tr style="height: 18px;">
|
||||
<td style="width: 30.5118%; height: 18px;border: none;"><strong>Collected by:</strong> <?= $staff_name ?></td>
|
||||
<td style="width: 69.4882%; height: 18px;text-align: right;border: none;"><img src="<?= base_url()."public/uploads/signature.png" ?>" width="100px" alt="Signature"></td>
|
||||
</tr>
|
||||
<td style="width: 69.4882%; height: 18px;text-align: right;border: none;"><img src="<?= base_url()."public/uploads/".$signature ?>" width="100px" alt="Signature"></td>
|
||||
<tr>
|
||||
</tr><td style="width: 30.5118%; height: 18px;"></td></tr>
|
||||
<tr style="height: 18px;">
|
||||
<td style="width: 100%; height: 18px; text-align: center;border: none;" colspan="2"><strong>Note:</strong> <?= $data->notes ?></td>
|
||||
<td style="width: 100%; height: 18px; text-align: center;border: none;padding:30px 0px 0px 0px;font-size: 9px;border-top: 1px solid #ccc;" colspan="2"><strong>Note:</strong> <?= $Notes ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- <div class="container">
|
||||
<div class="row same-line">
|
||||
<div class="logo">
|
||||
<img class="img" src="<?= $baseurl ?>" alt="Your Organization Logo">
|
||||
</div>
|
||||
<div class="header">
|
||||
<div class="underline"><?= $data->title ?></div>
|
||||
<p class="sub-add"><?= $data->org_address ?>, <?= $data->org_city ?>,<?= $data->org_state ?> ,<?= $data->org_zip ?>.<br>
|
||||
MobileNo: <?= $data->org_mobile ?>, Email: <?= $data->org_email ?>,<br>
|
||||
PAN No: <?= $data->org_pan ?>, Register No:<?= $data->org_reg_no ?></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row same-line">
|
||||
<div class="text">
|
||||
<p><b>Receipt:</b> <?=$data->receipt_number?></p>
|
||||
</div>
|
||||
<div class="heading same-line2">
|
||||
<p><b><?=$data->receipt_header?></b></p>
|
||||
</div>
|
||||
<div class="same-line2">
|
||||
<p><b>Date:</b> <?=date("d-m-Y", strtotime($data->receipt_date));?></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="body">
|
||||
<p>Received with thanks from <b><?= $data->customer_name ?></b> <?php if($data->cust_pan_no) { echo ', PAN <b>'.$data->cust_pan_no.'</b>'; } ?>, a sum of <b><?= $data->amount ?></b>, towards <b><?= $data->cause_name ?></b>.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="same-line">
|
||||
<div class="collected-by text">
|
||||
<p><b>Collected by:</b> <?= $staff_name ?></p>
|
||||
</div>
|
||||
<div class="signature text">
|
||||
<img src="<?= base_url()."public/uploads/signature.png" ?>" width="100px" alt="Signature">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="notes">
|
||||
<p><b>Note:</b> This template includes placeholders for various pieces of information related to the donation receipt, such as receipt number, receipt date, donor information, donation details, and a thank you message.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -180,14 +180,14 @@
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php if ($loggedin_person_role === 'sadmin' && $loggedin_person_role !== 'accounts') : ?>
|
||||
<!-- <?php if ($loggedin_person_role === 'sadmin' && $loggedin_person_role !== 'accounts') : ?>
|
||||
<li>
|
||||
<a href="<?= base_url()."sitesetting_list"; ?>">
|
||||
<i class="ri-list-settings-line"></i>
|
||||
<span> Org Settings </span>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?> -->
|
||||
<?php if ($loggedin_person_role === 'sadmin' && $loggedin_person_role !== 'accounts') : ?>
|
||||
<li>
|
||||
<a href="<?= base_url()."appsetting_page/1"; ?>">
|
||||
@ -213,14 +213,6 @@
|
||||
</a>
|
||||
</li> -->
|
||||
<?php endif; ?>
|
||||
<?php if ($loggedin_person_role !== 'manager' && $loggedin_person_role !== 'sadmin' && $loggedin_person_role !== 'accounts') : ?>
|
||||
<li>
|
||||
<a href="<?= base_url()."donor_group"; ?>">
|
||||
<i class="ri-team-line"></i>
|
||||
<span> Donor Groups </span>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($loggedin_person_role !== 'manager' && $loggedin_person_role !== 'sadmin' && $loggedin_person_role !== 'accounts') : ?>
|
||||
<!-- <li>
|
||||
@ -254,6 +246,14 @@
|
||||
</a>
|
||||
<div class="collapse" id="notificationsLayouts">
|
||||
<ul class="nav-second-level">
|
||||
<?php if ($loggedin_person_role !== 'manager' && $loggedin_person_role !== 'sadmin' && $loggedin_person_role !== 'accounts') : ?>
|
||||
<li>
|
||||
<a href="<?= base_url()."donor_group"; ?>">
|
||||
<i class="ri-team-line"></i>
|
||||
<span> Donor Groups </span>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<li>
|
||||
<a href="<?= base_url()."template_creation"; ?>">Template Creation</a>
|
||||
</li>
|
||||
|
||||
@ -77,7 +77,7 @@
|
||||
|
||||
<?php if ($loggedin_person_role !== 'manager' && $loggedin_person_role !== 'sadmin') : ?>
|
||||
<a href="<?= base_url()."new_org/".$bid; ?>"class="dropdown-item notify-item">
|
||||
<i class="ri-briefcase-4-fill"></i><span> Profile Setting </span>
|
||||
<i class="ri-briefcase-4-fill"></i><span> Org Setting </span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user