351

(4 replies, posted in General)

Adam,
Attached is the fixed project. I put in code to do the appropriate show procedure depending on the page index that is active from the Form1 buttons. I also put in your scroll code when changing between people/suppliers tabs on Form2.

352

(4 replies, posted in General)

domebil,

I'm not sure if there is a function within MVD to determine the active database for a project. However, the settings.ini file contains a line with the filepath to your active database if you have renamed your database or your database is in another drive or path. It is the 4th line down in the settings.ini file and it contains "server=....\....db"


I put together the attached project to demonstrate how to retrieve that line and use it to do a backup. When you run it, change the database location in the Options/Settings dialog box, then close the project and rerun it. Your database location will be displayed on the form. The backup button allows you to select the folder to place the backup.

353

(3 replies, posted in General)

Adam,
If I'm understanding correctly, you need two things.


1. Include cbPIRpurchInvID combobox in your Save action to make the connection between the purchase invoice and refund.


2. Place a dbupdate for tgMainPI after you delete a refund in the tgMainPIR tablegrid:

procedure Form1_btnMainPIRdelete_OnAfterClick (Sender: string);
begin
    Form1.tgMainPI.dbUpdate;
end;

354

(5 replies, posted in General)

Is the attached what you are looking for. There should be various date formats within FastReport for date reporting purposes.

355

(3 replies, posted in General)

Just add the literal between V2 and V3


openurl(v1+v2+', '+v3);

I populated tablegrid8.


in Child: Batch Time: the problem is, its showing all student batch status, Time Wise.
I Also need the Batch Time wise data of each software belong to trainer handing


I'm not sure I understand. Tablegrid3 is already filtered by trainer. If you want it further filtered by the software from tablegrid2 then tablegrid3 would be identical to tablegrid8.

Nitin,
Quite frankly, I'm not sure how the calculated fields worked before, but even though they worked you couldn't do the admin maintenance without getting an error. I'm not a huge fan of calculated fields anyway. There's a place for them, but in this case I think it is better to load the middle grids through SQL QUERY action which does all the summary counting inside the query. So I removed the calculated fields causing errors in the Admin maintenance form and created SQL QUERY buttons to load the tablegrids. Your search buttons are still present, but not used now.

I used your original project posted in the forum to do the modifications. Hope this allows you to move forward.

Nitin,
Can you circle the totals that are wrong in your previous picture and write in words what the calculation is suppose to be. I'm having a difficult time understanding what is in error.

I adjusted your calc fields. Your admin works now.

I would like to try to help you but my system has flagged your download file as having a virus in it.

361

(1 replies, posted in General)

Welcome Jack. It wasn't that long ago I knew nothing about MVD nor Pascal. The learning curve is not bad at all.  I'll try to answer your questions as best I can. I am making some assumptions based on my understanding of what you are looking to do in your project.


Do my client need to purchase the MVD software in order to run the application?

The answer is no. You will create the Windows exe and supporting files to distribute to your clients.


It is better to separate the Delivery Order Table and Sales Invoice Table separately or use the same table?

Assuming one invoice to one delivery to a customer, then you can use a single table. Basically your delivery order info is the same as the invoice info.


When user add new record on the Delivery Order, the default location auto show on the Delivery Order Header.
Do I need to write the script? If yes, how to write the script.

No script necessary if the location will always be the same default.


After completed the Delivery Order transaction, I would like to make a button click to generate the Sales Invoice and copy the Delivery Order Header Information and Line to Sales Invoice Header and Line? Do I need to write the script for this? If yes, how to write the script

Since the delivery and sale info is in the same table, there is no copying necessary. You will simply use the same source table to print the invoice.


From the Sales Order Form, user click "Add New" record for Sales Invoice and select the Customer Name. I need to create a button -> click to show all the "Delivery Order Transaction" related to this customer only. User can tick the check box to select which DO to be selected and click "Generate" -> those selected "Delivery Order" will copy the Delivery Order Line to the Sales Invoice Line auto. It is difficult to write the script?

Again, since the delivery and invoice are using the same table, then there is no copying necessary. The same source table is used for invoicing.


I know I am making some assumptions about your project, but on the surface it does not appear that you will not need to do much scripting. However, sometimes some minor scripting may be necessary to tweak a project to do exactly what you want. The forum is here to help you with that if necessary. Happy developing!

362

(9 replies, posted in General)

That should work Adam. You do not need the "Cancel := True" though.

363

(9 replies, posted in General)

Adam,

I took a different approach. On the Delete button I made the necessary changes to the record fields to make the record a purchase invoice. It really does not delete the record. I changed the button caption to "Remove Sale". Visually it mimics the delete button in your project from your previous post with two tables.

364

(9 replies, posted in General)

Adam,

Yeah this won't work

procedure Form1_btnSaleDelete_OnAfterClick (Sender: string);
begin
  frmInvoice.cbInvoiceDBCR.Text := 'Purchase';
  frmInvoice.edDBCR.Text := 'Purchase';
  Form1.tgMainPurchInvs.dbUpdate;
end;

You can't really make a change like that on a delete. If it's just one table, then I think you are on the right track with making changes to the characteristics of the record depending on purchase or sale. Attach your project and I'll take a look at it and see what needs to be put in place.

365

(9 replies, posted in Script)

hichame

Maybe the attached will help you.

366

(9 replies, posted in General)

I added to your filter on the purchase invoice grid setting.  If a purchase invoice is converted to a sale then the filter will exclude it from the purchase grid. Also, I placed a dbupdate after deleting a sale invoice so the purchase invoice will immediately show again in the purchase grid.

Thank you. I appreciate your compliment. But I consider myself as just average. I've been around a lot of business applications using a lot of development systems so it usually does not take me long to learn a new environment and apply it to a business process. Thanks again. Glad I could help.

Good catch. You can either put in "Form1.close" on the Form2 close event. This will make the user restart the program. Or you can use the fix in the attached project which allows the user to begin using the application immediately after entering a valid key. But if they do not enter a key and 'X' out then it closes Form1.

stelios91,

Ok, I understand what you are wanting to do now. I put together a project to get you started. The first time the user runs the software it will ask for a registration key. I have an array of keys in the project. You can add to the list. Each entry has a three digit number on the end of the key representing the duration in days till expiration. Do not enter the days in the registration form (Form2), just the key. The days in the array are only used to determine the expiration date. The expiration date is stored in your registry so that each time the software is run it checks against and displays the expiration date. Once the expiration date has arrived it will notify the user of the expiration. The last entry in the array has a duration of '999'. This tells the system not to write an expiration date so the software will always run with no expiration.


For testing purposes, if you want to test various keys and durations, you can go into your system registry and remove the entries for your software. Obviously a savvy user could do the same thing and start over. So because of this, it may not be totally foolproof. One thing you could do is put an obscure name as the name of your software in the global variable APP_NAME so the user cannot readily find your entries in the registry. It will be more or less hidden to the user, but not to you.


Also, I do not have anything incorporated into the software for renewals of the software. Not exactly sure how to handle that. I have to think about that a little more. How many times can they renew?

Yes.

You may be confused as to the purpose of the keys. They are for your registered customers of your software, not for trial users. When your customer has paid you for your software, you give them one of the valid registration keys. Your customer then enters that key one time in a registration form in your project. This key is then stored in your computer's registry. This allows your customer to run your software on a permanent basis. The keys are not meant to be any kind of user login. It's there just for the valid execution of your software on your registered customer's computer.

I'm not sure why you would have different durations for different customers. You may need to distribute different trial versions of your software in this case. Maybe somebody else has another idea or solution for you.

372

(4 replies, posted in General)

See attached.

373

(4 replies, posted in General)

David,
See if the attached is what you are looking for.

Invoicing with Inventory, etc. can take on various looks and approaches depending on the business or industry using it. It can become quite intricate. It would have been beneficial if your project was included. However, a few weeks ago someone on this forum needed to be able to have stock and non-stock invoice items. I provided my solution to that. So I used that same project and extended it with qty onhand and reorder points for stock items to show how you can update inventory quantities from invoices. It requires sql scripting to update the inventory and I commented the sections to show the various inventory updates depending on the invoice item action.


For new invoice items, the input qty will be subtracted from the onhand qty. If a qty changes, then the onhand qty will be adjusted based on the difference in the qty being changed. If a stock item is changed to another stock item on an invoice item, then the qty onhand is adjusted for the old and new stock items.  If an invoice item is deleted and it is a stock item, then the onhand qty will be increased by the deleted invoice qty.


Hopefully it will help you with your project.

375

(34 replies, posted in General)

Hey if it works that's all that matters. I think I would have used the variables though. It's a whole lot less typing. But that's just a personal preference.


Street := frmInvoice.edPIsuppStreet.Text;
  City := frmInvoice.edPIsuppCity.Text;
  State := frmInvoice.edPIsuppState.Text;
  zip := frmInvoice.edPIsuppZip.Text;
  StateZip := State + ' ' + Zip;
  Country := frmInvoice.cbPIsuppCountry.Text;
  If State = '' then StateZip := Zip;
  If StateZip = '' then
    Begin
      StateZip := Country;
      Country := '';
    End;
  If City = '' then
    Begin
      City := StateZip;
      StateZip := Country;
      Country := '';
    End;
  If Street = '' then
    Begin
      Street := City;
      City := StateZip;
      StateZip := Country;
      Country := '';
    End;

  frmInvoice.lblSuppName.Caption := frmInvoice.cbPIsuppName.Text;
  frmInvoice.lblSuppAddr1.Caption := Street;
  frmInvoice.lblSuppAddr2.Caption := City;;
  frmInvoice.lblSuppAddr3.Caption := StateZip;
  frmInvoice.lblSuppAddr4.Caption := Country;