Subversion Repositories cheapmusic

Rev

Rev 113 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 113 Rev 121
Line 127... Line 127...
127
            return true;
127
            return true;
128
        }
128
        }
129
    }
129
    }
130
 
130
 
131
    public static function GTINCalcCheckDigit($p_sGTINCode) {
131
    public static function GTINCalcCheckDigit($p_sGTINCode) {
-
 
132
        $p_sGTINCode = (string)trim($p_sGTINCode);
-
 
133
        if (preg_match('/[^0-9]/', $p_sGTINCode)) return false;
-
 
134
 
132
        $p_sGTINCode .= '0';
135
        $p_sGTINCode .= '0';
133
        $sGTINCode = trim($p_sGTINCode);
136
        $sGTINCode = trim($p_sGTINCode);
134
        $length = strlen($sGTINCode);
137
        $length = strlen($sGTINCode);
135
        if (($length > 11 && $length <= 14) || $length == 8) {
138
        if (($length > 11 && $length <= 14) || $length == 8) {
136
            $zeroes = 18 - $length;
139
            $zeroes = 18 - $length;