You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
1.8 KiB
JavaScript

globalThis._validasi = function () {
var d = globalThis['debit'].parent.value.number();
var k = globalThis['kredit'].parent.value.number();
if (d != k) {
Swal('Warning', 'Jurnal harus balance', 'warning');
throw 'jurnal harus balance';
}
};
globalThis._update = function () {
var q = [];
if (globalThis.insertS != undefined) {
q.push(globalThis.insertS);
};
if (globalThis.updateS != undefined) {
q.push(globalThis.updateS);
};
if (globalThis.insertSq != undefined) {
q.push(globalThis.insertSq);
};
if (globalThis.updateSq != undefined) {
q.push(globalThis.updateSq);
};
var dp = cssLoader();
var c = 0;
(function gld() {
if (c < q.length) {
AuditDevQuery(q[c], function () {
c++;
gld();
})
} else {
dp.remove();
}
})();
};
globalThis._insert = function () {
var q = [];
if (globalThis.insertS != undefined) {
q.push(globalThis.insertS);
};
if (globalThis.updateS != undefined) {
q.push(globalThis.updateS);
};
if (globalThis.insertSq != undefined) {
q.push(globalThis.insertSq);
};
if (globalThis.updateSq != undefined) {
q.push(globalThis.updateSq);
};
var dp = cssLoader();
var c = 0;
(function gld() {
if (c < q.length) {
AuditDevQuery(q[c], function () {
c++;
gld();
});
} else {
dp.remove();
}
})();
};
globalThis._delete = function (kode) {
var dp = cssLoader();
AuditDevQuery(`DELETE FROM bb WHERE kode = "${kode}" `, function (a) {
AuditDevQuery(`DELETE FROM lap_bb WHERE kode = "${kode}" `, function (a) {
dp.remove();
});
});
};