Example #1
0
 function testOpenRings()
 {
     lttLib::clear();
     $d = new DeptKey();
     $this->assertEquals(true, $d->check('100DP10'));
     $json = $d->parse('100DP10');
     $this->assertInternalType('array', $json);
     $record = lttLib::genericRecord();
     $record['upc'] = '1DP1';
     $record['description'] = 'BBAKING';
     $record['trans_type'] = 'D';
     $record['department'] = 1;
     $record['quantity'] = 1;
     $record['foodstamp'] = 1;
     $record['unitPrice'] = 1.0;
     $record['total'] = 1.0;
     $record['regPrice'] = 1.0;
     $record['ItemQtty'] = 1;
     lttLib::verifyRecord(1, $record, $this);
     CoreLocal::set('currentid', 1);
     $v = new Void();
     $this->assertEquals(true, $v->check('VD'));
     $json = $v->parse('VD');
     $this->assertInternalType('array', $json);
     $record['total'] *= -1;
     $record['quantity'] *= -1;
     $record['ItemQtty'] *= -1;
     $record['voided'] = 1;
     $record['trans_status'] = 'V';
     lttLib::verifyRecord(2, $record, $this);
     lttLib::clear();
     CoreLocal::set('refund', 1);
     CoreLocal::set('refundComment', 'TEST REFUND');
     $d = new DeptKey();
     $this->assertEquals(true, $d->check('100DP10'));
     $json = $d->parse('100DP10');
     $this->assertInternalType('array', $json);
     $record = lttLib::genericRecord();
     $record['upc'] = '1DP1';
     $record['description'] = 'BBAKING';
     $record['trans_type'] = 'D';
     $record['trans_status'] = 'R';
     $record['department'] = 1;
     $record['quantity'] = -1;
     $record['foodstamp'] = 1;
     $record['unitPrice'] = 1.0;
     $record['total'] = -1.0;
     $record['regPrice'] = 1.0;
     $record['ItemQtty'] = 1;
     lttLib::verifyRecord(1, $record, $this);
     CoreLocal::set('currentid', 1);
     $v = new Void();
     $this->assertEquals(true, $v->check('VD'));
     $json = $v->parse('VD');
     $this->assertInternalType('array', $json);
     $record['total'] *= -1;
     $record['quantity'] *= -1;
     $record['ItemQtty'] *= -1;
     $record['voided'] = 1;
     $record['trans_status'] = 'V';
     lttLib::verifyRecord(2, $record, $this);
 }