🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Problem z właściwym sumowaniem

#231097
From: Dariusz Budyta
Date: Sun, 12 Jul 2015 19:32
65 lines
3837 bytes
W dniu niedziela, 12 lipca 2015 21:02:15 UTC+2 użytkownik Borys Pogoreło napisał:

> Zacznijmy od tego, że ten przykład to jest jakaś masakra... Wymieszany kod
> z prezentacją, nieczytelny układ i nazwy zmiennych. Gdybyś to sprowadził do
> czytelniejszej postaci, to znacznie łatwiej by Ci było znaleźć błąd.
> 
> A tych błędów tu jest sporo:
 Dotarło to do mnie i to jeszcze jak.

> To jest przykład jak nie nazywać zmiennych. Jak ktoś ma pomóc, jeśli widzi
> jakieś $n_kier? Co to jest n_kier? Co oznacza $nf? Żeby chociaż tam były
> jakieś komentarze. Czy dobrze zgaduję, że n_kier to faktura wystawiana od
> cen netto, a nf to numer faktury?

CREATE TABLE `import_pozycje` (
	`nf` VARCHAR(250) NULL DEFAULT NULL,
	`N_Kier` INT(11) NULL DEFAULT NULL,
	`ilosc` FLOAT NULL DEFAULT NULL,
	`svat` VARCHAR(250) NULL DEFAULT NULL,
	`liczba` FLOAT NULL DEFAULT NULL,
	`usl` VARCHAR(250) NULL DEFAULT NULL,
	`sww` FLOAT NULL DEFAULT NULL,
	`netto` FLOAT NULL DEFAULT NULL,
	`dzial` VARCHAR(250) NULL DEFAULT NULL,
	`ID` INT(11) NOT NULL AUTO_INCREMENT,
	PRIMARY KEY (`ID`),
	INDEX `nf` (`nf`(191))
CREATE TABLE `import_faktury` (
	`nf` VARCHAR(90) NOT NULL DEFAULT '',
	`dw` DATE NULL DEFAULT NULL,
	`ds` DATE NULL DEFAULT NULL,
	`sz` INT(11) NULL DEFAULT NULL,
	`onip` VARCHAR(250) NULL DEFAULT NULL,
	`wnip` VARCHAR(250) NULL DEFAULT NULL,
	`N_Kier` INT(11) NULL DEFAULT NULL,
	`kf` VARCHAR(250) NULL DEFAULT NULL,
	`nazwa` VARCHAR(250) NULL DEFAULT NULL,
	`info` VARCHAR(250) NULL DEFAULT NULL,
	`idz` VARCHAR(250) NULL DEFAULT NULL,
	`fadres` VARCHAR(250) NULL DEFAULT NULL,
	`fkod` VARCHAR(250) NULL DEFAULT NULL,
	`fmiasto` VARCHAR(250) NULL DEFAULT NULL,
	`pobrano` INT(11) NULL DEFAULT '0',
	`wydrukowano` INT(11) NULL DEFAULT '0',
	`data_pobrania` DATE NULL DEFAULT NULL,
	PRIMARY KEY (`nf`)
)
CREATE TABLE `user` (
	`login` VARCHAR(90) NOT NULL,
	`haslo` VARCHAR(250) NOT NULL,
	`iduser` INT(11) NULL DEFAULT NULL,
	`nip` VARCHAR(90) NULL DEFAULT NULL,
	`nazwa` VARCHAR(250) NULL DEFAULT NULL,
	`ulica` VARCHAR(250) NULL DEFAULT NULL,
	`kod_pocztowy` VARCHAR(250) NULL DEFAULT NULL,
	`miejscowosc` VARCHAR(250) NULL DEFAULT NULL,
	`N_Kier` INT(11) NULL DEFAULT NULL,
	`pobral` INT(11) NULL DEFAULT '0',
	`wydrukowal` INT(11) NULL DEFAULT '0',
	`data_pobrania` DATE NULL DEFAULT NULL,
	`mail` VARCHAR(250) NULL DEFAULT NULL,
	PRIMARY KEY (`login`),
	UNIQUE INDEX `nip` (`nip`)
)
zrzuciłem tabele z Mysql-a
Technical Details
Message-ID: <2934c9eb-d885-491a-b954-221bb785ec8b@googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!news.cyf-kr.edu.pl!news.nask.pl!news.nask.org.pl!newsfeed.pionier.net.pl!news.glorb.com!qs7no4331198igc.0!news-out.google.com!w15ni32543qge.0!nntp.google.com!z61no527492qge.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
References: <9ecf2928-3e4b-4d12-8383-9217f3a32d17@googlegroups.com> <ro5zd7pcdi70.3ixvest5m2xc.dlg@40tude.net>

Show Full Headers
Complete Article Headers
X-Received: by 10.66.237.2 with SMTP id uy2mr41526330pac.11.1436729556444;        Sun, 12 Jul 2015 12:32:36 -0700 (PDT)
X-Received: by 10.140.98.117 with SMTP id n108mr77320qge.23.1436729556204; Sun, 12 Jul 2015 12:32:36 -0700 (PDT)
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!news.cyf-kr.edu.pl!news.nask.pl!news.nask.org.pl!newsfeed.pionier.net.pl!news.glorb.com!qs7no4331198igc.0!news-out.google.com!w15ni32543qge.0!nntp.google.com!z61no527492qge.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: pl.comp.lang.php
Date: Sun, 12 Jul 2015 12:32:36 -0700 (PDT)
In-Reply-To: <ro5zd7pcdi70.3ixvest5m2xc.dlg@40tude.net>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=89.70.25.54; posting-account=uubveQoAAAAyhe8ojI_0uIXBprAYrcIW
NNTP-Posting-Host: 89.70.25.54
References: <9ecf2928-3e4b-4d12-8383-9217f3a32d17@googlegroups.com> <ro5zd7pcdi70.3ixvest5m2xc.dlg@40tude.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2934c9eb-d885-491a-b954-221bb785ec8b@googlegroups.com>
Subject: Re: Problem z właściwym sumowaniem
From: Dariusz Budyta <dariusz.budyta@gmail.com>
Injection-Date: Sun, 12 Jul 2015 19:32:36 +0000
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit