Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision bb7e2e85

Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt

  • ID bb7e2e85d50544c6b72eb40d57f513eeacf578d5
  • Vorgänger fff57e55
  • Nachfolger 6ee486a5

Lieferscheine -> Rechnungen wandeln: Lieferscheinnummer in jeder Rechnungsposition speichern

Dies geschieht analog zu invoice.ordnumber als invoice.donumber. In
Druckvorlagen steht sie als Variable donumber_do zur Verfügung (auch
dies angelehnt an invoice.ordnumber, die als ordnumber_oe zur
Verfügung steht).

Unterschiede anzeigen:

SL/DB/MetaSetup/InvoiceItem.pm
17 17
  description        => { type => 'text' },
18 18
  discount           => { type => 'float', precision => 4 },
19 19
  fxsellprice        => { type => 'numeric', precision => 5, scale => 15 },
20
  donumber           => { type => 'text' },
20 21
  id                 => { type => 'integer', not_null => 1, sequence => 'invoiceid' },
21 22
  itime              => { type => 'timestamp', default => 'now()' },
22 23
  lastcost           => { type => 'numeric', precision => 5, scale => 15 },
SL/DO.pm
680 680
         doi.reqdate, doi.project_id, doi.serialnumber, doi.lastcost,
681 681
         doi.ordnumber, doi.transdate, doi.cusordnumber, doi.longdescription,
682 682
         doi.price_factor_id, doi.price_factor, doi.marge_price_factor, doi.pricegroup_id,
683
         pr.projectnumber, dord.transdate AS dord_transdate,
683
         pr.projectnumber, dord.transdate AS dord_transdate, dord.donumber,
684 684
         pg.partsgroup
685 685
       FROM delivery_order_items doi
686 686
       JOIN parts p ON (doi.parts_id = p.id)
SL/IS.pm
149 149

  
150 150
  my @arrays =
151 151
    qw(runningnumber number description longdescription qty ship unit bin
152
       deliverydate_oe ordnumber_oe transdate_oe validuntil
152
       deliverydate_oe ordnumber_oe donumber_do transdate_oe validuntil
153 153
       partnotes serialnumber reqdate sellprice listprice netprice
154 154
       discount p_discount discount_sub nodiscount_sub
155 155
       linetotal  nodiscount_linetotal tax_rate projectnumber projectdescription
......
210 210
      push @{ $form->{TEMPLATE_ARRAYS}->{sellprice} },         $form->{"sellprice_$i"};
211 211
      push @{ $form->{TEMPLATE_ARRAYS}->{sellprice_nofmt} },   $form->parse_amount($myconfig, $form->{"sellprice_$i"});
212 212
      push @{ $form->{TEMPLATE_ARRAYS}->{ordnumber_oe} },      $form->{"ordnumber_$i"};
213
      push @{ $form->{TEMPLATE_ARRAYS}->{donumber_do} },       $form->{"donumber_$i"};
213 214
      push @{ $form->{TEMPLATE_ARRAYS}->{transdate_oe} },      $form->{"transdate_$i"};
214 215
      push @{ $form->{TEMPLATE_ARRAYS}->{invnumber} },         $form->{"invnumber"};
215 216
      push @{ $form->{TEMPLATE_ARRAYS}->{invdate} },           $form->{"invdate"};
......
741 742
        qq|INSERT INTO invoice (id, trans_id, parts_id, description, longdescription, qty,
742 743
                                sellprice, fxsellprice, discount, allocated, assemblyitem,
743 744
                                unit, deliverydate, project_id, serialnumber, pricegroup_id,
744
                                ordnumber, transdate, cusordnumber, base_qty, subtotal,
745
                                ordnumber, donumber, transdate, cusordnumber, base_qty, subtotal,
745 746
                                marge_percent, marge_total, lastcost,
746 747
                                price_factor_id, price_factor, marge_price_factor)
747
           VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
748
           VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
748 749
                   (SELECT factor FROM price_factors WHERE id = ?), ?)|;
749 750

  
750 751
      @values = ($invoice_id, conv_i($form->{id}), conv_i($form->{"id_$i"}),
......
753 754
                 $form->{"discount_$i"}, $allocated, 'f',
754 755
                 $form->{"unit_$i"}, conv_date($form->{"reqdate_$i"}), conv_i($form->{"project_id_$i"}),
755 756
                 $form->{"serialnumber_$i"}, $pricegroup_id,
756
                 $form->{"ordnumber_$i"}, conv_date($form->{"transdate_$i"}),
757
                 $form->{"ordnumber_$i"}, $form->{"donumber_$i"}, conv_date($form->{"transdate_$i"}),
757 758
                 $form->{"cusordnumber_$i"}, $baseqty, $form->{"subtotal_$i"} ? 't' : 'f',
758 759
                 $form->{"marge_percent_$i"}, $form->{"marge_absolut_$i"},
759 760
                 $form->{"lastcost_$i"},
......
1652 1653

  
1653 1654
           i.id AS invoice_id,
1654 1655
           i.description, i.longdescription, i.qty, i.fxsellprice AS sellprice, i.discount, i.parts_id AS id, i.unit, i.deliverydate AS reqdate,
1655
           i.project_id, i.serialnumber, i.id AS invoice_pos, i.pricegroup_id, i.ordnumber, i.transdate, i.cusordnumber, i.subtotal, i.lastcost,
1656
           i.project_id, i.serialnumber, i.id AS invoice_pos, i.pricegroup_id, i.ordnumber, i.donumber, i.transdate, i.cusordnumber, i.subtotal, i.lastcost,
1656 1657
           i.price_factor_id, i.price_factor, i.marge_price_factor,
1657 1658
           p.partnumber, p.assembly, p.notes AS partnotes, p.inventory_accno_id AS part_inventory_accno_id, p.formel, p.listprice,
1658 1659
           pr.projectnumber, pg.partsgroup, prg.pricegroup
bin/mozilla/do.pl
775 775
      }
776 776
    }
777 777
    map { $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if $form->{"${_}_${i}"} } qw(ship qty sellprice listprice lastcost basefactor);
778
    $form->{"donumber_$i"} = $form->{donumber};
778 779
  }
779 780

  
780 781
  $form->{type} = "invoice";
bin/mozilla/io.pl
437 437
          $cgi->hidden("-name" => "price_new_$i", "-value" => $form->format_amount(\%myconfig, $form->{"price_new_$i"})),
438 438
          map { ($cgi->hidden("-name" => $_, "-id" => $_, "-value" => $form->{$_})); } map { $_."_$i" }
439 439
            (qw(orderitems_id bo pricegroup_old price_old id inventory_accno bin partsgroup partnotes
440
                income_accno expense_accno listprice assembly taxaccounts ordnumber transdate cusordnumber
440
                income_accno expense_accno listprice assembly taxaccounts ordnumber donumber transdate cusordnumber
441 441
                longdescription basefactor marge_absolut marge_percent marge_price_factor weight), @hidden_vars)
442 442
    );
443 443

  
......
750 750
                taxaccounts bin assembly weight projectnumber project_id
751 751
                oldprojectnumber runningnumber serialnumber partsgroup payment_id
752 752
                not_discountable shop ve gv buchungsgruppen_id language_values
753
                sellprice_pg pricegroup_old price_old price_new unit_old ordnumber
753
                sellprice_pg pricegroup_old price_old price_new unit_old ordnumber donumber
754 754
                transdate longdescription basefactor marge_total marge_percent
755 755
                marge_price_factor lastcost price_factor_id partnotes
756 756
                stock_out stock_in has_sernumber reqdate);
doc/dokumentation.xml
3773 3773
              </listitem>
3774 3774
            </varlistentry>
3775 3775

  
3776
            <varlistentry>
3777
              <term><varname>donumber_do</varname></term>
3778

  
3779
              <listitem>
3780
                <para>Lieferscheinnummer desjenigen Lieferscheins, aus dem die Position stammt, sofern die Rechnung aus einem oder
3781
                mehreren Lieferscheinen erstellt wurde</para>
3782
              </listitem>
3783
            </varlistentry>
3784

  
3776 3785
            <varlistentry>
3777 3786
              <term><varname>p_discount</varname></term>
3778 3787

  
sql/Pg-upgrade2/invoice_add_donumber.sql
1
-- @tag: invoice_add_donumber
2
-- @description: invoice_add_donumber
3
-- @depends: release_3_0_0
4
ALTER TABLE invoice ADD COLUMN donumber TEXT;

Auch abrufbar als: Unified diff