Subversion Repositories SmartDukaan

Rev

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

Rev 36175 Rev 36176
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 prefix (e.g. "₹", "Rs.", "INR ") keeping only the numeric part
1246
        // Strip currency symbol prefix (Rs., ₹, etc.) — keep only digits, commas, dots, minus
1247
        String symbol = indianCurrencyFormat.getCurrency().getSymbol(indianLocale);
-
 
1248
        formatted = formatted.replace(symbol, "").trim();
-
 
1249
        // Fallback: strip any remaining non-numeric prefix characters
-
 
1250
        formatted = formatted.replaceFirst("^[^0-9-]+", "");
1247
        return formatted.replaceFirst("^[^0-9-]+", "");
1251
        return formatted;
-
 
1252
    }
1248
    }
1253
 
1249
 
1254
    public static void generateAndWriteCustomerCreditNotes(List<CreditNotePdfModel> creditNotes, OutputStream outputStream) {
1250
    public static void generateAndWriteCustomerCreditNotes(List<CreditNotePdfModel> creditNotes, OutputStream outputStream) {
1255
        Document document = new Document();
1251
        Document document = new Document();
1256
        document.setMargins(0, 0, 25, 0);
1252
        document.setMargins(0, 0, 25, 0);