File Changes Report

OldOld — C:\pb-diff-demo\old\w_order_entry.srw
NewNew — C:\pb-diff-demo\new\w_order_entry.srw
File typeWindow
Items7
New2
Modified4
Deleted1
Unchanged0

NewModifiedDeleted

Summary

ItemKindStatusAddedDeletedModified
Instance VariablesInstance variablesModified100
PrototypesPrototypesModified101
Functions / wf_total (decimal ad_pct)FunctionModified512
Functions / wf_preview ()SubroutineDeleted040
Functions / wf_cancelled (long al_row)FunctionNew400
Functions / wf_show_total (decimal ad_total)SubroutineNew1000
Controls / cb_save (commandbutton) / Events / clickedEventModified001

Instance Variables Modified

1type variables1type variables
2decimal{2} id_tax = 0.222decimal{2} id_tax = 0.22
+3decimal{2} id_max_pct = 30
3long il_order4long il_order
4end variables5end variables

Prototypes Modified

1forward prototypes1forward prototypes
2public function decimal wf_total (decimal ad_pct)2public function decimal wf_total (decimal ad_pct)
3public function integer wf_save ()3public function integer wf_save ()
4~public subroutine wf_preview ()4public function boolean wf_cancelled (long al_row)
+5public subroutine wf_show_total (decimal ad_total)
5end prototypes6end prototypes

Functions / wf_total (decimal ad_pct) Modified

public function decimal wf_total (decimal ad_pct)

1public function decimal wf_total (decimal ad_pct);1public function decimal wf_total (decimal ad_pct);
2// Order total after discount and tax.2// Order total after discount and tax.
3decimal{2} ld_sub, ld_disc, ld_total3decimal{2} ld_sub, ld_disc, ld_total
4long ll_row, ll_rows4long ll_row, ll_rows
55
+6if ad_pct < 0 or ad_pct > id_max_pct then
+7 ad_pct = 0
+8end if
+9
6ll_rows = dw_lines.RowCount()10ll_rows = dw_lines.RowCount()
7for ll_row = 1 to ll_rows11for ll_row = 1 to ll_rows
+12 if wf_cancelled(ll_row) then continue
8 ld_sub += dw_lines.GetItemDecimal(ll_row, 5)13 ld_sub += dw_lines.GetItemDecimal(ll_row, 5)
9next14next
1015
11ld_disc = ld_sub * ad_pct / 10016ld_disc = ld_sub * ad_pct / 100
12ld_total = (ld_sub - ld_disc) * (1 + id_tax)17ld_total = (ld_sub - ld_disc) * (1 + id_tax)
13~ld_total = Truncate(ld_total, 2)18ld_total = Round(ld_total, 2)
14-MessageBox("debug", String(ld_total))
1519
16~st_total.Text = String(ld_total, "#,##0.00")20wf_show_total(ld_total)
17return ld_total21return ld_total
18end function22end function

Functions / wf_preview () Deleted

public subroutine wf_preview ()

1-public subroutine wf_preview ();
2-// Shows the lines in print preview.
3-dw_lines.Modify("DataWindow.Print.Preview=Yes")
4-end subroutine

Functions / wf_cancelled (long al_row) New

public function boolean wf_cancelled (long al_row)

+1public function boolean wf_cancelled (long al_row);
+2// True when the order line is cancelled.
+3return dw_lines.GetItemString(al_row, 9) = "X"
+4end function

Functions / wf_show_total (decimal ad_total) New

public subroutine wf_show_total (decimal ad_total)

+1public subroutine wf_show_total (decimal ad_total);
+2// Shows the total, in red when it is zero.
+3st_total.Text = String(ad_total, "#,##0.00")
+4
+5if ad_total = 0 then
+6 st_total.TextColor = RGB(192, 0, 0)
+7else
+8 st_total.TextColor = RGB(0, 0, 0)
+9end if
+10end subroutine

Controls / cb_save (commandbutton) / Events / clicked Modified

event clicked

1event clicked;if wf_save() = 1 then1event clicked;if wf_save() = 1 then
2~ MessageBox("Order Entry", "Order saved.")2 MessageBox("Order Entry", "Order " + String(il_order) + " saved.")
3end if3end if
4end event4end event