返回
[error] [client 127.0.0.1] Argument "" isn't numeric in numeric ne (!=) at ./pro/mscquo2.pl line 557
[error] [client 127.0.0.1] Argument "" isn't numeric in numeric ne (!=) at ./pro/mscquo2.pl line 591
[error] [client 127.0.0.1] Argument "" isn't numeric in numeric ne (!=) at ./pro/mscquo2.pl line 773
557:if ( $t{A1} != 0 ) {
591:if ( $t{pl1}[$n] != 0 ) {
773:if ( $t{pl1}[$n] != 0 ) {
分析:
mysql> select partsid from enq1 where id = 12399;
+----------+
| partsid |
+----------+
| 179==3=4 |
+----------+
修改如下:
557:if ( $t{A1} ) {
591:if ( $t{pl1}[$n] ) {
773:if ( $t{pl1}[$n] ) {
[error] [client 127.0.0.1] Argument "P0" isn't numeric in multiplication (*) at ./pro/mscquo2.pl line 108, line 11.
[error] [client 127.0.0.1] Use of uninitialized value in multiplication (*) at ./pro/mscquo2.pl line 869, line 11.,
[error] [client 127.0.0.1] Use of uninitialized value in concatenation (.) or string at ./pro/mscquo2.pl line 882,
108: $t{ppp1} = int($t{prices}[$n]*$t{pe}[$n]/100);
869: $t{price2} = $t{pri}[$t{NO}-1]*$t{Q1};
882: $t{line1} .= $t{pri}[$t{NO}-1] . '">' . '
';
==>修改如下
if ( $t{price0} ne 'P0' ) { # 追加
if ( $t{pri}[$t{NO}-1] ) {
$t{price2} = $t{pri}[$t{NO}-1]*$t{Q1};
} else {
$t{price2} = 0;
}
if ($t{pri}[$t{NO}-1]) {
$t{line1} .= $t{pri}[$t{NO}-1] . '">' . '
';
} else {
$t{line1} .= '"0>' . '
';
}
增加"THE PRICE IS NOT INCLUDING PACKING & HANDING CHARGE."按钮选择(EXCEL自动写入)
quo2.htm,default,选择功能。
mscquo2.pl/write_excel.pl
quo2表格增加项目:pi_ok=1,写入,default是1;pi_ok=0,不写
增加表格packing_ok,1:OK;2:NG
最后的零件的价格是0的话,数据库的长度出错。不能再现。似乎已解决?
# ORIGINid
$t{ORIGIN1} = $t{q}->param("ORIGIN1");
$t{sql} = 'UPDATE quo2 set ORIGINid = "';
$t{sql} .= $t{ORIGIN1} . '" where id = ';
$t{sql} .= $t{quo2_id};
$t{DO} = $self->dbh->do($t{sql});
==>
# POKid
$t{POK1} = $t{q}->param("POK1");
$t{sql} = 'UPDATE quo2 set pi_ok = "';
$t{sql} .= $t{POK1} . '" where id = ';
$t{sql} .= $t{quo2_id};
$t{DO} = $self->dbh->do($t{sql});
==>
mysql> update quo2 set pi_ok = 2 where id = 12395;
Query OK, 1 row affected (0.08 sec)
Rows matched: 1 Changed: 1 Warnings: 0
# ORIGIN输出
$t{sth} = $self->dbh->prepare("select id, ORIGIN from enq2_origin");
$t{sth}->execute;
while (@rec = $t{sth}->fetchrow_array) {
$row_ref = (); # 这个初始化非常重要!
if ( $rec[0] == $t{ORIGINid} ) {
$t{line1} = '';
} else {
$t{line1} = '';
}
$$row_ref{line1} = $t{line1};
push(@origin_loop, $row_ref);
}
$t{sth}->finish;
==>
# POK输出
$t{sth} = $self->dbh->prepare("select id, PACKING1 from packing_ok");
$t{sth}->execute;
while (@rec = $t{sth}->fetchrow_array) {
$row_ref = (); # 这个初始化非常重要!
if ( $rec[0] == $t{POKid} ) {
$t{line1} = '';
} else {
$t{line1} = '';
}
$$row_ref{line1} = $t{line1};
push(@pok_loop, $row_ref);
}
$t{sth}->finish;
$t{template}->param(ORIGIN_LOOP => \@origin_loop);
==>
$t{template}->param(POK_LOOP => \@pok_loop);
$t{ORIGINid} = $t{e}[2];
==>
$t{POKid} = $t{e}[18];
mysql> select * from packing_ok;
+----+----------+
| id | PACKING1 |
+----+----------+
| 1 | OK |
| 2 | NG |
+----+----------+
2 rows in set (0.00 sec)
c:\database\sql>mysql cookbook < packing_ok.sql -u cbuser -p
Enter password: ******
packing_ok.sql
DROP TABLE IF EXISTS packing_ok;
CREATE TABLE packing_ok
(
id INT AUTO_INCREMENT,
PACKING1 varchar(20),
PRIMARY KEY (id)
);
INSERT INTO packing_ok (PACKING1) VALUES("OK");
INSERT INTO packing_ok (PACKING1) VALUES("NG");
mysql> ALTER TABLE quo2 ADD pi_ok INT DEFAULT 1;
Query OK, 12395 rows affected (1.38 sec)
Records: 12395 Duplicates: 0 Warnings: 0
mysql> show columns from quo2;
+-----------+---------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+---------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| time | date | YES | | NULL | |
| ORIGINid | int(11) | YES | | NULL | |
| PRICEid | int(11) | YES | | NULL | |
| PAYMENTid | int(11) | YES | | NULL | |
| DELIVERY | text | YES | | NULL | |
| money | int(11) | YES | | NULL | |
| percent0 | int(11) | YES | | NULL | |
| discount0 | int(11) | YES | | NULL | |
| percent | text | YES | | NULL | |
| discount | text | YES | | NULL | |
| price | text | YES | | NULL | |
| D_FEE | text | YES | | NULL | |
| total | text | YES | | NULL | |
| memo | text | YES | | NULL | |
| disc0 | int(11) | YES | | NULL | |
| disc | text | YES | | NULL | |
| price0 | text | YES | | NULL | |
| pi_ok | int(11) | YES | | 1 | |
+-----------+---------+------+-----+---------+----------------+
19 rows in set (0.05 sec)
mysql> show columns from quo2;
+-----------+---------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+---------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| time | date | YES | | NULL | |
| ORIGINid | int(11) | YES | | NULL | |
| PRICEid | int(11) | YES | | NULL | |
| PAYMENTid | int(11) | YES | | NULL | |
| DELIVERY | text | YES | | NULL | |
| money | int(11) | YES | | NULL | |
| percent0 | int(11) | YES | | NULL | |
| discount0 | int(11) | YES | | NULL | |
| percent | text | YES | | NULL | |
| discount | text | YES | | NULL | |
| price | text | YES | | NULL | |
| D_FEE | text | YES | | NULL | |
| total | text | YES | | NULL | |
| memo | text | YES | | NULL | |
| disc0 | int(11) | YES | | NULL | |
| disc | text | YES | | NULL | |
| price0 | text | YES | | NULL | |
+-----------+---------+------+-----+---------+----------------+
18 rows in set (0.14 sec)
台塑输入时,自动选择FCA==>已取消
mysql> select * from enq2_price;
+----+------------------+
| id | PRICE |
+----+------------------+
| 1 | EXW KOBE (OSAKA) |
| 2 | EXW JAPAN |
| 3 | FOB KOBE (OSAKA) |
| 4 | FCA |
| 5 | CFR KAOHSIUNG |
| 6 | EXW CHINA |
| 7 | EXW EUROPE |
| 8 | EXW KOREA |
+----+------------------+
8 rows in set (0.00 sec)
[Sun Sep 12 12:12:46 2010] [error] [client 127.0.0.1] Argument "C" isn't numeric in numeric ne (!=) at ./pro/mscquo2.pl line 559, line 11., referer: http://localhost/cgi-bin/msc_start.cgi
[Sun Sep 12 12:12:46 2010] [error] [client 127.0.0.1] Argument "C" isn't numeric in numeric ne (!=) at ./pro/mscquo2.pl line 739, line 11.,
558:for $n ( 0 .. $#{ $t{pl1} } ) {
559: if ( $t{pl1}[$n] != 0 ) {
$t{pl2}++;
}
}
738:for $n ( 0 .. $#{ $t{pl1} } ) {
739: if ( $t{pl1}[$n] != 0 ) {
$t{pl2}++;
}
}
修改如下:
$t{pl2} = 0;
if ( $t{partsid} ne 'C' ) {
@{ $t{pl1} } = split(/=/,$t{partsid});
for $n ( 0 .. $#{ $t{pl1} } ) {
if ( $t{pl1}[$n] != 0 ) {
$t{pl2}++;
}
}
}