Code Duplication    Length = 11-16 lines in 2 locations

src/Intraface/modules/accounting/Year.php 2 locations

@@ 258-273 (lines=16) @@
255
     *
256
     * @return 1 = year set; 0 = year NOT set
257
     */
258
    private function _isValid()
259
    {
260
        $sql = "SELECT id FROM accounting_year
261
            WHERE id = ".$this->id."
262
                AND intranet_id = ". $this->kernel->intranet->get('id') . " AND active = 1";
263
264
        $db = new DB_Sql;
265
        $db->query($sql);
266
267
268
        if (!$db->nextRecord()) {
269
            return false;
270
        }
271
272
        return true;
273
    }
274
275
    function vatAccountIsSet()
276
    {
@@ 291-301 (lines=11) @@
288
     *
289
     * @return boolean
290
     */
291
    public function isYearOpen()
292
    {
293
        $db = new Db_Sql;
294
        $db->query("SELECT locked FROM accounting_year WHERE id = " . $this->id . " AND intranet_id = ".$this->kernel->intranet->get('id'));
295
        if ($db->nextRecord()) {
296
            if ($db->f('locked') == 1) {
297
                return false;
298
            }
299
        }
300
        return true;
301
    }
302
303
    /**
304
     * is the date in the current year