<td colspan="3"><div style="text-align:left; float"><font color="red">WARNING!</font>
Removing or changing categories is permanent! Each category one must have an unique ID.
Blank a category name to remove it. LOG records will change to the
- <b>Unspecified</b> (id 1) category! And the category <b>Unspecified</b>, can't be removed!
+ <b>Unspecified</b> (id 1) category! And the categories <b>Unspecified</b>, <b>Income</b> and <b>Expense</b> can't be removed!
</div>
</td>
</tr>
if($pnm ne $cnm || $pds ne $cds){
- if($cid!=1 && $pnm eq ""){
+ if( ($cid!=1 && $cid!=32 && $cid!=35) && $pnm eq ""){
$s = "SELECT rowid, ID_CAT FROM LOG WHERE ID_CAT =".$cid.";";
$d = $db->prepare($s);
my $cats = qq(<select id="cats" name="cats"><option value="0">---</option>\n);
$dbs = dbExecute("SELECT ID, NAME, DESCRIPTION FROM CAT ORDER BY ID;");
while ( my @row = $dbs->fetchrow_array() ) {
+
$cats .= qq(<option value="$row[0]">$row[1]</option>\n);
}
$cats .= '</select>';
/*
- Programed in vim by: Will Budic
+ Programed by: Will Budic
Open Source License -> https://choosealicense.com/licenses/isc/
*/
var DEF_BACKGROUND = 'white';
+var RTF_DOC_RESIZED = false;
+var RTF_DOC_ORIG;
+
function loadedBody(toggle) {
firstDay: 1
});
+ $('#srh_date_from').datepicker({
+ dateFormat: 'yy-mm-dd',
+ firstDay: 1
+ });
+
+ $('#srh_date_to').datepicker({
+ dateFormat: 'yy-mm-dd',
+ firstDay: 1
+ });
$('#ed').poshytip({
content: "Select here date and time of your log.",
className: 'tip-yellowsimple',
DEF_BACKGROUND = RGBToHex($('#editor-container').css('background-color'));
$("#fldBG").val(DEF_BACKGROUND);
+ // $( function() {
+ var amf = $( "#amf" );//Amount Field Type dropdown
+ var ec = $( "#ec" ); //Category dropdown
+
+ $( amf ).selectmenu({style: "dropdown", width:120,
+ change: function( event, data ) {
+ var evv =ec.val();
+ if(ec.val()<2||evv==32||evv==35||data.item.value == 0){
+ var sel = null;
+ if(data.item.label == "Income"){ sel = 35; }
+ else if(data.item.label == "Expense"){sel = 32; }
+ else if(data.item.value == 0 && (evv == 35||evv==32)){sel = 1; }
+ if(sel){
+ ec.val(sel);
+ ec.selectmenu("refresh");
+ }
+ }
+ }});
+
}
-function encodeText(el) {
+function encodeText(el){
var el = $("#frm_entry [name=log]");
var txt = el.val();
txt = txt.replace(/\r\n/g, "\\n");
return false;
}
-
-
-var RTF_DOC_RESIZED = false;
-var RTF_DOC_ORIG;
function resizeDoc() {
var css = $("#editor-container").prop('style');
if(RTF_DOC_RESIZED){
function RGBToHex(rgb) {
// Choose correct separator
- let sep = rgb.indexOf(",") > -1 ? "," : " ";
+ var sep = rgb.indexOf(",") > -1 ? "," : " ";
// Turn "rgb(r,g,b)" into [r,g,b]
rgb = rgb.substr(4).split(")")[0].split(sep);
- let r = (+rgb[0]).toString(16),
+ var r = (+rgb[0]).toString(16),
g = (+rgb[1]).toString(16),
b = (+rgb[2]).toString(16);
- if (r.length == 1)
- r = "0" + r;
- if (g.length == 1)
- g = "0" + g;
- if (b.length == 1)
- b = "0" + b;
+ if (r.length == 1) r = "0" + r;
+ if (g.length == 1) g = "0" + g;
+ if (b.length == 1) b = "0" + b;
return "#" + r + g + b;
}