I see:
( $getallline[receivedsum] = "" )
You have 1 equals sign here and this is an assigment, not a condition. You would want "==" or ( $getallline[receivedsum] == "" ) or ( $getallline[receivedsum] != "" ) instead.
Although this may not be a problem right now, but may cause problems later:
You'll want ( and ) around the entire conditional statement so instead of:
( $getallline[receivedsum] = "" ) ? '$getallline[receivedsum]="0"' : $getallline[receivedsum];
You'd have:
(( $getallline[receivedsum] = "" ) ? '$getallline[receivedsum]="0"' : $getallline[receivedsum]);
I've seen PHP hang up on this depending on if you're putting it inline with other code. Here, it may not be a problem, but something to watch for...