Subversion Repositories SmartDukaan

Rev

Rev 36145 | Rev 36176 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 36145 Rev 36175
Line 1241... Line 1241...
1241
    /**
1241
    /**
1242
     * Format amount in Indian comma style: 1,25,129.00
1242
     * Format amount in Indian comma style: 1,25,129.00
1243
     */
1243
     */
1244
    static String formatIndianCurrency(double amount) {
1244
    static String formatIndianCurrency(double amount) {
1245
        String formatted = indianCurrencyFormat.format(amount);
1245
        String formatted = indianCurrencyFormat.format(amount);
1246
        // Remove currency symbol, keep just the number with commas
1246
        // Remove currency symbol prefix (e.g. "₹", "Rs.", "INR ") keeping only the numeric part
-
 
1247
        String symbol = indianCurrencyFormat.getCurrency().getSymbol(indianLocale);
1247
        return formatted.replaceAll("[^0-9,.]", "").trim();
1248
        formatted = formatted.replace(symbol, "").trim();
-
 
1249
        // Fallback: strip any remaining non-numeric prefix characters
-
 
1250
        formatted = formatted.replaceFirst("^[^0-9-]+", "");
-
 
1251
        return formatted;
1248
    }
1252
    }
1249
 
1253
 
1250
    public static void generateAndWriteCustomerCreditNotes(List<CreditNotePdfModel> creditNotes, OutputStream outputStream) {
1254
    public static void generateAndWriteCustomerCreditNotes(List<CreditNotePdfModel> creditNotes, OutputStream outputStream) {
1251
        Document document = new Document();
1255
        Document document = new Document();
1252
        document.setMargins(0, 0, 25, 0);
1256
        document.setMargins(0, 0, 25, 0);