Fix Company Settings save, invoice PAID stamp, and purge script
- Company Settings: switch save button from type=submit to type=button to bypass HTML5 form validation blocking the submit event; replace AutoMapper Map() with explicit property assignment so EF change tracking reliably detects mutations; fix showButtonSuccess() never re-enabling the button after a successful save - Invoice PDF: move PAID stamp into the header row as a centered middle column so it sits between the company and invoice blocks without adding height to the document - Purge script: use business-date fields instead of CreatedAt so imported records (which all share today's CreatedAt) are correctly filtered by actual transaction dates Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -312,7 +312,7 @@
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-end">
|
||||
<button type="submit" class="btn btn-primary" id="btnSaveCompanyInfo">
|
||||
<button type="button" class="btn btn-primary" id="btnSaveCompanyInfo">
|
||||
<i class="bi bi-save"></i> Save Changes
|
||||
</button>
|
||||
</div>
|
||||
@@ -2749,10 +2749,8 @@
|
||||
}
|
||||
});
|
||||
|
||||
// Company Info Form Submit
|
||||
$('#companyInfoForm').on('submit', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Company Info Save
|
||||
$('#btnSaveCompanyInfo').on('click', function () {
|
||||
const formData = {
|
||||
CompanyName: $('#companyName').val(),
|
||||
CompanyCode: $('#companyCode').val(),
|
||||
@@ -3192,7 +3190,7 @@
|
||||
|
||||
// Button success animation helper
|
||||
function showButtonSuccess(btn, originalHtml, duration = 2000) {
|
||||
btn.removeClass('btn-primary').addClass('btn-success');
|
||||
btn.prop('disabled', false).removeClass('btn-primary').addClass('btn-success');
|
||||
btn.html('<i class="bi bi-check-circle-fill"></i> Saved!');
|
||||
setTimeout(function() {
|
||||
btn.removeClass('btn-success').addClass('btn-primary');
|
||||
|
||||
Reference in New Issue
Block a user