Total Comprobantes AFIP

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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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);
})();