Total Comprobantes AFIP

Muestra un label con la suma de pesos totales para los comprobantes generados.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Total Comprobantes AFIP
// @namespace    http://tampermonkey.net/
// @version      2024-11-28
// @description  Muestra un label con la suma de pesos totales para los comprobantes generados.
// @author       @AcademicoMDP
// @match        https://fe.afip.gob.ar/rcel/jsp/buscarComprobantesGenerados.do
// @icon         https://www.google.com/s2/favicons?sz=64&domain=gob.ar
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Get the totals
    let total = 0;
    const tds = document.querySelectorAll(".jig_table tbody tr[class] td[title^='Importe']")
    tds.forEach(td => {
        const value = parseFloat(td.textContent.trim());
        if (!isNaN(value)) {
            total += value;
        }
    })

    // Format as Currency
    const formattedTotal = Intl.NumberFormat('es-AR', { style: 'currency', currency: 'ARS'}).format(total)

    // Create floating label
    const floatingLabel = document.createElement('div');
    floatingLabel.textContent = `Total: ${formattedTotal}`;
    floatingLabel.style.position = 'fixed';
    floatingLabel.style.top = '10px';
    floatingLabel.style.right = '10px';
    floatingLabel.style.backgroundColor = 'rgba(0, 0, 0, 0.8)';
    floatingLabel.style.color = 'white';
    floatingLabel.style.padding = '10px 15px';
    floatingLabel.style.borderRadius = '5px';
    floatingLabel.style.boxShadow = '0px 4px 6px rgba(0, 0, 0, 0.1)';
    floatingLabel.style.zIndex = '1000';
    floatingLabel.style.fontSize = '14px';

    // Append label to body
    document.body.appendChild(floatingLabel);
})();