501

(34 replies, posted in General)

Hi EHW,


Thank you very much....... Now it works much better.


Tax rates on refund record edit works fine now, when invoice record selected then refund record belonging to selected invoice, clicking on refund edit button shows correct tax rate under refund prices.


However, if a refund record selected then clicked on refund edit after running application where all refunds are displayed, refund tax value is not displayed correctly. Please see reference screen cap below:
https://s27.postimg.org/9tev19noz/zzzzz_Temp46.png



- Sometimes, All Refunds button doesn't work.

I managed to replicate this issue I think.
1. Compile/run the project
2. All refunds will be displayed fine on refunds tGrids
3. Select an invoice record from PI Purchase Invs tGrid and click on refund tGrid edit button to show record.
4. Repeat num 3 with few otherPI Purchase Invs tGrid records.
5. Click on All refunds button of PIR Purchase Invs.
https://s27.postimg.org/rxhvlwldf/zzzzz_Temp47.png


I'm thinking that there may be some issue with All Refunds buttons?

502

(34 replies, posted in General)

Hi Derek,


Thank you very much for your kind help....


Unfortunately issue remains and there seems to be few others .
- Sometimes, All Refunds button doesn't work.
- Sometimes adding new refund doesn't show, on second try it does. This happens usually after start of the application.
- Sometimes adding second refund to another inv record moves "Ref" column cr / db to last refund issued inv record on inv tGrids.
I couldn't replicate all those above issues properly in order to identify the causes.


In essence there is only one tax rate that's under product field in invoice table and on invoice and refund forms.
I have tried copying tax rate combobox value under products field for all other refund form tax rates by adding link to tax rates from refund table and including cbPIRtaxRate and cbSIRtaxRate in frmRefund Save button but couldn't get it working.


https://s27.postimg.org/65uihgq43/zzzzz_Temp45.png


Please see the updated sample project below:

503

(34 replies, posted in General)

I have noticed that taxRate combobox value is not displaying tax rate value correctly on edit of a refund record. Refund edit form tax rate combobox shows last added refund record tax rate value on edit of a all refund records.


I have tried few things but couldn't get it working correctly.


EHW, it was unresolved issue at my end nothing to do with your fix. I just missed it.


Please see the sample project in post #3
tGrid Field Display 3 Two Tables Test2c Fixed.zip 611.91 kb,

504

(34 replies, posted in General)

Hi EHW,


Thank you very much...................................
Truly appreciated.............................................


If you and Derek weren't around, probably I'd have been forced to give up on MVD and most likely start with Java from zero.

505

(34 replies, posted in General)

Looks like I have sorted some issues except one.


I cannot get supplier and customers names plus country comboboxes values on frmRefund after clicking on issue refund buttons (both Purchase and sale refund) on Form1 as highlighted on the screen cap below:
https://s4.postimg.org/g8sj6v8n1/zzzzz_Temp44.png


Please see the updated sample project below.

506

(34 replies, posted in General)

Added customers and suppliers to working test project and start having various issues with refunds.
1. Cannot get refunds supplier and customer values displayed correctly on refunds edit.
2. Sale refund adding multiple sale refund records


If I include supplier and customers name comboboxes on refunds save button, then I can only add 1 purchase or sale refund.


Please see the attached sample project attached:

507

(4 replies, posted in General)

DriveSoft wrote:

Check it out ...


Now it works fine.
Thank you very much Dmitry................
Truly appreciated...................

508

(4 replies, posted in General)

DriveSoft wrote:

Unfortunately I can't understand the problem.


Combo items:
Print
Print Selected
Print All


First combo item (Print) is not associated to any button action. I wanted to display first combo item Print on combobox as a caption on Form1 show always. If I was to use buttons only then I'd have to use 2 buttons, one for print all and other for print selected. With combobox approach I'd use one button space.


However, currently I'm using disabled textbox with default value (Print) over combobox as a workaround.

509

(4 replies, posted in General)

I'm trying to use combobox items as buttons except the first combo item. I like to use first combo item as combo caption. Combobox is on main form (form1)


Combo items:
Print
Print Selected
Print All
First empty item unchecked (false) on combo properties.


Buttons part seems to be OK but getting first combo item displayed as combo caption on form1 show is not?

procedure Form1_OnShow (Sender: string; Action: string);
begin
  Form1.ComboBox1.Clear;
  Form1.ComboBox1.Items.Add('Print');
  Form1.ComboBox1.Items.Add('Print All');
  Form1.ComboBox1.Items.Add('Print Selected');
  Form1.ComboBox1.Text := 'Print';
  Form1.edCombo1Value.Text := 'Print';
end;

procedure Form1_ComboBox1_OnChange (Sender: string);
begin
  Form1.edCombo1Value.Text := Form1.ComboBox1.Text;
  if Form1.ComboBox1.Text = 'Print All' then Form1.Button2.Click;
  if Form1.ComboBox1.Text = 'Print Selected' then Form1.Button3.Click;
end;

Please see the attached sample project below if needed.

510

(5 replies, posted in General)

Hi Guys,


Nice question Derek...


Nice solution Dmitry...


Nice alternative solution EHW...


Thank you very much to all......................................

511

(6 replies, posted in General)

Thank you very much EHW..................... Truly appreciated...................


As you mentioned populated fields are disabled, therefore I also prefer your one line text field approach.
Additionally thank you for offering two approaches. Something to learn from for me.


Since we are not using show records via hidden button fully, I took out clear search fields on form1 show.

512

(6 replies, posted in General)

Thank you very much EHW....................................
Your kind help is always appreciated.........................


There is one issue I could notice.
When added new record without date (DOB) it would return error saying something like '' not valid date on tGrid record browsing.


I have commented outI your date SQL line:

//Form1.DateTimePicker2.DateTime := StrToDate(Form1.GridEmployees.Cells[2,Form1.GridEmployees.SelectedRow]);

then added the following SQL to mouse click, key up and highlight grid row in each tabsheet sections to get rid of the error:

procedure Form1_GridEmployees_OnClick (Sender: string); //*** do when using mouse on employee grid
var s: string;
begin
  derekwhichsheetisactive;

  s := SQLExecute('SELECT dateofbirth FROM Employees WHERE id='+Form1.GridEmployees.sqlValue);
    if s <> '' then Form1.DateTimePicker2.Date := SQLDateTimeToDateTime (s)
    else Form1.DateTimePicker2.Checked := False;
end;

Somehow my approach looks messy. I tried to play around with your date SQL line but couldn't get it working.

513

(6 replies, posted in General)

Hi Derek,

Thank you very much...............

However, inc search prevents browsing tGrid records properly.
I added clear under mouse click and keyup but didn't work.

514

(6 replies, posted in General)

Incremental  search doesn't seems to be working when using Derek's showing details without SQL method.


Please see the attached sample project below:

515

(5 replies, posted in General)

Thank you very much Dmitry....................
Truly appreciated......................

516

(5 replies, posted in General)

As far as I can see, there is one issue remains:
When there is no record on tGrid/s I get info - error dialog "No record selected for editing." on app start and when last record on tGrid deleted.


Any solution?

517

(9 replies, posted in General)

Hi EHW,

Your approach comes quite close to original objective.
Thank you very much..............


I know, what I was trying to do against the logic. I thought there may be a trick.

518

(9 replies, posted in General)

jonibek wrote:

I changed a bit the procedure. Take a look!


Thanks a lot for your kind help.....
I was trying to avaoid writing code for each field in the groupbox hence in actual project groupbox contains many fields. That's the main reason for looking a solution as stated on post #1, if there is one.

519

(9 replies, posted in General)

jonibek wrote:

... Try this.
procedure Form1_Edit1_OnClick (Sender: string; var Cancel: boolean);
begin
if Form1.Edit1.Enabled = False then ShowMessage ('Custom message ....');
end;


Hi jonibek,
thanks but unfortunately, it doesn't work.


jonibek wrote:

i dont understand your purpose, why you need to pop-up the message...

Please see the attached sample project below:

520

(9 replies, posted in General)

jonibek wrote:

what do you mean Disabled?


Form1.Edit1.Enabled := False;

521

(9 replies, posted in General)

Is it possible to add a message pop-up for disabled field? If so how?



something like below which doesn't work:

procedure Form1_Edit1_OnClick (Sender: string; var Cancel: boolean);
begin
ShowMessage ('Custom message ....');
end;

522

(5 replies, posted in General)

Hi Derek,


Thank you very much............
Truly appreciated...................


As far as I can see, there is one issue remains:
When there is no record on tGrid/s I get info - error dialog "No record selected for editing." on app start and when last record on tGrid deleted.
I couldn't find a way to kill it.

523

(5 replies, posted in General)

I wanted use Derek's showing selected record details without SQL on same record.

It works fine with one tGrid on same form but couldn't make it work when added additional tGrid on same form.


Hopefully Derek is around to help.....


Please see attached sample project.

524

(6 replies, posted in General)

Hi EHW,


Thank you very much.....................
Truly appreciated..............................

525

(6 replies, posted in General)

Thanks a lot EHW.......................


Some invoices can have multiple refunds. It needs to clear ref column when all refunds relating to inv are deleted.
I tried something with if statement just above your clear code but couldn't get syntax right.