🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.php
Article #231095

Re: Problem z właściwym sumowaniem

#231095
From: Borys Pogoreło
Date: Sun, 12 Jul 2015 19:06
21 lines
1578 bytes
Dnia Sun, 12 Jul 2015 11:57:57 -0700 (PDT), Dariusz Budyta napisał(a):

> Zastosowanie:
> $buf = str_replace('[suma]', round00($wartosc_brutto), $buf);
> zwrociło mi ostatnią wartość brutto - zależy mi na tym aby zwracało sumę tych wartośći brutto

W pętli przetwarzającej pozycje faktury powinieneś po prostu zwiększać
jakąś zmienną, typu:

$wartosc_brutto += $brutto;

Ale ten podział powinieneś prowadzić w rozbiciu na stawki VAT, czyli
raczej:

$podsumowanie_vat[$stawka_vat]['netto'] += $netto;
$podsumowanie_vat[$stawka_vat]['brutto'] += $brutto;
$podsumowanie_vat[$stawka_vat]['vat'] += $vat;

-- 
Borys Pogoreło
borys(#)leszno,edu,pl
Technical Details
Message-ID: <7tb5ymxudefi.117rn53zd75f4.dlg@40tude.net>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!news.promontel.net.pl!not-for-mail
References: <9ecf2928-3e4b-4d12-8383-9217f3a32d17@googlegroups.com> <4c9b067d-a24e-46e3-ba29-494470a27ba7@googlegroups.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!news.promontel.net.pl!not-for-mail
From: Borys Pogoreło <borys@pl.edu.leszno>
Newsgroups: pl.comp.lang.php
Subject: Re: Problem z właściwym sumowaniem
Date: Sun, 12 Jul 2015 21:06:46 +0200
Organization: snafu
Lines: 21
Message-ID: <7tb5ymxudefi.117rn53zd75f4.dlg@40tude.net>
References: <9ecf2928-3e4b-4d12-8383-9217f3a32d17@googlegroups.com> <4c9b067d-a24e-46e3-ba29-494470a27ba7@googlegroups.com>
NNTP-Posting-Host: bbh208.neoplus.adsl.tpnet.pl
Mime-Version: 1.0
X-Trace: thunar.promontel.net.pl 1436727995 10884 83.27.197.208 (12 Jul 2015 19:06:35 GMT)
X-Complaints-To: abuse@promontel.net.pl
NNTP-Posting-Date: Sun, 12 Jul 2015 19:06:35 +0000 (UTC)
User-Agent: 40tude_Dialog/2.0.14.1pl
X-fnord: obey.
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit