You are on page 1of 18
sisv2017 ‘CSharp Code For Making @ Double Entty General Ledger Posting (Method 1) SEIAPORBEF ny caatnay we eeanne cever y Censeeee SE rCedger Posting (Meth ASK A QUESTION CONTRIBUTE. 2 10 12.3k Download 100% FREE Spire Office APIs INTRODUCTION Here | will discuss a programming technique | use in the C# platform to perform a double entry posting to a general ledger in a Chart Of Accounts application I made for a long time customer. This is actually the first of two methods used in this program. | will discuss the second method in a later article. ‘THE FIRST STEP Initially, we need to key in the total amount to process for the double entry posting operation. You enter this amount in either the “Total Debit Amount” or “Total Credit Amount” textbox in the screen below igures 1 & 2), The transaction type and transaction description also need to be entered. Next, click the corresponding button for either the “Total Debit Amount For Double Entry Posting’ or “Total Credit Amount For Double Entry Posting”. One thing to note - this step is not yet performing the double entry posting - we are merely setting up for doing that next. 4 Abd snt env De iy Pigs o x Figure 1: Entry htipslww.c-harpomer.con/UploadFile!87o8e4/c-sharp-code-fo 18 sisv2017 (CSharp Cade For Making a Double Entry General Ledger Posting (Method 1) CH C#Cormer Fi 2 Entry Posting Next, | present the underlying C# code that facilitates this preliminary step. For the button, “Total Debit Amount For Double Entry Posting”: ai. e2. 23 ea. es. es. e7 Long Long] convert_to_number = new long{GLAMOUNTS]; string transaction_str, debit_str, stringhutoNumber} char[] totalanount = new char[GLAMOUNTS ]; autenun_vars if (textBox_transactiondescription.Text.Length > @ 8& textBox_totaldebitanount. Text .Length { result = MessageBox.Show("Do you want to proceed with this double entry posting transactioi if (result { Dialogresult.Yes) Cursor.Current = new Cursor(currdir + "Busy_1.cur"); // get current date. DateTime saveNow = DateTime.Now; dateString = saveNow, ToString(datePatt) ; 11 grab data from Winforn controls. ‘transaction_str = textBox_transactiondescription.Text; debit_str = textBox_totaldebitanount. Text; renaiaing_offsetting_balance_str = textBox_totaldebitamount. Texts ‘textBox_renainingbalanceoftotal.Text = textBox_totaldebitanount.Text; // set the chart of accounts List box to purple to signal to the 7/ user that it is engaged to perform the debit side of the 2 postings 7] to the gl account to be clicked on in the next step. ListBox_chartofaccountslisting-BackColor = Color.MediunPurple; // disable buttons used to denote the first posting as a debi button_totaldebitanountfordoubleentryposting.Fnabled = false; button_totalcreditanountfordoubleentryposting.Enabled = false; or a credit. J] set internal flags. MakeList8oxSandyBrown = MakeListBoxtediunPurple MakeListaoxTonato = @; u ApplyoffSettingbebits = 1; ApplyoffSettingCredits = 0; // retrieve the last used auto-generated transaction posting 7/ number and increment it to the next one and then save that 11 to the sane data file. StreamReader streanabj3 = new StreanReader(curedin 4 “autonunber.txt"); streanobj3.BaseStrean.Seek(®, SeekOrigin. Begin); stringautotlunber = streano2}3.ReadLine()} streanobj3.Close(); For (a = 8; a < 35 ate) « convert_to_nunber[a] = 0; if (stringAutoNunber.Substring(a, 1) ) convert_to_nunber{a] Af (stringAutoNunber -Substring(a, 1) 5) convert_to_numberfa] = 1; Af (stringautoNunber.Substring(a, 1) == "2") convert_te_number(a] = 2; Af (stringAutotunber.Substring(a, 1) convert_to_number[a] = 3; if (SteingautoNunber-Substring(a, 1) Af (Stingautosunber-Substring(a, 1) convert_to_rumber(a] convert_te_number[a] = 53 hip lwwn.c-sharpcomer.conVUplosdFile!87b864Ie-sharp-code-fr-making-2-dovble-entry-genoralledger-postin’ 28 sisv2017 ae 101 102 103 104 05 108 107 108 109 ue a1 haa 43 aa us us 47 ua hao 12e aaa #Corner (CSharp Cade For Making a Double Entry General Ledger Posting (Method 1) if (steingautonunber.substring( ~~ unberiaj = 95 ‘autonun_var = ((convert_to_nurber[@) * 104) + (convert_to_nunber(1] * 1@) + (convert_t: autonum_var++; if (qutonun_var > 999) { ‘autonun_var = @; y for (a = 0 a < 3; at+) charval_auto_number[a] = (char)485 countervar = do « Longresult = Math.DivRen(autonum_var, 18, out long2); autonun_var = longresult; Af (long2 == @) charVal_auto_number{countervar] = (char)48; if (long2 == 1) charVal_auto_nunber{countervar] = (char)49; Af (long2 == 2) charval_auto_nunber[countervar] = (char)5@; if (long2 == 3) charval_auto_nunber{countervar] = (char)51; Af (longa == 4) charVal_auto_nunber[countervar] = (char)52; Af (long2 == 5) charVal_auto_nunber{countervar] = (char)533 if (long2 == 6) charval_auto_nunber{countervar] = (char)$4; Af (long? == 7) charVal_auto_number[countervar] = (char)553 if (long? == 8) charVal_outo_nunber[countervar] = (char)56; Af (long2 == 9) charval_aute_number[countervar] = (char)573 countervar- var > @)3 if (File.Exists(currdir + “autonunber.txt")) « y FileStrean fstreanobj2 = new FileStrean(currdir + “autonunber.txt", FileMede.Create); Streamhriter writerobj2 = new Streaniiriter(fstreancb}2); weiterobj2.WriteLine( charval_auto_nunber); writerobj2.Close(); #streanodj2.Close(); File.Delete(currdir + “autonunber.txt"); /{ zero out the “total debit anount™ textbox. ‘this. textBox_totaldebitanount .Text 0.00"; Cursor.Current = Cursors.Default; alse MessageBox.Shou("The debit and/or transaction description and/or transaction type field(s) Now for the button, “Total Credit Amount For Double Entry Posting”: an e2. 23. ea 2. 26. e7 ea. es. 10. Long ‘longl] convert_to_nunber = new long[GLAMOUNTS]; string transaction_str, credit_str, stringAutoNunber; char[] totalanount = new char[GLAMOUNTS]; autonum_vars AF (textdox_transactiondescription.Text.Length > @ && textBox_totalcreditamount Text Leng: { hip lwwn.c-sharpcomer.conVUplosdFile!87b864Ie-sharp-code-fr-making-2-dovble-entry-genoralledger-postin’ 38 sisv2017 (CSharp Cade For Making a Double Entry General Ledger Posting (Method 1) 4#c8mer Cursor.Current = new Cursor(curedin + -wusy_1.cur 95 J/ get current date. DateTime saveNow = DateTine.Now; dateString = saveliow.ToString(datePatt); J/ grab data fron Winform controls. transaction_str = textBox_transactiondescription.Text; credit_ste = textBox_totaicreditanaunt. Text; renaining_offsetting_balance_str = textBox_totalcreditanount . Text ‘textox_renainingbalanceoftotal. Text = textox_totalcreditanount. Text; J/ set the chart of accounts List box to purple to signal to the 7/ user that it is engaged to perform the credit side of the 2 postings 7/ to the gl account to be clicked on in the next step. ListBox_chartofaccountslisting.dackColor = Color.MediunPurple; // disable buttons used to denote the first posting as a debit or a credit button _totaldebitanountfordoubleentryposting.Enabled = false; button_totalcreditanountfordoubleentryposting.Enabled = false; J/ set internal flags MakeListBoxSandyBrown = 03 MakeListloxMediunPurple = 13 MakelistBoxTonato = 2; Applyoffsettingdebits ApplyoffSettingcredits J/ retrieve the last used auto-generated transaction posting 7/ number and increment it to the next one and then save that W/ to the same data File. StreanReader streanobj3 = new StreanReader(currdir + “autonumber.txt"); streanobj3.BaseStrean.Seek(@, SeekOrigin. Begin); stringdutoNunber = streancbj3.ReadLine(); streamobj3.Close() for (a q 5 att) convert_to_nunber[a] = 95 if (stringlutoNunber.Substring(a, 1) Af (stringautoNunber. Substring(@, 1) Af (stringdutoNunber.Substring(a, 1) Af (stringdutoNunber.Substring(a, 1) Af (stringautoNunber.Substring(a, 1) Af (stringautoNunber Substeing(a, 1) Af (stringdutoNunber.Substring(a, 1) Af (stringautoNunber Substring(a, 1) Af (stringautoNunber.Substring(a, 1) Af (stringdutoNunber Substring(a, 1) convert_to_nunber[a] convert_to_nunber(a] convert_to_nunber[a] convertto_nunber(a] convert_to_nunber[a] convert_tonunber[a] convert _to_nunber(a] convert _to_nunber[a] convert_to_nunber(a] convert_to_nunber[a] } autonum_var = ((convert_to_nunber[@) * 108) + (convert_to_number{1] * 10) + (convert_ ‘autonun_var++s if (autonum_var > 999) t y autonum_var = 0; for (a = @; a < 3; att) charVal_auto_oumber[a] = (char)48; countervar = 25 do { Jongresult = Math.DivRem(autonum_var, 1@, out long2); autonum_var = longresult; Af (long2 == @) charVal_auto_nunber[countervar] = (char)48; Af Clong2 == 1) charVal_auto_number{ countervar] = (char)49; Af Clong2 == 2) charVal_auto_nunber[countervar] = (char)50; Af (long2 == 3) charVal_auto_number[ countervar] = (char)$1; hip lwwn.c-sharpcomer.conVUplosdFile!87b864Ie-sharp-code-fr-making-2-dovble-entry-genoralledger-postin’ ane. sisv2017 93 94. 95. 96. 97. 98 99. 10@ 101 02 103 104 105 1096 107 108 109 ue a1 a2 13 haa, us he a7 ia us ne a aa Af Clonge ; #Comer i¢ (onge 1 92. (CSharp Cade For Making a Double Entry General Ledger Posting (Method 1) 7) charvat_autoln © > 855 8) charVal_auto_n 565 if (Longe == 9) charVal_aute_numper| countervar) = (cnar)57} countervar- } while (autonum_var > @); if (File.Exists(currdir + “autonunber.txt")) { y File.belete(currdir + “autonunber. tx FileStream fstreanobj2 = new FileStrean(currdir + "autonunber.txt", FLleMode.Create); Streanuriter writerobj2 = new Streambriter(fstrearobj2); writerodj2.WriteLine(charval_auto_number); uriterob j2-Close(); fstreanobj2.Close(); J/ zero out the “total credit amount" textbox. ‘this. textBox_totalcreditarount. Text 0.00"; Cursor.Current = Cursors.Default; else MessageBox.Show("The credit and/or transaction description and/or transaction type Field NOW FOR THE POSTING CODE After keying in a debit or credit amount for the initial posting operation and clicking the corresponding button beneath its textbox, we are now ready to proceed with the double entry posting operation. Notice that the color for the listing for Chart of Accounts has changed from "sandy brown” to “medium purple” (Figures 3 & 4). This is a sort of heads up | devised to alert the operator to the fact that we are now in the initial posting phase of the double entry posting operation, Figure 3: Posting hip lwwn.c-sharpcomer.conVUplosdFile!87b864Ie-sharp-code-fr-making-2-dovble-entry-genoralledger-postin’ 518 sisv2017 ‘CSharp Code For Making @ Double Entty General Ledger Posting (Method 1) Domne etna a Bsa Figure 4: purple Notice the amount that was originally entered for the total debit or credit amount is now in the textbox for the remaining balance. Just below that is a textbox for the amount to be applied. The operator may enter any number of amounts in this textbox as long as the cumulative total does not exceed the original remaining balance amount. In fact, the operator cannot exit this mode and proceed to the next step until the full amount to be posted has been reduced to zero by successive posting operations. To post an amount after keying in how much of the remaining balance you want to apply, just double click on a selected ledger in the “medium purple” colored Chart of Accounts listing, After the remaining balance of the initial posting phase has been reduced to zero, we will enter the offsetting posting phase as evidenced by the “medium purple" color of the Chart of Accounts listing turning to "tomato color” (Figures 5 & 6). Mechanically, this functions identically to the initial posting, phase. hip lwwn:c-sharpcomer.conVUploadFile!87b8e4/e-sharp-code-fr-making-2-dovble-entry-generaHedger-postin’ ene sisvz017 (CSharp Code For Making a Double Entry General Ledger Posting (Method 1) eee Soo Ay cormeto ncn cts gc! teste hast [ 20 Tedona mae oe] TedOst mst Fo Ont Bay Ferg Telnet eDode Pere Tamms [or SEpekies “aa Wehw'ssO One bey ans ‘Singer Resetiecter Aust. = Netra bona rcte [2] [El tem omcncnreinns §—— oh-tceITE @ sense ticetOno et tse FESPA me eats FSi uuu cnraes Figure 5: medium Purple Steere reset teeam | Ne RASS re Dometic metres teste ae | Tas bt ast Foie ay Parg Tan ema fDi ey Pars nba Ot oats EP (i [a] ) convert_to_nunber[2] } debit_var = ((convert_to_number[@] * 180000000) + (convert_to_nunber[1] * for (a = € 2 < GLAMOUNTS; avs) convert_te_number[a] = @; if (stringVal .Substring(62 if (stringval -Substring(6e Af (stringVal -Substring(62 if (stringVal.Substring(6e Af (stringval -Substring(6e if (stringVal -Substring(6e Af (stringval -Substring(6@ Af (stringVal -Substring(62 Jf (Stringval -Substring(6e if (stringVal Substring(62 convert_to_nunbe>[2] convert_to_nunbe[a] convert_to_nunber[a] convert_to_nunbe>(a] convert_to_nunber(a] convert_to_nunbe>[a] convert_to_nunbe>(a] } convert_to_number(a] = 3; convert_to_numbes[a] = 4; 55 convert_to_number[a] = 6; credit_var = ((convert_to_nunber[@] * 160060000) + (convert_to_nunber[1] unningbalance = eunningbalance - debit_var + credit_var; for (@ = 0; a < 10; at+) totalanount{a] = (char)323 ‘totalamount(6] = (char)4s; totalanount [7] = (char)46; totalanount [8] = (char)4a; totalamount[9] = (char)48; runningbalance_to_chararray = runningbalance; if (runningbalance < @) sunningbatance to_charorray = @ ~ runningbalances y countervar = 95 do ¢ ‘Longresult runningbalance to_chararray = longresult; if (long? == 6) totalanount{countervar] = (char)48; Jf (ong? == 1) totalanount[countervar] = (char)49; if (long? ‘totalanount [countervar] = (char)5@; if (long? totalanount{countervar] = (char)513 if (long2 totalanount [countervar] = (char)525 if (Longe ‘totalanount{countervar] = (char)53; if Qongz totalanount[countervar] = (char)54; if ‘totalanount{countervar] = (char)55; if if totalanount[countervar] = (char)56; ‘totalanount|countervar] = (char)573 ” t totalanount{countervar] = (char)46; countervar: } while (runningoalance_to_chararray > 0); stringBalance = new string(totalanount); if (runningbalance < @) « stringBalance = "- " + stringBalance; } alse ra stringBalance = "+ " + stringBalances } ListBox2. Items. Add(stringval.Substring(@, 8) + "\t " + stringVal.Substrin, datafileoffset jatafileoffset + GLDETAILEN; hip lwwn.c-sharpcomer.conVUplosdFile!87b864Ie-sharp-code-fr-making-2-dovble-entry-genoralledger-postin’ lath.DivRem(runningbalance_to_chararray, 18, out long2); one sisv2017 é #Corner ay uw uw W af (CSharp Cade For Making a Double Entry General Ledger Posting (Method 1) ‘this. textBox_totaldeditano ‘this. textBox_totalcreditanount. 1ext. = ‘this. textBox_transact iondesc~!ption. Text Cursor.current = Cursors.Default; y process the selected general ledger when the Chart of Accounts Listing color is medium purple (initial posting) or tonato color (offsetting posting) (MakeListioxMediumurple == 1 || MakeListSoxTonato == 1) 11 grab today's date as well as the remaining balance and the 11 amount to be applied to this posting operation. DateTime saveNow = DateTime.Now; dateString = saveNow.ToString(datePatt) ; reraining_balance_str = textBox_renainingbalanceoftotal.Text; post_anount_str = textBox_enteranounttebeapplied. Texts for (a 4 2 < GLANOUNTS; a++) convert_to_nunber{a] = 0; iF (remaining. balance_str.Substring(a, 1) Lf (remaining balence_str-substring(a, 1) if (renaining balance str.Substring(a, 1) Af (remaining balance str/Substring(a, 2) if (remaining balance_str.Substring(a, 1) Af (remaining balance_str Substring(a, 2) Af (renaining balance str.Substring(a, 1) if (remaining balance str-Substring(a, 1) Af (remaining balance str-Substring(a, 1) iF (remaining balance_str.Substring(a, 1) convert_to_number[a] = ¢ convert _te_number[a] = convert _to_nunber(3] convert to-number[a] = convert_to_number[a] = + convertte-number[a] = | convert_to_number[a] convert_to_number[a] convert_to_number[a] convert=to_nunber(a] y enaining_balance = ((convert_to_number[@] * 10080000) + (convert_to_nunber| for (a = @; @ < GLANOUNTS; a+) { convert_to_nunber{a] = @; if (post_anount_str.Substring(a, 1) ) convert_to_nunber{a] Af (post_anount_str.Substring(a, 1) ) convert_to_nunber[a] Af (post_anount_str.Substring(a, 1) ) convert_to_nunbera] if (post_anount_str.Substring(a, 1) == "3") convert_to_nunber[a] = 3; Af (post_anount_str.Substring(a, 1) == "4") convert_to_nunber[a] = 43 Af (post_anount_str.Substring(a, 1) == "5") convert_to_nunber[a] = 53 Af (post_anount_str.Substring(a, 1) ) convert_to_nunber[a] = 6; Lf (post_anount_str.Substring(a, 1) == "7") convert_to_nunber[a] = 73 Af (post_anount_ste.Substring(a, 1) ) convert_to-nunber[a] = 83 if (post_anount_str.Substring(a, 1) ) convert_to_nunber[a] = 93 y post_anount = ((convert_to_nunber[@] * 10¢0¢000@) + (convert_to_nunser(1] * 21 // make sure the amount to be posted is always less than or equal to 1/ the remaining balance before proceeding. Af (post_anount <= renaining_balance) « // if we are in offsetting posting mode, then show this message, LF (MakeListBoxTonato == 1) ¢ result = MessageBox.Show("Do you want to process this offsetting genei else // show this message for initial posting mode... hip lwwn.c-sharpcomer.conVUplosdFile!87b864Ie-sharp-code-fr-making-2-dovble-entry-genoralledger-postin’ son sisv2017 232 233 234 235, 236 237 238 239 20e 2a1 282 203 24a, 24s 246 207 248 249 25@ 251 282 253 284 255 256 237 258 259 26@ 262 262 263 264, 265, 266 267 268 268 27e 271 272 273 274 275 276 277 278 279 20 281 282 283 284 285 286 287 288 229 29 29 292 293 294, 295 298 297 298 298 & # COMNE® (result { (CSharp Cade For Making a Double Entry General Ledger Posting (Method 1) Dialogkesult.Yes) // if it is a debit posting, then co this... AF (ApplyoffSettingdebits == 1) t // get the date, transaction description, debit amount 1/ and the transaction type from the winform controls. 11 create the new posting record and then append it to 1/ the corresponding general ledger selected by the operator. transaction_str = textBox_transactiondescription.Text; debit_str = textBox_enteranounttobeapplied. Text; charVal_date = dateString. TocharArray(@, dateString. Length); charval_tranaction = transaction_str.Tochararray(@, transaction_str.Length); charval_debit = debit_str.ToChararray(@, debit_str.Length); for (a for (a Af (this. conboBox_transactiontype.Text 4 2; @ < GLDETATLEN - 2; a+) recordatavar_transactions[a] (char) 325 @} 2 < datestring.Length; a++) recordatavar_transactions[a] = charva ) recordatavar_transactions[8] = "C's recordatavar_transactions[9] = 'R' Lf (this. conboBox_transactiontype. Text recordatavar_transactions[8] recordatavar_transactions[9] Lf (this.conboBox_transactiontype.Text == "GL") recordatavar_transactions[8] = '6' recordatavar_transactions[9] = "L Lf (this.comboBox_transactiontype. Text recordatavar_transactions[8] recordatavar_transactions[9] =" ‘5 (this. comboBox_transactiontype. Text recordatavar_transactions[8] = "P recordatavar_transactions[9] = ‘R's r Lf (this.comboBox_transactiontype.Text 4 recordatavar_transactions[8] = "P recordatavar_transactions[9] = 'Y' y Lf (this. comboBox_transactiontype. Text « recordatavar_transactions[8] recordatavar_transactions[9] y for (a = 0; 2 < transaction_str.Length; a+) recordstavar_transactions(a + 10 for (a = 8; a < debit_str.Length; a++) recordatavar_transactions[a + 58] = ch: for (a = 8} 2 < 3; a4#) recordatavar_transactions[a + 70] = charVal_auto_nunb: FileStrean fstreanobj1 = new FileStream(currdir + strfile, FileMode.Append); Streaniiniter weiterodji = new StrearWriter(Fstreanobj1); writerobj1 briteLine(recordatavar_transactions); luriterobj1.Close() ; fstreanobj1.Close(); y J/ Xf it isa credit posting, then do this... iF (ApplyOFFSettingCredits => 1) hip lwwn.c-sharpcomer.conVUplosdFile!87b864Ie-sharp-code-fr-making-2-dovble-entry-genoralledger-postin’ 08 sisv2017 & #Corner 306 307 308 309 ne 311 312 313 314 as 316 317 318 319 322 322 322 323 324 325 326 327 328 329 33e 332 332 333 334, 335 336 337 338 339 3ae 3a 342 343, aaa 345 346 347 348 349 350 352 352 383 354, 355, 356 357 388 359 360 361 362 363 364 365 366 367 368 369 378 371, 372 373 (CSharp Cade For Making a Double Entry General Ledger Posting (Method 1) 11 and the transaction typ - s. 11 create the new posting ASK A QUESTION 20 1/ the corresponding generai eager seiectea by tne operator. transaction_str = textBox_transactiondescription.Text; credit_str = textdox_enteranounttobeapplied. Text; charval_date = datestring.TocharArray(@, datestring. Length); charval_tranaction = transaction_str.Tochararray(@, transaction_str.Length); charVal_credit = credit_str.Tochararray(®, credit_str.Length); for (a for (a Af (this. conboBox_transactiontype.Text 4 2; @ < GLDETATLEN - 2; a++) recordatavar_transactions[a] (char) 325 @} a < dateString.Length; 11) recordatavar_transactions[a] = charva ) recordatavar_transactions[8] = °C'5 recordatavar_transactions[9] = 'R' Lf (this. conboBox_transactiontype. Text recordatavar_transactions(8] Pecordatavar_transactions(9] Lf (this.conboBox_transactiontype.Text == "GL") recordatavar_transactions[8] = ‘6’ recordatavar_transactions[9] = "L Lt (this. comboBox_transactiontype. Text recordatavar_transactions[8] recordatavar_transactions[9] =" ' Le (this.comboBox_transactiontype. Text recordatavar_transactions[8] = "P recordatavar_transactions[9] = 'R' Lf (this.comboBox_transactiontype. Text recordatavar_transactions[8] = ‘P's recordatavar_transactions[9] = 'Y' Lf (this. comboBox_transactiontype.Text recordatavar_transactions[8] recordatavar_transactions[9] = " y for (a = 0; a < transaction_str.Length; a++) recordatavar_transactions[a + 1¢ for (a = 8; a < credit str.Length; a++) recordatavar_transactions[a + 68] = cl for (a = 8} 2 < 3; at+) recordatavar_transactions(a + 70] = charVal_auto_nunb: FileStrean fstreanobji = new FileStream(currdir + stefile, FileMode.Append); Streanhiniter weiterodji = new StrearWriter(Fstreanobj1); writerobj1 briteLine(recordatavar_transactions); wrSterobj1.Close(); fstreanobj1.Close(); > J/ subtract the anount that was just posted from the renaining 71 balance and zero the anount to be applied on the screen and 71 wait for the operator to enter a new anount to be applied for // the next posting. new_renaining balance = remaining balance - post_anount; ‘this. textox_enteranounttobeapplied.Text = 0.08"; amount_flag = 95 // X€ the remaining balance is down to zero and the Chart of 71 Recounts Listing color is tomato (offsetting side of posting hip lwwn.c-sharpcomer.conVUplosdFile!87b864Ie-sharp-code-fr-making-2-dovble-entry-genoralledger-postin’ 28 sisv2017 3 38e 381 382 383 38a 385, 386 387 388 389 398 392, 392 393 394, 395, 396 397 398 399 400. 401, 402. 403. 406. 4205. 406. 407, 408. 409. aie. aun, a2. a3, a1. as. a6. 417. ag, aig. 420. a2. 422, 423, 424. 425. 426. 427, 428. 429, 430. 431, 432. 433, 434, 435; 436. 437. 438. 439, 440. aaa, aaa, 443, aa. as. as. 447. #Corner (CSharp Cade For Making a Double Entry General Ledger Posting (Method 1) J/ set the Chart of Accoun ASK A QUESTION brown. ‘this. ListBox_chartofaccountsiistng.backLoLon = LoLer.SandyBrown; MakeListBoxSandyBrown = 15 MakeListdoxMediunPurple = @; Makel ist8oxTonato = @; // blank out transaction description text box and J/ re-enable both buttons for “total debit anount* and 1/ “total credit amount”. ‘this. button_totaldebitanountfordoubleentryposting.Enabled = true; ‘this. button_totalcreditanountfordoubleentryposting.Enabled ‘this. textBox_transactiondesceiption.Text = ""; // if the initial posting was 2 debit, then make it a credit. 1/1 it had been a credit, then make it a debit. Af (ApplyoFfSettingbebits == 1 && ApplyoffSettingcredits °) Applyoffsettingbebits Applyoffsettingcredits = 1; y aise Applyoffsettingbebits = 1; ApplyoffSettingCredits = @; y // Xf the remaining balance is down to zero and the Chart of // Accounts Listing color is mediun purple (initial side of posting 71 operation), then do this... AF (new_remaining balance == @ && MakeListBoxediumPurple t » /{ set the Chart of Accounts Listing color to tonato. ‘this. 1istBox_chartofaccountslisting.BackColor = Color. Tomato; MakelistBoxSandyBrown = 0; Makel LstBoxMediunPurple MakeListdoxronato = 1; // set the renaining balance text box to the original anount to be // posted from the initial posting operation. ‘this. textBox_renainingbalanceoftotal.Text = renaining offsetting _balance_str; ‘anount_flag // if the initial posting was @ debit, then make it a credit. // if it had been a credit, then make it a debit. Af (ApplyOFfSettingdebits =~ 1 8& ApplyofFSettingcredits =~ 0) 4 ApplyoffSettingbebits = ApplyoffSettingcredits y else ApplyoffSettingbebits ApplyoffSettingcredits y d // Sf there is still a remaining balance, then 71 show it on the Winfor control. Af (amount_flag == @) { for (a = 0; a < 10; at+) totalamount[a] = (char)325 totalanount [6] = (char)4a; totalanount[7] = (char)4; totalanount [3] = (char)4a; totalanount[9] = (char)4a; countervar = 9; do hip lwwn.c-sharpcomer.conVUplosdFile!87b864Ie-sharp-code-fr-making-2-dovble-entry-genoralledger-postin’ 1318 sisv2017 (CSharp Cade For Making a Double Entry General Ledger Posting (Method 1) if (ong2 € #Cormer i (long Af (long2 == 2) totalanauncicountervar| = (cnaryst; 454. 4f (long2 == 3) totalanount[countervar] = (char)51; 435, if (long2 == 4) totalanount[countervar] = (char)52; 456. Af (longz == 5) totalanount[countervar] = (char)53; 437, if (long2 == 6) totalanount{countervar] = (char)54; 438. Af (longz = 7) totalanount[countervar] = (char)55; 459. if (long? == 8) totalanount[countervar] = (char)56; 460. Af (long2 == 9) totalanount[countervar] = (char)§7; 461, countervar--j 462, Af (counterva 463 t 464. ‘totalanount{countervar] = (char)465 465. countervar=s5 @) totalamoun ~ 1) totalanoun ” 467, } while (new_renaining balance > @); 469) ‘this. textBox_renainingbalanceoftotal.Text = nex string(totalanount); 470. ) 475: y 476. else 477 { 479. MessageBox.Show("The anount you want to post is greater than the remainin) CONCLUSION This method of performing a double entry posting is versatile, because the total debit or credit amount to be posted can be spread among any number of general ledger accounts until the total amount has been subtracted down to zero by the program's built in calculator. It is also user friendly, because the color coded listing for the Chart of Accounts uses specific colors to denote the initial posting phase of “medium purple” and the offsetting posting phase of “tomato”. | have seen Chart of Accounts software packages that are very intimidating to work with. I tried to get as far away from that as | could when I designed this one. Download 100% FREE Spire Office APIs C# ) C# Code ) | Double Entry General Ledger Posting Making Double Entry General Ledger Posting Douglas Miller 70P 500 —— PAGING] | perform PC troubleshooting chores such as data recovery of files/folders from crashed wwuneue = hard drives. | also replace bad hard drives and recover files/folders from them. | replace power supplies and add memory modules to ... Read more http:/www.c-sharpcorner.com/members/dougias-miller hip lwwn.c-sharpcomer.conVUplosdFile!87b864Ie-sharp-code-fr-making-2-dovble-entry-genoralledger-postin’ sane sisv2017 (CSharp Cade For Making a Double Entry General Ledger Posting (Method 1) M2 cH#Ctiner ASK A QUESTION Mi Type your comment here and press Enter Key (Minimum 18 characters) Thanks for this good one project ahmed nady Nov 12, 2016 1440 4 0 0 0 Reply w tase Nice One Mario Sep 21, 2016 1298 146 149 0 0 Reply The Source Code for this Project please? ww X ‘Abwaank Khaliif Apr 19, 2016 1426 18 46k 0 0 Reply Good article Santhakumar Munuswamy 018, 2015 61 19k 497k 0 0 Reply Thanks for the share Priyaranjan KS 015, 2015 24 345k 1.5m 0 0 Reply Glad you all liked it... thought the color coded idea for doing double entry postings would make for an interesting coding article! Douglas Miller ct 15, 2015 463 25k 279.5k 0 0 Reply Great Shakti Saxena ct 15, 2015 321 42k 265.4 0 0 Reply Thanks for sharing Sibeesh Venu Oct 15, 2015 18 384k 4.3m 0 0 Reply Nice One Mukesh Kumar oct 15, 2015 87 147k 2.4m 0 0 Reply Good One! Rajeesh Menoth oct 15, 2015 71 167k 436.3k 0 0 Reply Comment Using hip lwwn.c-sharpcomer.conVUplosdFile!87b864Ie-sharp-code-fr-making-2-dovble-entry-genoralledger-postin’ 1518 aior2017 (CSharp Cade For Making a Double Entry General Ledger Posting (Method 1) AM ae C#Corner. Add a comment... Facebook Comments Plugin File APIs for NET (owe ‘Aspose are the market leader of .NET APIs for file business formats = natively work with DOCK, XLSX, PPT, PDF, MSG, MPP, images formats and many more! Progress’ Build Your ASP.NET Web Forms Apps Faster_with UI for ASP.NET AJAX aan ‘TRENDING UP 01. Multithreading in C# Net 02. Best Practices For MVC 03 What Is Big Data? 04. Learn ASP.NET Core Using Angular 2 05 HowTo Use Joins, and Group By Clause In Entity Framework With LINQ C# 06 Confessions Of An Angry Programmer 07 Creating Web API With ASP.NET Core Using Visual Studio Code 08 How To Upload Records From Excel File to Database Using Stored Procedure In MVC 09 Future Of loT, Machine Learning, And Artificial Intelligence 10. Project Server 2013 Migration From One Farm To Another View All O hip lwwn.c-sharpcomer.conVUplosdFile!87b864Ie-sharp-code-fr-making-2-dovble-entry-genoralledger-postin’ 168 aior2017 (CSharp Cade For Making a Double Entry General Ledger Posting (Method 1) C#Gorner, ke Page | FE Lt Be the first of your friends to like this Progress’ Build Your ASP.NET Web Forms Apps Faster_with Ul for ASP.NET AJAX aan JOIN C# CORNER Enter your email address Sign Up hip lwwn.c-sharpcomer.conVUplosdFile!87b864Ie-sharp-code-fr-making-2-dovble-entry-generalledger-postin’ 78 sisv2017 (CSharp Cade For Making a Double Entry General Ledger Posting (Method 1) Hm ae C#Corner ASK A QUESTION hip lwwn.c-sharpcomer.conVUplosdFile!87b864Ie-sharp-code-fr-making-2-dovble-entry-genoralledger-postin’ 88

You might also like