~ubuntu-branches/debian/stretch/sql-ledger/stretch

« back to all changes in this revision

Viewing changes to bin/mozilla/ct.pl

  • Committer: Bazaar Package Importer
  • Author(s): Raphael Hertzog
  • Date: 2009-01-15 10:46:03 UTC
  • mfrom: (1.2.3 upstream) (5.1.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090115104603-x23d4p1bwiz4fyqz
Tags: 2.8.20-1
* New upstream release.
  From 2.8.20:
  - fixed "database handle destroyed" error when printing 
  From 2.8.19:
  - added missing localization strings for batch printing module
  - added query to unlock orders when invoice is removed
  - added option to generate detailed purchase orders from sales orders
  - cross-reference consolidated orders; recall original order
    shipping address selection; select from previous addresses or enter a new
    address
  - added missing lineitem details on ship/receive screen
  - changed template parser to allow for multiple spaces and inline if
    statements 
* Add ${misc:Depends} to the Depends field.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2047
2047
  $form->{title} = $locale->text('Shipping Address');
2048
2048
 
2049
2049
  $form->{name} ||= "$form->{firstname} $form->{lastname}";
2050
 
  
 
2050
 
 
2051
  CT->ship_to(\%myconfig, \%$form);
 
2052
 
 
2053
  %shipto = (
 
2054
          address1 => { i => 2, label => $locale->text('Address') },
 
2055
          address2 => { i => 3, label => '' },
 
2056
          city => { i => 4, label => $locale->text('City') },
 
2057
          state => { i => 5, label => $locale->text('State/Province') },
 
2058
          zipcode => { i => 6, label => $locale->text('Zip/Postal Code') },
 
2059
          country => { i => 7, label => $locale->text('Country') },
 
2060
          contact => { i => 8, label => $locale->text('Contact') },
 
2061
          phone => { i => 9, label => $locale->text('Phone') },
 
2062
          fax => { i => 10, label => $locale->text('Fax') },
 
2063
          email => { i => 11, label => $locale->text('E-mail') } );
 
2064
 
2051
2065
  $form->header;
2052
2066
 
 
2067
  $vcname = $locale->text('Name');
 
2068
 
2053
2069
  print qq|
2054
2070
<body>
2055
2071
 
2064
2080
    <td>
2065
2081
      <table width=100%>
2066
2082
        <tr>
2067
 
          <th class=listheading colspan=2>$form->{name}</th>
 
2083
          <th class=listheading colspan=3>$form->{name}</th>
2068
2084
        </tr>
2069
2085
        <tr>
2070
 
          <th align=right nowrap>|.$locale->text('Name').qq|</th>
 
2086
          <td></td>
 
2087
          <th align=right nowrap>$vcname</th>
2071
2088
          <td><input name=shiptoname size=32 maxlength=64 value="|.$form->quote($form->{shiptoname}).qq|"></td>
2072
2089
        </tr>
2073
2090
        <tr>
2074
 
          <th align=right nowrap>|.$locale->text('Address').qq|</th>
 
2091
          <td></td>
 
2092
          <th align=right nowrap>$shipto{address1}{label}</th>
2075
2093
          <td><input name=shiptoaddress1 size=32 maxlength=32 value="|.$form->quote($form->{shiptoaddress1}).qq|"></td>
2076
2094
        </tr>
2077
2095
        <tr>
2078
 
          <th></th>
 
2096
          <td></td>
 
2097
          <td></td>
2079
2098
          <td><input name=shiptoaddress2 size=32 maxlength=32 value="|.$form->quote($form->{shiptoaddress2}).qq|"></td>
2080
2099
        </tr>
2081
2100
        <tr>
2082
 
          <th align=right nowrap>|.$locale->text('City').qq|</th>
 
2101
          <td></td>
 
2102
          <th align=right nowrap>$shipto{city}{label}</th>
2083
2103
          <td><input name=shiptocity size=32 maxlength=32 value="|.$form->quote($form->{shiptocity}).qq|"></td>
2084
2104
        </tr>
2085
2105
        <tr>
2086
 
          <th align=right nowrap>|.$locale->text('State/Province').qq|</th>
 
2106
          <td></td>
 
2107
          <th align=right nowrap>$shipto{state}{label}</th>
2087
2108
          <td><input name=shiptostate size=32 maxlength=32 value="|.$form->quote($form->{shiptostate}).qq|"></td>
2088
2109
        </tr>
2089
2110
        <tr>
2090
 
          <th align=right nowrap>|.$locale->text('Zip/Postal Code').qq|</th>
 
2111
          <td></td>
 
2112
          <th align=right nowrap>$shipto{zipcode}{label}</th>
2091
2113
          <td><input name=shiptozipcode size=11 maxlength=10 value="|.$form->quote($form->{shiptozipcode}).qq|"></td>
2092
2114
        </tr>
2093
2115
        <tr>
2094
 
          <th align=right nowrap>|.$locale->text('Country').qq|</th>
 
2116
          <td></td>
 
2117
          <th align=right nowrap>$shipto{country}{label}</th>
2095
2118
          <td><input name=shiptocountry size=32 maxlength=32 value="|.$form->quote($form->{shiptocountry}).qq|"></td>
2096
2119
        </tr>
2097
2120
        <tr>
2098
 
          <th align=right nowrap>|.$locale->text('Contact').qq|</th>
 
2121
          <td></td>
 
2122
          <th align=right nowrap>$shipto{contact}{label}</th>
2099
2123
          <td><input name=shiptocontact size=35 maxlength=64 value="|.$form->quote($form->{shiptocontact}).qq|"></td>
2100
2124
        </tr>
2101
2125
        <tr>
2102
 
          <th align=right nowrap>|.$locale->text('Phone').qq|</th>
 
2126
          <td></td>
 
2127
          <th align=right nowrap>$shipto{phone}{label}</th>
2103
2128
          <td><input name=shiptophone size=22 maxlength=20 value="$form->{shiptophone}"></td>
2104
2129
        </tr>
2105
2130
        <tr>
2106
 
          <th align=right nowrap>|.$locale->text('Fax').qq|</th>
 
2131
          <td></td>
 
2132
          <th align=right nowrap>$shipto{fax}{label}</th>
2107
2133
          <td><input name=shiptofax size=22 maxlength=20 value="$form->{shiptofax}"></td>
2108
2134
        </tr>
2109
2135
        <tr>
2110
 
          <th align=right nowrap>|.$locale->text('E-mail').qq|</th>
 
2136
          <td></td>
 
2137
          <th align=right nowrap>$shipto{email}{label}</th>
2111
2138
          <td><input name=shiptoemail size=32 value="$form->{shiptoemail}"></td>
2112
2139
        </tr>
 
2140
|;
 
2141
 
 
2142
  $i = 1;
 
2143
  for $ref (@{ $form->{all_shipto} }) {
 
2144
 
 
2145
    print qq|
 
2146
        <tr>
 
2147
          <td></td>
 
2148
          <td><hr noshade></td>
 
2149
          <td><hr noshade></td>
 
2150
        </tr>
 
2151
 
 
2152
        <tr>
 
2153
          <td><input name="ndx_$i" type=checkbox class=checkbox>
 
2154
          <th align=right nowrap>$vcname</th>
 
2155
          <td>$ref->{shiptoname}</td>
 
2156
        </tr>
 
2157
|;
 
2158
 
 
2159
    for (sort { $shipto{$a}{i} <=> $shipto{$b}{i} } keys %shipto) {
 
2160
      print qq|
 
2161
        <tr>
 
2162
          <td></td>
 
2163
          <th align=right nowrap>$shipto{$_}{label}</th>
 
2164
          <td>$ref->{"shipto$_"}</td>
 
2165
        </tr>
 
2166
|;
 
2167
    }
 
2168
 
 
2169
    for (keys %$ref) { $form->{"${_}_$i"} = $ref->{$_} }
 
2170
    $form->hide_form(map { "${_}_$i" } keys %$ref);
 
2171
 
 
2172
    $i++;
 
2173
  }
 
2174
  $form->{shipto_rows} = $i - 1;
 
2175
 
 
2176
  print qq|
2113
2177
      </table>
2114
2178
    </td>
2115
2179
  </tr>
2116
 
  <tr>
2117
 
    <td><hr size=3 noshade></td>
2118
 
  </tr>
2119
2180
</table>
2120
2181
|;
2121
2182
 
2122
 
  for (map { "shipto$_" } qw(name address1 address2 city state zipcode country contact phone fax email)) { delete $form->{$_} }
 
2183
  for (qw(name address1 address2 city state zipcode country contact phone fax email)) {
 
2184
    delete $form->{"shipto$_"};
 
2185
    $form->{flds} .= "$_ ";
 
2186
  }
 
2187
  chop $form->{flds};
2123
2188
 
2124
 
  $form->{nextsub} = "update";
 
2189
  $form->{nextsub} = "shipto_selected";
2125
2190
  $form->{action} = $form->{nextsub};
2126
 
 
 
2191
  
2127
2192
  $form->hide_form;
2128
2193
  
2129
2194
  print qq|
2130
 
  <input type=submit class=submit name=action value="|.$locale->text('Continue').qq|">
 
2195
<hr size=3 noshade>
 
2196
 
 
2197
<br>
 
2198
<input type=submit class=submit name=action value="|.$locale->text('Continue').qq|">
2131
2199
  
2132
2200
</form>
2133
2201
 
2138
2206
}
2139
2207
 
2140
2208
 
 
2209
sub shipto_selected {
 
2210
 
 
2211
  for $i (1 .. $form->{shipto_rows}) {
 
2212
    if ($form->{"ndx_$i"}) {
 
2213
      for (split / /, $form->{flds}) { $form->{"shipto$_"} = $form->{"shipto${_}_$i"} }
 
2214
      last;
 
2215
    }
 
2216
  }
 
2217
 
 
2218
  &update;
 
2219
 
 
2220
}
 
2221
 
 
2222
 
2141
2223
sub pricelist {
2142
2224
 
2143
2225
  if ("$form->{name}$form->{lastname}$form->{firstname}" eq "") {