How to design programe for jewelry order ? (K.A. Rao)

How to design programe for jewelry order ? (K.A. Rao)

Postby dagiayunus » Thu Jul 18, 2024 7:53 am

Dear Mr.Rao

Good afternoon

After long gap of 5 years with programming. I am planning to develop accounting program for my jewellery business with Fivewin and Mariadb.

For Order of Jewelry
Customer may Give Cash, Old Gold, Old silver against Gold jewelry order
or
Customer give advance cash, old gold, old silver without confirming the order

How to handle this situation in program ? Any guide suggestion from you sir?

Regards
Yunus.
dagiayunus
 
Posts: 85
Joined: Wed Nov 19, 2014 1:04 pm

Re: How to design programe for jewelry order ? (K.A. Rao)

Postby Otto » Sun Jul 21, 2024 7:17 am

Hello Yunus,

I have thought again about your assignment.
If you haven't programmed for a long time and yunus.prg was programmed for you, then I would - assuming you are a standard Fivewin user - start with a simpler code for deposit management - a simple CRUD program.
The yunus.prg code is ultra high-end and serves as a template. But the code assumes that you are a power Fivewin user.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6312
Joined: Fri Oct 07, 2005 7:07 pm

Re: How to design programe for jewelry order ? (K.A. Rao)

Postby Otto » Sun Jul 21, 2024 8:27 am

Hello Yunus,

I don't know your skills in FIVEWIN.

But considering that you will sooner or later also create a web version, you are best positioned to implement it on the web if you hard code your dialogs.

I would start with the simple edit mask, create a DBF deposit and fill it. Then make the additions in the existing yunus.prg.

Best regards,
Otto

Image


Code: Select all  Expand view
#include "FiveWin.ch"

static oDlg

//----------------------------------------------------------------------------//

function Main()

    LOCAL oDlg, oCustomerName, oTransactionType, oCash, oOldGold, oOldSilver, oCbx
    LOCAL cCustomerName := "                      "
    LOCAL cTransactionType := "                   "
    LOCAL nCash := 0.0
    LOCAL nOldGold := 0.0
    LOCAL nOldSilver := 0.0
    LOCAL oFont

    DEFINE FONT oFont NAME "Segoe UI" SIZE 0, -16

    DEFINE DIALOG oDlg ;
           TITLE "Jewelry Order" ;
           FROM 200, 200 ;
           TO 600, 700 ;  // Increased height for more spacing
           PIXEL ;
           TRUEPIXEL

    oDlg:SetFont(oFont)

    @ 20, 10 SAY "Customer Name:" OF oDlg PIXEL
    @ 20, 160 GET oCustomerName VAR cCustomerName OF oDlg SIZE 200, 30 PIXEL

    @ 70, 10 SAY "Transaction Type:" OF oDlg PIXEL
    @ 70, 160 COMBOBOX oCbx VAR cTransactionType ITEMS { "Order", "Advance" } SIZE 200,400 OF oDlg PIXEL HEIGHTGET 30  

    @ 140, 10 SAY "Cash (in $):" OF oDlg PIXEL
    @ 140, 160 GET oCash VAR nCash OF oDlg SIZE 100, 30 PICTURE "9999.99" PIXEL

    @ 190, 10 SAY "Old Gold (in grams):" OF oDlg PIXEL
    @ 190, 160 GET oOldGold VAR nOldGold OF oDlg SIZE 100, 30 PICTURE "9999.99" PIXEL

    @ 240, 10 SAY "Old Silver (in grams):" OF oDlg PIXEL
    @ 240, 160 GET oOldSilver VAR nOldSilver OF oDlg SIZE 100, 30 PICTURE "9999.99" PIXEL

    @ 300, 60 BUTTON "&Save" SIZE 80, 40 PIXEL OF oDlg ACTION SaveTransaction(cCustomerName, cTransactionType, nCash, nOldGold, nOldSilver)
    @ 300, 160 BUTTON "&Cancel" SIZE 80, 40 PIXEL OF oDlg ACTION oDlg:End()

    ACTIVATE DIALOG oDlg CENTERED

    RELEASE FONT oFont

return nil

//----------------------------------------------------------------------------//

function SaveTransaction(cCustomerName, cTransactionType, nCash, nOldGold, nOldSilver)
    // Here, you would save the transaction details to your database.
    MsgInfo("Transaction Saved:" + CRLF + ;
            "Customer Name: " + cCustomerName + CRLF + ;
            "Transaction Type: " + cTransactionType + CRLF + ;
            "Cash: " + Transform(nCash, "9999.99") + CRLF + ;
            "Old Gold: " + Transform(nOldGold, "9999.99") + CRLF + ;
            "Old Silver: " + Transform(nOldSilver, "9999.99"))

    oDlg:End()
return nil

//----------------------------------------------------------------------------//
 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6312
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 98 guests