# Sponge Document Template

**URL:** <https://www.dolibarr.org/forum/t/sponge-document-template/29742>\
**Category:** Using my Dolibarr\
**Created:** [December 18, 2024, 7:14am UTC](https://www.dolibarr.org/forum/t/sponge-document-template/29742 "2024-12-18T07:14:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sribalaji.tvn](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/s/848f3c/32.png) [@sribalaji.tvn](https://www.dolibarr.org/forum/u/sribalaji.tvn)\
**Post date:** [December 18, 2024, 7:14am UTC](https://www.dolibarr.org/forum/t/sponge-document-template/29742/1 "2024-12-18T07:14:37Z")

</div>

We are using “Sponge Document Template” for customer invoice. It will be good not to print Tax information and remaining unpaid if the values are Zero. It will save space of the Invoice. please find attached image

 ![doli](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/e/e13ae3c1d1bd46b06a2163987df33daeafb76844.png)

---

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [December 18, 2024, 5:16pm UTC](https://www.dolibarr.org/forum/t/sponge-document-template/29742/2 "2024-12-18T17:16:10Z")

</div>

which dolibarr and php version?

---

<div class="post-metadata">

**Author:** ![sribalaji.tvn](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/s/848f3c/32.png) [@sribalaji.tvn](https://www.dolibarr.org/forum/u/sribalaji.tvn)\
**Post date:** [December 18, 2024, 5:37pm UTC](https://www.dolibarr.org/forum/t/sponge-document-template/29742/3 "2024-12-18T17:37:25Z")

</div>

Dolibarr - 20.0.2  
PHP version - 8.1.31

---

<div class="post-metadata">

**Author:** ![sribalaji.tvn](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/s/848f3c/32.png) [@sribalaji.tvn](https://www.dolibarr.org/forum/u/sribalaji.tvn)\
**Post date:** [April 2, 2025, 3:17pm UTC](https://www.dolibarr.org/forum/t/sponge-document-template/29742/4 "2025-04-02T15:17:28Z")

</div>

![IGST](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/3/3ffff510d1fcce6d8a38c24a68022ed730fdb792.jpeg)

Would be great if the following logic implemented in the Invoice printing (Tax details)…  
If Tax-2 & Tax-3 used then no need to print Tax-1  
Since In India either Tax-1 used OR Tax-2 & Tax-3 used.for both Sales and Purchase (All 3 tax are not used anywhere).  
Also if Remaining unpaid=0 then need not to print this line (to save the space)  
thank you

---

<div class="post-metadata">

**Author:** ![GhanshyamParmar](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/ghanshyamparmar/32/9018_2.png) [@GhanshyamParmar](https://www.dolibarr.org/forum/u/GhanshyamParmar)\
**Post date:** [March 28, 2026, 5:13am UTC](https://www.dolibarr.org/forum/t/sponge-document-template/29742/5 "2026-03-28T05:13:10Z")

</div>

core/modules/facture/doc/pdf\_sponge.modules.php  
Inside the class pdf\_sponge , locate the method drawTotalTable and find the section that displays the VAT breakdown.

```auto
if (!getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) {
    // VAT
    foreach ($this->tva_array as $tvakey => $tvaval) {
        if ($tvakey != 0 || getDolGlobalString('INVOICE_SHOW_ALSO_VAT_LINE_IF_ZERO')) {
            // ... output the line
        }
    }
}

```

Replace the `if` condition with one that also checks that the tax amount is not zero:

```auto
if (($tvakey != 0 || getDolGlobalString('INVOICE_SHOW_ALSO_VAT_LINE_IF_ZERO')) && $tvaval['amount'] != 0) {

```

---

<div class="post-metadata">

**Author:** ![sribalaji.tvn](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/s/848f3c/32.png) [@sribalaji.tvn](https://www.dolibarr.org/forum/u/sribalaji.tvn)\
**Post date:** [March 28, 2026, 6:33am UTC](https://www.dolibarr.org/forum/t/sponge-document-template/29742/6 "2026-03-28T06:33:38Z")

</div>

Respected Ghanshyam Parmar

Well Done !!! Great Work!!!

“0” valued tax lines are hided now. The invoice is nice looking and saved printing cost
