Merged PR 1134: Fix Invoice Deserialization Failure for PaymentMode::NOTSET
Changes: - Added support for PaymentMode::NOTSET in payment mode string-to-enum conversion. - Improved invoice table column labels and spacing for better readability in invoice display screens. Fixes #1789 Related work items: #1646, #1789
This commit is contained in:
@@ -137,6 +137,10 @@ namespace util
|
|||||||
{
|
{
|
||||||
return PaymentMode::OFFLINE;
|
return PaymentMode::OFFLINE;
|
||||||
}
|
}
|
||||||
|
if (value == "NOTSET")
|
||||||
|
{
|
||||||
|
return PaymentMode::NOTSET;
|
||||||
|
}
|
||||||
throw std::invalid_argument("Invalid PaymentMode string");
|
throw std::invalid_argument("Invalid PaymentMode string");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -453,11 +453,11 @@ inline const Invoice* selectInvoiceToDisplay(util::Map<std::string, const Invoic
|
|||||||
<< std::left
|
<< std::left
|
||||||
<< std::setw(10) << "Index"
|
<< std::setw(10) << "Index"
|
||||||
<< std::setw(12) << "BookingID"
|
<< std::setw(12) << "BookingID"
|
||||||
<< std::setw(15) << "VehicleNumber"
|
<< std::setw(20) << "Vehicle Number"
|
||||||
<< std::setw(20) << "Technician Name"
|
<< std::setw(20) << "Technician Name"
|
||||||
<< std::setw(15) << "Total Amount"
|
<< std::setw(15) << "Total Amount"
|
||||||
<< std::setw(25) << "Invoice Date"
|
<< std::setw(25) << "Invoice Date"
|
||||||
<< std::setw(15) << "PaymentStatus"
|
<< std::setw(20) << "Payment Status"
|
||||||
<< std::setw(15) << "Payment Mode"
|
<< std::setw(15) << "Payment Mode"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
for (int iterator = 0; iterator < currentInvoices.getSize(); iterator++)
|
for (int iterator = 0; iterator < currentInvoices.getSize(); iterator++)
|
||||||
@@ -471,11 +471,11 @@ inline const Invoice* selectInvoiceToDisplay(util::Map<std::string, const Invoic
|
|||||||
std::cout << std::left
|
std::cout << std::left
|
||||||
<< std::setw(10) << currentIndex
|
<< std::setw(10) << currentIndex
|
||||||
<< std::setw(12) << currentInvoice->getBookingId()
|
<< std::setw(12) << currentInvoice->getBookingId()
|
||||||
<< std::setw(15) << currentInvoice->getBooking()->getVehicleNumber()
|
<< std::setw(20) << currentInvoice->getBooking()->getVehicleNumber()
|
||||||
<< std::setw(20) << ((currentTechnician && !currentTechnician->getName().empty()) ? currentTechnician->getName() : "NULL")
|
<< std::setw(20) << ((currentTechnician && !currentTechnician->getName().empty()) ? currentTechnician->getName() : "NULL")
|
||||||
<< std::setw(15) << currentInvoice->getTotalAmount()
|
<< std::setw(15) << currentInvoice->getTotalAmount()
|
||||||
<< std::setw(25) << currentInvoice->getInvoiceDate().toString()
|
<< std::setw(25) << currentInvoice->getInvoiceDate().toString()
|
||||||
<< std::setw(15) << util::getPaymentStatusString(currentInvoice->getStatus())
|
<< std::setw(20) << util::getPaymentStatusString(currentInvoice->getStatus())
|
||||||
<< std::setw(15) << util::getPaymentModeString(currentInvoice->getPaymentMethod())
|
<< std::setw(15) << util::getPaymentModeString(currentInvoice->getPaymentMethod())
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
currentInvoicesIndexMap.insert(currentIndex++, currentInvoice);
|
currentInvoicesIndexMap.insert(currentIndex++, currentInvoice);
|
||||||
|
|||||||
Reference in New Issue
Block a user